Boundary value problems for ODE with bvp4c - singular jacobian error
Show older comments
Hello all,
I'm trying to solve a boundary value problem with 2 coupled differential equations using bvp4c. I'm new to that kind of problem so i did the tutorial by Jacek Kierzenka available on file exchange. When i try to apply it to my case, i have the singular jacobian error but i don't get the problem.
Here are the equations i try to solve :
- u''=-alpha.u'.(1-exp(-x)/(x.g)
- g'=beta.u^2/x^2
With alpha and beta 2 constant parameters and the following set of boundary conditions :
- u=0 for x=0
- u and g -> 1 for x-> infinity
Here is my code :
infinity = 4;
solinit=bvpinit(linspace(0,infinity,8),[0 1 1]);
options = bvpset('stats','on');
sol=bvp4c(@funODE,@funBC,solinit,options);
%------
function dydx = funODE(x,y)
beta=0.0217;
alpha=2;
dydx=[y(2)
-alpha*y(2)*(1-exp(-x))/(x*y(3))
beta*y(1)^2/x^2];
%------
function res = funBC(y0,yinf)
res= [y0(1)
yinf(1) - 1
yinf(3) - 1];
I tried to change infinity value, number of points in solinit, values of the initial guess and values for alpha and beta. In every case, i have the singular jacobian error, but i don't get if the problem comes from my formulation or from the initial guess.
Does somebody see where the problem can be ?
Accepted Answer
More Answers (1)
eh
on 29 Nov 2013
0 votes
Hi I want to solve system of coupler ODEs in ode45 my bondery condition :: Some conditions are initially And others in end . can you helpe mi to enter bondery condition???
Categories
Find more on Boundary Value Problems 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!