Solving coupled ODE's by ode45 / exp input error
Mostra commenti meno recenti
Hello,
I have a set of coupled differential equations that are in an .m file:
function dy = system_ex1(t, y)
dy = zeros (2 ,1);
dy(1) = -1.*exp^(-10./(y(2)+273)).*y(1);
dy(2) = 1000.*exp^(-10./(y(2)+273)).*y(1)-10.*(y(2)-20);
I solve it using ODE45 as such below:
Tspan = [0, 5];
IC = [1, 15];
[T, Y] = ode45(@system_ex1, Tspan, IC);
When I try to solve I am bombarded with messages. The first being "Error using exp" & "Not enough input arguments.". I believe that my ODE troubles stem from this but I also recieved many more ODE error messages as seen below:
Error using exp
Not enough input arguments.
Error in system_ex1 (line 7)
dy(1) = -1.*exp^(-10./(T+273)).*C;
Error in odearguments (line 90)
f0 = feval(ode,t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ode15s (line 150)
odearguments(FcnHandlesUsed, solver_name, ode, tspan, y0, options, varargin);
Error in Task1_Call (line 13)
[T, Y] = ode15s(@system_ex1, Tspan, IC);
Any and all help is appreciated, especially with trying to understand the issues with the exp function.
Thank you,
Mike
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Ordinary Differential Equations in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!