I'd like help with the ode45 function for a biological model
Mostrar comentarios más antiguos
I'm trying to solve a differential equation using the ode45 model however I am encountering a recurring error problem here is my script:
function dydt = odepharm(t,y,S,R)
dydt = zeros(2,1);
dydt(1) = (gs*(Nmax-(y(1)+y(2))/Nmax)-ks*c/c+EC50s)*y(1);%S;
dydt(2) = (gr*(Nmax-(y(1)+y(2))/Nmax)-kr*c/c+EC50r)*y(2);%R;
end
gs=0.99;
gr=0.66;
Nmax=1.10e9;
ks=1.56;
kr=1.17;
c=400;
EC50s=0.21;
EC50r=5.19;
tspan = [0:12:96];
y0 = [1.06 1.06];
[t,y] = ode45(@(t,y) odefpharm(t,y,S,R), tspan, y0);
The error message includes:
Unrecognized function or variable 'S'.
Error in @(t,y)odefpharm(t,y,S,R)
Error in odearguments (line 92)
f0 = ode(t0,y0,args{:}); % ODE15I sets args{1} to yp0.
Error in ode45 (line 107)
odearguments(odeIsFuncHandle,odeTreatAsMFile, solver_name, ode, tspan, y0, options, varargin);
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Ordinary Differential Equations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
