Back to the Top
Hello all,
I am interested in calculating the Tmax or Cmax after oral
administration for a
drug which displays 2 compartment kinetics. I know the mathematics is
easy for
a 1 compartment kinetic model, but I've search around and cant find the
solution for 2 compartment kinetics...the best solution so far is to
simulate
the profile at acceptable time intervals and read off the Cmax or Tmax
("spline
interpolation"?).
Has anyone diferentiated, and is willing to share the solution for the
oral
admin 2 comp model and solved for dC/dt = zero? My differentiation is a
little
rusty...
Thanks,
David
Dr David J R Foster
NH&MRC Research Officer
Department of Clinical and Experimental Pharmacology
The University of Adelaide
South Australia 5005
david.foster.at.adelaide.edu.aus
Back to the Top
Dear Dr. Foster,
I believe that Dr. John Wagneraddressed
this issue in his 2nd text, Fundamentals
of Clinical Pharmacokinetics.
I think that it can only be solved by iteration,
either by using equation for C or dC/dt.
I have the text but not with me. I can check
more if you like.
Sincerely,
Bill Ravis
William R. Ravis, Ph.D., F.C.P.
Professor/Head
Department of Pharmacal Sciences
Harrison School of Pharmacy
Auburn University, AL 36849
Back to the Top
Attached exe file (David - ok?) will calculate tmax and Cmax based on
parameters
obtained from fitting a sum of exponentials - it is an old program and
requires
a printer for output.
gary
[The file isn't attached but I have put the 'compiled' BASIC program on
line (with Gary's permission) at http://www.boomer.org/pkin/pk/tp.exe -
it is an .exe file and the server seems to download it OK - db]
Back to the Top
Dear Dr Foster,
tp=ln(ka/beta)/(ka-beta) is for approximate time of peak,
according to Kahan B.D. et al.: Application of Bayesian Forecasting to
Predict
Appropiate Cyclosporine Dosing Regimens for Renal Allograft Recipients.
Transplantation Proceedings 18(6) [suppl. 5], 200-2003, 1986.
ZERO= - alfa*A*EXP(-alfa*(tmax-tlag)) - beta*B*EXP(-beta*(tmax-tlag))
+ (A+B)*EXP(-ka*(tmax-tlag))
tmax should be iterated until ZERO=0 for exact peak-time value.
sincerely
Kazimierz H. Kozlowski, Pharm. D.
Laboratory of Pharmacokinetics
The Children's memorial Health Institute
04-736 Warsaw, Poland
E-mail: khkoz.-a-.czd.waw.pl
[I'm guessing this might be better as:
ZERO = - alfa*A*EXP(-alfa*(tmax-tlag)) - beta*B*EXP(-beta*(tmax-tlag))
- -ka*(A+B)*EXP(-ka*(tmax-tlag))
I added -ka to the third term and changed the sign in front of the -ka
- db]
Back to the Top
A little more recent approach, This is an excel vba macro subroutine
that takes an array of clearances, volumes and returns an array of
free_cmax and total cmax. It uses Excels solver to find the maximum
value. This uses only one previous dose, not steady state, (currently
set up for q 24 hour dosing, can be changed at the line
Cells(4, 1) = "=R[-1]C + 24" ' 24 hours previous to Tmax, for previous
dose, super position
). This was from a NONMEM model where q, v2 and ka were constant
(i.e., no eta on them)
Required globals are
num_samples, which is the number of samples (for a MonteCarlo
simulation, not the number of pk samples from a person)
free_fraction - free fraction of drug
Dose is entered into cell F2 of the worksheet.
Tmax is calculate on the worksheet (cells A3), but isn't returned by
this macro.
Diagnostics is the name of another worksheet that saves results
It will likely require some Excel expertise to use, but it seem pretty
robust, and reasonably fast (1000 Monte Carlo Simulations in about 10
minutes)
Sub get_cmax(total_cmax() As Single, free_cmax() As Single, cl() As
Single, volume() As Single)
Dim A1(1 To num_samples) As Single, A2(1 To num_samples) As Single,
A3(1 To num_samples) As Single
Dim alpha As Single, beta As Single
Dim i As Integer
Dim q As Single, v1 As Single, v2 As Single, ka As Single
Application.ScreenUpdating = False
q = 13.2 ' l/hr
v2 = 122 ' l
ka = 1.7 ' 1/hr
Dim k12 As Double, k21 As Double, ke As Double
' convert q and v to k12, k21 and k
k21 = q / v2 ' only k21 has everything constant
Worksheet.Select
setup_names
Cells(1, 1) = "alpha": Cells(1, 2) = "beta": Cells(1, 3) = "V1"
Cells(1, 4) = "K21": Cells(1, 5) = "ka": Cells(1, 6) = "dose"
' for most recent dose
' cell(1,7) is first term
Cells(1, 7) = "=dose*ka/v_1"
' cells(1,8) is first exponential term
Cells(1, 8) = "=(k_21 - alpha) / ((ka - alpha) * (beta - alpha)) *
Exp(-alpha * time)"
' cells(1,9) is second exponential term
Cells(1, 9) = "=(k_21 - beta)/((ka-beta)*(alpha-beta))*exp(-beta*time)"
' cells(1,10) is third exponential term
Cells(1, 10) = "=(k_21-ka)/((alpha-ka)*(beta-ka))*exp(-ka*time)"
' and cells(1,11) is concentration
Cells(1, 11) = "=term1*(ex_term1+ex_term2+ex_term3)"
' for previous dose, 24 hours age
' cell(2,7) is first term - actually not time dependent
Cells(2, 7) = "=dose*ka/v_1"
' cells(2,8) is first exponential term
Cells(2, 8) = "=(k_21 - alpha) / ((ka - alpha) * (beta - alpha)) *
Exp(-alpha * time_last)"
' cells(2,9) is second exponential term
Cells(2, 9) = "=(k_21 -
beta)/((ka-beta)*(alpha-beta))*exp(-beta*time_last)"
' cells(2,10) is third exponential term
Cells(2, 10) = "=(k_21-ka)/((alpha-ka)*(beta-ka))*exp(-ka*time_last)"
' and cells(2,11) is concentration from previous dose
Cells(2, 11) = "=term1*(ex_term1_last+ex_term2_last+ex_term3_last)"
' and total concentration
Cells(1, 12) = "=RC[-1] + R[1]C[-1]" ' sum of last dose and dose before
that
Cells(3, 1) = 1.4 ' initial estimate of Tmax
Cells(4, 1) = "=R[-1]C + 24" ' 24 hours previous to Tmax, for previous
dose, super position
' set up the solver, maximize cells f1 (concentration) by changing cell
a3
SolverAdd CellRef:="$A$3", Relation:=3, FormulaText:="0.001"
SolverAdd CellRef:="$A$3", Relation:=1, FormulaText:="10"
SolverOk SetCell:="$L$1", MaxMinVal:=1, ValueOf:="0",
ByChange:="$A$3"
' cell A3 is Tmax, change Tmax to maximize concentration (cell L1)
For i = 1 To num_samples
Cells(3, 1) = 1.4 'reset Tmax initial estimate
k12 = q / volume(i)
ke = cl(i) / volume(i)
Cells(2, 1) = 0.5 * ((k12 + k21 + ke) + Sqr((k12 + k21 + ke) ^ 2 -
4 * k21 * ke)) ' alpha
Cells(2, 2) = 0.5 * ((k12 + k21 + ke) - Sqr((k12 + k21 + ke) ^ 2 -
4 * k21 * ke)) ' beta
Cells(2, 3) = volume(i): Cells(2, 4) = k12: Cells(2, 5) = ka:
Cells(2, 6) = dose
' and run solver to time Cmax and Tmax
SolverSolve userFinish:=True
total_cmax(i) = Cells(1, 12)
free_cmax(i) = Cells(1, 12) * free_fraction
Next i
' write to log
diagnostics.Cells(1, 10) = "Total Cmax"
diagnostics.Cells(1, 11) = "Free Cmax"
For i = 1 To num_samples
diagnostics.Cells(i + 1, 10) = total_cmax(i)
diagnostics.Cells(i + 1, 11) = free_cmax(i)
Next i
End Sub
' require subroutine
Sub setup_names()
Application.ScreenUpdating = False
Worksheet.Select
' this sub defines all the names need for the get_cmax routine
Dim this_name As name
' first delete all that are there
For Each this_name In ActiveWorkbook.Names
this_name.Delete
Next this_name
' and add the ones we need
ActiveWorkbook.Names.Add name:="alpha",
RefersToR1C1:=Worksheet.Cells(2, 1)
ActiveWorkbook.Names.Add name:="beta",
RefersToR1C1:=Worksheet.Cells(2, 2)
ActiveWorkbook.Names.Add name:="v_1",
RefersToR1C1:=Worksheet.Cells(2, 3)
ActiveWorkbook.Names.Add name:="k_21",
RefersToR1C1:=Worksheet.Cells(2, 4)
ActiveWorkbook.Names.Add name:="ka",
RefersToR1C1:=Worksheet.Cells(2, 5)
ActiveWorkbook.Names.Add name:="dose",
RefersToR1C1:=Worksheet.Cells(2, 6)
ActiveWorkbook.Names.Add name:="time",
RefersToR1C1:=Worksheet.Cells(3, 1)
ActiveWorkbook.Names.Add name:="time_last",
RefersToR1C1:=Worksheet.Cells(4, 1) 'time of previous dose for
superposition
ActiveWorkbook.Names.Add name:="term1",
RefersToR1C1:=Worksheet.Cells(1, 7)
ActiveWorkbook.Names.Add name:="ex_term1",
RefersToR1C1:=Worksheet.Cells(1, 8)
ActiveWorkbook.Names.Add name:="ex_term2",
RefersToR1C1:=Worksheet.Cells(1, 9)
ActiveWorkbook.Names.Add name:="ex_term3",
RefersToR1C1:=Worksheet.Cells(1, 10)
ActiveWorkbook.Names.Add name:="ex_term1_last",
RefersToR1C1:=Worksheet.Cells(2, 8)
ActiveWorkbook.Names.Add name:="ex_term2_last",
RefersToR1C1:=Worksheet.Cells(2, 9)
ActiveWorkbook.Names.Add name:="ex_term3_last",
RefersToR1C1:=Worksheet.Cells(2, 10)
End Sub
Mark
Back to the Top
Perhaps David would consider putting the attached Excel file on his
site for download. It uses the Solver Add-In to estimate Tmax. I have
used the V, K21, alpha, beta, ka parameterization in this example. The
method can be adapted to any model that you choose to code as an Excel
formula.
Nick Holford, Divn Pharmacology & Clinical Pharmacology
University of Auckland, 85 Park Rd, Private Bag 92019, Auckland, New
Zealand
email:n.holford.aaa.auckland.ac.nz
http://www.health.auckland.ac.nz/pharmacology/staff/nholford/
[I have added the file to the website at
http://www.boomer.org/pkin/pk/TmaxCmax.xls . I hadn't used the solver
(much? at all?) before. After opening the spreadsheet and changing the
parameters to your liking you need to run solver from Excel tools menu
- db]
Back to the Top
David
in the atached excel file you have an example as I
told you I would do that, by iteration.
With solver. you have to change cell D7 to make cell
F2=0. I added the restriction of tmax>0 tmaxhope this helps
Marival
[I have placed this Excel file online at
http://www.boomer.org/pkin/pk/tmaxOralbicom.xls
- db]
PharmPK Discussion List Archive Index page
Copyright 1995-2010 David W. A. Bourne (david@boomer.org)