Jian, here is some proposed code.
test(){ kg = t < T1? kg1: t > T1+deltaT? kg1: kg2 deriv(Ast = -kg * Ast) deriv(Aint = kg * Ast - ka * Aint) deriv(Cp = (ka *Aint + k21 * Aper)/ V - (k12 + ke) * Cp) deriv(Aper = k12 * Cp * V - k21 * Aper) dosepoint(Ast) error(CEps = 0.1)
observe(CObs = Cp*(1 + CEps)) fixef(ka = c(, 4.5, )) fixef(k12 = c(, 5.8, )) fixef(k21 = c(, 0.9, )) fixef(ke = c(, 1.7, )) fixef(V = c(, 0.7, )) fixef(kg1 = c(, 0.5,)) fixef(kg2 = c(, 0.1,)) # T1 is Tend fixef(T1 = c(, 3, )) # T2 is Tlag # deltaT is Tlag - Tend fixef(deltaT = c(0, 3, )) } I would also suggest that you could instead call T1, Tend in the code etc. then the code is more transparentAlso in your model it is possible to append all your doses into one worksheet and dit them together, you can even run them as Naive pool population without an NLME license if you feel the individual data is too sparse to fit well. that would be better than meaning the data first I think.[color=#000000][font=calibri][size=2] Simon.
Edited by Simon Davis, 04 August 2020 - 08:22 AM.