# Bvp4c: singular jacobian

Discussion in 'Off-Topic Chat' started by Peresvet, Sep 23, 2014.

1. ### Peresvet

Joined:
Sep 23, 2014
Messages:
2
0
Hello!

I can not solve the system of differential equations with given boudary conditions using bvp4c:

tau=linspace(0,1,100);
solinit = bvpinit(tau,[5000 200 10 -100 35]);
sol = bvp4c(@myode,@mybc,solinit);

%--------------

function dydx=myode(x,y)
g0=9.81;
ve=g0*300;
m0 = 2000;
Pmax=100000;
v=y(2);
px=y(3);pv=y(4);tf=y(5);

if (Pmax/ve)+pv*(Pmax/m0)>=0
u1=0;
else
u1=1;
end

dydx=[v*tf
(u1*Pmax/m0-g0)*tf
0
-px*tf
0];
%-----

function res=mybc(ya,yb)
res=[ya(1)
yb(1)-5000
ya(2)
yb(2)
yb(4)];

Error: Singular Jacobian. But! The same system with initial conditions:

function res=mybc(ya,yb)
res=[ya(1)
ya(2)
ya(3)+0.023741
ya(4)+0.84546
ya(5)-35.612];

is solvable. And the solution corresponds to the boudary conditions of the first problem. Thus there is a solution. Why can't I solve this problem directly? What can I try to do to get the solution in such case?

Last edited: Sep 25, 2014
Peresvet, Sep 23, 2014

Joined:
Sep 23, 2014
Messages:
2