BVP4C: Error: Unable to solve the collocation equations -- a singular Jacobian encountered

Hello, I am facing "Unable to solve the collocation equations -- a singular Jacobian encountered" error using BVP4C function.Below are the details:
Equations:
1--> f''' + ff'' - f'^2 + B(f''^2-ff'''')+Zg' - M^2f' + D^2 = 0
2--> Yg''+ fg' +f'g - I(2g +f'') = 0
3--> h'' +Prfh'+PrQh = 0
Boundary Conditions:
f(0)=0, f'(0)=1+Kf''(0), f'(infty)=D, f''(infty) = 0
h'(0)=-ga*(1-h(0)) , h(infty)=0
g(0)=-Mzf''
I have formulated equations & boundary conditions in m script as follows:
ff = [y(2)
y(3)
y(4)
y(5)
(- y(1)*y(3) + y(2)^2 - B*y(3)^2 - Z* y(5)+ M^2*y(2)-D^2)
(-y(1)*y(5)-y(2)*y(4)+I*(2*y(4)+y(3)))
y(6)
y(7)
-pr * ((y(1)*y(7)) + Q*(y(6)))];
res = [ya(1)
ya(2) - 1 - K*ya(3)
yb(1)
yb(2)-D
ya(4)+Mz*ya(3)
yb(3)
ya(5)
ya(6) + ga * (1 - ya(5))
yb(6)];
Where , y(1) = f, y(2) = f', y(3) = f'', y(4) = g, y(5) = g'',y(6) = h, y(7) = h'
All the parameters used for equation(M,I,B etc.) are known & defined as global variables.
Script is developed referring to the BVP4C samples.
Please help me resolve this error. Thanks.

2 Comments

Please indicate which functions are meant by y(1),y(2),...,y(9).
Best wishes
Torsten.
Thanks for responding. Below is the information:
y(1) = f, y(2) = f', y(3) = f'', y(4) = g, y(5) = g'',y(6) = h, y(7) = h'

Sign in to comment.

 Accepted Answer

y1'=y2
y2'=y3
y3'=y4
y4'=solve your first equation for f''''
y5'=y6
y6'=solve your second equation for g''
y7'=y8
y8'=solve your third equation for h''
(y1=f, y2=f', y3=f'', y4'=f''', y5=g, y6=g', y7=h, y8=h')
Now specify 8 boundary conditions (instead of 7 in the problem formulation or 9 in the code as above), and you are done.
Best wishes
Torsten.

5 Comments

Thank you so much for responding, but I got really confused with the syntax of equation & boundary condition formulation. Can you please help.
Now I formulated equation like below:
ff = [y(2)
y(3)
(- y(1)*y(3) + y(2)^2 - B*y(3)^2 - Z* y(6)+ M^2*y(2)-D^2)
y(5)
(-y(1)*y(5)-y(2)*y(4)+I*(2*y(4)+y(3)))/Y
y(7)
-pr * ((y(1)*y(7)) + Q*(y(6)))];
And boundary conditions like below:
res = [ya(1)
ya(2) - 1 - K*ya(3)
yb(3)
yb(2)-D
ya(4)+Mz*ya(3)
yb(4)
ya(6) + ga * (1 - ya(5))];
Still facing same problem. Can you please help.
Thanks.
ff=[y(2)
y(3)
y(4)
(y(4)+y(1)*y(3)-y(2)^2+B*y(3)^2+Z*y(6)-M^2*y(2)+D^2)/(B*y(1))
y(6)
(I*(2*y(5)+y(3))-y(2)*y(5)-y(1)*y(6))/Y
y(8)
-(pr*y(1)*y(8)+pr*Q*y(7))];
res = [ya(1)
ya(2) - 1 - K*ya(3)
yb(3)
yb(2)-D
ya(5)+Mz*ya(3)
yb(7)
ya(8) + ga * (1 - ya(7))];
By I, you really mean the imaginary unit ?
Best wishes
Torsten.
You will need to add one more boundary condition since you supplied 8 ODEs, but only 7 boundary conditions.
Best wishes
Torsten.
Thank you so much for your help, Torsten. Really appreciate your help.
Everything is working fine now.
Note:I is not imaginary unit but just another parameter in equation.

Sign in to comment.

More Answers (1)

initialguess=bvpinit(linspace(0,10,5000),@mat4init);
sol=bvp4c(@rhs_ode1,@bcs1,initialguess);
eta=linspace(0,10,5000);
f=deval(sol,eta);
plot(eta,f(11,:),'LineWidth',1.2);
hold on
end
axis([0 1.4 0 1.05]);
xlabel('\eta','FontSize',14,'FontAngle', 'italic','FontName','Arial','Color','k');
ylabel('f(\theta)',
how to solve for singular jacobian ???

Tags

Community Treasure Hunt

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

Start Hunting!