# Bvp4c Unable to solve the collocation equations -- a singular Jacobian Encountered

11 views (last 30 days)
Syed Mohiuddin on 7 Oct 2022
Commented: Syed Mohiuddin on 7 Oct 2022
I have a coupled non-linear differential equations u''-b1*(t')*(u')+(1+b1*t)*[G1*F1*t+G2*F1*p-F3*P]=0; t''-b2*(t')^2+B*F6*(u')^2+(b2-b1)*t*B*F6*(u')^2-b2*b1*B*F6*t^2*(u')^2=0; p''- A*p=0 and the boundary conditions are u=0,t=1+m,p=1+n at y=-1 and u=0,t=0,p=1 at y=1.
The code is:
clc;
p=0.01;
Betaf= 207;
Betas = 17;
Beta = 0.5;
kof = 0.613;
kos = 400;
m = 1;
b2 = 0.5;
b1 = 0.5;
G1 = 5;
G2 = 5;
A = 0.5;
Rhof = 997.1;
Rhos = 8933;
P = 0.5;
n=0.3;
B=0.01;
A1 = (1-p).^2.5;
A2 = 1/(1 + 1/Beta);
A3 = (1-p)+p.*((Rhos.*Betas)./(Rhof.*Betaf));
F1 = A2.*A3;
F3 = A1.*A2;
F4 = (kos + 2*kof - 2*p.*(kof - kos))/(kos + 2*kof + p.*(kof - kos));
F5 = (1 + 1/Beta)./A1;
F6 = F5./F4;
dydx=@(x,y)[y(2);
y(4);
y(5);
(b1.*y(4).*y(2)-(1+b1.*y(3)).*(G1.*F1.*y(3)+G2.*F1.*y(5)-F3.*P));
b2.*y(4).^2-B.*F6.*y(2).^2+(bk-bv).*y(3).*B.*F6.*y(2).^2-b2.*b1.*B.*F6.*y(3).^2*y(2).^2;
Alpha.*y(5)];
BC=@(ya,yb)[ya(1);yb(1);ya(3)-(1+m);yb(3)-1;ya(5)-(1+n);yb(5)];
yint=@(x)[0.01;0.01;0.01;0.01;0.01;0.01];
solint=bvpinit(linspace(-1,1,50),yint);
S=bvp4c(dydx,BC,solint)
for i=1:6
S=bvp4c(dydx,BC,S);
end
The error I get is “Unable to solve the collocation equations -- a singular Jacobian Encountered”.
I tried using different guess in the statement yint=@(x)[0.01;0.01;0.01;0.01;0.01;0.01];
But still the error persist.

Torsten on 7 Oct 2022
Edited: Torsten on 7 Oct 2022
clc;
p = 0.01;
Betaf = 207;
Betas = 17;
Beta = 0.5;
kof = 0.613;
kos = 400;
m = 1;
b2 = 0.5;
b1 = 0.5;
G1 = 5;
G2 = 5;
A = 0.5;
Rhof = 997.1;
Rhos = 8933;
P = 0.5;
n = 0.3;
B = 0.01;
A1 = (1-p).^2.5;
A2 = 1/(1 + 1/Beta);
A3 = (1-p)+p.*((Rhos.*Betas)./(Rhof.*Betaf));
F1 = A2.*A3;
F3 = A1.*A2;
F4 = (kos + 2*kof - 2*p.*(kof - kos))/(kos + 2*kof + p.*(kof - kos));
F5 = (1 + 1/Beta)./A1;
F6 = F5./F4;
dydx=@(x,y)[y(4);
y(5);
y(6);
b1.*y(4).*y(5)-(1+b1.*y(2)).*(G1.*F1.*y(2)+G2.*F1.*y(3)-F3.*P);
b2.*y(5).^2-B.*F6.*y(4).^2-(b2-b1).*y(2).*B.*F6.*y(4).^2+b2.*b1.*B.*F6.*y(2).^2*y(4).^2;
A.*y(3)];
BC = @(ya,yb)[ya(1);yb(1);ya(2)-(1+m);yb(2);ya(3)-(1+n);yb(3)-1.0];
yinit = [0.01;0.01;0.01;0.01;0.01;0.01];
solint = bvpinit(linspace(-1,1,50),yinit);
S = bvp4c(dydx,BC,solint);
plot(S.x,[S.y(1,:);S.y(2,:);S.y(3,:)])
##### 1 CommentShowHide None
Syed Mohiuddin on 7 Oct 2022
Thank you very much for the solution

### Categories

Find more on Systems of Nonlinear Equations in Help Center and File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by