singular Jacobian encountered in bvp4c

Hello,
I use "bvp4c" command for solving a ODE system,
I encounter the following problem:
??? Error using ==> bvp4c
Unable to solve The collocation equations - a singular Jacobian encountered
Is there someone who knows a method or solution. My code is, as follows:
function [phi90,phivarrho,phiteta]=phiFn(a,S90,Svarrho,coeff)
c1=coeff(1); c2=coeff(2); c3=coeff(3); c4=coeff(4); c5=coeff(5); c6=coeff(6); c7=coeff(7); c8=coeff(8); c9=coeff(9);
options=[];
xinit1= linspace(-a/2,0);
xinit2=linspace(0,a/2);
xinit=[xinit1,xinit2];
yinit=[1 ;0; 0; -c7*c1; 1; 0; 0; -c7*c1];
solinit= bvpinit(xinit,yinit);
sol = bvp4c(@ode1,@BCs,solinit,options,S90,Svarrho,coeff)
xint=sol.x;
yint=sol.y;
phi90=yint(1,:);
phivarrho=yint(5,:);
phiteta=-(2*phi90+phivarrho);
function odesys = ode1(x,y,region,S90,Svarrho,coeff)
c1=coeff(1); c2=coeff(2); c3=coeff(3); c4=coeff(4);
c5=coeff(5); c6=coeff(6); c7=coeff(7); c8=coeff(8);
c9=coeff(9);
switch region
case 1 % x in [-a/2 0]
odesys = [ y(2);y(3);y(4);
(c6*c3*y(3)+c7*c3*y(1)+c9*c3*y(7)-c8*c2*y(3)-
c8*c4*y(7))/(-c5*c3+c1*c8);
y(6);y(7);y(8);(-c6*c3*y(3)-c7*c1*y(1)-
c9*c1*y(7)+c5*c2*y(3)+c5*c4*y(7))/(-c5*c3+c1*c8)];
case 2 % x in [0 a/2]
odesys = [ y(2);y(3);y(4);
(c6*c3*y(3)+c7*c3*y(1)+c9*c3*y(7)-c8*c2*y(3)-
c8*c4*y(7))/(-c5*c3+c1*c8);
y(6);y(7);y(8);(-c6*c3*y(3)-c7*c1*y(1)-
c9*c1*y(7)+c5*c2*y(3)+c5*c4*y(7))/(-c5*c3+c1*c8)];
end
end
function res = BCs(YL,YR,S90,Svarrho,coeff)
res = [YL(1,1)-S90;
YR(1,1)-S90;
YL(1,2)-S90;
YR(1,2)-S90;
YL(2,1);
YR(2,1);
YL(2,2);
YR(2,2);
YL(5,1)- Svarrho;
YR(5,1)-YL(5,2);
YL(5,2)-YR(5,1);
YR(5,2)-Svarrho;
YL(6,1);
YR(6,1)-YL(6,2);
YL(6,2)-YR(6,1);
YR(6,2)];
end
end
thank you

댓글 수: 1

Walter Roberson
Walter Roberson 2011년 4월 28일
See http://www.mathworks.com/matlabcentral/answers/6369-bvp4c

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

답변 (2개)

Zeynab Mousavi.K
Zeynab Mousavi.K 2011년 4월 28일

0 개 추천

oooooooo i have the same problem with exactly the same error if you understood the answer please inform me and i will tell you any solution if i found

댓글 수: 2

Amir K Neghab
Amir K Neghab 2011년 11월 17일
Hi,
Have you found the error? I think so.
How can you solve the " Singular Jacobian Error"
Walter Roberson
Walter Roberson 2011년 11월 17일
Amir, did you follow the link in my Comment, and try the Singular option?

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

Zachary
Zachary 2012년 10월 22일

0 개 추천

Being that there are no 1/x terms in your odes we need to see your coeff function to determine if it contributes to the singular jacobian.

카테고리

도움말 센터File Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기

제품

질문:

2011년 4월 26일

Community Treasure Hunt

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

Start Hunting!

Translated by