Info
此问题已关闭。 请重新打开它进行编辑或回答。
Error occurs while running the code
1 次查看(过去 30 天)
显示 更早的评论
function main
B=0.3; L=0.3; M=1; Pr=1;Nb=.1; Nt=0.1;R=1;Le=5;
xa=0;xb=5;
solinit=bvpinit(linspace(xa,xb,101),[0 1 1 0 1 0 0 0]);
sol=bvp4c(@ode,@bc,solinit);
xint=linspace(xa,xb,101);
sxint=deval(sol,xint);
figure(1)
plot(xint,sxint(2,:));
xlabel('\eta');
ylabel('f^\prime');
hold on
function res=bc(ya,yb)
res=[ya(1); ya(2)-1; ya(5)-1; ya(7); Nb*ya(8)+Nt*ya(6); yb(2); yb(5);yb(7)];
end
function dydx=ode(x,y)
dydx=[y(2); y(3); y(4);
(y(4)+B*y(3)^2+(1+L)*(y(3)*y(1)-y(2)^2-M*y(2)))/(B*y(1)); y(6);
-3*Pr*(y(1)*y(5)+Nb*y(6)*y(8)+Nt*y(6)^2)/(3+4*R); y(8);
-Le*Pr*y(2)*y(8)-(Nt/Nb)*(-3*Pr*(y(1)*y(5)+Nb*y(6)*y(8)+Nt*y(6)^2)/(3+4*R)); ];
end
end
ERROR:
while running the code error is coming as:
Error using bvp4c (line 251)
Unable to solve the collocation equations -- a singular Jacobian encountered.
Error in (line 6)
sol=bvp4c(@ode,@bc,solinit);
What next to do
0 个评论
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!