MATLAB: Third Order Coupled ODE’s

boundary value problemdifferential equations

I have these coupled equations based off Falkner-Skan:
f′′′=−f⋅f′′−(2m/(m+1))⋅(1−(f′)2)−(2/(m+1))⋅Ri⋅θcos(m/(m+1))
&
θ′′=−Pr⋅f⋅θ'
With the BC's: f(0)=f′(0)=0 and θ(0)=1. f(5)=1 and θ(5)=0 (5 has been taken as the endpoint)
Where Pr, m and Ri are constants which can be assigned, f and θ are functions of η and the dash (') means derivative with respect to η.
I have a MATLAB file which solves this when Ri=0 by using the shooting method (as this is a BVP) and ODE45 but now it seems like that can no longer be used as easily because now they need to be solved simultaneously when Ri is not zero and I don't know where to start.
How can I solve this problem using MATLAB for the plots of f' and θ against η?

Best Answer

function main
xa = 0; xb = 5;
solinit = bvpinit(linspace(xa,xb,10),[0 0 1 1 0]);
sol = bvp4c(@coupled_falkner_skan,@bc,solinit);
function res = bc(ya,yb)
res = [ ya(1); ya(2); ya(4)-1; yb(2)-1; yb(4)];
function dydx = coupled_falkner_skan(x,y)
m = 0.0909; Ri = 5; Pr = 0.71;
dydx = [y(2); y(3); -y(1)*y(3)-(2*m/(m+1))*(1-y(2)^2)-(2/(m+1))*Ri*y(4)*cos(m*pi/(m+1)); y(5); -Pr*y(1)*y(5)];
Best wishes
Torsten.