- On 12 May 2003 at 14:32:09, "Eddie Kwan" (eddiewk.at.interchange.ubc.ca) sent the message

Back to the Top

I am wondering if anyone at the pharmpk group has the ASCII code for a

2 compartment model with MM elimination within the WInNonlin program.

I am trying to write the ASCII code for the model and having some

difficulty.

I would appreciate any suggestion from any group members.

Thank you very much

Eddie Kwan at UBC - On 13 May 2003 at 11:51:43, Nick Holford (n.holford.-a-.auckland.ac.nz) sent the message

Back to the Top

The following message was posted to: PharmPK

Eddie,

You could try this (untested) code. Note the dose is hard coded. Its up

to you to change this to something more appropriate.

MODEL

remark ******************************************************

remark Developer: Nick Holford

remark Model Date: 05-13-2003

remark Model: first order absortpion, 2 compartment dispostion, mixed

order elimination

remark Single dose. Dose amount is hard coded

remark ******************************************************

remark

remark - define model-specific commands

COMMANDS

NFUNCTIONS 1

NDERIVATIVES 3

NPARAMETERS 6

PNAMES 'Vmax', 'Km', 'V1', 'V2', 'CLic', 'Tabs'

END

remark - define temporary variables

TEMPORARY

remark Define the dose in whatever way suits you e.g.

dose=100

ka=dlog(2)/tabs

END

remark - define differential equations starting values

START

Z(1) = Dose

Z(2) = 0

Z(3) = 0

END

remark - define differential equations

DIFFERENTIAL

RateIn=ka*Z(2)

C1=Z(2)/V1

C2=Z(3)/V2

CL=Vmax/(Km+C1)

DZ(1) = -RateIn

DZ(2) = RateIn + CLic*C2 - (CLic+CL)*C1

DZ(3) = CLic*(C1-C2)

END

remark - define algebraic functions

FUNCTION 1

F= Z(2)/V1

END

remark - define any secondary parameters

remark - end of model

EOM

Nick Holford, Dept Pharmacology & Clinical Pharmacology

University of Auckland, 85 Park Rd, Private Bag 92019, Auckland, New

Zealand

email:n.holford.-a-.auckland.ac.nz tel:+64(9)373-7599x86730 fax:373-7556

http://www.health.auckland.ac.nz/pharmacology/staff/nholford/ - On 13 May 2003 at 11:15:37, "Diederik Vansassenbroeck" (diederik.vansassenbroeck.aaa.rug.ac.be) sent the message

Back to the Top

The following message was posted to: PharmPK

Eddie,

the following model works fine for drugs like GHB and ethanol.

CLd is the intercompartmental clearance, Vc and Vt the central and

peripharal volume of distribution, Vmax , the theoretical maximal

metabolic

rate and Km the MM constant.

Model 1

COMM

NPARM 5

NCON 3

nder 2

PNAMES 'CLD','VC','VMAX','KM','VT'

END

TEMP

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=X

END

START

z(1)= 0

z(2)= 0.0

END

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)/VT

END

func 1

f = z(1)

end

EOM

Dr. D. Van Sassenbroeck

Heymans Institute for Pharmacology

Dept. of Pharmacology in Critical Care

De Pintelaan 185

B-9000 Gent

TEL : +32 (0)9 240 33 56

FAX : +32 (0)9 240 49 88

e-mail : diederik.vansassenbroeck.aaa.rug.ac.be - On 13 May 2003 at 22:32:39, Nick Holford (n.holford.aaa.auckland.ac.nz) sent the message

Back to the Top

The following message was posted to: PharmPK

Not a good day for me. I had an error pointed out in code I sent to

nmusers and now an astute PharmPk observer pointed out that I should

have written:

RateIn=ka*Z(1)

not

RateIn=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 Pharmacology

University of Auckland, 85 Park Rd, Private Bag 92019, Auckland, New

Zealand

email:n.holford.at.auckland.ac.nz tel:+64(9)373-7599x86730 fax:373-7556

http://www.health.auckland.ac.nz/pharmacology/staff/nholford/ - On 13 May 2003 at 15:29:57, David Bourne (david.-at-.boomer.org) sent the message

Back to the Top

[Two responses - db]

From: "Tata, Prasad N"

Date: Tue May 13, 2003 2:07:01 PM US/Central

To: david.at.boomer.org

Subject: RE: PharmPK Re: WinNonlin User Models - three compartment model

Reply-To: "Tata, Prasad N"

The following message was posted to: PharmPK

Let me clarify what I said. I am trying to model my drug onto a

three-compartment model PK, If anyone can help me with code that I can

use

in WinNonlin I appreciate it.

Thank you very much.

Prasad Tata

Mallinckrodt, Inc.

---

From: Nick Holford

Date: Tue May 13, 2003 2:08:22 PM US/Central

To: david.at.boomer.org

Subject: Re: HELP NEEDED:user defined model in winnonlin

Reply-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 that

the initial condition is only evaluated once (at x=0). In order to made

the input rate depend on t you must put the condition on input rate not

on dose eg.

if (tDZ(1)=0

else

DZ(1)=-KA*XA

endif

PLEASE NOTE I AM NOT A WINNONLIN CONSULTANT. I RARELY USE THE PROGRAM

EXCEPT FOR

SOME SIMPLE TEACHING EXAMPLES BECAUSE I FIND NONMEM IS MUCH MORE USEFUL

FOR 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 Pharmacology

University of Auckland, 85 Park Rd, Private Bag 92019, Auckland, New

Zealand

email:n.holford.at.auckland.ac.nz tel:+64(9)373-7599x86730 fax:373-7556

http://www.health.auckland.ac.nz/pharmacology/staff/nholford/ - On 14 May 2003 at 20:52:49, (vicente.casabo.-at-.uv.es) sent the message

Back to the Top

The following message was posted to: PharmPK

Hi ,

this is for trying to simultaneously fit oral and IV data using user

defined models try :

MODEL

remark DOSE1 IS IV DOSE AND DOSE2 IS PO DOSE

remark - define model-specific commands

COMMANDS

NFUN 2

NDER 5

NPARAMETERS 4

NCONSTANTS 2

PNAMES 'KA', 'KE', 'V1', 'TL'

NSEC 1

END

TEMPORARY

K12=4.02

K21=2.06

FD=0.22

DOSE1=CON(1)

DOSE2=CON(2)

END

START

Z(1)=FD*DOSE2

Z(2)=0

Z(3)=0

Z(4)=DOSE1

Z(5)=0.0

END

DIFF

t=X

if (tRATEIN=0.0

else

RATEIN=KA*Z(1)

endif

DZ(1)=-RATEIN

DZ(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)

END

FUNCTION 1

F= Z(2)/V1

END

FUNCTION 2

F= Z(4)/V1

END

SECO

S(1)=V1*KE

REMA

END

EOM

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

PharmPK Discussion List Archive Index page

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