Back to the Top
Dear Colleagues,
I have to build up simulations for complicated compartmental models (e.g.
drug with 3-compartment disposition and generating N metabolites with
partial interconversion, etc.). It would be both more convenient and more
exact to use integrated equations and macroconstants for that. If all
transfer processes are linear, this is theoretically possible for any
number of compartments. But the derivation of such equations from
microconstants becomes incredibly time-consuming and produces huge
expressions difficult to handle with paper and pencil when you deal with
many-compartment models.
So does anybody know about a software which would perform symbolic
integration and provide integrated equations for a multicompartmental model
specified in microconstants, without regard to the amount of arrows and
boxes it includes ? Thank you in advance
Thierry BUCLIN, MD
Division of Clinical Pharmacology
University Hospital CHUV - Beaumont 633
CH 1011 Lausanne - SWITZERLAND
Tel: +41 21 314 42 61 - Fax: +41 21 314 42 66
Back to the Top
[A few replies - Mathematica, MATLAB, and Maple for symbolic
integration. ADAPT II and others SAAM II, WinNONLIN, even Boomer ;-)
to perform numerical integration - see
http://www.boomer.org/pkin/soft.html for info re programs to do
numerical integration. Maybe I need to add entries for the symbolic
integrators - db]
Reply-To: "Stephen Duffull"
From: "Stephen Duffull"
To:
Subject: Re: PharmPK Integration of compartmental models
Date: Tue, 10 Aug 1999 09:18:49 +0100
X-Priority: 3
Thiery:
I have used Mathematica for this and it works fairly well.
I understand MATLAB (& Maple) can also perform symbolic
integration - although I have not used either for this
purpose. Please note that I say Mathematica works "fairly
well", I have had problems when integrating some systems of
linear ODEs. Indeed in one case I found it less
problematical to integrate them by hand using Laplace
transforms.
Regards
Steve
=====================
Stephen Duffull
School of Pharmacy
University of Manchester
Manchester, M13 9PL, UK
Ph +44 161 275 2355
Fax +44 161 275 2396
---
From: "Bachman, William"
To: "'PharmPK.-at-.boomer.org'"
Subject: RE: PharmPK Integration of compartmental models
Date: Tue, 10 Aug 1999 07:54:39 -0400
One such program (to provide analytical solutions to differential equation
models) is Mathematica. There are others including Maple).
William J. Bachman, Ph.D.
GloboMax LLC
Senior Scientist
7250 Parkway Drive, Suite 430
Hanover, MD 21076
Voice (410) 782-2212
FAX (410) 712-0737
bachmanw.aaa.globomax.com
---
Reply-To:
Sender: "Eric Masson"
To:
Subject: RE: PharmPK Integration of compartmental models
Date: Tue, 10 Aug 1999 09:11:07 -0400
X-Priority: 3 (Normal)
Importance: Normal
I would try to fit this model using differential equations. A software such
as ADAPTII will let you do that.
Eric Masson, Pharm.D.
Scientific Director,
Anapharm inc
2050, boul Rene-Levesque West,
Ste-Foy, QC, Canada, G1V-2K8
418-527-4000 (EXT:222)
FAX: 418-527-3456
---
X-Sender: jelliffe.aaa.hsc.usc.edu
Date: Tue, 10 Aug 1999 13:40:12 -0700
To: PharmPK.at.boomer.org
From: Roger Jelliffe
Subject: Re: PharmPK Integration of compartmental models
Dear Thierry:
The ADAPT II programs of D'Argenio and Schumitzky use differential
equations and ODE solvers to do such simulations for both linear and
nonlinear models. You might consider them. To my knowledge, they do not do
symbolic integration, but use well-tested ODE solvers to do the job. They
have been around for many years, are well tested, and have a very good
reputation. Dr. D'Argenio's email is
dargenio.-at-.bmsrs.usc.edu
Hope this is useful to you.
Roger Jelliffe
---
Back to the Top
Thierry, for complex simulations I recommend:
http://www.VISSIM.com/PRODUCTS/pro-ov.html
http://www.mathworks.com/products/simulink/ and/or
http://www.hps-inc.com/products/stella/chapter_one/chapone.html
For symbolic integration the best is
http://www.mathematica.com/solutions/biomed/
for more ideas start with:
http://www.biosoft.com/main.htm
-Tony Hunt-
Back to the Top
I use Mathematica(TM) for this sort of problem.
Mathematica isn't as
easy to use as one might like but it does work. You can get information
concerning Mathematica at the Wolfram web site http://www.wolfram.com . Hope
this helps
Richard J. Traub
MSIN K3-55
Pacific Northwest National Laboratory
P.O. Box 999
Richland, WA 99352
(509) 375-4385 (voice)
(509) 375-2019 (FAX)
mailto:richard.traub.-at-.pnl.gov
Back to the Top
Dear Thierry,
presently available techniques of differential equation integration make
it unnecessary to explicitly integrate compartmental model equations to
obtain sums of exponentials. Plus (as you suggest), these expressions
become so cumbersome for more than three compartments that they quickly
outgrow their usefulness.
A tool that accomplishes what you suggest is SAAM II. In SAAM II, the
compartmental model can be built graphically on the screen, and the
differential equations (however complicated) are handled by the program.
Thus, you can simulate the output of any model you can conceive, for any
value of the (micro)parameters.
More information about SAAM II is available at: http://www.saam.com or
by emailing to info.aaa.saam.com. A demo version of the program is also
available for you to try.
Best wishes,
David M. Foster
*******************
Please note the change of my e-mail address to:
dmfoster.at.u.washington.edu
******************
Back to the Top
Dear David
There are still valid reasons for having analytical solutions to
differential equation models. Speed for one. Particularly in the
population context. Using the analytical solution for population analyses
with large populations can save an ENORMOUS amount of computing time
compared to the diff. eqn.
Best regards,
Bill
William J. Bachman, Ph.D.
GloboMax LLC
Senior Scientist
7250 Parkway Drive, Suite 430
Hanover, MD 21076
Voice (410) 782-2212
FAX (410) 712-0737
bachmanw.aaa.globomax.com
Back to the Top
[Two replies - db]
X-Sender: balaz.-at-.prairie.nodak.edu
Date: Fri, 13 Aug 1999 16:10:29 -0500
To: PharmPK.-at-.boomer.org
From: Stefan Balaz
Subject: Re: Integration of compartmental models
Dear Thierry:
Just a comment.
To the best of my knowledge, analytical (explicit, algebraic) integration
of the set of differential equations even for linear models is not feasible
for any structure of the compartment system. Let's denote the set of
underlying differential equations as -dc/dt = B x c + f, where c is the
(column) vector of the drug concentrations in all compartments, B is the
coefficient matrix, f is the (column) vector of the functions characterizing
the drug input to individual compartments, and x indicates multiplication.
Analytical integration can only be done if you can (1) express analytically
the eigenvalues of the matrix B and (2) integrate analytically the functions
"f(t-a) x exp(-b x a) x da" (f are the input functions, b are the
eigenvalues, and a is a variable). There is a lot of literature on the
subject but it is frequently difficult to read for a non-mathematician. A
very good treatise (in German) on the symbolic integration by Bozler,
Heinzel, Koss, and Wolf (Karl Thomae and Boehringer) was published long time
ago in a special issue 4a of Arzneimittel Forschung/Drug Research vol
27 (1977).
Translating the first condition (eigenvalues) into the structure of the
compartmental models, the models with unidirectional transfer are
comparatively easy to integrate analytically but cycles can cause problems.
However, when bidirectional transfer is involved, analytical integration
becomes very difficult, if at all feasible, when your system contains a
series of 3 or more compartments that exhibit bidirectional transfer
(occasionally, serial 4-compartment systems with bidirectional transfers are
integrable but only for special cases when some of the parameters are
identical - an example is given in our paper in J. Theor. Biol. 185 (1997)
213-222). The second condition (integration of the input functions) cannot
be discussed because you do not provide any information about your input.
In summary, numerical integration is the method to go, if you have a
multitude of more complicated models. I hope this helps and saves some time.
Good luck with your simulations,
Stefan
---
X-Sender: walt.-a-.mail.simulations-plus.com
Date: Sat, 14 Aug 1999 15:32:21 -0700
To: PharmPK.-a-.boomer.org
From: Walt Woltosz
Subject: PharmPK Re: Integration of compartmental models
Dear David,
While analytical solutions are fast, they are also far more difficult to
make general. If you want to solve something analytically, then every
dependency in the model must take a functional form that is integrable. It
can be challenging to come up with such models, and very time-consuming if
the problem is complex.
I come from the aerospace industry, which has had the luxury of many, many
millions of dollars and at least three decades of simulation development
for a wide variety of problems. With perhaps a rare exception (at least in
my experience), the most sophisticated models of any phenomenon are those
that involve numerically integrating a set of differential equations. Of
course, sometimes, within the derivative routines, there are closed form
(analytical) models that provide some of the numbers required to generate
the derivatives.
The tremendous flexibility of integrating differential equations allows the
developer to incorporate dependencies that are not always easily put into a
functional form that allows analytical solution (such as table lookups of
dertain dependencies from experimental data). And modifying the model,
which is inevitable, is made much faster as well, because you avoid having
to analytically derive a new solution each time your equations change.
While almost all modeling approaches involve theoretical equations based on
simplifying assumptions, those using the numerical solution approach can
usually be based on less simplification. The price you pay is the time
required to get a better answer. Computer processing power being relatively
cheap nowadays, this is not the problem it once was. I used to run
simulation/optimization programs on the Space Shuttle that took 12-14 hours
(on a Univac 1108 in 1971) which would now run in minutes on my notebook
computer.
For some problems, analytical solutions are appropriate. But as complexity
increases, analytical solutions often provide only a "quick and dirty"
ballpark estimate of behaviors. I believe there is usually a positive
correlation between quickness and dirtiness. On the other hand, anyone
developing a numerical model is remiss if they don't compare it to a good
analytical model now and then as a cross check - the differences should be
explainable.
Walt Woltosz Phone: (661) 723-7723
Chairman & CEO FAX: (661) 723-5524
Simulations Plus, Inc. (OTCBB:SIMU)
1220 West Avenue J
Lancaster, CA 93534-2902
U.S.A.
http://www.simulations-plus.com
walt.-a-.simulations-plus.com
Back to the Top
To ask a question...
Walt Woltosz commented:
>For some problems, analytical solutions are appropriate.
But as complexity
>increases, analytical solutions often provide only a "quick
and dirty"
>ballpark estimate of behaviors.
If there is a closed form analytical solution to the set of
ODEs then why would this be "quick and dirty"? Surely the
solution must be just that? If there is such a solution
then (to me) it would seem prudent to use it since this
would eliminate a numerical routine and provide a
significant improvement in speed. Despite comments to the
contrary speed is an important issue for some population
PKPD problems.
Regards
Steve
=====================
Stephen Duffull
School of Pharmacy
University of Manchester
Manchester, M13 9PL, UK
Ph +44 161 275 2355
Fax +44 161 275 2396
Back to the Top
Several correspondents have commented that it is not necessary to
use analytical solutions to linear ordinary differential equations
in fitting pharmacokinetic models to data as there are several good
programs available that incorporate differential equation solvers.
While this is undoubtedly true and certainly it is an easier way to
implement many pharmacokinetic models, there is a price to pay.
The solution of the differential equation is a numerical procedure
which is implemented within another numerical procedure: the optimizer
within the the nonlinear regression routine. Therefore it will
invariably take much longer specifying the model in terms of
differential equations. For single individual modelling this may not
be a concern but for large mixed-effects (population) problems this
becomes significant. Furthermore for flat or ill-conditioned surfaces
numerical errors arising from the differential equation solver can
propagate leading to nonconvergence and even divergence.
Therefore whenever possible, it is preferable to specify the equation
in algebraic form.
Leon Aarons
_____________
Leon Aarons
School of Pharmacy and Pharmaceutical Sciences
University of Manchester
Manchester, M13 9PL, U.K.
tel +44-161-275-2357
fax +44-161-275-2396
email l.aarons.at.man.ac.uk
Back to the Top
Yes:
Solving ordinary differential equations within a nonlinear regression
program is indeed time consuming even for small datasets. However, the
regression software used may alow direct incorporation of the differential
equation part of the model into a fortran program. This is a feature of
WinNonlin and is said to decrease the run time significantly. It makes
sense, because fortran is very good at doing many complicated nested loops
very quickly. I have not used this feature but it seems a possible
solution to waiting hours for odfe solution and regression convergence.
Perhaps other software such as Adapt and WinSam have the same features.
One draw back, aside from the extra programming, is that one must have a
fortran compliler such as Microsoft Fortran Powerstation 4.0 or Digital
Visual Fortran (version ??).
Other possibilities could be to write the entire model in fortran, or
perhaps use the SAS user application for PK modeling (never officially
released by SAS since it was a user program).
===========
Dan Combs
PK&Metabolism Dept.
Genentech Inc.
voice (650) 225-5847
fax (650) 225-6452
e-mail dzc.aaa.gene.com
Back to the Top
Dear Dan Combs:
About the need for differential equation solvers and Fortran
compilers. We
use the BOXES program in the USC*PACK collection. It writes the Fortran
source code for the model part of the analysis. You can then tweak the
source code if you wish. Then you can send this file, and another file with
the data and the instructions, to the Cray T3E at the San Diego
Supercomputer Center. The source code gets compiled. The analysis is done,
either using the iterative Bayesian or the Nonparametric EM software (for
best results, get the assay error pattern determined first, then find
gamma, the remainder of the intraindividual variability, then use this data
in the NPEM program. Results are then downloaded back to your PC and
examined with numbers and plots. This is an NIH supported research
resource, and it avoids having to get a compiler. That is all done for you.
We can arrange an account for those who are interested.
[Please reply directly to Roger if you want an account - db]
Very best regards,
Roger Jelliffe
Roger W. Jelliffe, M.D. Professor of Medicine, USC
USC Laboratory of Applied Pharmacokinetics
2250 Alcazar St, Los Angeles CA 90033, USA
Phone (323)442-1300, fax (323)442-1302, email= jelliffe.at.hsc.usc.edu
Our web site= http://www.usc.edu/hsc/lab_apk
PharmPK Discussion List Archive Index page
Copyright 1995-2010 David W. A. Bourne (david@boomer.org)