%{ Solution of 3rd-oder BVP describing the laminar velocity boundary layer over a flat plate. Method: shooting, combined with RK4 for integration and secant method for zero-search. M. Piller, 21st march 2023 %} function Blasius % Function handle to system of ODEs (Blasius' problem) f = @BlasiusFunc; % Step size for integration h0 = 0.05; % Initial value of independent variable % (x0 = 0 means "at the wall") x0 = 0; % "Numerical" boundary layer extends up to x = 10 xend = 10; % Tollerance for zero-fnding procedure toll = 1e-6; % First two guesses for the second derivative of % the solution at the wall (needed to start the % secant method). We look for the value of the % second derivative at the wall that yields % a value of 1 for the first derivative at % x = xend (10 in this case) A = 0; B = 1; [~,y]=RK4stage(x0,xend,[0;0;A],f,h0); eA = y(2)-1; [~,y]=RK4stage(x0,xend,[0;0;B],f,h0); eB = y(2)-1; % Switch first guesses such that the best one is "B" if (abs(eA)xend h=xend-x; end [x,y]=RK4_1Step(x,y,f,h,{}); if x>=xend break; end end end