Evan, the issue is the term
at t=0. If you set t0 for the integration time span slightly differently, such as
[tv, Yv] = ode45('Tcells',[0.1 1500],[500, 0, 0, 1000]);
you should get it to work. Also, to improve readability and performance (especially for more complex, non-linear ODEs):
function dydt = Tcells(t,y)
y1 = y(1);
y2 = y(2);
y3 = y(3);
y4 = y(4);
dydt = [10 + 0.03*y1*(1-y1/t) - 0.02*y1 - (2.4e-5)*y4*y1; ...
(2.4e-5)*y4*y1 - 0.02*y2 - (3e-3)*y2; ...
(3e-3)*y2 - 0.24*y3; ...
1400*y3 - 2.4e-5*y4*y1 - 2.4*y4];
end
Best Answer