Shooting Method to solve Blasius equation

Click For Summary
SUMMARY

The discussion centers on solving the Blasius equation using MATLAB, specifically the equation f*f'' + f''' = 0 with boundary conditions f'(0) = 0 and f'(∞) = 1. Participants emphasize the inadequacy of the forward Euler method for integration and recommend using the Runge-Kutta-Fehlberg method (rkf45) for better accuracy. They highlight the importance of intelligently modifying initial conditions during iterations to converge on the boundary condition and suggest setting a fixed value of eta, such as 10, to approximate infinity for integration.

PREREQUISITES
  • Understanding of the Blasius equation and its boundary conditions
  • Familiarity with MATLAB programming and syntax
  • Knowledge of numerical integration methods, specifically Runge-Kutta methods
  • Basic concepts of boundary layer theory in fluid dynamics
NEXT STEPS
  • Implement the Runge-Kutta-Fehlberg method (rkf45) in MATLAB for solving ODEs
  • Research Newton's method for root-finding and its application in boundary value problems
  • Explore techniques for modifying initial conditions in iterative numerical methods
  • Study boundary layer theory to understand the physical implications of the Blasius equation
USEFUL FOR

Fluid dynamics researchers, MATLAB programmers, and engineers working on boundary layer problems will benefit from this discussion, particularly those looking to solve differential equations accurately.

HoosierDaddy
Messages
4
Reaction score
0
Hello all,
I'm trying to write a bit of Matlab to solve the Blasius Equation f*f'' + f''' = 0, where at eta = 0, f' = 0, and at eta = infinity, f' = 1.

What I have so far is below...I'm a bit rusty. Two specific questions:

1. I'm trying to drive y2 to the b.c. of 1, however my loop appear to not be working.

2. Once I've solved the transformed equation in Matlab, how does it physically relate back to reality, in terms of boundary layer thickness and Cf?

Code:
%Define variables
%n = eta
%y1 = f
%y2 = df/dn = d(y1)/dn
%y3 = d^2f/dn^2 = d(y2)/dn
%d(y3)/dn = d^3/dn^3 = -y1*y3

%Clear values
clear;
clc;

%Initial conditions at n = 0
%f(0) = 0
y1 = 0;
%df/dn(0) = 0
y2 = 0;
%Need iniial guess for d^f/dn^2
y3 = .1;

%Need step size in eta
dn = 0.1;

%Set debugging counter
count = 0;

%Integration loop seeking target value of 1 for y2 = df/dn


if abs(y2-1) > 0.001
for n = dn:dn:10 %establish incremental range over eta
y1 = y1 + y2*dn;
y2 = y2 + y3*dn;
y3 = y3 + (-y1*y3)*dn;
end
count = count + 1;
end

y2
count
y3

Any help you can provide is greatly appreciated!

Thanks!
 
Physics news on Phys.org
HoosierDaddy said:
%Integration loop seeking target value of 1 for y2 = df/dn


if abs(y2-1) > 0.001
for n = dn:dn:10 %establish incremental range over eta
y1 = y1 + y2*dn;
y2 = y2 + y3*dn;
y3 = y3 + (-y1*y3)*dn;
end
count = count + 1;
end
What are you doing here?

First, that is not an acceptable way to integrate a system of ODEs. Since you are using Matlab, take a robust method such as rkf45.

Second, you don't loop over the integration many times until you (magically) get the right boundary condition. You have to integrate every time starting from a set of initial conditions, and these have to be modified intelligently so that at each iteration you get closer to the desired target.
 
Dr Claude is right. You have to reset the initial conditions on all the dependent variables each time you restart the integration. You also need to use a better algorithm for converging to the final solution using the shooting method. I always use Newton's method, evaluating the partial derivative of the error with respect to the unknown initial condition numerically. This requires you to got through the integration twice in advance of the actual set of iterations, using two slightly different values of the unknown initial condition. Make sure you integrate far enough out in eta to be sure you are close enough to infinity. What final value of eta are you using?

chet
 
I have some additional comments.

1. Dr. Claude is also right about the integration formula you are using. You are using a forward Euler integration, which is very inaccurate. You should be using an automatic integration package or a more accurate integration algorithm.

2. You are cutting off the integration when y' exceeds 1.0, but y' might also level off before it reaches 1.0. You need to decide on a fixed value of eta that you integrate up to, and regard that as essentially infinity. You then test the boundary condition at that location. I recommend eta = 10.

3. You know the answer to this problem before you begin. So, substitute this value in for the unknown boundary condition, as see if your integration comes close to matching the far boundary condition. This will give you a check on your coding, and also on the accuracy of your integration.

4. You need to decide on how to iterate upon the initial guess in an efficient way so that you converge rapidly to the desired solution. As I mentioned in my previous post, I recommend Newton's method (or modified Newton's method).

Chet
 
hellow everyone i need help to find the value f''(0) in blasius equation f'''+f*f''=0 or post a easy MATLAB code.
thanks
 

Similar threads

  • · Replies 14 ·
Replies
14
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 11 ·
Replies
11
Views
6K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K