Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

Error occurs while running the code

1 vue (au cours des 30 derniers jours)
MINATI
MINATI le 16 Avr 2019
Clôturé : MATLAB Answer Bot le 20 Août 2021
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

Réponses (0)

Cette question est clôturée.

Community Treasure Hunt

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

Start Hunting!

Translated by