필터 지우기
필터 지우기

singular Jacobian encountered bvp4c

조회 수: 1 (최근 30일)
pxg882
pxg882 2012년 12월 5일
I'm following the bvp4c example 5 found here:
I have tried to modify the code for my problem, however I receive 'a singular Jacobian encountered' message when I try to run my code.
This is what I have:
function nNbvp
etainf = 55;
options = bvpset('RelTol',1e-6);
solinit = bvpinit(linspace(0,etainf),[0 0.506869 1 -0.624297 0]);
sol = bvp4c(@nN,@nNbc,solinit,options);
eta = sol.x;
f = sol.y;
fprintf('\n');
fprintf('Value of H(etainf) is = %7.5f.\n',f(5,end))
clf reset
hold on
plot(eta,f(1,:));
plot(eta,f(3,:));
plot(eta,f(5,:));
axis([0 55 0 2]);
xlabel('\eta')
hold off
shg
% --------------------------------------------------------------------------
function Yprime = nN(eta,Y)
n = 0.9;
X(1) = (Y(2)^2+Y(4)^2)^((1-n)/2);
X(2) = Y(5)+((1-n)/(n+1))*eta*Y(1);
X(3) = (n-1)/(Y(2)^(2)+Y(4)^(2));
X(4) = Y(2)*Y(4)*X(3);
Yprime = [ Y(1)
X(1)/n*((Y(1)^2-Y(3)^2+X(2)*Y(2))*(1+X(3)*Y(4)^2)-X(4)*(2*Y(1)*Y(3)+X(2)*Y(4)))
Y(3)
X(1)/n*((2*Y(1)*Y(3)+X(2)*Y(4))*(1+X(3)*Y(2)^2)-X(4)*(Y(1)^2-Y(3)^2+X(2)*Y(2)))
-2*Y(1)-((1-n)/(n+1))*eta*Y(2)];
% --------------------------------------------------------------------------
function res = nNbc(Y0,Yinf)
n = 0.9;
res = [Y0(1)
Y0(3)-1
Y0(5)
Yinf(2) - (n/(inf*(n-1)))*Yinf(1)
Yinf(4) - (n/(inf*(n-1)))*Yinf(3)];
Can anybody help explain why I am receiving this message? I'm sure the problem is set up correctly, I have checkedit through numerous times.
Thanks.
  댓글 수: 1
pxg882
pxg882 2012년 12월 5일
Resolved please ignore.

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

답변 (0개)

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by