Why Observation Times Need Care
PBPK observations are often scheduled at times that do not coincide with the solver’s internal time steps. A blood sample may be collected at 2.3 hours even though an adaptive solver has accepted steps ending at 2.1 and 2.6 hours. The model still needs a prediction at 2.3 hours, but requesting that prediction does not necessarily require the solver to restart or take a step ending there.
The key distinction is between the numerical trajectory used to solve the differential equations and the times at which predictions are reported. Confusing these can cause unnecessary computation, misleading interpolation, or a change to the numerical integration itself. The earlier material on encoding PBPK compartments as an ODE state vector established that the solver advances the vector of model states; here, the task is to obtain and interpret that state at an observation time.
For example, a state component might be an amount \(A_p(t)\) in a plasma compartment, while the measured prediction is concentration \(C_p(t)=A_p(t)/V_p\), where \(V_p\) is the relevant volume. The solver returns states; the observation mapping determines what is reported. Units must remain consistent: an amount in milligrams divided by a volume in litres gives a concentration in milligrams per litre.
Dense Output and Controlled Step Endpoints
An adaptive solver chooses internal step sizes to meet its error-control criteria. If the requested time \(t_{\mathrm{obs}}\) lies inside an accepted step, a dense-output formula evaluates an approximation there. The formula is generally constructed from the integration method and information already computed during the step. It is not simply a straight line between reported output values, and its accuracy depends on the solver, the step’s error control, and whether the right-hand side is sufficiently smooth over the interval.
A different option is to require the solver to end a step at \(t_{\mathrm{obs}}\). This can be useful when a solver lacks suitable dense output, when the endpoint is important to a downstream calculation, or when explicitly controlling the step boundary is required. Many interfaces accept a list of output times without requiring steps to end at each one; others offer a mode that does impose those times as endpoints. The user must distinguish these behaviors in the solver interface.
If every requested output time is imposed as a step endpoint, the integrator may take a different sequence of steps than it would have taken otherwise. That is not automatically wrong: a well-controlled solver can integrate accurately with those endpoints. But the output grid has then affected the integration process, not just the reporting. For fixed-step methods, the effect is especially direct because changing the output spacing can change the step size and numerical result.
Worked Example: Evaluating a Dense-Output Polynomial
Suppose a solver reports a hypothetical dense-output polynomial for a concentration on an accepted step from 2.0 to 2.5 hours. Within the step, let \(u=(t-2.0)/0.5\), and suppose the interpolant is \( \tilde C(t)=10-2u+0.5u^2-0.2u^3 \) mg/L. Find the prediction at 2.2 hours.
The time is inside the accepted step, and its scaled position is \(u=(2.2-2.0)/0.5=0.4\). Substitute that value into the supplied interpolant:
Thus the requested prediction from this interpolant is 9.267 mg/L. The result is an approximation produced by the solver’s dense-output formula, not a new measured value or a guarantee that the unknown exact concentration is precisely 9.267 mg/L. The endpoint at 2.5 hours is not needed as an interpolation substitute for the requested time.
For comparison, the interpolant gives 10 mg/L at \(u=0\) and 8.3 mg/L at \(u=1\). Straight-line interpolation between those endpoints would give \(10+0.4(8.3-10)=9.32\) mg/L, which differs from the dense-output value by 0.0528 mg/L. The difference illustrates why arbitrary post-hoc linear interpolation should not be assumed equivalent to the solver’s own interpolation.
What Interpolation Assumes
A dense-output value is meaningful when the solver’s continuous extension is valid over the requested interval. In particular, the differential equation should be smooth over the step, the solver should have accepted the step under its error-control rules, and the requested time should lie within the interval covered by that step. A formula fitted across a discontinuity does not meet the smoothness condition.
A simple interpolation result shows why interpolation error depends on the shape of the solution. If \(y(t)\) is twice continuously differentiable on \([a,b]\), and \(L(t)\) is the straight line joining \(y(a)\) and \(y(b)\), then for each interior \(t\) there is some \(\xi\) in \((a,b)\) such that
To justify this form, define \(K=(y(t)-L(t))/((t-a)(t-b))\) and consider \(g(s)=y(s)-L(s)-K(s-a)(s-b)\). This function is zero at \(a\), \(t\), and \(b\). Applying Rolle’s theorem twice gives a point \(\xi\) between \(a\) and \(b\) where \(g''(\xi)=0\). Since \(L''(s)=0\) and the second derivative of \((s-a)(s-b)\) is 2, it follows that \(y''(\xi)-2K=0\), giving the stated result. If \(|y''(s)|\le M\) on the interval, then
This bound is for straight-line interpolation, not a general error bound for every solver’s dense output. It does show that a wide interval and strong curvature can make linear interpolation inaccurate, even when the endpoint values look plausible. Dense-output error properties depend on the particular numerical method.
Worked Example: Output Requests Versus Fixed-Step Integration
Consider the hypothetical scalar equation \(dy/dt=-0.5y\), with \(y(0)=10\), where time is in hours. Its exact solution is \(y(t)=10e^{-0.5t}\). Compare a fixed-step fourth-order Runge–Kutta calculation using one step of 1 hour with one using two steps of 0.5 hour.
For this equation, a fourth-order Runge–Kutta step of size \(h\) multiplies the current value by \(R(z)=1-z+z^2/2-z^3/6+z^4/24\), where \(z=0.5h\). With one step of 1 hour, \(z=0.5\), so
The one-step prediction at 1 hour is \(10(0.6067708)=6.067708\). With two steps of 0.5 hour, \(z=0.25\), and
After two steps, the prediction is \(10(0.7788086)^2=6.065428\). The exact value is \(10e^{-0.5}=6.065307\). In this fixed-step illustration, adding 0.5 hour as a required endpoint changes the step sequence and therefore changes the numerical result. The two-step result happens to be closer to the exact value, but this example does not establish that adding output endpoints always improves accuracy.
An output-only request is different: if the solver supports dense output, it can report an approximation at 0.5 hour from its existing accepted step or steps without requiring that time to become a new endpoint. The particular interpolated value depends on the solver’s continuous extension; it should not be inferred from the endpoint calculations above.
Mapping States to Concentrations and Respecting Events
A prediction at a sampling time usually involves two operations: evaluate the state at that time, then apply the observation mapping. If the measured quantity is a concentration derived from a compartment amount and a constant volume, this is a direct division. For more complicated observation mappings, use the state at the requested time as the input to the mapping rather than substituting a nearby state or confusing a solver state with the reported quantity.
Worked Example: Extracting a Plasma Concentration from an Amount State
In a hypothetical PBPK simulation, the plasma amount state \(A_p(t)\) is measured in milligrams. On an accepted step from 4.0 to 4.5 hours, the solver’s dense output for this state is \( \tilde A_p(t)=16+6q-1.6q^2 \) mg, where \(q=(t-4.0)/0.5\). The plasma volume is constant at \(V_p=3.0\) L. Find the predicted plasma concentration at 4.25 hours.
First evaluate the state at the sampling time: \(q=(4.25-4.0)/0.5=0.5\), so
Then apply the observation mapping \(C_p=A_p/V_p\):
The requested prediction is therefore 6.20 mg/L at 4.25 hours. The units follow from the amount and volume, and the sample time lies within the interval for which the interpolant was supplied.
The smooth-step assumption needs special attention when a dose or infusion event creates a discontinuity in the model input or state. The earlier material on scheduling repeated doses across solver discontinuities treats event times explicitly. For prediction extraction, the practical rule is that an interpolation interval must not straddle an event where the state or derivative is discontinuous. The simulation should be segmented at that event, with the appropriate pre-event or post-event state used.
If an observation time coincides exactly with an event, specify which convention the observation uses. A bolus may create different left- and right-limit states at the event time. Reporting a value without stating whether it is immediately before or after the dose can therefore be ambiguous. Do not evaluate one smooth interpolant across both sides of that jump.
Choosing a Method and Diagnosing Problems
| Approach | What it does | Main consideration |
|---|---|---|
| Solver-provided dense output | Evaluates the numerical trajectory between accepted step endpoints. | Convenient for many observation times; use only within a valid smooth step and according to the solver’s documented output behavior. |
| Require a step endpoint | Makes the observation time an integration boundary. | Useful when explicitly needed, but may change the step sequence and computational cost. |
| Post-hoc linear interpolation | Connects two available values with a straight line. | May be inadequate for curved trajectories, wide intervals, or steps near rapid changes; it is not automatically equivalent to dense output. |
Several diagnostics help identify extraction errors. Check that every requested time is within the simulated interval and, for dense output, within the relevant accepted step. Check time units before evaluating the solver output: a sampling time recorded in minutes cannot be passed as though it were in hours. Confirm that the state component and observation mapping correspond to the measured quantity, and verify the resulting units. Inspect requested times near doses, infusion starts or stops, and other discontinuities to ensure they are handled on the correct side of the event.
A reported value that changes when a reporting grid is changed may indicate that the grid is forcing different integration steps, that a different interpolation route is being used, or that a discontinuity is being treated inconsistently. It does not by itself identify which explanation applies. Check the solver interface’s behavior and the time-step and event handling rather than assuming that every output grid is merely cosmetic.
Common Mistake and Limitations
A common mistake is to assume that asking for more output times necessarily makes the numerical solution more accurate. That reasoning confuses reporting density with integration accuracy. If the solver only evaluates dense output at the additional times, its accepted integration steps may be unchanged. If the solver instead forces those times as endpoints, the integration may change, but the added endpoints do not guarantee a more accurate result. Accuracy depends on the numerical method, error control, the dynamics, and correct handling of events.
Dense output is also an approximation, not an exact reconstruction of the underlying continuous solution. Its quality can be limited by a step that is too wide for rapid changes, by interpolation across nonsmooth behavior, or by applying the wrong observation mapping. Post-hoc interpolation can be a practical fallback when the original solver output is unavailable, but its assumptions and potential error should be stated rather than silently treating it as the solver’s own prediction.
Check Your Understanding
Answer each question, then compare your reasoning with the solutions below.
- A sampling time lies between two accepted solver-step endpoints. What is dense output, and does evaluating it necessarily make that time a new integration endpoint?
- A model has amount states in milligrams and a constant compartment volume of 4.0 L. Dense output gives 12.0 mg at a sampling time. What concentration should be reported, with units?
- Why can requiring every output time as an endpoint change a fixed-step solver’s result?
- A requested sample time coincides with a bolus event that jumps the state. What must be specified before reporting the prediction?
- Why is straight-line interpolation between two solver outputs not automatically equivalent to dense output?
Solutions. (1) Dense output is a solver-provided continuous approximation within an accepted step. Evaluating it can provide an intermediate prediction without making that time a new integration endpoint. (2) The concentration is \(12.0\ \text{mg}/4.0\ \text{L}=3.00\ \text{mg/L}\). (3) A fixed-step method computes updates using its step sizes. Requiring output times as endpoints can split or otherwise change those steps, changing the numerical updates and result. (4) Specify whether the prediction is immediately before or immediately after the bolus, and use the corresponding state; do not interpolate across the jump. (5) A straight line ignores curvature except as represented by its endpoints, whereas dense output uses the solver’s method-specific continuous approximation. Their values can differ, especially when curvature is appreciable.