1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Shooting Method to solve Blasius equation

  1. Mar 25, 2014 #1
    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!
     
  2. jcsd
  3. Mar 26, 2014 #2

    DrClaude

    User Avatar

    Staff: Mentor

    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.
     
  4. Mar 26, 2014 #3
    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
     
  5. Mar 26, 2014 #4
    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
     
  6. Apr 8, 2015 #5
    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
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted