None Notebook

This notebook contains material from CBE30338; content is available on Github.

< 3.4 Fitting First Order plus Time Delay to Step Response | Contents | Tag Index | 3.6 Second Order Models >

Open in Colab

Download

3.5 One Compartment Pharmacokinetics

3.5.1 Summary

Pharmacokinetics is a branch of pharmacology that studies the fate of chemical species in living organisms. The diverse range of applications includes the administration of drugs and anesthesia in humans. This notebook introduces a one compartment model for pharmacokinetics, and shows how it can be used to determine strategies for the intravenous administration of an antibiotic.

The notebook demonstrates the simulation and analysis of systems modeled by a single first-order linear differential equation.

3.5.2 Antibiotics

Let's consider the administration of an antibiotic to a patient. Concentration $C$ refers to the concentration of the antibiotic in blood plasma with units [mg/liter].

Minimum Inhibitory Concentration (MIC) The minimum concentration of the antibiotic that prevents growth of a particular bacterium.

Minimum Bactricidal Concentration (MBC) The lowest concentration of the antibiotic that kills a particular bacterium.

Extended exposure to an antibiotic at levels below MBC leads to antibiotic resistance.

3.5.3 Model Description

A simple pharmacokinetic model has the same form as a model for the dilution of a chemical species in a constant volume stirred-tank mixer. For a stirred-tank reactor with constant volume $V$, volumetric outlet flowrate $Q$, and inlet mass flow $u(t)$,

$$V \frac{dC}{dt} = u(t) - Q C(t)$$

where $C$ is concentration in units of mass per unit volume. In this pharacokinetics application, $V$ refers to blood plasma volume, and $Q$ to the clearance rate.

3.5.4 Problem Statement 1

The minimum inhibitory concentration (MIC) of a particular organism to a particular antibiotic is 5 mg/liter, the minimum bactricidal concentration (MBC) is 8 mg/liter. Assume the plasma volume $V$ is 4 liters with a clearance rate $Q$ of 0.5 liters/hour.

An initial intravenous antibiotic dose of 64 mg results in an initial plasma concentration $C_{initial}$ of 64mg/4 liters = 16 mg/liter. How long will the concentration stay above MBC? Above MIC?

3.5.5 Solution Strategy 1: Simulation from a Known Initial Condition

For this first simulation we compute the response of the one compartment model due starting with an initial condition $C_{initial}$, and assuming input $u(t) = 0$.

3.5.5.1 Step 1. Initialization

Generally the first steps in any Jupyter notebook are to

  1. Initialize the plotting system.
  2. Import the numpy library for basic mathematical functions.
  3. Import the matplotlib.pyplot library for plotting.

In addition, for this application we also import odeint function for solving differential equations from the scipy.integrate library.

3.5.5.2 Step 2. Enter Parameter Values

3.5.5.3 Step 3. A Function the RHS of the Differential equation

$$\frac{dC}{dt} = \frac{1}{V}u(t) - \frac{Q}{V}C$$

where $u(t) = 0$.

3.5.5.4 Step 4. Solution and Visualization

3.5.5.5 Step 5. Analysis of the Results

Let's compare our results to a typical experimental result.

We see that that the assumption of a fixed initial condition is questionable. Can we fix this?

Levison, Matthew E., and Julie H. Levison. “Pharmacokinetics and Pharmacodynamics of Antibacterial Agents.” Infectious disease clinics of North America 23.4 (2009): 791–vii. PMC. Web. 8 May 2017.

3.5.6 Solution Strategy 2: Time-Dependent Input

For the next simulation we will assume the dosing takes place over a short period of time $\delta t$. To obtain a total dose $U_{dose}$ in a time period $\delta t$, the mass flow rate rate must be

$$u(t) = \begin{cases} U/ \delta t \qquad \mbox{for } 0 \leq t \leq \delta t \\ 0 \qquad \mbox{for } t \geq \delta t \end{cases} $$

Before doing a simulation, we will write a Python function for $u(t)$.

This code cell demonstrates the use of a list comprehension to apply a function to each value in a list.

Simulation

3.5.6.1 Analysis of the Results

Let's compare our results to a typical experimental result.

While it isn't perfect, this is a closer facsimile of actual physiological response.

Levison, Matthew E., and Julie H. Levison. “Pharmacokinetics and Pharmacodynamics of Antibacterial Agents.” Infectious disease clinics of North America 23.4 (2009): 791–vii. PMC. Web. 8 May 2017.

3.5.7 Problem Statement 2

The minimum inhibitory concentration (MIC) of a particular organism to a particular antibiotic is 5 mg/liter, the minimum bactricidal concentration (MBC) is 8 mg/liter. Assume the plasma volume $V$ is 4 liters with a clearance rate $Q$ of 0.5 liters/hour.

Design an antibiotic therapy to keep the plasma concentration above the MIC level for a period of 96 hours.

3.5.8 Solution Strategy 3: Periodic Dosing

Finally, we'll consider the case of repetitive dosing where a new dose is administered every $t_{dose}$ hours. The trick to this calculation is the Python % operator which returns the remainder following division. This is a very useful tool for creating complex repetitive functions.

The dosing function $u(t)$ is now applied to the simulation of drug concentration in the blood plasma. A fourth argument is added to odeint(deriv, Cinitial, t, tcrit=t) indicating that special care must be used for every time step. This is needed in order to get a high fidelity simulation that accounts for the rapidly varying values of $u(t)$.

3.5 Exercise 1

The purpose of the dosing regime is to maintain the plasma concentration above the MIC level for at least 96 hours. Assuming that each dose is 64 mg, modify the simulation and find a value of $t_{dose}$ that results satisfies the MIC objective for a 96 hour period. Show a plot concentration versus time, and include Python code to compute the total amount of antibiotic administered for the whole treatment.

3.5 Exercise 2

Consider a continous antibiotic injection at a constant rate designed to maintain the plasma concentration at minimum bactricidal level. Your solution should proceed in three steps:

  1. First, by hand, set up and solve the steady state equation to find the desired constant dosage rate.
  2. Modify the Python function for $u(t)$ to simulate the desired flowrate.
  3. Verify your result by repeating the above simulation using your function for $u(t)$.

< 3.4 Fitting First Order plus Time Delay to Step Response | Contents | Tag Index | 3.6 Second Order Models >

Open in Colab

Download