Bvp4c Error, Unable to solve the collocation equations -- a singular Jacobian encountered
2 views (last 30 days)
Show older comments
function sol= proj
global beta M R Pr m Q Sc Kr la
beta = 2; M = 6.0; R = 1; Pr = 0.75; m = 2.0; Q = 2; Sc = 0.6;
Kr = 0.2;
xa=0; xb=6;
xint=linspace(xa,xb,50);
nxint = length(xint);
LL=[0:0.5:2];
nLL = length(LL);
S = zeros(nLL, nxint);
%figure(1)
%subplot(2,1,1);
%subplot(2,1,2);
solinit= bvpinit([0:10:1000],[0,0,0,0,0,0,0,0]);
for i=1:nLL
la = LL(i);
sol= bvp4c(@projfun,@projbc,solinit);
solinit= sol;
sxint = deval(sol,xint);
S(i,1) = sxint(3,1);
%plot(sol.x,sol.y(2,:));hold on
end
figure(1)
plot(LL, S, '-', 'Linewidth', 1.5);
xlabel('\bf \lambda');
ylabel('\bf C_{f}');
end
function f= projfun(x,y)
global beta M R Pr m Q Sc Kr la
f= [y(2);y(3);y(4);(1/y(1))*y(3)^2-((1+la)/beta)*(M*y(2)+y(2)^2-y(1)*y(3));y(6);(3*Pr/(3+4*R))*(M*y(2)*y(6)-Q*y(5)-y(1)*y(6));y(8);Sc*(m*y(2)*y(7)+Kr*y(7)-y(1)*y(8))];
end
function res= projbc(ya,yb)
res= [ya(1); ya(2)-1;yb(2);yb(3);ya(5)-1;yb(5);ya(7)-1;yb(7)];
end
%% Error using bvp4c (line 248)
Unable to solve the collocation equations -- a singular Jacobian encountered.
%% Error in vkp (line 18)
sol= bvp4c(@projfun,@projbc,solinit);
2 Comments
Answers (0)
See Also
Categories
Find more on Boundary Value Problems in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!