Back to the Top
The following message was posted to: PharmPK
HI there:
I am working on PBPK modeling of chemicals with ACSL. I have been
bothered
with mass balance problem,i.e.,the total mass(sum of the calculated
amount in
tissues/organs) and mass balance ((total mass - experimental
dose)/experimental dose) steadily increases and decreases instead of
keeping
constant. To avoid the effects of any potential culprits,I simplified
the code
as the following one. However,the problem is still there.
Would someone kindly take a look for me? Thanks very much.
Yasong
PROGRAM: test4.CSL
!Simplest model. To check mass balance.
INITIAL
!Physiological Parameters*****************
!Body fraction*********
CONSTANT BW=0.234 !kg
CONSTANT VFC=0.07
CONSTANT VLC=0.038
CONSTANT VRC=0.05
CONSTANT VBLDC=0.062 !Lee & Blaufox
!Blood flow rate parameters****************
CONSTANT QCC=14.1
CONSTANT QFC=0.07
CONSTANT QSC=0.17
CONSTANT QRC=0.58
CONSTANT QLC=0.18
!Scaled parameters*************
VF=BW*VFC
VL=BW*VLC
VR=BW*VRC
VBLD=BW*VBLDC
VS=0.91*BW-VF-VL-VR-VBLD
QC=QCC*BW**0.75
QF=QC*QFC
QS=QC*QSC
QR=QC*QRC
QL=QC*QLC
!Chemical-specific parameters***********
!Partition Coefficients
CONSTANT PL = 11. !reset for visual fit
CONSTANT PF=300.
CONSTANT PS = 3. !slowly perfused:plsm
CONSTANT PR= 12. !rapidly perfused:plsm
CONSTANT KAB=0.2
!Parameters for simulated experiment****
CONSTANT DOSE=1.5 !mg/kg
GI0=DOSE*BW*1000.0 !ug
!Timing commands***************
CONSTANT TSTOP = 72.0
CONSTANT POINTS = 720.0
CINT = TSTOP/POINTS !communication interval
END
DYNAMIC
ALGORITHM IALG=2
DERIVATIVE
!GI tract
RAGI=-KAB*AGI
AGI=INTEG(RAGI,GI0)
!Fat
RAF=QF*(CA-CVF)
AF=INTEG(RAF,0.0)
CF=AF/VF
CVF=CF/PF
!Slowly perfused tissues
RAS=QS*(CA-CVS)
AS=INTEG(RAS,0.0)
CS=AS/VS
CVS=CS/PS
!Rapidly perfused tissues
RAR=QR*(CA-CVR)
AR=INTEG(RAR,0.0)
CR=AR/VR
CVR=CR/PR
!Liver mass balance
RAL=QL*(CA-CVL)+KAB*AGI
AL=INTEG(RAL,0.0)
CL=AL/VL
CVL=CL/PL
!Blood
RAB=QL*CVL+QR*CVR+QF*CVF+QS*CVS-QC*CA
AB=INTEG(RAB,0.0)
CA=AB/VBLD
!Mass balance
TMASS=AGI+AF+AS+AR+AL+AB
MB=(GI0-TMASS)*100./GI0
TERMT(T.GE.TSTOP)
END
Yasong Lu
Center for Environmental Toxicology & Technology
Foothill Campus,CSU
Office 491-8615
Back to the Top
The following message was posted to: PharmPK
Dear Yasong,
There may not be a problem. What is the magnitude of your variation?
The only requirement for the difference (or ratio) between what was
administered and what is accounted for in the various tissues is that
it be numerically equivalent to zero. This means that some variation,
both plus or minus, is acceptable - and expected from the numerical
integrators - but the absolute value should be in a sufficiently small
range such that it could be considered zero. There is no requirement
that it remain constant - in fact, a perfectly constant value might
signal other problems.
Edmond B. Edwards, Ph.D.
EDIT Research,
Back to the Top
Dear Yasong,
Further to your problem. I've transcribed your program from ACSL into
SCoP and have attached both the source code and the compiled version
[not attached - db]. I've included both the relative error and actual
difference between the administered and distributed mass. Hopefully
the *.exe file will run on your computer [not attached - db]. As you
can see from the output graph, the actual difference varies between
-1.e-10 and 1.e-10 and the relative error seems to be in the range of
-1.e-12 to 1.e-12. In my humble opinion, for all practical purposes
these 'errors' may be considered zero.
Best Wishes,
Edmond B. Edwards, Ph.D.
EDIT Research
...
PARAMETER
{
: Physiological Parameters*****************
: Body fraction*********
BWt = 0.234 : kg
VCFat = 0.07
VCLiv = 0.038
VCRpd = 0.05
VCBld = 0.062 : Lee & Blaufox
: Blood flow rate parameters****************
QCCO = 14.1
QCFat = 0.07
QCSlw = 0.17
QCRpd = 0.58
QCLiv = 0.18
: Chemical-specific parameters***********
: Partition Coefficients
PLiv = 11. : reset for visual fit
PFat = 300.
PSlw = 3. : slowly perfused:plsm
PRpd = 12. : rapidly perfused:plsm
KAB = 0.2
: Parameters for simulated experiment****
DOSE = 1.5 : mg/kg
}
INDEPENDENT
{
TIME FROM 0 TO 72 WITH 720
}
ASSIGNED
{
VFat VLiv VRpd VBld VSlw
QCO QFat QSlw QRpd QLiv GI0
CFat CVFat CSlw CVSlw CRpd CVRpd CLiv CVLiv CArt
Admin TMASS MassDist
MBpct FROM -1.e-10 TO 1.e-10
MassDiff FROM -1.e-10 TO 1.e-10
}
STATE
{
AGI AFat ASlw ARpd ALiv ABld
}
INITIAL
{
: Scaled parameters*************
VFat = BWt*VCFat
VLiv = BWt*VCLiv
VRpd = BWt*VCRpd
VBld = BWt*VCBld
VSlw = 0.91 * BWt - VFat - VLiv - VRpd - VBld
QCO = QCCO * BWt^0.75
QFat = QCO*QCFat
QSlw = QCO*QCSlw
QRpd = QCO*QCRpd
QLiv = QCO*QCLiv
GI0 = DOSE * BWt * 1000.0 : ug
AGI = GI0
AFat = 0.0
ASlw = 0.0
ARpd = 0.0
ALiv = 0.0
ABld = 0.0
}
DERIVATIVE Test4
{
: assume all state variables have been solved
CFat = AFat/VFat
CVFat = CFat/PFat
CSlw = ASlw/VSlw
CVSlw = CSlw/PSlw
CRpd = ARpd/VRpd
CVRpd = CRpd/PRpd
CLiv = ALiv/VLiv
CVLiv = CLiv/PLiv
CArt = ABld/VBld
:----------------------------------------------------------
: GI tract
AGI' = -KAB*AGI
: Fat
AFat' = QFat * (CArt - CVFat)
: Slowly perfused tissues
ASlw' = QSlw * (CArt-CVSlw)
: Rapidly perfused tissues
ARpd' = QRpd * (CArt-CVRpd)
: Liver mass balance
ALiv' = QLiv * (CArt-CVLiv) + KAB*AGI
: Blood
ABld' = QLiv*CVLiv + QRpd*CVRpd + QFat*CVFat + QSlw*CVSlw - QCO*CArt
}
PLOT MassDiff, MBpct VS TIME
BREAKPOINT
{
SOLVE Test4 METHOD clsoda
: Mass balance
Admin = GI0 - AGI
TMASS = AGI + AFat + ASlw + ARpd + ALiv + ABld
MassDist = AFat + ASlw + ARpd + ALiv + ABld
MBpct = (GI0-TMASS)*100./GI0
MassDiff = Admin - MassDist
}
_sav_indep
0
0
BWt
0.234
1
VCFat
0.07
1
VCLiv
0.038
1
VCRpd
0.05
1
VCBld
0.062
1
QCCO
14.1
1
QCFat
0.07
1
QCSlw
0.17
1
QCRpd
0.58
1
QCLiv
0.18
1
PLiv
11.
1
PFat
300.
1
PSlw
3.
1
PRpd
12.
1
KAB
0.2
1
DOSE
1.5
1
TIME
0*72(720)
4
AGI
0:1
16
AFat
0:1
16
ASlw
0:1
16
ARpd
0:1
16
ALiv
0:1
16
ABld
0:1
16
VFat
0;1
2
VLiv
0;1
2
VRpd
0;1
2
VBld
0;1
2
VSlw
0;1
2
QCO
0;1
2
QFat
0;1
2
QSlw
0;1
2
QRpd
0;1
2
QLiv
0;1
2
GI0
0;1
2
CFat
0;1
2
CVFat
0;1
2
CSlw
0;1
2
CVSlw
0;1
2
CRpd
0;1
2
CVRpd
0;1
2
CLiv
0;1
2
CVLiv
0;1
2
CArt
0;1
2
Admin
0;1
2
TMASS
0;1
2
MassDist
0;1
2
MBpct
-1.e-10;1.e-10
2
MassDiff
-1.e-10;1.e-10
2
AGI0
0
1
AFat0
0
1
ASlw0
0
1
ARpd0
0
1
ALiv0
0
1
ABld0
0
1
delta_TIME
0.1
1
TIME0
0
1
maxerr
1e-5
1
AGI'
0;1
/
2
AFat'
0;1
/
2
ASlw'
0;1
/
2
ARpd'
0;1
/
2
ALiv'
0;1
/
2
ABld'
0;1
/
2
TIME
17 17 0
MassDiff
48 48 0
MBpct
47 47 0
0 0 0
0 0 0
0 0 0
TIME
0 72
MassDiff
-1e-10 1e-10
Back to the Top
The following message was posted to: PharmPK
Dear Edmond:
Thank you so much for your time in my problem. It was finally cracked.
I observed that some parameters (e.g.,volume fraction of fat) had
slightly
different values after compilation by the fortran compiler from the
original
assigned ones,e.g.,0.180(original setting) vs 0.18000001 (after
compilation).Suggested by AEgis technicians,I explicitly set the values
with a
double precision form,like 0.180D0,which led to a very good mass
balance.
Again,thanks.
Yasong
Yasong Lu
Center for Environmental Toxicology & Technology
Foothill Campus,CSU
Office 491-8615
Back to the Top
The following message was posted to: PharmPK
Dear Yasong Lu,
You wrote:
> I observed that some parameters (e.g.,volume fraction of fat) had
> slightly different values after compilation by the fortran compiler
> from the original assigned ones,
> e.g.,0.180(original setting) vs 0.18000001 (after
> compilation).Suggested by AEgis technicians,I explicitly set the
> values with a double precision form,like 0.180D0,
> which led to a very good mass balance.
It is good that this solved your problem, but I would not be happy. If
using 0.18000001 instead of 0.18 really makes a difference in your
calculations, there is definitely something wrong. This demonstrates
that your outcome is extremely dependent on the input, and such results
should be discarded, since they do not make sense. There is no reason
why the result obtained using 0.18 should be preferred over that
obtained using 0.18000001, isn't it?
This kind of numerical problems are often encountered in 'extreme'
situations, e.g. if one of the parameters comes close to a critical
value, e.g. zero. In my experience the use of double precision versus
single precision is not critical in normal cases. IMHO, any difference
due to the precision assigned to variables is suspected.
This situation may have some resemblance with an apparently different
problem, as commented upon by me a few years ago:
Proost JH. Do computational results depend on PC processors? (Letter to
the Editor). Clin Pharmacol Ther 1999;65:460.
In short: did you look at the standard errors of your estimates?
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.farm.rug.nl
Back to the Top
The following message was posted to: PharmPK
Dear Yasong:
I'm glad to hear that you have resolved your problem - but I'm curious.
What was the mass balance error before and after the precision was
doubled?
Thank you.
... Edmond
Back to the Top
The following message was posted to: PharmPK
Dear Proost
I fully agree with you. Actually we deal with numbers to tackle a
"non-numerical" situation. Common sense should also be
characterised as one of the methods or models in PK. Not method(s)
of solving problems, but right solution should be our concern.
Dr.Prashant
Ph.D.
Back to the Top
The following message was posted to: PharmPK
Dear Yasong:
I'm glad to hear that you have resolved your problem - but I'm curious.
What was the mass balance error before and after the precision was
doubled?
Thank you.
... Edmond
Back to the Top
The following message was posted to: PharmPK
Hi,Edmond:
The mass balance error was at the order of magnitude of 1e-03, and it
is 1e-13
to 1e-12.Thanks.
Yasong
[Hmm. Looks like I may have resent a couple of messages this morning -
db]
PharmPK Discussion List Archive Index page
Copyright 1995-2010 David W. A. Bourne (david@boomer.org)