PharmPK Discussion - WinNonMix - 3 Compartment Model

PharmPK Discussion List Archive Index page
• On 27 Oct 2006 at 12:56:21, "Abouel Leil, Tarek M. Ph.D." (AbouelLeil.Tarek.-a-.mayo.edu) sent the message
`Hello,I am trying to model the PK of a drug and its metabolitesimultaneously.  The parent drug is modeled with 2-compartments, withelimination from the central compartment.  The metabolite is modeledas a 3rd compartment with its own elimination.  We have concentrationdata for the parent drug and the metabolite in the central compartment.I am attempting to write a user compiled model (using differentialequations) using Fortran for WinNonMix, but for some reason thesoftware is unable to solve the differential equations, and I keepgetting errors.  I don't think there is a problem with the equationsbut I am not sure.  I have placed the fortran code below.  I supposeI can try to get numerical solutions for the differential equationsusing Laplace transforms, but that is very cumbersome.So here are my questions:1.      Do you see any problems with the fortran code or way thedifferential equations are written that would cause WinNonMix to beunable to solve them?[What errors are you getting? Is it a stiff system - db]2.      Does anyone have a numerical solution to these differentialequations?* This way I could write the fortran code using algebraic functions,rather than differential equations.[See http://www.boomer.org/c/p4/c02/c07/c0707.html - db]Thanks in advance for your help.  The code is below:--subroutine usrmod(mode, funcno, dta, f, p, dz, s, con, x, z, wt, y,objfn)implicit real*8(a-h,o-z)implicit integer(i-n)!ms\$attributes dllexport :: usrmodinteger mode, funcnoreal*8 p(1), con(1), x, f, s(1), z(1), dz(1), dta(1), wt(1), y, objfn!******************************************************************************!*      *!*  Block 1: declare any model specific variables (if any),e.g.              *!*      *!*    real*8var                                                              *!*      *!******************************************************************************real*8 k10, k12, k21, v, Dose, TSTART, TSTOP, Q, cl1, v2, cl2real*8 k13, k30, v3, cl3, k31integer i, k!---- end of block (1)--!******************************************************************************!*      *!*  Block 2: initialize variables (if any),e.g.                              *!*      *!*    var =1.0d0                                                             *!*      *!******************************************************************************Dose = con(1)TSTART = con(2)TSTOP = con(3)Q = Dose/(TSTOP - TSTART)v = p(1)k10 = p(2)k12 = p(3)k13 = p(4)k21 = p(5)k31 = p(6)k30 = p(7)!---- end of block (2)--if (mode == 2) then!******************************************************************************!*      *!*  Block 3: set function value (required). It must include thefollowing     *!*statement:                                                       *!*      *!*    f =            ;value of the modelfunction                             *!*      *!******************************************************************************if (funcno == 1) f = z(1)if (funcno == 2) f = z(3)!---- end of block (3)--else if (mode == 5) then!******************************************************************************!*      *!*  Block 4: set secondary parameter values (if any). Dependingon            *!*           the number of secondary parameters, one or more ofthe           *!*           following statements may appear in thisblock                    *!*      *!*    s(1) =         ;value of the first secondaryparameter                  *!*      *!******************************************************************************!---- end of block (4)--else if (mode == 4) then!******************************************************************************!*      *!*  Block 5: Set initial values of differential equations (if any).Depending *!*           on the number of differential equations involved in themodel,   *!*           one or more of the following statements may appear inthis       *!*block:                                                           *!*      *!*    z(1) =         ;initial value of the 1st differentialequation          *!*      *!******************************************************************************z(1) = 0.0d0z(2) = 0.0d0z(3) = 0.0d0!---- end of block (5)--else if (mode == 3) then!******************************************************************************!*      *!*  Block 6: Describe differential equations (if any). Dependingon           *!*           the number of differential equations involved in themodel,      *!*           one or more of the following statements may appear inthis       *!*block:                                                           *!*      *!*    dz(1) =        ;value of the 1st differentialequation                  *!*      *!******************************************************************************if (x <= TSTOP) then         dz(1) = Q/v - (k13 + k10 + k12) * z(1) + k21 * z(2) + k31 * z(3)         dz(2) = k12 * z(1) - k21 * z(2)         dz(3) = k13 * z(1) - k31 * z(3) - k30 * z(3)else         dz(1) = - (k13 + k10 + k12) * z(1) + k21 * z(2) + k31 * z(3)         dz(2) = k12 * z(1) - k21 * z(2)         dz(3) = k13 * z(1) - k31 * z(3) - k30 * z(3)end if!---- end of block (6)--end if!******************************************************************************!*      *!*  Block 7: description of local subroutines/functions(optional)            *!*      *!*  Note:  if any local subroutine/function is to be included in thisblock,  *!*         the following statement must appear before any of thesubroutine/  *!*function:                                                          *!*      *!*contains*!*      *!******************************************************************************!---- end of block (7)--end subroutine usrmod--Tarek A. Leil, Ph.D.Department of Oncology, Guggenheim 1311Mayo Clinic200 First Street SWRochester, MN 55905ph: 507-538-4227fax: 507-266-5146`
Back to the Top

• On 28 Oct 2006 at 08:40:20, Nick Holford (n.holford.aaa.auckland.ac.nz) sent the message
`The following message was posted to: PharmPKIt is hard to suggest to you why you are having errors when you don'ttell us what they are!It is unlikely that the metabolite returns reversibly to the parent.If this reaction is not reversible then you do not need k31 * z(3) inthe differential equations for parent (compartment 1) and metabolite(compartment 3)You have a start and stop time for the infusion which you use tocalculate the input rate Q but you do not use the start time in thedifferential equations. If TSTART is not 0 then the input durationwill be TSTOP not (TSTOP-TSTART).You also need to be careful about which parameters you are trying toestimate. Because you do not give metabolite directly but onlyobserve the concentration derived from the parent you cannot identifyk13 separately from k10. Because you cannot estimate k10 directly youcan simply make the assumption that all the parent is converted tothe metabolite ie. k10=0.A simpler way of coding your system which includes these suggestionswould be:Dose = con(1)TSTART = con(2)TSTOP = con(3)v = p(1)if (x>=TSTART and x<=TSTOP) then    Q = Dose/(TSTOP - TSTART)/velse    Q = 0end ifdz(1) = Q - (k13 + k12) * z(1) + k21 * z(2)dz(2) = k12 * z(1) - k21 * z(2)dz(3) = k13 * z(1) - k30 * z(3)--Nick Holford, Dept Pharmacology & Clinical PharmacologyUniversity of Auckland, 85 Park Rd, Private Bag 92019, Auckland, NewZealandemail:n.holford.-a-.auckland.ac.nz tel:+64(9)373-7599x86730 fax:373-7556http://www.health.auckland.ac.nz/pharmacology/staff/nholford/`
Back to the Top

• On 29 Oct 2006 at 14:26:52, =?WINDOWS-1252?Q?M=E1ria_Duri=9Aov=E1?= (exfamadu.aaa.savba.sk) sent the message
`The following message was posted to: PharmPKDear Tarek A. Leil, Ph.D.As an alternative to a compartment  method I am suggesting asystem-approach based method for modeling formation of a metabolite froma parent drug. The use of the latter method is exemplified in:  DedikL., \0x00uri\0x00ova M.: System approach to modeling metaboliteformation fromparent drug: A working example with methotrexate. Methods Find Exp ClinPharmacol 24, 2002, 481-486.With best regards,Maria Durisova, DrSc (Math/Phys)http://www.uef.sav.sk/http://www.uef.sav.sk/advanced.htmhttp://www.klinickafarmakologie.cz/artkey/far-20030`
Back to the Top

Want to post a follow-up message on this topic? If this link does not work with your browser send a follow-up message to PharmPK@boomer.org with "WinNonMix - 3 Compartment Model" as the subject

Copyright 1995-2010 David W. A. Bourne (david@boomer.org)