Tutorials › Pharmacometric Workflows and Reproducible Modeling › State Variables, Amounts, and Concentrations Across Tools

Software Landscape and Interoperability · Tutorial 202 of 399

State Variables, Amounts, and Concentrations Across Tools

Learn to identify whether a software state represents amount or concentration, translate between the two consistently, and check one-compartment predictions using volume and units.

Intermediate 10 min read

What You'll Learn

  • Distinguish a compartment amount state from a concentration calculated from that state.
  • Derive the concentration equation from a one-compartment amount equation.
  • Check the volume scaling in a one-compartment prediction across four tools.
  • Recognize how parameterization and output conventions affect software comparisons.
  • Use units and numerical checks to diagnose amount–concentration errors.

Why the State and the Reported Concentration Are Different

A pharmacokinetic model can describe how much drug is in a compartment while reporting the concentration measured in a sample. These are related quantities, but they are not interchangeable: amount has units such as mg, while concentration has units such as mg/L. The volume of distribution links them. Confusing a model’s internal state with its reported output can create predictions that differ by a factor of volume, even when the intended pharmacokinetic model is the same.

The distinction matters when comparing implementations in NONMEM, Monolix, nlmixr2, and mrgsolve. The four tools can express the same one-compartment model using different names, syntax, or parameterizations. A useful comparison therefore asks two separate questions: what quantity does the state variable represent, and how is the observation-scale concentration calculated? The earlier material on translating clearance and rate parameterizations established the relation between clearance and the elimination rate constant; here the focus is the state-to-output mapping.

Definition: A state variable is a model quantity whose value changes over time and whose evolution is specified by a model equation. An amount state represents the quantity of drug in a compartment, for example \(A(t)\) in mg. A concentration represents amount per volume, for example \(C(t)\) in mg/L. For a well-mixed compartment with volume \(V\), \(C(t)=A(t)/V\).

This relation assumes that the modeled amount is distributed in the volume \(V\) used for that concentration. In a standard one-compartment model, \(V\) is constant and the central amount and plasma concentration are linked directly. A state variable is not guaranteed to be an amount simply because it is named “central,” “compartment 1,” or “drug.” Its meaning follows from the equation and its units.

Deriving the One-Compartment Concentration Equation

Suppose an amount state \(A(t)\) receives drug at an input rate \(R_{\mathrm{in}}(t)\), measured in amount per time, and eliminates drug according to clearance \(CL\), measured in volume per time. With concentration \(C(t)=A(t)/V\), the amount balance is input minus elimination:

$$ \frac{dA}{dt}=R_{\mathrm{in}}(t)-CL\,C(t) $$

Since \(A=VC\), a constant \(V\) gives \(dA/dt=V\,dC/dt\). Substituting \(C=A/V\) into the amount equation and dividing by \(V\) yields:

$$ \frac{dC}{dt} = \frac{R_{\mathrm{in}}(t)}{V} - \frac{CL}{V}C(t) $$

The elimination rate constant is \(k=CL/V\), with units of inverse time. Thus an amount-state implementation and a concentration-state implementation can describe the same model, but their input terms differ: the amount equation uses an amount-per-time input, whereas the concentration equation uses that input divided by volume.

Model conditions: The equations above assume a well-mixed one-compartment model, constant \(V\), linear elimination with clearance \(CL\), and consistent amount, volume, and time units. For an instantaneous dose \(D\) placed directly into the compartment with bioavailability 1, the amount jumps by \(D\), so the concentration jumps by \(D/V\). For an infusion, \(R_{\mathrm{in}}(t)\) is a rate rather than a dose amount.

Worked Example: Checking a Bolus Concentration From an Amount State

Consider a hypothetical one-compartment intravenous bolus of 100 mg. Let \(V=20\) L and \(CL=4\) L/h. Assume the dose enters the compartment immediately, the volume is constant, and elimination is linear. What are the initial concentration and the concentration after 3 hours?

Immediately after dosing, the amount is \(A(0^+)=100\) mg. Convert amount to concentration using the stated volume:

$$ C(0^+)=\frac{A(0^+)}{V} =\frac{100\ \mathrm{mg}}{20\ \mathrm{L}} =5\ \mathrm{mg/L} $$

The elimination rate constant is \(k=CL/V=(4\ \mathrm{L/h})/(20\ \mathrm{L})=0.2\ \mathrm{h}^{-1}\). With no further input, \(A(t)=A(0^+)e^{-kt}\), and \(C(t)=A(t)/V\). Therefore:

$$ C(3\ \mathrm{h}) = 5\ \mathrm{mg/L}\times e^{-(0.2\ \mathrm{h}^{-1})(3\ \mathrm{h})} = 5e^{-0.6}\ \mathrm{mg/L} \approx 2.744\ \mathrm{mg/L} $$

The exponent is dimensionless because the inverse-hour rate is multiplied by hours. The amount state at 3 hours is \(A(3)=20\ \mathrm{L}\times2.744\ \mathrm{mg/L}\approx54.88\) mg. Dividing that amount by 20 L recovers 2.744 mg/L. This round trip is a direct check that the state and reported concentration use the intended volume scaling.

How the Four Tools Represent the Mapping

The software names and syntax are not themselves a reliable guide to physical units. In each implementation, inspect the state equation and the prediction or output calculation. The following describes common ways to express the one-compartment model; model files can instead choose a different state parameterization.

ToolCommon amount-state approachConcentration mapping to verify
NONMEMPREDPP compartment models and user-defined differential-equation models commonly track compartment amounts.Check how the observation prediction is obtained. In user-defined code, a prediction may explicitly use amount divided by volume; built-in model behavior depends on its configuration.
MonolixA structural model can define compartment amounts as states, including in a user-defined ODE model.Check that the concentration used for the observation is the relevant amount divided by the appropriate volume, unless the chosen state is already a concentration.
nlmixr2A model can use ODE states for amounts, such as depot and central amounts.A prediction such as central amount divided by \(V\) is needed when the observation is concentration. Confirm that the model’s prediction variable has concentration units.
mrgsolveCompartment states in a typical compartmental model represent amounts, with derivatives specified for those states.Calculate or select a concentration output explicitly, for example central amount divided by central volume; do not assume an amount output is a concentration.

These are conceptual correspondences, not a claim that every model in a tool uses amount states or that every tool applies the same automatic conversion. A built-in model, user-defined ODE, or output table may handle the mapping differently. The implementation must be checked in the actual model definition. In particular, a prediction variable named “F,” “CP,” or “CONC” does not establish its units without examining how it is calculated.

1
Identify the state.
Read the initial condition and differential equation. If a dose of 100 mg adds 100 to the state, that strongly indicates an amount state in mg; if it adds \(100/V\), the state may be concentration.
2
Check the derivative units.
An amount-state derivative must have units of amount per time. A concentration-state derivative must have units of concentration per time.
3
Trace the observation prediction.
Determine whether it is the state itself or the state divided by volume, and confirm that its units match the measured data.
4
Test a simple case.
For an instantaneous dose into a one-compartment model, verify that the initial concentration equals dose divided by volume when bioavailability is 1.

Worked Example: Translating Between Amount and Concentration States

A hypothetical model has \(CL=6\) L/h, \(V=30\) L, and a constant infusion rate of 12 mg/h. Assume constant volume, linear elimination, and that the infusion enters the modeled compartment directly. Write the rate constant and compare the initial concentration slopes under amount-state and concentration-state formulations, starting from zero drug.

First, \(k=CL/V=(6\ \mathrm{L/h})/(30\ \mathrm{L})=0.2\ \mathrm{h}^{-1}\). In the amount formulation, the input rate is added directly:

$$ \frac{dA}{dt}=12\ \mathrm{mg/h}-(6\ \mathrm{L/h})C $$

At the start, \(C=0\), so \(dA/dt=12\) mg/h. Since \(C=A/V\) and \(V\) is constant, the initial concentration slope is:

$$ \left.\frac{dC}{dt}\right|_{t=0} = \frac{1}{30\ \mathrm{L}}\left(12\ \mathrm{mg/h}\right) = 0.4\ \mathrm{mg/(L\cdot h)} $$

The concentration-state equation gives the same result directly: \(dC/dt=R_{\mathrm{in}}/V-kC\). At \(t=0\), \(C=0\), so \(dC/dt=(12\ \mathrm{mg/h})/(30\ \mathrm{L})=0.4\) mg/(L·h). If a concentration equation instead adds 12 mg/h directly to \(dC/dt\), it is dimensionally inconsistent and omits division by volume.

Numerical Cross-Checks and Failure Modes

A compact numerical test can expose a state/output mismatch before fitting or simulation results are compared. Use a hypothetical 100 mg bolus, \(V=20\) L, and \(CL=4\) L/h. Immediately after dosing, an amount-state implementation should have 100 mg in the compartment and return \(100/20=5\) mg/L as concentration. A concentration-state implementation should instead initialize to 5 mg/L. If the output is 100 mg/L, the amount was likely reported as concentration without dividing by volume. If an amount state is initialized to 5 mg, volume scaling may have been applied twice or the state’s meaning may have been misidentified.

A second check uses elimination. In the amount equation, the elimination term \(CL\,C\) has units \((\mathrm{L/h})(\mathrm{mg/L})=\mathrm{mg/h}\). In the concentration equation, the elimination term \((CL/V)C\) has units \((1/\mathrm{h})(\mathrm{mg/L})=\mathrm{mg/(L\cdot h)}\). These checks catch a common coding error: using clearance directly as the multiplier of concentration in a concentration derivative, where the multiplier should be \(CL/V\).

Unit conversions deserve the same attention as equations. For example, 1 mg/L equals 1 µg/mL numerically, but 1 mg/L does not equal 1 mg/mL. If volume is specified in mL while clearance is in L/h, convert one of them before calculating \(CL/V\). Otherwise the resulting rate constant can be wrong by a factor of 1,000.

When a model’s predictions differ across tools, compare the state trajectory and the concentration output separately. Matching concentration predictions do not require identical state values if one model stores amounts and another stores concentrations. Conversely, matching state values are not enough if their units or definitions differ.

Worked Example: Diagnosing a Volume-Scale Discrepancy

Two hypothetical implementations use a 150 mg bolus and \(V=25\) L. One reports an initial prediction of 6 mg/L; the other reports 150 in its output. Assume both received the same dose and the second output is labelled as a concentration. Find the expected concentration, identify the likely discrepancy, and state what should be checked next.

The expected initial concentration is:

$$ C(0^+)=\frac{150\ \mathrm{mg}}{25\ \mathrm{L}}=6\ \mathrm{mg/L} $$

The first implementation’s output is consistent with amount divided by volume. The second output equals the dose amount numerically, suggesting that it may be reporting the amount state while labeling it as concentration, or that its output mapping is missing. The ratio \(150/6=25\) matches the numerical value of the volume in liters, supporting this diagnosis. Check the state units, the prediction equation, and the output units; do not change the dose or volume merely to force the outputs to agree.

Choosing and Interpreting an Implementation

An amount-state formulation is often natural for compartment mass balance: doses and infusion rates enter as amounts, and elimination removes amount per time. A concentration-state formulation can be convenient when the modeled quantity is directly the concentration of interest. With constant volume and the assumptions stated above, either is valid if inputs, rates, initial conditions, and predictions are transformed consistently.

The equivalence is more delicate if volume changes over time. Since \(A(t)=V(t)C(t)\), differentiation gives \(dA/dt=V\,dC/dt+C\,dV/dt\). The constant-volume concentration equation cannot simply be reused without addressing the additional term. Likewise, in multi-compartment models, each concentration must be paired with the volume associated with its amount state; dividing every amount by the same volume is not generally justified.

Do not infer that a software output is an observed concentration merely because its column is called “prediction.” The output could be an amount, a concentration, or another derived quantity. Confirm the mapping and units before comparing it with measured data. Residual-error specifications concern how predictions relate to observations and are a separate modeling choice; the state-to-concentration conversion must already be correct before that relationship is applied.

Key takeaway: For a one-compartment model with constant volume, \(C=A/V\). Keep the state’s physical meaning explicit, check that derivatives have the correct units, and verify that the output used for concentration data is on the concentration scale. Software syntax may differ; the mass balance and unit relationships do not.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. A model has an amount state of 80 mg and a volume of 16 L. What concentration does that amount imply?
  2. With \(CL=3\) L/h and \(V=15\) L, calculate \(k\) and state its units.
  3. A concentration-state model has an infusion input of 10 mg/h and \(V=20\) L. What is the input contribution to \(dC/dt\), before considering elimination?
  4. Why can two tools have different state values but matching concentration predictions?
  5. A model uses \(dC/dt=R_{\mathrm{in}}- (CL/V)C\), where \(R_{\mathrm{in}}\) is in mg/h. Identify the unit problem and the required correction.

Solutions. (1) \(80\ \mathrm{mg}/16\ \mathrm{L}=5\) mg/L. (2) \(k=(3\ \mathrm{L/h})/(15\ \mathrm{L})=0.2\ \mathrm{h}^{-1}\). (3) The contribution is \(R_{\mathrm{in}}/V=(10\ \mathrm{mg/h})/(20\ \mathrm{L})=0.5\) mg/(L·h). (4) One may store amount and the other concentration; compare the mapped concentration, not the raw state. (5) \(R_{\mathrm{in}}\) has amount-per-time units, which cannot be added to a concentration-per-time derivative. Use \(R_{\mathrm{in}}/V\), yielding concentration per time.

Clinical Biostats