PML implementation of QSS approx of a TMDD model

Hi, I am trying to “translate” a TMDD model with QSS approximation (as described in J Pharmacokinet Pharmacodyn (2008) 35:573–591) from NONMEM into PML. The NONMEM file is attached. My PML code is the following: test(){ deriv(Aa = - Ka * Aa) deriv(A1 = Ka * Aa - (K+K12) * CONCVC + K21 * A2 -KINTRMAXCONCVC/(KSS + CONC)) deriv(A2 = K12 CONCVC - K21 * A2) CONC=0.5*(A1/VC-RMAX-KSS)+0.5SQRT((A1/VC-RMAX-KSS)**2+4KSSA1/VC) dosepoint(Aa) error(CEps = 0.28) observe(CObs = ln(CONC) + CEps) stparm(Ka = tvKa * exp(nKa)) stparm(VC = tvVC * exp(nVC)) stparm(K = tvK * exp(nK)) stparm(K12 = tvK12 * exp(nK12)) stparm(K21 = tvK21) stparm(KINT = tvKINT) stparm(RMAX = tvRMAX) stparm(KSS = tvKSSexp(nKSS)) fixef(tvKa = c(, 1, )) fixef(tvVC = c(0, 0.15, )) fixef(tvK = c(, 0.05, )) fixef(tvK12 = c(, 0.15, )) fixef(tvK21 = c(, 0.3, )) fixef(tvKINT = c(, 0.06, )) fixef(tvRMAX = c(, 15, )) fixef(tvKSS = c(, 3, )) ranef(diag(nVC, nKa, nK, nK12, nKSS) = c(1,1, 1,1,1)) } I know for a fact that this is not a correct implementation because the term that describes the free drug concentration (“CONC”) should be evaluated at each dt interval, along with the differential equations. In Nonmem, this is taken care of by placing CONC under $DES. Any guidance on how to correctly implement this model in PML would be greatly appreciated! Thanks, Dora [file name=003.pdf size=50197]Certara | Drug Development Solutions

003.pdf (49 KB)

Dear Dora pml by default evaaluates each expression like CONC at each numerical integration interval. Therefore if it is the only issue here you did it right. I did not check the model but to your question nothing to worry. best serge

Dear Serge, Thank you for your quick reply. I am not sure what I am missing. If it’s not the implementation of CONC, then there should be something else wrong, because the model is not running, and I get the following error message “Object reference not set to an instance of an object.” Could you take a look? Thanks, Dora [file name=TMDD_test.phxproj size=1028857]Certara | Drug Development Solutions

TMDD_test.phxproj (1000 KB)

OK, here is the deal, SQRT is not accepted by Phoenix. It should be lower case. Try that CONC=0.5*(A1/VC-RMAX-KSS)+0.5sqrt((A1/VC-RMAX-KSS)**2+4KSS*A1/VC) If it does not work, I can retire. best Serge

Hmm… You were right about the lowercase - it started iterating, but 10 minutes into the run, and it didn’t progress beyond iteration 1. :frowning: Any further advice? Thanks, Dora

Can you try qrpem algorithm. Best would bebto send me the data set. best serge

Can you try qrpem algorithm. Best would bebto send me the data set. best serge

Hi Serge, The project file is attached to the previous message where I mentioned the error “Object reference not set to an instance of an object.”. I tried with QRPEM and it still does not progress with the iterations. Thanks, Dora