I am receiving the error message Index exceeds the number of array elements (1) when trying to use ode45.

조회 수: 2 (최근 30일)
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);

채택된 답변

darova
darova 2019년 11월 30일

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by