test(){
##
## STRUCTURAL MODEL SECTION
##
deriv(Aa = - Ka * Aa) # differential equation for the amount of drug
# in absorption compartment
deriv(A1 = Ka * Aa - Cl * C - Cl2 * (C - C2)) # ditto for the central compartment
deriv(A2 = Cl2 * (C - C2)) # ditto for the peripheral compartment
dosepoint(Aa, tlag = Tlag) # absorption compartment can receive doses (extravascular)
C = A1 / V # amount is divided by volume to get concentration
C2 = A2 / V2 # ditto for peripheral compartment
E = Emax * C / (EC50 + C) # response (E) is expressed with Hill equation
##
## ERROR MODEL SECTION
##
error(EEps = 1) # initial estimate for standard deviation for
# the observational error (EEps)
observe(EObs = E + EEps) # observed quantity (EObs) is predicted response (E)
# plus the error (EEps) for an additive residual error model
##
## PARAMETER SECTION
##
# structural parameters and their associated fixed effects
stparm(Ka = tvKa)
stparm(V = tvV)
stparm(V2 = tvV2)
stparm(Cl = tvCl)
stparm(Cl2 = tvCl2)
stparm(Tlag = tvTlag)
stparm(EC50 = tvEC50)
stparm(Emax = tvEmax)
# fixed effect parameters and assignment of lower bound, an initial value, and an upper bound
# lower and upper bound are not specified, values separated by commas
# note, that all PK parameters are frozen
fixef(tvKa(freeze) = c(, 0.316365, ))
fixef(tvV(freeze) = c(, 2.97511, ))
fixef(tvV2(freeze) = c(, 14.0138, ))
fixef(tvCl(freeze) = c(, 5.18185, ))
fixef(tvCl2(freeze) = c(, 0.882968, ))
fixef(tvTlag(freeze) = c(, 0.31787, ))
fixef(tvEC50 = c(, 2, ))
fixef(tvEmax = c(, 100, ))
}