Thanks Bernd for your help.

I think I need to add a function to describe enterohepatic recycling but I am not sure how to add it to PML

Here is the code "Drug is administered once" No dosing interval

test(){

# ntr is the structural parameter representing one less than the number of transit stages.

transit(Aa, mtt, ntr, max=50, out=-Aa*Ka)

deriv(A1 = Ka * Aa - Cl * C - Cl2 * (C - C2))

deriv(A2 = Cl2 * (C - C2))

dosepoint(Aa)

C = A1 / V

C2 = A2 / V2

error(CEps = 0.1)

observe(CObs = C + CEps * sqrt(1 + C^2 * (CMultStdev/sigma())^2))

stparm(Ka = tvKa * exp(nKa))

stparm(V = tvV * exp(nV))

stparm(V2 = tvV2 * exp(nV2))

stparm(Cl = tvCl * exp(nCl))

stparm(Cl2 = tvCl2 * exp(nCl2))

stparm(mtt = tvmtt * exp(nmtt))

stparm(ntr = tvntr) # fixed

stparm(CMultStdev = tvCMultStdev)

fixef(tvKa = c(, 1, ))

fixef(tvV = c(, 162929.74, ))

fixef(tvV2 = c(, 625466, ))

fixef(tvCl = c(, 7243, ))

fixef(tvCl2 = c(, 7243, ))

fixef(tvmtt = c(,1.05, ))

fixef(tvntr(freeze) =c(,7,))

fixef(tvCMultStdev = c(,1, ))

ranef(diag(nV, nCl, nKa, nV2, nCl2, nmtt) = c(1, 1, 1, 1, 1, 1))

}

Thanks !!