I am receiving the error message Index exceeds the number of array elements (1) when trying to use ode45.
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Michael Gomez
le 30 Nov 2019
Réponse apportée : darova
le 30 Nov 2019
I am attempting to produce a solution to a system of ODE's that model a PFR. When the function is run it gives the error Index exceeds the number of array elements (1). The number of differential equations and the number of initial conditions match so I do not understand why this error is occurring.
tspan=[0 8.41*10^-4];
y0=[300;293;.5;0];
k1=0.01;
kc=10;
hrx=-6000;
cps=30;
U=117.1793294;
Fa0=.35;
T0=300;
Tc0=293;
E=10000;
A=0.02142857143;
R=1.98720425864083;
[T,V]=ode45(@(T,V) [(k1*(exp((-E/R)*(T(1)-T0)))*(T(3)*T(3)-T(4)/kc)*(-hrx)-U*A*(T(1)-T(2))/(Fa0*cps));(U*A*(T(2)-T(1)))/(10^-3*.7*882*1900);k1*(exp((-E/R)*(T(1)-T0)))*(T(3)*T(3)-T(4)/kc);-k1*(exp((-E/R)*(T(1)-T0)))*(T(3)*T(3)-T(4)/kc)],tspan,y0);
0 commentaires
Réponse acceptée
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Ordinary Differential Equations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!