Professional Documents
Culture Documents
The following short code calculates the non-dimensional speed component u for
the Blasius transformation variable η. The Blasius ODE is
f ′′′ + 12 f f ′′ = 0
y1 = f
y2 = f ′ = y1′
y3 = f ′′ = y2′
y4 = f ′′′ = − 21 y1 y3 = y3′
Using fsolve a good value for the initial value of y is [0, 0, 0.328554].
function [u,eta]=blasius(y0)
1
% that y(3)=1 at eta_max.
if (nargin==0)
[y0]=find_initial_value();
display([’f’’’’(0)=’,num2str(y0(3))]);
end
% March the initial solution y0 at eta=0 up to eta_max.
[sol]=ode45(@blasiusode,[0 eta_max],y0);
% The values of eta used by ode45
[eta]=sol.x;
% The values of f’ or y(2).
[u]=sol.y(2,:);
if (nargin==0)
clf;
plot(u,eta,’-o’);
xlabel(’u/U’);
ylabel(’\eta’);
end
2
f’’(0)=0.32855
ans =
Columns 1 through 15
Columns 16 through 23
10
5
η
0
−0.2 0 0.2 0.4 0.6 0.8 1 1.2
u/U