% run BLrhs.m

% This program solves the revised Blasius equation

% using the initial value method and iterating on

% the value of f"(0). The iteration is performed

% using the Newton-Raphson method. In addition, it

% is necessary to solve the problem with different

% values of long, the location of infinity.

tol = 1.e-12;

long = 9;

change = 1.;

c = 1.;

iter=0;

while change>tol

iter=iter+1;

f0 = [0 0 c 0 0 1];

etaspan = [0 long];

[eta f] = ode45('BLrhs',etaspan,f0)

nn= size(f)

psi = f(nn(1),2) - 1

dpsi = f(nn(1),5)

change = abs(psi/dpsi)

c = c - psi/dpsi

end

f0 = [0 0 c 0 0 1];

etaspan = [0 long];

[eta f] = ode45('BLrhs',etaspan,f0)

plot(eta,f(:,2),'b')

xlabel('\eta')

ylabel('f-prime')

title('Boundary Layer Solution')

f(1,3)

iter

psi

%********************************

%make this a separate function

% BLrhs.m

% This function evaluates the right-hand side for

% laminar boundary layer flow past a flat plate.

function fdot=BLrhs(eta,f)

fdot(1) = f(2);

fdot(2) = f(3);

fdot(3) = - f(1)*f(3);

fdot(4) = f(5);

fdot(5) = f(6);

fdot(6) = - f(1)*f(6) - f(4)*f(3);

fdot = fdot';