Pharmacokinetics

Mathematical Modeling

Richard Hitt

Introduction

Pharmacokinetics is the study of the movement of drugs through the body.  Compartment models are often used in this context where cells in the body are grouped together in a small number of compartments.  We will begin by developing a 2-compartment model of a therapeutic drug.  One compartment will be the GI tract and the other will be the blood system.

A Two-Compartment Model

When an oral medication is ingested, it will usually disolve quickly in the stomach and pass into the intestines.  The drug is absorbed into the blood by the vessels which line the intestines.

Assumption 1

Once ingested, the drug dissolves in the stomach and is delivered to the intestines at a constant rate.

Assumption 2

The rate at which the drug moves from the first compartment, the GI tract, into the second, the blood, is proportional to the concentration in the intestines (independent of the blood level).

Once in the blood, the body usually works to rid itself of the drug through metabolism by the liver, filtering by the kidneys, etc.

Assumption 3

The rate at which the drug is removed from the blood is proportional to the amount present in the blood.

Assumption 3 implies that if an individual takes a single dose of a drug, the blood level of the drug will decay exponentially after reaching a peak level.  This gives rise to the notion of  a half-life for a drug - the length of time required for the blood level to fall by one half.  The half life of a drug varies with the drug, and also with the individual. A drug given to a person with a high metaboliism will usually have a shorter half-life than the same drug given to a person with a slower metabolism.

To build a mathematical model which will predict blood level of a drug, we let

x'(t) = -a x(t) + D(t)
y'(t) =  a x(t) - b y(t)

where x(t) is the amount of drug in the intestines, y(t) is the amount of drug in the blood system, P(t) is rate of inflow of the drug into the intestines, and a and b are constants of proportionality.  Each of these equations is just a version of the

rate of change = rate in - rate out.

An Single-DoseExample

Suppose the half-life of a particular drug in the intestines is 1 hour and the half-life in the blood is 8 hours.  Also assume the duration of the pulse given by D is 30 minutes.  If a drug dose of 10 mg is ingested, then the system of differential equations using a two-compartment model on this system can be numerically solved as follows.

Clear[x, y, t, sol]; \(P[t_] := 20 /; 0 ≤ t ≤  .5; 

    \(P[t_] := 0 /;  .5 < t; 
P[t_] := 0 /; t < 0; \)\)

sol=NDSolve[{x'[t]==- Log[2] x[t] + P[t],y'[t]== Log[2] x[t] - (1/8) Log[2] y[t],x[0] == 0,y[0] == 0},{x, y},{t, 0, 40}]

Plot[Evaluate[{x[t], y[t]} /. sol], {t, 0, 40},  
      PlotStyle  ->  {RGBColor[1, 0, 0],  RGBColor[0, 0, 1]}]

A Repeated Dose Example

In many medical situations, the patient needs to maintain a blood level of a drug within certain bounds over time.  Usually, there is some minimum blood level at which the drug is therapeutic and a maximum level above which the drug is toxic.  The idea is to keep the blood level between those two levels over time.  One common strategy is to take repeated doses of the drug at periodic intervals.

In this example, lets suppose the half-life of the drug in the blood is 8 hours, the pulse function lasts 30 minutes, and a 100 mg dose of medication is taken every 12 hours.  First, we need an appropriate pulse function.

First Attempt at a Pulse Function

Clear[x, y, t, P]; \(P[t_] := 200 /; 0 ≤ t ≤  .5; 

    P[t_] := 0 /;  .5 < t; 
\(P[t_] := 0 /; t < 0; \)\)

Q[t_] := (∑_(n = 0)^8) P[t - 12 n]

To see what this function does, we can plot it:

Plot[Q[t], {t, 0, 60},  PlotPoints -> 120]

Second Attempt at a Pulse Function

While this is all right on the given interval, if we want the pulses to last longer we need to increase the upper limit on the sum.  Rather than do this, we can devise a general square wave function as follows:

Clear[Sqw]Sqw[t_, d_, T_]  :=  
      0  /;  t  -  Floor[t/T]*T  >=  (d/100)*TSqw[t_, d_, T_]  :=  
      1  /;  t  -  Floor[t/T]*T  <    (d/100)*T

This gives a square-wave function of period T that is "on" for d percent of the time.  For example

Plot[Sqw[t, 1/24*100, 12], {t, 0, 80},  PlotPoints -> 150]

Returning to our repeated dose problem, we can solve the system of differential equations as before.  However, to keep Mathematica from getting bogged down computing values too accurately, we relax the accuracy goals.

sol2=NDSolve[{x'[t]==-Log[2] x[t] + 200*Sqw[t, 100/24, 12],y'[t]== Log[2] x[t] - (1/8) Log[2] y[t],x[0] == 0,y[0] == 0},{x, y},{t, 0, 72}]

We can now plot the GI level and the blood level over 96 hours.

Plot[Evaluate[{x[t], y[t]} /. sol2], {t, 0, 72}, 
      PlotStyle  ->  {RGBColor[1, 0, 0],  RGBColor[0, 0, 1]}]

Here is a phase plane plot of y versus x.

ParametricPlot[Evaluate[{x[t], y[t]} /. sol2], {t, 0, 72}, 
      PlotPoints -> 100, AxesLabel -> {"x", "y"}]

From the above graphs, we see that the blood level will stabilize to cyling between 60 and 125 units (approximately).  If that variation is too large, we can lessen it by giving doses at more frequent intervals, e.g., every 8 hours.

sol3=NDSolve[{x'[t]==-Log[2] x[t] +  200*Sqw[t, 100/16, 8],y'[t]==Log[2] x[t] - (1/8) Log[2] y[t],x[0] == 0,y[0] == 0},{x, y},{t, 0, 72}, MaxSteps -> 2000]

Plot[Evaluate[{x[t], y[t]} /. sol3], {t, 0, 72},  
      PlotStyle  ->  {RGBColor[1, 0, 0],  RGBColor[0, 0, 1]}]

ParametricPlot[Evaluate[{x[t], y[t]} /. sol3], {t, 0, 72}, 
      PlotPoints -> 100, AxesLabel -> {"x", "y"}]

Notice that the blood level of the drug stabilizes to a cycle ranging from 115 to 165 units (approximately) now.  By increasing the frequency of the drug, but keeping the daily intake constant, the variation in blood level has been lessened.

Exercises

Exercise 1

Give an explanation of the coefficients used in the system of differential equations (1) used to model the blood level.

Exercise 2

Explain why the PlotPoints option is needed in the plots of the square wave function above.

Exercise 3 (Time-Release Medication)

If a medication is embedded in resins which dissolve at different rates, it is possible to construct a time-release delivery vehicle for the medication.  In an ideal situation, this would provice a constant dose of medication whereby a pill could be taken peridocally, say every 12 hours, to obtain a constant rate of release of medication into the GI tract.  Of course, this never happens exactly.

Now suppose we take a time-release capsule that works for 12 hours and that we repeat the dose indefinitely at 12-hour intervals.  This gives us, say, a constant dose of 10 milligrams per hour released into the intestines.  Suppose the half-life of the drug in the intestines is 2 hours and in the blood is 12 hours.  Graph the blood level and the intestine level of the drug over several days.  What happens in the long run with this drug regimen?

Exercise 4 (Loading Dosage)

In this problem, we have a drug with a 2 hour and 12 hour half-life in the intestines and blood, respectively.  We take a dose of 100 mg every 12 hours eventually achieving a steady-state blood level fluctuation.  Assume that the goal is to keep the blood level above 100 mg but to not let the level rise above 250 mg.  Study the effect of taking extra medication during the first dose or two to achieve a therapeutic level of medication more rapidly.  Suggest a course of medication which will realize the desired blood range as quickly as possible.

Exercise 5

Using the same information as in the previous problem, suppose the patient takes the first five doses but forgets the sixth.  The mistake is not discovered until time for the seventh dose.  What has happened to the patient's blood level in the meantime.  Should the patient take two doses at the time of the scheduled seventh dose?

In order to guard against the possibility of the blood level falling below the theraeutic level if a dose is forgotten, what do you think should be done.  Should you have the patient take a larger dose each time?  If so, how large of a dose would you need to provide a margin of safety?  Does this cause the patient's blood level to exceed the therapeutic range?  Or perhaps you should take the doses more often, say every eight hours instead of every twelve.  What dose would you recommend every eight hours so that the effect of missing a dose was minimal.

Briefly discuss with a sentence or two the effect of decreasing the dosing interval (and proportionally decreasing the amount taken at each dose).