None Notebook

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

< 7.0 Simulation and Optimal Control | Contents | Tag Index | 7.2 Soft Landing a Rocket >

Open in Colab

Download

7.1 Simulation and Optimal Control in Pharmacokinetics

7.1.1 Installations and Initialization

Pyomo and ipopt are now preinstalled on Google Colaboratory. On MacOS and Windows PC, a one-time installation of pyomo and ipopt is required. The following commands will perform the needed installation when using the Anaconda distribution of Python.

On MacOS and Windows PC, a one-time installation of pyomo and ipopt is required. The following commands will perform the needed installation when using the Anaconda distribution of Python.

!conda install -c conda-forge pyomo
!conda install -c conda-forge pyomo.extras
!conda install -c conda-forge ipopt

7.1.2 A Pharmacokinetics Example

Pharmacokinetics -- the study of the drugs and other substances administered to a living organism -- is a rich source of examples for simulation and optimization. Here we discuss a solution to a very simple problem.

A patient is admitted to a clinic with a dangerous blood borne infection that needs to be treated with a specific antibiotic. The treatment requires a minimum therapeutic concentration of 20 mg/liter of blood, but, for safety reasons, should not exceed 40 mg/liter. The attending physician has established a target value of 25 mg/liter. The antibiotic will be administered to the patient by continuous infusion over a 72 hour period using a pump capable of delivering up to 50 mg/hour.

Infusionspumpe

(photo from Pflegewiki-User Würfel, CC BY-SA 3.0)

The research literature shows dynamics of antibiotic concentration in the body behaves according to a one-compartment pharmacokinetic model

\begin{align*} V\frac{dC}{dt} & = u(t) - k C \end{align*}

where $V$ is compartment volume (e.g., blood is about 5 liters in an adult), and $kC$ is the rate of elimination due to all sources, including metabolism and excretion. Based on an observed half-life in the blood of 8 hours, $k$ has an estimated value of 0.625 liters/hour. Given this information, what administration policy would you recommend?

7.1.3 Simulation of Fixed Infusion Rate Strategy

The first strategy we will investigate is constant infusion. At steady-state, the pharmacokinetic model becomes

\begin{align*} \bar{u} & = k \bar{C} \\ & = 0.625 \times 25 \\ & = 15.625 \mbox{ mg/hr} \end{align*}

The following cell simulates the patient response.

7.1.4 Optimizing the Infusion Strategy

The simulation results show that a constant rate of infusion results in a prolonged period, more than twelve hours, where the antibiotic concentration is below the minimum therapuetic dose of 20 mg/liter. Can we find a better strategy? In particular, can a time-varying strategy yield reduce the time needed to achieve the therapuetic level?

For this case, we consider $u(t)$ to be a time-varying infusion rate bounded by the capabilities of the infusion pump.

\begin{align*} 0 \leq u(t) \leq 50 \mbox{ mg/hr} \end{align*}

Next we need to express the objective of maintaining the antibiotic concentration at or near a value $C_{SP}$ = 25 mg/liter. For this purpose, we define the objective as minimizing the integral square error defined as

\begin{align*} \mbox{ISE} & = \int_0^{t_f} (C(t) - C_{SP})^2 \, dt \end{align*}

The next cell demonstrates how to formulate the model in Pyomo, and compute a solution using ipopt.

The result of this optimization is a much better therapy for the patient. Therapuetic levels of antibiotic are reach with 3 hours thereby leading to an earlier outcome and the possibility of an earlier recovery.

7.1.5 Alternative Objectives

< 7.0 Simulation and Optimal Control | Contents | Tag Index | 7.2 Soft Landing a Rocket >

Open in Colab

Download