Bvp4c Error; cannot solve collocation equations- singular Jacobian

The eqns to be solved: f'''+ff''+1-f'^2-A(f'-1+(n/2)f'')+M(1-f')=0 (1/Pr)Y''+fY'-2f'Y-A(2Y+(n/2)Y')+Ec(M(1-f')^2+f''^2)=0 w/BC's: f(0)=0,f'(0)=lambda,Y(0)=1,f'(inf)=>1,Y(inf)=>0 it is known that there are two solutions where one can be found at infinity=10 and will add infinity=40 when I can fix error. Later will also be running for different values of lambda. I have checked and rechecked equation, I have also played with the initial guesses. I would appreciate any guidance.
global Pr A M Ec lambda
Pr=1; A=0.1; M=0.05; Ec=1; lambda=-1.33;
%
rlow=0;
rhigh=10;
N=50;
options=bvpset('stats','on','RelTol',1e-9);
solinit=bvpinit(linspace(rlow,rhigh,N),[0, -1, 0, 1 ,0]);
%
sol=bvp4c(@projode,@mybcs,solinit,options);
function dy=projode(n,y)
global Pr A M Ec
dy=[y(2); y(3); A*y(2)+A*n*y(3)/2+M*y(2)+y(2)^2-y(1)*y(3)-1-A-M; y(4);...
Pr*(2*y(2)*y(4)+A*2*y(4)+A*n*y(5)/2-y(1)*y(5)-Ec*M*(1-y(2))^2-Ec*y(3)^2)];
function dy=projode(n,y)
global Pr A M Ec
dy=[y(2); y(3); A*y(2)+A*n*y(3)/2+M*y(2)+y(2)^2-y(1)*y(3)-1-A-M; y(4);...
Pr*(2*y(2)*y(4)+A*2*y(4)+A*n*y(5)/2-y(1)*y(5)-Ec*M*(1-y(2))^2-Ec*y(3)^2)];
function res=mybcs(ya,yb)
global lambda
res=[ya(1) ya(2)-lambda ya(4)-1 yb(2)-1 yb(4)];

 Réponse acceptée

Replace
function dy=projode(n,y)
global Pr A M Ec
dy=[y(2); y(3); A*y(2)+A*n*y(3)/2+M*y(2)+y(2)^2-y(1)*y(3)-1-A-M; y(4);...
Pr*(2*y(2)*y(4)+A*2*y(4)+A*n*y(5)/2-y(1)*y(5)-Ec*M*(1-y(2))^2-Ec*y(3)^2)];
by
function dy=projode(n,y)
global Pr A M Ec
dy=[y(2); y(3); A*y(2)+A*n*y(3)/2+M*y(2)+y(2)^2-y(1)*y(3)-1-A-M; y(5);...
Pr*(2*y(2)*y(4)+A*2*y(4)+A*n*y(5)/2-y(1)*y(5)-Ec*M*(1-y(2))^2-Ec*y(3)^2)];
Best wishes
Torsten.

2 commentaires

Thank You! I feel silly now. That worked. I then just had to tweak the initial guesses a bit more to get the result I was looking for. Thanks again.
Hey Shelly I have a similar problem as yours
How do I modify your code in mine, please help
Here's my equations(coupled) need to use shooting method with RK-4
(1+2M*eta)f''' + 2M*f"+ f*f" -f'^2 - k1*f' + lambda*theta=0 ---------- (1)
(1+2M*eta)theta" + 2M*theta' + Pr(f*theta'-f'*theta)=0 -------(2)
'f' and 'theta' are functions of 'eta', eta is an independent variable
3 initial conditions are given: eta=0, f(0)=0, f'(0)=1,theta(0)=1
Say I reduce these equations (1) and (2) to five ode (shooting method)
f'=z ; f(0)=0 -----(3)
z'=p ; z(0)=1 ------(4)
p'= (-2M*f"-f*f"+f'^2+k1*f'-lamda*theta)/(1+2*M*eta) ;p(0)= (guess value) -----(5)
theta'= q ; theta(0)=1 -----(6)
q' = (-2M*theta'-Pr(f*theta'-f'*theta))/(1+2*M*eta) ; q(0)= (guess value) ------(7)
The boundary conditions that needs to be satisfied are: f'(eta=10)=> 0 and theta(eta=10)=>0 as eta=>10
Given:
M= 1
k1= 0.1
lamda= 0.1
Pr= 0.7
taking step length: h= 0.01

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Symbolic Math Toolbox dans Centre d'aide et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by