Question: Question on drug administration

Hello,

I am generating a code to describe how drug dosages (starting from 1 until dosage 2) are metabolized by the body.

The plot looks weird becasue it does not start from C0 = 4. I don't know how to set t=L so that C0 starts at 4. I suspect that I am misssing something in the piecewise function?  

My code is the follwoing:

C0 := 4;
k := 0.2;
L := 1;
C := t -> C0*(1 + exp(-k*L))*exp(-k*(t - L));
L := piecewise(L <= t and t < 2*L, 0, C(t));

plot(C(t), t = 1 .. 10) 

Thanks,

Andre

Please Wait...