I have a set of ODEs. I am using them to simulate a PK model. The parameter of one of those equations k1 is a time varying variable, when time is within a specific time range, the value of k7 is 100, otherwise is 1. How could I express this in code?
Here are some code I have written:
global k1 k2 k3 k4 k5 k6 k7 tspan;
if tspan(i)>8 & tspan(i)<24
k7 = 1;
[t,y]=ode45(@derivatives, tspan, y_0);