Hopefully someone can provide me a little help. I am building a population PK model to describe the PK of a drug after administration of a tablet that has an immediate release coating and an extended release core. Thus, I need to have 2 different Ka values, a fractional bioavailability, and a lag time on one of the absorption parameters. I have tried a few things and not been successful ... Here's my current code which employs 2 different dosing "compartments" (Aa and Aa2), and associated Ka parameters (Kafast and Kaslow). Unfortunately, the model doesn't seem to work properly. Any suggestions?
test(){
deriv(Aa = - Kaslow * Aa)
deriv(Aa2 = - Kafast * Aa2)
deriv(A1 = Kaslow * Aa + Kafast * Aa2 - Cl * C)
dosepoint(Aa, tlag = Tlag, bioavail=(1-F))
dosepoint(Aa2, bioavail=F)
C = A1 / V
error(CEps = 1)
observe(CObs = C * (1 + CEps))
stparm(Kaslow = tvKaslow * exp(nKaslow))
stparm(Kafast = tvKafast * exp(nKafast))
stparm(F = tvF * exp(nF))
stparm(V = tvV * exp(nV))
stparm(Cl = tvCl * exp(nCl))
stparm(Tlag = tvTlag * exp(nTlag))
fixef(tvKafast = c(, 1.1, ))
fixef(tvKaslow = c(, 0.4, ))
fixef(tvV = c(, 1827, ))
fixef(tvCl = c(, 564, ))
fixef(tvTlag = c(, 2.89, ))
fixef(tvF = c(0,0.4,0.5))
ranef(diag(nV, nCl, nKafast, nKaslow, nF, nTlag) = c(1, 1, 1, 1, 1, 1))
}