I want to create a zero order 2 compartmental model with saturable absorption to address the nonlinear PK. Kindly help me to design the script. I have drafted but there is an issue that the Predicted keeps on going up up with time. Model parameter values are dummy. Kindly help
test(){
deriv(R0 = Fa)
deriv(Fa = 1 + (Fabsolute - 1) * shift)
deriv(shift = (DOSELEVEL^Gamma / (DOSELEVEL^Gamma + Dose50^Gamma)))
deriv(Aa = - R0)
deriv(A1 = Aa - Cl * C - Cl2 * (C - C2))
deriv(A2 = Cl2 * (C - C2))
dosepoint(Aa, duration = D, tlag = Tlag)
C = A1 / V
C2 = A2 / V2
error(CEps = 0.1)
observe(CObs = C + CEps * sqrt(1 + C^2 * (CMultStdev/sigma())^2))
stparm(D = tvD * exp(nD))
stparm(Fabsolute = tvFabsolute * exp(nFabsolute))
stparm(Gamma = tvGamma * exp(nGamma))
stparm(Dose50 = tvDose50 * exp(nDose50))
stparm(V = tvV * (WTBL/55)^dVdWTBL * exp(nV))
stparm(V2 = tvV2 (WTBL/55)^dVdWTBL * exp(nV2))
stparm(Cl = tvCl * (WTBL/55)^dCldWTBL exp(nCl))
stparm(Cl2 = tvCl2 * (WTBL/55)^dCl2dWTBL* exp(nCl2))
stparm(Tlag = tvTlag * exp(nTlag))
stparm(CMultStdev = tvCMultStdev)
fcovariate(WTBL)
fcovariate(DOSELEVEL)
fixef(tvD = c(, 1 , ))
fixef(tvFabsolute = c(, 1, ))
fixef(tvGamma = c(, 1, ))
fixef(tvDose50 = c(, 100, ))
fixef(tvV = c(0, 1, ))
fixef(tvV2 = c(0, 1, ))
fixef(tvCl = c(0, 1, ))
fixef(tvCl2 = c(0, 1, ))
fixef(tvTlag = c(0, 1, ))
fixef(tvCMultStdev = c(, 0.001, ))
fixef(dVdWTBL(enable=c(0)) = c(, 1, ))
fixef(dV2dWTBL(enable=c(1)) = c(, 1, ))
fixef(dCldWTBL(enable=c(2)) = c(, 0.75, ))
fixef(dCl2dWTBL(enable=c(3)) = c(, 0.75, ))
ranef(block(nV, nCl) = c(1, 0.2, 1),
diag(nFabsolute, nGamma, nDose50, nV2, nCl2, nTlag, nD) = c(1, 1, 1, 1, 1, 1 ))
}