% Drug absorption model - basic
K0=0.01;
K1=0.035;
[Tout, Cout]=ode45 (@ drugAbsorption, [0, 200], [200, 0, 0], [], k0, k1);
The function Cout=drugAbsorption (t, ICs, k0, k1)
A=ICs (1);
B=ICs (2);
L=ICs (3);
DAdt=- k0 * A;
DBdt=k0 * - k1 * B;
DLdt=k1 * B;
Cout=[dAdt dBdt; dLdt];
End
Such as topic, ode45 function, they are defined with A B why variables need to set the initial state, A and B is the code inside A=ICs (1); B=ICs (2) the two parts, I look at this step, in the official ode45 official examples below,
Function dydt=vdp1 (t, y) dydt=[y (2), (1 - y (1) ^ 2) * y (2) - (1) y];/t, y=ode45 (@ vdp1, 20 [0], [2; 0]). The first post, thanks for your answer!