Back to the Top
The following message was posted to: PharmPK
Dear all of you,
I'm using WinNonmix for population analysis and I hope there's somebody
around who can help me with my problem.
I have been trying to write a model in WinNonmix for oral dosing with
zero order input and first order elimination from the central and
peripheral compartment. Every time I try to run the model I get the
error message "Unable to calculate the first derivative matrix of the
model". Changing the initials does not help. I've attached the code
below. Can somebody tell me if there is an error in the model? Any help
would be highly appreciated!
Thanks for your help
Nele
Nele Plock
Freie Universitaet Berlin
Institute of Pharmacy
Dept. Clinical Pharmacy
Kelchstr. 31
D-12169 Berlin
Germany
tel: +49 (0) 30 838-50625
fax: +49 (0) 30 838-50711
email: nplock.-a-.zedat.fu-berlin.de
The used model is as follows:
!
************************************************************************
******
!*
!* PK3.f90
!*
!* DESCRIPTION:
!*
!* This subroutine describes an two compartment model with zero order
!* input, first-order output, elimination from a peripheral cmt and
lag time.
!*
!* REQUIRED FORTRAN COMPILERS
!*
!* 1) DIGITAL VISUAL FORTRAN
!* 2) MICROSOFT FORTRAN POWERSTATION 4.0
!*
!* INPUT:
!*
!* 1) mode: index describing the type of calculation to be
performed.
!*
!* mode = 2 for predicted values
!* mode = 3 for differential equations
!* mode = 4 for starting values of differential equations
!* mode = 5 for secondary parameters
!*
!* 2) p: vector containing structural model parameters, where
!*
!* p(1) = V
!* p(2) = cl
!* p(3) = ti
!* p(4) = tlag
!* p(5) = q
!* p(6) = v2
!* p(7) = cl2
!*
!* 3) con: vector containing constants requried in the model,
where
!*
!* con(1) = # doses
!* con(2) = dose 1
!* con(3) = time of dose 1
!* etc.
!*
subroutine usrmod(mode, funcno, dta, f, p, dz, s, con, x, z, wt, y,
objfn)
implicit none
integer mode, funcno
real*8 p(1), con(1), x, f, s(1), z(1), dz(1), dta(1), wt(1), y, objfn
real*8 v, cl, k10, t, sum, dose, auc, cmax, tmax, k0, ti, tlag, k12, k21
real*8 k20, INP, q, v2, cl2
integer nn, ndose, k, i
v = p(1)
cl = p(2)
ti = p(3)
tlag = p(4)
q = p(5)
v2 = p(6)
cl2 = p(7)
if (mode == 2) then
f = z(1)/v
else if (mode == 5) then
else if (mode == 4) then
z(1) = 0.0d0
z(2) = 0.0d0
else if (mode == 3) then
nn = idint(con(1) + 1.0d-4)
call n_dose(nn, x, con, 3, 2, ndose)
if (ndose == 0) then
f = 0.0d0
else
sum = 0.0d0
end if
k = 3
k10 = cl / v
k12 = q / v
k21 = q / v2
k20 = cl2 / v2
do i = 1, ndose
t = x - con(k)
dose = con(k-1)
k0 = dose / ti
INP = 0.0d0
if (t < ti) then
INP = k0
endif
dz(1) = INP - k10 * z(1) - k12 * z(1) + k21 * z(2)
dz(2) = k12 * z(1) - k21 * z(2) - k20 * z(2)
k = k + 2
end do
end if
contains
subroutine n_dose(nn, t, con, fst, inc, ndose)
implicit none
integer nn, fst, inc, ndose
real*8 t, con(:)
integer i, k
k = fst
do i = 1, nn
if (con(k) > t) exit
k = k + inc
end do
ndose = i - 1
end subroutine n_dose
end subroutine usrmod
Back to the Top
The following message was posted to: PharmPK
Dear Nele,
The problem in your model is probably that it is overparameterized. You
cannot calculate both clearance from the central compartment (cl) and
from
the peripheral compartment (cl2). This would imply that you have five
disposition parameters (v, cl, q, v2, cl2), whereas a biexponential
equation
provides only four parameters. In other words, you want to get
information
that is not in the data. There is an infinite number of solutions for
this
problems, resulting in a numerical problem somewhere in the
calculation. The
standard method to solve this is to fix cl or cl2 to zero, or some other
fixed (known) value.
Best regards,
Hans Proost
Johannes H. Proost
Dept. of Pharmacokinetics and Drug Delivery
University Centre for Pharmacy
Antonius Deusinglaan 1
9713 AV Groningen, The Netherlands
tel. 31-50 363 3292
fax 31-50 363 3247
Email: j.h.proost.aaa.rug.nl
PharmPK Discussion List Archive Index page
Copyright 1995-2010 David W. A. Bourne (david@boomer.org)