# PharmPK Discussion - WinNonlin User Models

PharmPK Discussion List Archive Index page
• On 12 May 2003 at 14:32:09, "Eddie Kwan" (eddiewk.at.interchange.ubc.ca) sent the message
`I am wondering if anyone at the pharmpk group has the ASCII code for a2 compartment model with MM elimination within the WInNonlin program.I am trying to write the ASCII code for the model and having somedifficulty.I would appreciate any suggestion from any group members.Thank you very muchEddie Kwan at UBC`
Back to the Top

• On 13 May 2003 at 11:51:43, Nick Holford (n.holford.-a-.auckland.ac.nz) sent the message
`The following message was posted to: PharmPKEddie,You could try this (untested) code. Note the dose is hard coded. Its upto you to change this to something more appropriate.MODELremark   ******************************************************remark   Developer:	Nick Holfordremark   Model Date:	05-13-2003remark   Model:	first order absortpion, 2 compartment dispostion, mixedorder eliminationremark   Single dose. Dose amount is hard codedremark   ******************************************************remarkremark - define model-specific commandsCOMMANDSNFUNCTIONS 1NDERIVATIVES 3NPARAMETERS 6PNAMES  'Vmax', 'Km', 'V1', 'V2', 'CLic', 'Tabs'ENDremark - define temporary variablesTEMPORARYremark Define the dose in whatever way suits you e.g.dose=100ka=dlog(2)/tabsENDremark - define differential equations starting valuesSTARTZ(1) = DoseZ(2) = 0Z(3) = 0ENDremark - define differential equationsDIFFERENTIALRateIn=ka*Z(2)C1=Z(2)/V1C2=Z(3)/V2CL=Vmax/(Km+C1)DZ(1) = -RateInDZ(2) = RateIn + CLic*C2 - (CLic+CL)*C1DZ(3) = CLic*(C1-C2)ENDremark - define algebraic functionsFUNCTION 1F= Z(2)/V1ENDremark - define any secondary parametersremark - end of modelEOMNick 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 13 May 2003 at 11:15:37, "Diederik Vansassenbroeck" (diederik.vansassenbroeck.aaa.rug.ac.be) sent the message
`The following message was posted to: PharmPKEddie,the following model works fine for drugs like GHB and ethanol.CLd is the intercompartmental clearance, Vc and Vt the central andperipharal volume of distribution, Vmax , the theoretical maximalmetabolicrate and Km the MM constant.Model 1COMM   NPARM 5   NCON 3   nder 2   PNAMES 'CLD','VC','VMAX','KM','VT'ENDTEMP   Dose=CON(1)   TSTART = CON(2)   TSTOP  = CON(3)   RATE = Dose/(TSTOP - TSTART)    CLD=P(1)   VC=P(2)   VMAX=P(3)   KM=P(4)   VT=P(5)   T=XENDSTART   z(1)= 0   z(2)= 0.0END  DIFF  If X <= TSTOP THEN   DZ(1)= RATE/VC -CLD*Z(1)/VC + CLD*Z(2)/VC - VMAX*Z(1)/(KM + Z(1))/VC  ELSE   DZ(1)= -CLD*Z(1)/VC + CLD*Z(2)/VC - VMAX*Z(1)/(KM + Z(1))/VC  ENDIF   DZ(2)=  CLD*Z(1)/VT - CLD*Z(2)/VTENDfunc 1   f = z(1)endEOMDr. D. Van SassenbroeckHeymans Institute for PharmacologyDept. of Pharmacology in Critical CareDe Pintelaan 185B-9000 GentTEL : +32 (0)9 240 33 56FAX : +32 (0)9 240 49 88e-mail : diederik.vansassenbroeck.aaa.rug.ac.be`
Back to the Top

• On 13 May 2003 at 22:32:39, Nick Holford (n.holford.aaa.auckland.ac.nz) sent the message
`The following message was posted to: PharmPKNot a good day for me. I had an error pointed out in code I sent tonmusers and now an astute PharmPk observer pointed out that I shouldhave written:RateIn=ka*Z(1)notRateIn=ka*Z(2)in my code for a 2 cpt mixed order first order absorption model.Sorry for the confusion.--Nick Holford, Dept Pharmacology & Clinical PharmacologyUniversity of Auckland, 85 Park Rd, Private Bag 92019, Auckland, NewZealandemail:n.holford.at.auckland.ac.nz tel:+64(9)373-7599x86730 fax:373-7556http://www.health.auckland.ac.nz/pharmacology/staff/nholford/`
Back to the Top

• On 13 May 2003 at 15:29:57, David Bourne (david.-at-.boomer.org) sent the message
`[Two responses - db]From: "Tata, Prasad N" Date: Tue May 13, 2003  2:07:01  PM US/CentralTo: david.at.boomer.orgSubject: RE: PharmPK Re: WinNonlin User Models - three compartment modelReply-To: "Tata, Prasad N" The following message was posted to: PharmPKLet me clarify what I said.  I am trying to model my drug onto athree-compartment model PK, If anyone can help me with code that I canusein WinNonlin I appreciate it.Thank you very much.Prasad TataMallinckrodt, Inc.---From: Nick Holford Date: Tue May 13, 2003  2:08:22  PM US/CentralTo: david.at.boomer.orgSubject: Re: HELP NEEDED:user defined model in winnonlinReply-To: Nick Holford The following message was posted to: PharmPK>> Dr Holford> i am trying to simultaneously fit oral and IV data using user defined> models> in Winnonlin ver 3.1. i have used differential equations to write the> code> for it, however, to incorporate a Tlag (which i quess has to be in the> form> of INTEGRAL form) i am facing difficulties to link the intergral ORAL> dosing> input to the differential components.When trying to solve differential equations you have to understand thatthe initial condition is only evaluated once (at x=0). In order to madethe input rate depend on t you must put the condition on input rate noton dose eg.if (tDZ(1)=0elseDZ(1)=-KA*XAendifPLEASE NOTE I AM NOT A WINNONLIN CONSULTANT. I RARELY USE THE PROGRAMEXCEPT FORSOME SIMPLE TEACHING EXAMPLES BECAUSE I FIND NONMEM IS MUCH MORE USEFULFOR REAL MODELLING PROBLEMS.> THIS IS THE CODE I TRIED WRITING AND I WOULD REALLY APPRECIATE SOME> HELP> FROM UR END>> MODEL> remark ******************************************************> remark Developer:> remark Model Date: 05-11-2003> remark Model Version: 1.0> remark ******************************************************> remark DOSE1 IS IV DOSE AND DOSE2 IS PO DOSE> remark - define model-specific commands> COMMANDS> NFUNCTIONS 2> NDERIVATIVES 4> NPARAMETERS 4> NCONSTANTS 2> PNAMES 'KA', 'KE', 'V1', 'TL'> PCONSTANTS 'DOSE1', 'DOSE2'> END> remark - define temporary variables> TEMPORARY> T=X> DOSE1=CON(1)> DOSE2=CON(2)> IF T<=TL THEN> DOSE2=0.0> ELSE> XA=DOSE2*DEXP(-KA*(T-TL))> ENDIF> K12=4.02> K21=2.06> FD=0.22> END> remark - define differential equations starting values> START> Z(1)=FD*DOSE2> Z(2)=0> Z(3)=0> Z(4)=DOSE1> END> remark - define differential equations> DIFFERENTIAL> DZ(1)=-KA*XA> DZ(2)=KA*XA+K21*Z(3)-K12*Z(2)-KE*Z(2)> DZ(3)=K12*Z(2)-K21*Z(3)> DZ(4)=-(KE+K12)*Z(2)+K21*Z(3)> END> remark - define algebraic functions> FUNCTION 1> F= Z(2)/V1> END> FUNCTION 2> F= Z(4)/V1> END> remark - define any secondary parameters> remark - end of model> EOM>--Nick Holford, Dept Pharmacology & Clinical PharmacologyUniversity of Auckland, 85 Park Rd, Private Bag 92019, Auckland, NewZealandemail:n.holford.at.auckland.ac.nz tel:+64(9)373-7599x86730 fax:373-7556http://www.health.auckland.ac.nz/pharmacology/staff/nholford/`
Back to the Top

• On 14 May 2003 at 20:52:49, (vicente.casabo.-at-.uv.es) sent the message
`The following message was posted to: PharmPKHi ,this is for  trying to simultaneously fit oral and IV data using userdefined models try :MODELremark DOSE1 IS IV DOSE AND DOSE2 IS PO DOSEremark - define model-specific commandsCOMMANDSNFUN 2NDER 5NPARAMETERS 4NCONSTANTS 2PNAMES 'KA', 'KE', 'V1', 'TL'NSEC 1ENDTEMPORARYK12=4.02K21=2.06FD=0.22DOSE1=CON(1)DOSE2=CON(2)ENDSTARTZ(1)=FD*DOSE2Z(2)=0Z(3)=0Z(4)=DOSE1Z(5)=0.0ENDDIFFt=Xif (tRATEIN=0.0elseRATEIN=KA*Z(1)endifDZ(1)=-RATEINDZ(2)=RATEIN+K21*Z(3)-K12*Z(2)-KE*Z(2)DZ(3)=K12*Z(2)-K21*Z(3)DZ(4)=-(KE+K12)*Z(4)+K21*Z(5)DZ(5)=K12*Z(4)-K21*Z(5)ENDFUNCTION 1F= Z(2)/V1ENDFUNCTION 2F= Z(4)/V1ENDSECOS(1)=V1*KEREMAENDEOM`
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 "WinNonlin User Models" as the subject

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