# PML implementation of QSS approx of a TMDD model

**URL:** <https://forum.certara.com/t/pml-implementation-of-qss-approx-of-a-tmdd-model/2739>\
**Category:** Modelling and Simulation\
**Created:** [June 3, 2014, 7:00pm UTC](https://forum.certara.com/t/pml-implementation-of-qss-approx-of-a-tmdd-model/2739 "2014-06-03T19:00:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dora\_teo](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@dora\_teo](https://forum.certara.com/u/dora_teo)\
**Post date:** [June 3, 2014, 7:00pm UTC](https://forum.certara.com/t/pml-implementation-of-qss-approx-of-a-tmdd-model/2739/1 "2014-06-03T19:00:52Z")

</div>

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) \* CONC_VC + K21 \* A2 -KINT_RMAX_CONC_VC/(KSS + CONC)) deriv(A2 = K12 _CONC_VC - K21 \* A2) CONC=0.5\*(A1/VC-RMAX-KSS)+0.5_SQRT((A1/VC-RMAX-KSS)\*\*2+4_KSS_A1/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 = tvKSS_exp(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](http://www.pharsight.com/extranet/media/kunena/attachments/legacy/files/003.pdf%5B/file%5D)

[003.pdf](https://forum.certara.com/uploads/short-url/vzaNp7dz2B6f4CBJXnRwfmAt6sS.pdf) (49 KB)

---

<div class="post-metadata">

**Author:** ![minhaj](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@minhaj](https://forum.certara.com/u/minhaj)\
**Post date:** [June 3, 2014, 8:18pm UTC](https://forum.certara.com/t/pml-implementation-of-qss-approx-of-a-tmdd-model/2739/2 "2014-06-03T20:18:42Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dora\_teo](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@dora\_teo](https://forum.certara.com/u/dora_teo)\
**Post date:** [June 3, 2014, 9:16pm UTC](https://forum.certara.com/t/pml-implementation-of-qss-approx-of-a-tmdd-model/2739/3 "2014-06-03T21:16:43Z")

</div>

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](http://www.pharsight.com/extranet/media/kunena/attachments/legacy/files/TMDD_test.phxproj%5B/file%5D)

[TMDD\_test.phxproj](https://forum.certara.com/uploads/short-url/gBhr90cvAMxg0HhtUNW5t4zlzZO.phxproj) (1000 KB)

---

<div class="post-metadata">

**Author:** ![minhaj](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@minhaj](https://forum.certara.com/u/minhaj)\
**Post date:** [June 4, 2014, 1:27am UTC](https://forum.certara.com/t/pml-implementation-of-qss-approx-of-a-tmdd-model/2739/4 "2014-06-04T01:27:36Z")

</div>

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.5_sqrt((A1/VC-RMAX-KSS)\*\*2+4_KSS\*A1/VC) If it does not work, I can retire. best Serge

---

<div class="post-metadata">

**Author:** ![dora\_teo](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@dora\_teo](https://forum.certara.com/u/dora_teo)\
**Post date:** [June 4, 2014, 1:49am UTC](https://forum.certara.com/t/pml-implementation-of-qss-approx-of-a-tmdd-model/2739/5 "2014-06-04T01:49:58Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![minhaj](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@minhaj](https://forum.certara.com/u/minhaj)\
**Post date:** [June 4, 2014, 5:07am UTC](https://forum.certara.com/t/pml-implementation-of-qss-approx-of-a-tmdd-model/2739/6 "2014-06-04T05:07:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![minhaj](https://avatars.discourse-cdn.com/v4/letter/m/a698b9/32.png) [@minhaj](https://forum.certara.com/u/minhaj)\
**Post date:** [June 4, 2014, 6:05am UTC](https://forum.certara.com/t/pml-implementation-of-qss-approx-of-a-tmdd-model/2739/7 "2014-06-04T06:05:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dora\_teo](https://avatars.discourse-cdn.com/v4/letter/d/7ea924/32.png) [@dora\_teo](https://forum.certara.com/u/dora_teo)\
**Post date:** [June 4, 2014, 12:01pm UTC](https://forum.certara.com/t/pml-implementation-of-qss-approx-of-a-tmdd-model/2739/8 "2014-06-04T12:01:38Z")

</div>

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
