Boundary value problems for ODE with bvp4c - singular jacobian error
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Yann
am 27 Jan. 2012
Beantwortet: eh
am 29 Nov. 2013
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 ?
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 27 Jan. 2012
Maple says that the system has no solutions. The constraint u(0) = 0 forces u(x) = 0 but that conflicts with u(infinity) = 1
But let us make sure we are discussing the same equations, as your notation is not typical and you are missing a ')'.
The equations I used were
diff(u(x), x, x) = -alpha*(diff(u(x), x))*(1-exp(-x))/(x*g(x))
diff(g(x), x) = beta*u(x)^2/x^2
In particular please check whether it should be (1-exp(-x))/(x*g(x)) (as you coded in your attempt) or should be (1-exp(-x)/(x*g(x))) which is the other possible place to put the missing ')'
If the expression for u is correct then I can establish from the finite boundary condition for u(infinity) that u(x) must be a constant.
5 Kommentare
Walter Roberson
am 31 Jan. 2012
Maple solves that as u(x) = 0, g(x) = 1
For the general case without any boundary conditions imposed yet, Maple shows two possibilities, one of which immediately leads to the simple conditions, and the other in terms of u''' . That second possibility is a ratio in which both the numerator and denominator become 0 at x = 0, but because of the derivative terms multiplying the x, it is _perhaps_ possible that the derivatives go to infinity at a rate that "cancel" the 0's. It would not be easy to solve, if it could be solved at all.
Weitere Antworten (1)
eh
am 29 Nov. 2013
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???
0 Kommentare
Siehe auch
Kategorien
Mehr zu Boundary Value Problems finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!