error: Unrecognized function or variable 'y', using ode45
Show older comments
this is my code and i get error: Unrecognized function or variable 'y', please help
function main
a = 0.01725*exp(2660/300);
E = 2660;
T0 = 300;
Cao = 2;
cpa = 20;
cpb = 20;
nao = 2*1200;
nbo = 2*1200;
b = (10*nao)/(cpa*nao+cpb*nbo);
[t,y]=ode45(@(t,y) DiabaticBatch(a,E,T0,Cao,b),[0 4000],[0 0]);
end
function dydt = DiabaticBatch(a,E,T0,Cao,b)
dydt = zeros(2,1);
dydt(1) = a*exp(-E/(T0+y(2)*b))*Cao*(1-y(1))^2;
dydt(2) = b*dydt(1);
end
Accepted Answer
More Answers (0)
Categories
Find more on Ordinary Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!