Tutorials › Physiologically-Based Pharmacokinetics (PBPK) › Pre-Fit PBPK Model Audit With a Worked Example

Units, Dimensional Consistency and Debugging · Tutorial 98 of 799

Pre-Fit PBPK Model Audit With a Worked Example

Learn a structured way to test whether a small PBPK model is internally consistent before fitting it to data.

Intermediate 10 min read

What You'll Learn

  • Specify a small blood-and-organ PBPK model and check the dimensions of its flows, concentrations, and clearance.
  • Calculate initial exchange fluxes and verify that they cancel in the whole-body amount balance.
  • Use a mass-balance residual to assess dose bookkeeping and cumulative elimination.
  • Check continuous-infusion and closed-system steady states against model equations.
  • Distinguish implementation errors from problems that fitting cannot resolve.

Why Audit a Model Before Fitting?

Parameter fitting can make a model follow observed data, but it cannot make inconsistent bookkeeping or incorrect equations physiologically coherent. A unit error, omitted dose, or misplaced clearance term may be obscured by parameter estimates that compensate for the mistake. A pre-fit audit instead asks whether the model behaves as its equations say it should, before data are used to tune its parameters.

This tutorial audits a deliberately small hypothetical model with a circulating blood compartment and two exchanging organs. It is not intended as a complete representation of a person. Its purpose is to make the checks transparent: establish the state variables and equations, trace a dose through the amount balance, calculate an instantaneous derivative, and verify the model's limiting steady states.

Model and Audit Assumptions

Let \(A_B\), \(A_1\), and \(A_2\) denote drug amounts in blood, organ 1, and organ 2, respectively, all measured in mg. The corresponding compartment volumes are \(V_B\), \(V_1\), and \(V_2\), measured in L. Concentrations are amount divided by volume, so \(C_B=A_B/V_B\) and \(C_i=A_i/V_i\) have units mg/L. Each organ is represented by one well-mixed compartment, and exchange is driven by the difference between blood concentration and the organ concentration divided by its dimensionless partition ratio \(K_i\).

Model definition: For organ \(i\), the exchange flux from blood into the organ is \(J_i=Q_i(C_B-C_i/K_i)\). Here \(Q_i\) is blood flow in L/h, \(K_i\) is a dimensionless tissue-to-blood concentration ratio, and \(J_i\) is an amount rate in mg/h. The amount equations are \(dA_B/dt=R_{\mathrm{in}}-J_1-J_2-CL\,C_B\), \(dA_1/dt=J_1\), and \(dA_2/dt=J_2\). The input rate \(R_{\mathrm{in}}\) is in mg/h and clearance \(CL\) is in L/h.

The model assumes constant volumes, flows, partition ratios, and clearance over the period considered. Exchange is reversible: \(J_i\) can be positive or negative depending on the concentration gradient. Clearance removes drug from blood at rate \(CL\,C_B\); it is not an exchange flux to another modeled organ. A dose given directly into blood is represented by an initial amount, while an ongoing infusion is represented by \(R_{\mathrm{in}}\). These alternatives must not be counted twice.

The dimensions provide an immediate check. Since \(K_i\) has no units, both \(C_B\) and \(C_i/K_i\) are in mg/L. Multiplying their difference by \(Q_i\) in L/h gives \(J_i\) in mg/h. Similarly, \(CL\,C_B\) is in mg/h. Thus every term on the right side of each amount equation is an amount rate. This check does not establish that the model is physiologically adequate, but a failed check establishes that the written equations are not dimensionally consistent as stated.

Worked Example: Check Units and Initial Fluxes

Worked Example: Check Units and Initial Fluxes

Consider hypothetical parameters \(V_B=3\) L, \(V_1=2\) L, \(V_2=4\) L, \(Q_1=6\) L/h, \(Q_2=4\) L/h, \(K_1=2\), \(K_2=0.5\), and \(CL=1\) L/h. A hypothetical 100 mg intravenous bolus is placed in blood at time zero, with no drug initially in either organ. There is no continuing input after the bolus.

The initial concentrations are \(C_B=100/3\) mg/L, \(C_1=0\) mg/L, and \(C_2=0\) mg/L. The two exchange fluxes are

$$ J_1=6\left(\frac{100}{3}-\frac{0}{2}\right)=200\ \mathrm{mg/h}, \qquad J_2=4\left(\frac{100}{3}-\frac{0}{0.5}\right)=\frac{400}{3}\ \mathrm{mg/h}. $$

The initial clearance rate is \(CL\,C_B=1(100/3)=100/3\) mg/h. Because the post-bolus input rate is zero, the initial amount derivatives are

$$ \frac{dA_B}{dt} =-200-\frac{400}{3}-\frac{100}{3} =-\frac{1100}{3}\ \mathrm{mg/h}, \qquad \frac{dA_1}{dt}=200\ \mathrm{mg/h}, \qquad \frac{dA_2}{dt}=\frac{400}{3}\ \mathrm{mg/h}. $$

The blood amount initially decreases as drug transfers to both organs and is eliminated. Summing the three derivatives gives \(-1100/3+200+400/3=-100/3\) mg/h, exactly the negative clearance rate. The exchange terms cancel in the whole-body sum, as they should: exchange redistributes drug but does not create or remove it. The calculations retain exact fractions until the result is obtained; for orientation, the blood derivative is about \(-366.7\) mg/h and the total derivative is about \(-33.33\) mg/h.

Deriving the Whole-Body Balance

A key audit check follows directly from adding the amount equations. The result is useful because it does not depend on the sizes or directions of the individual exchange fluxes.

1
Add the compartment derivatives.
\(d(A_B+A_1+A_2)/dt=dA_B/dt+dA_1/dt+dA_2/dt\).
2
Substitute the model equations.
The right side becomes \(R_{\mathrm{in}}-J_1-J_2-CL\,C_B+J_1+J_2\).
3
Cancel internal exchange.
The \(J_1\) and \(J_2\) terms each appear once with each sign, leaving \(dA_{\mathrm{body}}/dt=R_{\mathrm{in}}-CL\,C_B\), where \(A_{\mathrm{body}}=A_B+A_1+A_2\).

Integrating this balance from time zero to time \(t\) gives the expected total amount in the modeled body compartments: initial amount plus cumulative input minus cumulative elimination. Define \(A_{\mathrm{in,cum}}(t)=\int_0^t R_{\mathrm{in}}(u)\,du\) and \(A_{\mathrm{elim}}(t)=\int_0^t CL\,C_B(u)\,du\). If \(A_0\) is the total amount present initially, the mass-balance residual is

$$ R_M(t)=A_B(t)+A_1(t)+A_2(t)-\left[A_0+A_{\mathrm{in,cum}}(t)-A_{\mathrm{elim}}(t)\right]. $$

For the stated equations and exact arithmetic, \(R_M(t)=0\) at every time. In a numerical simulation, a small nonzero value can arise from numerical integration and rounding. A residual that grows systematically, jumps at a dose event, or is large relative to the dose warrants investigation. The residual is an accounting diagnostic, not a measure of how closely predictions match observations.

Worked Example: Audit a Simulated Amount Balance

Worked Example: Audit a Simulated Amount Balance

Suppose a hypothetical simulation starts with the 100 mg bolus above and has no further input. At a later time, its reported amounts are \(A_B=20\) mg, \(A_1=30\) mg, and \(A_2=10\) mg. The cumulative eliminated amount reported by the simulation is 40 mg.

The modeled amount still present is \(20+30+10=60\) mg. The amount expected from bookkeeping is \(A_0+A_{\mathrm{in,cum}}-A_{\mathrm{elim}}=100+0-40=60\) mg. Therefore,

$$ R_M=60-(100+0-40)=0\ \mathrm{mg}. $$

The reported amounts and elimination are consistent with the initial dose. Now suppose the same amounts are reported but cumulative elimination is recorded as 38 mg. Then \(R_M=60-(100-38)=-2\) mg. The simulation accounts for 2 mg less in its compartments than its dose-and-elimination record predicts. This discrepancy could reflect a bookkeeping or implementation problem, or numerical error; the residual alone does not identify its cause. Check dose-event handling, the elimination integral, state indexing, and solver tolerances before fitting parameters.

Steady-State Checks

Steady-state checks provide a second independent test of the equations. A steady state is a state in which all modeled amount derivatives are zero under the specified input conditions. For the continuous-infusion case with positive clearance, setting the total amount derivative to zero requires \(R_{\mathrm{in}}=CL\,C_B\). Setting each organ derivative to zero also requires \(J_1=J_2=0\). Thus, at equilibrium, \(C_i=K_iC_B\) for each organ. These conditions can be checked against a numerical long-time simulation.

Worked Example: Verify a Continuous-Infusion Steady State

Using the hypothetical volumes, partition ratios, and clearance from the first example, let a constant infusion \(R_{\mathrm{in}}=10\) mg/h continue long enough to reach steady state. The whole-body balance requires \(0=10-1\cdot C_B\), so \(C_B=10\) mg/L. With zero exchange flux at steady state, \(C_1=K_1C_B=20\) mg/L and \(C_2=K_2C_B=5\) mg/L.

The implied compartment amounts are \(A_B=3(10)=30\) mg, \(A_1=2(20)=40\) mg, and \(A_2=4(5)=20\) mg. The exchange fluxes are \(J_1=6(10-20/2)=0\) mg/h and \(J_2=4(10-5/0.5)=0\) mg/h. The blood derivative is \(10-0-0-1(10)=0\) mg/h, and both organ derivatives are zero. The predicted steady state therefore satisfies the full model, not just the whole-body balance.

A closed system with no input and no clearance has a different steady-state interpretation. Its total amount remains constant, and equilibrium requires \(C_i=K_iC_B\). These conditions determine the equilibrium concentrations from the conserved total amount. For the hypothetical 100 mg initial dose and the same volumes and partition ratios, the amount at equilibrium is \(C_B(V_B+K_1V_1+K_2V_2)\). The effective volume in this expression is \(3+2(2)+0.5(4)=9\) L, so \(C_B=100/9\) mg/L. This is a redistribution equilibrium, not a state in which drug has disappeared. In a system with clearance and no further input, a nonzero concentration is generally not a permanent steady state: the total amount continues to decline until the drug is depleted, subject to the model's behavior near zero.

Worked Example: Check Closed-System Equilibrium

Worked Example: Check Closed-System Equilibrium

For this check, hypothetically set \(CL=0\) and \(R_{\mathrm{in}}=0\), retaining the 100 mg initial dose and the same volumes and partition ratios. At equilibrium, \(C_1=2C_B\) and \(C_2=0.5C_B\). Conservation of the initial 100 mg gives

$$ 100=V_BC_B+V_1C_1+V_2C_2 =3C_B+2(2C_B)+4(0.5C_B)=9C_B. $$

Hence \(C_B=100/9\approx11.11\) mg/L, \(C_1=200/9\approx22.22\) mg/L, and \(C_2=50/9\approx5.556\) mg/L. The corresponding amounts are \(A_B=100/3\approx33.33\) mg, \(A_1=400/9\approx44.44\) mg, and \(A_2=200/9\approx22.22\) mg. They sum to 100 mg. Since \(C_B-C_i/K_i=0\) for both organs, both exchange fluxes and all three derivatives are zero. This check verifies both equilibrium ratios and conservation of dose.

Practical Audit Order and Failure Modes

An efficient audit proceeds from the model specification to arithmetic checks, then to simulation behavior. A useful order is:

  1. List each state variable, its amount or concentration basis, and its units. Confirm that volume conversions and the concentration definition agree.
  2. Check every input, flow, exchange, and elimination term for units of amount per time in the amount equations. Confirm that the time unit is the same across rates and simulation time.
  3. Write down the dose convention and initial conditions. Decide whether each dose enters as an initial amount, an input event, or an infusion, and make sure it is represented once.
  4. Sum the equations and verify that internal exchange terms cancel while external input and elimination remain.
  5. Evaluate at least one hand-calculated derivative and compare it with the model implementation. Then test an appropriate steady state or limiting behavior.
  6. Calculate the mass-balance residual over the simulation, including immediately before and after dose events when relevant.

Common warning signs include a residual that changes abruptly at a dose, negative amounts when the model is intended to keep amounts nonnegative, a flux with the wrong direction under a known concentration gradient, or failure to approach the expected infusion steady state. A sign error in an exchange term may cause one organ's gain not to match blood's loss. A mistaken time unit can scale every rate without changing the equation's appearance. These are reasons to inspect the model, not automatic proof of one specific defect.

A pre-fit audit differs from fitting and from comparing alternative physiological structures. Fitting estimates parameters against data; an audit tests whether the selected equations and their implementation obey their own units and accounting identities. Passing the audit does not show that the model structure is adequate, that the parameters are identifiable, or that predictions agree with data. Conversely, a failed audit should not be addressed by allowing an optimizer to adjust physiological parameters until the discrepancy is hidden. Correct the formulation or implementation first, then reassess the model.

Common pitfall: A model's total amount appears to match the administered dose, so the analyst assumes the implementation is correct. That check is incomplete unless cumulative input and cumulative elimination are both included. Compare current compartment amounts with \(A_0+A_{\mathrm{in,cum}}-A_{\mathrm{elim}}\), and inspect how the residual behaves over time. A single endpoint can conceal offsetting bookkeeping errors.
Key takeaway: Before fitting, verify that every amount-rate term has compatible units, every dose is counted once, internal exchange cancels in the whole-body balance, and steady states satisfy the compartment equations as well as the total balance.

Check Your Understanding

Answer the questions, then compare your reasoning with the solutions.

  1. If \(Q_i\) is in L/h and both concentrations in \(J_i=Q_i(C_B-C_i/K_i)\) are in mg/L, what are the units of \(J_i\)?
  2. For a one-organ model with \(dA_B/dt=R_{\mathrm{in}}-J-CL\,C_B\) and \(dA_1/dt=J\), what is the whole-body amount derivative?
  3. A hypothetical model starts with 80 mg, receives 20 mg of additional input, reports 15 mg eliminated, and has 84 mg currently in its compartments. Calculate \(R_M\).
  4. At a continuous-infusion steady state with \(R_{\mathrm{in}}=12\) mg/h and \(CL=2\) L/h, what blood concentration is required by the whole-body balance?
  5. In a closed, non-eliminating model, does a nonzero equilibrium concentration violate mass balance? Explain briefly.

Solutions. (1) \(J_i\) is in mg/h, because L/h multiplied by mg/L gives mg/h. (2) Adding the derivatives cancels the internal exchange terms, leaving \(d(A_B+A_1)/dt=R_{\mathrm{in}}-CL\,C_B\). (3) \(R_M=84-(80+20-15)=-1\) mg; the reported compartments contain 1 mg less than the bookkeeping balance predicts. (4) At steady state \(R_{\mathrm{in}}=CL\,C_B\), so \(C_B=12/2=6\) mg/L. (5) No. With no input or elimination, total amount is conserved; exchange can redistribute a nonzero amount while the fluxes reach zero at equilibrium.