Tutorials › Nonlinear Mixed-Effects Models (NLME) › Updating Pharmacokinetic States Across Dose Events

Time-Varying Covariates and Dosing Complexity · Tutorial 402 of 797

Updating Pharmacokinetic States Across Dose Events

Calculate and check pharmacokinetic state updates across unequal intervals containing bolus doses and infusion starts or stops.

Advanced 10 min read

What You'll Learn

  • Propagate a one-compartment amount over an interval with constant first-order elimination.
  • Distinguish an instantaneous bolus jump from the continuous state during an infusion.
  • Update the input rate at infusion starts and stops without resetting the amount.
  • Apply exact state updates across unequal intervals and multiple events.
  • Recognize assumptions, numerical checks, and failure modes of event-by-event calculations.

Why State Updates Must Follow the Events

When dose times are irregular, an amount cannot be advanced by repeatedly applying a formula that assumes one fixed dosing interval. Instead, divide the timeline at each dose or infusion event. Within each interval, the input and model parameters must be constant for the exact one-compartment update below to apply. At an event, update the state or input as appropriate, then propagate over the next interval, whose duration may be different.

This tutorial uses a one-compartment model with first-order elimination to make the bookkeeping explicit. The same event logic is useful in more complex NLME models, although their state equations may need numerical integration rather than the exact formula derived here. Earlier material on Event-Based Encoding of Irregular Dosing Histories motivates representing dose records as events; here the focus is how those events change the model state.

Definition: Let \(A(t)\) be the amount of drug in a one-compartment system at time \(t\), measured in mg. Let \(V\) be the apparent volume of distribution in L, \(CL\) the clearance in L/h, and \(k=CL/V\) the first-order elimination rate constant in \(\mathrm{h}^{-1}\). During an interval with constant infusion rate \(R\) in mg/h, the amount follows \(\frac{dA}{dt}=R-kA\). When infusion is off, \(R=0\). An instantaneous intravenous bolus of size \(D\) mg changes the amount by \(D\) at its event time.

For an individual in an NLME model, \(CL\), \(V\), and therefore \(k\) may depend on that individual's parameters. Conditional on those parameter values, the update calculations below are deterministic. The state is the amount carried forward from one interval to the next; an infusion start or stop changes the input rate, not the amount itself.

The Exact Update Over One Interval

Suppose an interval begins at time \(t_j\) with amount \(A_j^+\), and ends after \(\Delta_j\) hours. The superscript \(+\) denotes the amount just after any dose applied at the beginning of the interval. Assume \(k\) and the infusion rate \(R_j\) remain constant during the interval. Solving the differential equation gives the amount just before the next event:

$$ A_{j+1}^- = A_j^+e^{-k\Delta_j} +\frac{R_j}{k}\left(1-e^{-k\Delta_j}\right). $$

Here \(A_{j+1}^-\) is the amount immediately before the event at the interval end. The first term is the surviving amount present at the interval start. The second is the amount contributed by infusion during the interval, accounting for elimination while drug enters. If there is no infusion, \(R_j=0\) and the update reduces to exponential elimination.

Event rules: At a bolus event, \(A^+=A^-+D\). At an infusion start or stop, \(A^+=A^-\): the amount is continuous, while the infusion rate changes for the following interval. If events occur at distinct times, apply the appropriate event update at each time and use the resulting state and input rate over the next interval.

The \(+\) and \(-\) superscripts distinguish the state on the two sides of an event; they do not indicate positive or negative amounts. For an interval with both a bolus at its start and an infusion running, first use the post-bolus amount as the initial state and include the infusion contribution in the interval formula.

Why the Formula Works

To justify the update, multiply the differential equation by the integrating factor \(e^{kt}\). The product rule gives \(\frac{d}{dt}(e^{kt}A(t))=Re^{kt}\), since \(R\) is constant on the interval. Integrating from \(t_j\) to \(t_j+\Delta_j\) yields:

$$ e^{k(t_j+\Delta_j)}A(t_j+\Delta_j)-e^{kt_j}A(t_j) = \frac{R}{k}\left(e^{k(t_j+\Delta_j)}-e^{kt_j}\right). $$

Dividing by \(e^{k(t_j+\Delta_j)}\) and rearranging gives \(A(t_j+\Delta_j)=A(t_j)e^{-k\Delta_j}+\frac{R}{k}(1-e^{-k\Delta_j})\). This derivation requires constant \(R\) and \(k\) on the interval. A change in either means the interval must be split at that change, or the state equation must be solved using a method that accommodates time-varying inputs or parameters.

Worked Event-by-Event Calculations

Worked Example: A Bolus Followed by an Unequal Interval

Hypothetical calculation. A patient receives a 100 mg intravenous bolus at time zero. The one-compartment model has \(k=0.2000\ \mathrm{h}^{-1}\). Three hours later, a second 50 mg bolus is given; the amount is then propagated for another two hours. Find the amount just before the second bolus, just after it, and at the end of the two-hour interval.

After the first three hours, there is no infusion, so the amount just before the second bolus is \(100e^{-0.2000(3)}=100e^{-0.6}=54.88\) mg. The bolus adds 50 mg instantaneously, giving \(54.8812+50=104.8812\) mg just after the event.

Over the next two hours there is no infusion. Thus the final amount is \(104.8812e^{-0.2000(2)}=104.8812e^{-0.4}=70.30\) mg. The two intervals are three and two hours long; no equal-interval assumption was needed.

Worked Example: Starting and Stopping an Infusion

Hypothetical calculation. Immediately before an infusion starts, the amount is 40.0 mg. The infusion runs at 8.00 mg/h for one hour, and \(k=0.1000\ \mathrm{h}^{-1}\). Find the amount at infusion stop and two hours after the stop.

During the one-hour infusion, use \(R=8.00\) mg/h and \(\Delta=1\) h: \(A=40.0e^{-0.1000}+(8.00/0.1000)(1-e^{-0.1000})\). Retaining precision through the calculation gives \(40.0e^{-0.1}=36.1935\) mg and \(80(1-e^{-0.1})=7.61301\) mg, for \(A=43.8065\) mg, or 43.81 mg at the infusion stop.

Stopping the infusion does not remove drug already in the compartment; it sets \(R=0\) for the next interval. Two hours later the amount is \(43.8065e^{-0.1000(2)}=35.8656\) mg, or 35.87 mg. This calculation uses the unrounded stop amount until the final report.

Worked Example: Infusion, Drug-Free Interval, and Later Bolus

Hypothetical calculation. An infusion starts at time zero at 120 mg/h and stops at two hours. At time five hours, a 50 mg bolus is given. Let \(k=0.2000\ \mathrm{h}^{-1}\), and assume the initial amount is zero. Find the amount immediately before and after the bolus, then 1.5 hours later.

During the two-hour infusion, \(A(2)=0e^{-0.4}+(120/0.2000)(1-e^{-0.4})=600(1-e^{-0.4})=197.808\) mg. The infusion then stops. Over the following three hours, the amount declines to \(197.808e^{-0.2000(3)}=197.808e^{-0.6}=108.559\) mg just before the bolus.

The bolus produces an immediate jump to \(108.559+50=158.559\) mg. With no further input, the amount 1.5 hours later is \(158.559e^{-0.2000(1.5)}=158.559e^{-0.3}=117.464\) mg, or 117.5 mg. Each interval is propagated using its own duration and input.

Assumptions, Diagnostics, and Alternatives

The exact interval formula relies on a one-compartment amount state, first-order elimination, constant \(k\), and constant infusion rate within each interval. Bolus doses are treated as instantaneous intravenous inputs with full dose entering the compartment. These assumptions are appropriate for illustrating state updates, but are not universal pharmacokinetic assumptions. For oral dosing, for example, a dose generally enters through an absorption process rather than as an instantaneous central-compartment jump.

A useful audit is to check the state immediately before and after each event and verify that the interval duration is the difference between the actual event times. With nonnegative initial amount and infusion rate, the formula should give a nonnegative amount. When \(R=0\), it should yield a decline for \(k>0\); with \(R>0\), the amount during a sufficiently long infusion approaches \(R/k\), not an indefinitely increasing amount. These checks can reveal a wrong interval length, a missed event, or use of the wrong infusion rate.

A common mistake is to treat an infusion stop like a negative bolus, subtracting the amount infused or resetting the amount to zero. The correction is that the infusion stop changes only \(R\); drug in the compartment continues to be eliminated. Another mistake is to apply \(R\Delta\) as the full amount contributed by an infusion while ignoring elimination. The exact contribution is \((R/k)(1-e^{-k\Delta})\), which is less than \(R\Delta\) when \(k,\Delta>0\).

For this linear one-compartment case, exact event-by-event propagation avoids numerical integration error within each constant-input interval. Numerical ODE integration is the main alternative when the state equations are nonlinear, compartments interact in ways without a closed-form update, or parameters and inputs vary continuously. Integration must still respect discontinuous dose events by carrying the state across them and applying the event-specific change. A steady-state or repeated equal-interval formula is not a substitute for this calculation when intervals differ. The limitation of exact propagation is that its convenience depends on the model and the within-interval constancy assumptions.

1
Set the current state.
Use the amount just after the preceding event, along with the current infusion rate and model parameters.
2
Propagate to the next event.
Use the exact interval formula with the actual elapsed time and constant input for that interval.
3
Apply the event change.
Add a bolus to the amount, or change the infusion rate while leaving the amount continuous at an infusion start or stop.
4
Check and continue.
Verify units, amount continuity where appropriate, and the interval length before propagating to the next event.
Key takeaway: Between events, propagate the state under the current model and input. At a bolus, change the amount; at an infusion start or stop, change the input rate. Unequal event intervals require unequal propagation times, not a different bolus or infusion rule.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. A 20 mg amount is present with no infusion, and \(k=0.25\ \mathrm{h}^{-1}\). What amount remains after two hours?
  2. For a constant infusion, name the two contributions in the exact interval update and explain what each represents.
  3. An infusion stops while 30 mg is in the compartment. What is the amount immediately after the stop, before any elapsed time?
  4. With zero starting amount, \(R=10\) mg/h, \(k=0.20\ \mathrm{h}^{-1}\), and a one-hour infusion, calculate the amount at the end of the infusion.

Solutions. (1) \(20e^{-0.25(2)}=20e^{-0.5}=12.13\) mg. (2) \(A_j^+e^{-k\Delta_j}\) is surviving starting amount; \((R_j/k)(1-e^{-k\Delta_j})\) is infused amount remaining after elimination during the interval. (3) It remains 30 mg: stopping changes the rate, not the state. (4) \(0e^{-0.2}+(10/0.20)(1-e^{-0.2})=50(1-e^{-0.2})=9.063\) mg.