bvp4c: a singular Jacobian encountered

Hi everybody! I'm trying to solve the following second order differential equation with known boundary conditions:
global a0 a1 a2 a3 a4 h k JA JB
% J/m^2 -> N/m
a0 = 2.0377638272727268;
a1 = -7.105521894545453;
a2 = 9.234000147272726;
a3 = -5.302489919999999;
a4 = 1.1362478399999998;
k = 5.92*10^-3; % N/m
h = 45.5 *10^-10; % Angstrom -> m
JA = 1.025;
JB = 1.308;
XA = 0;
XB = 45;
meshX = linspace(0,45,100);
Y0 = [JA, JB]; %guess values
init = bvpinit(meshX,Y0);
sol = bvp4c(@myode,@mybc,init);
==============
function yprime = myode(x,y)
global a1 a2 a3 a4 h k
H = h^2/12;
B = a1 + 2*a2.*y(1) + 3*a3.*y(1).^2 + 4*a4.*y(1).^3;
C = 5*a1 + 8*a2.*y(1) + 9*a3.*y(1).^2 + 8*a4.*y(1).^3;
yprime = [y(2);
(C.* y(2).^2)./(B.*y(1)) + (y(1).^5)./H - (k.*y(1).^5)./(H.*B)];
================
function res = mybc(ya,yb)
global JA JB
res = [ya(1) - JA
yb(1) - JB];
The function J(x) assumes the values JA and JB at the extremes of the interval. As reported in the title, I get the following error:
"Error using bvp4c (line 252) Unable to solve the collocation equations -- a singular Jacobian encountered.
Error in mybvp (line 54) sol = bvp4c(@myode,@mybc,init);"
How can I overtake this problem? Thanks in advance for your help. Pinco

댓글 수: 4

Pinco
Pinco 2013년 5월 3일
any ideas?
Kye Taylor
Kye Taylor 2013년 5월 3일
You bump your questions in hopes that they will be answered. Another good way to encourage answers is to accept good ones to previous threads.
Pinco
Pinco 2013년 5월 3일
@Kye Taylor: I apologize for this, but I know that you accept when the problem is solved, or is it not right? If the latter is the case, I apologize again, I will accept also the useful answers. Could you also explain to me the use of the flag? I'm not very familiar with this forum.
I posted a new question because it became different from the previous one.
Thanks for your help, but I studied the Jacobian and overtook this problem.
Kiran  Pathapati
Kiran Pathapati 2016년 8월 3일
@Pinco,
I'm also facing the same errors that you have mentioned in your earlier message. "Error using bvp4c (line 252) Unable to solve the collocation equations -- a singular Jacobian encountered.
Error in mybvp (line 54) sol = bvp4c(@myode,@mybc,init);"
You have mentioned that you were able to fix the errors. Could you please help me fixing the issue.
Thanks, Kiran

댓글을 달려면 로그인하십시오.

답변 (1개)

Sri Mukessh Subramanian
Sri Mukessh Subramanian 2015년 8월 21일

0 개 추천

the boundary condition vector should be specified column wise NOT ROW wise

카테고리

질문:

2013년 5월 2일

댓글:

2016년 8월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by