Error in stiff ode plot
Afficher commentaires plus anciens
Hi I've been having a promblem with ploting a stiff ode, I don't understand the error message that comes up as the same code has worked for a diffrent model I have investigate.
function dxdt=f(t,x)
dxdt=zeros(5,1);
r=1; k=1; dv=1; du=1; hu=1; he=1; hv=1; delta=1; pm=1;M=1; pe=1; de=1; dt=1; omega=1; b=1;
dxdt(1)=r*x(1)*(1-(x(1)+x(2))/k)-x(5)*dv*(1-exp(-hu*x(1)))-x(1)*du*(1-exp(-he*x(4)));
dxdt(2)=x(5)*dv*(1-exp(-hu*x(1)))-x(2)*du*(1-exp(-he*x(4)))-delta*x(2);
dxdt(3)=pm*(1-exp(-hv*x(5)))*x(3)*(1-x(3)/M);
dxdt(4)=x(3)*pe*(1-exp(hv(x(5)+x(1))))-de*x(4)-dt*x(1)*x(4);
dxdt(5)=delta*b*x(2)-omega*x(5);
end
function [T,X] = ffig()
tspan=[0 150];
x1_0=10^3;
x2_0=0;
x4_0=0;
x5_0=1;
[T_1,X1] = ode15s(@f,tspan,[x1_0 x2_0 1 x4_0 x5_0]);
plot(T_1,X1(:,1),'k')
end
thanks in advance :)
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Ordinary Differential Equations dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!