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
2011 年 4 月 28 日
See http://www.mathworks.com/matlabcentral/answers/6369-bvp4c
回答 (2 件)
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
2011 年 11 月 17 日
Hi,
Have you found the error? I think so.
How can you solve the " Singular Jacobian Error"
Walter Roberson
2011 年 11 月 17 日
Amir, did you follow the link in my Comment, and try the Singular option?
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 についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!