Tutorials › Pharmacometrics › Mass-Balance Equations in Mechanistic Models
Pharmacokinetics · Mechanistic Modeling

Mass-Balance Equations in Mechanistic Models

Learn how conservation of mass becomes a system of differential equations that describes drug movement, transformation, and elimination in mechanistic PK, PK/PD, QSP, and PBPK models.

Intermediate Mechanistic Modeling PK/PD Foundations QSP & PBPK
01 · The governing idea

1. What Is a Mass-Balance Equation?

A mass-balance equation describes how the amount of a substance in a system changes over time by accounting for what enters, what leaves, and what is created or consumed within the system.

The fundamental bookkeeping principle is simple:

$$\text{Rate of accumulation}=\text{Rate in}-\text{Rate out}+\text{Rate of formation}-\text{Rate of consumption}$$

This principle is the foundation of many mechanistic models. In pharmacokinetics, the substance may be a drug. In a QSP model, it may be a cytokine, immune-cell population, receptor, signaling molecule, or disease biomarker. In a PBPK model, it may be drug distributed among organs and tissues.

Core idea: a mechanistic model is often built by writing a mass balance for each quantity whose dynamics need to be represented. The resulting balances become differential equations.
02 · Why mass balance matters

2. Why Is Mass Balance So Important in Mechanistic Modeling?

Mechanistic models attempt to represent the processes that generate observed behavior rather than describing observations only with empirical curves. Mass balance provides a disciplined way to translate those processes into mathematics.

Suppose drug enters a compartment, leaves through clearance, and can also move into another compartment. Rather than guessing the shape of the concentration-time curve, we specify the flows responsible for the change.

System amount A(t) state variable input output Rin Rout Accumulation = input − output

A mass balance converts physical or biological flows into a differential equation for the amount in a system.

This approach is especially powerful when a model contains many interacting processes. Each process can be represented as a flow into or out of a state, making the model structure explicit.

03 · State variables

3. Start With the State Variable

The first practical step in writing a mass balance is to identify what quantity is being tracked. This quantity is the state variable.

For a drug compartment, the natural state variable may be the amount of drug, \(A(t)\). For a biochemical species, it may be a molecular amount or concentration. For a cell population, it may be the number of cells.

State variablePossible interpretationTypical unit
\(A(t)\)Amount of drug in a compartmentmg
\(C(t)\)Drug concentrationmg/L
\(X(t)\)Cell populationcells
\(P(t)\)Protein or biomarker amountmass or amount
\(R(t)\)Receptor concentration or amountamount/volume

A useful modeling habit is to distinguish carefully between amount and concentration. An amount measures how much substance is present. A concentration measures how much substance is present per unit volume.

Practical rule: write the balance on the quantity that is physically conserved or directly generated and consumed. Convert between amount and concentration only when the model requires it.
04 · General form

4. The General Mass-Balance Equation

For a state variable \(A(t)\), a general balance can be written as:

$$\frac{dA}{dt}=R_{\text{in}}-R_{\text{out}}+R_{\text{formation}}-R_{\text{consumption}}$$

Each term represents a rate with units of amount per unit time.

For example, if a drug compartment receives an infusion at rate \(R_{\text{in}}(t)\) and eliminates drug at rate \(R_{\text{elim}}(A)\), then:

$$\frac{dA}{dt}=R_{\text{in}}(t)-R_{\text{elim}}(A)$$

The mathematical model becomes more complex only when additional mechanisms are introduced. For example, intercompartmental distribution adds transfer terms, metabolism adds a consumption term, and nonlinear binding may make the rates functions of concentration.

05 · First-order elimination

5. A Simple Example: First-Order Elimination

Suppose the elimination process is first order. The elimination rate is proportional to the amount present:

$$R_{\text{elim}}=kA$$

The mass balance therefore becomes:

$$\frac{dA}{dt}=-kA$$

This is the familiar one-compartment elimination model. The negative sign indicates that elimination decreases the amount in the compartment.

Its solution is:

$$A(t)=A_0e^{-kt}$$

If the compartment volume is \(V\), concentration is \(C=A/V\), giving:

$$C(t)=C_0e^{-kt}$$

Thus, the familiar exponential decline in a basic PK model is not an arbitrary curve. It follows directly from a particular mass-balance assumption.

06 · Clearance as a flow

6. Clearance Can Be Written as a Mass-Balance Term

In linear pharmacokinetics, elimination can be expressed using clearance:

$$R_{\text{elim}}=CL\cdot C$$

Because \(C=A/V\), the mass balance becomes:

$$\frac{dA}{dt}=-CL\frac{A}{V}$$

or:

$$\frac{dA}{dt}=-\frac{CL}{V}A$$

Therefore:

$$k=\frac{CL}{V}$$

This shows how familiar PK parameters arise naturally from a conservation equation. Clearance represents a volumetric flow, while concentration converts that flow into an amount-per-time elimination rate.

07 · Multiple compartments

7. Mass Balance With Multiple Compartments

Mechanistic models become more interesting when material can move between connected compartments.

Consider a two-compartment PK model. Let \(A_1\) be the amount in the central compartment and \(A_2\) the amount in the peripheral compartment.

Drug may leave the central compartment by elimination and may also transfer between the two compartments.

Central A₁ V₁ Peripheral A₂ V₂ Q₁₂ Q₂₁ dose CL

In a multi-compartment model, each transfer is represented as a flow that appears with opposite signs in the balances of the connected compartments.

A simple linear two-compartment model can be written:

$$\frac{dA_1}{dt}=R_{\text{in}}-\frac{CL}{V_1}A_1-\frac{Q}{V_1}A_1+\frac{Q}{V_2}A_2$$
$$\frac{dA_2}{dt}=\frac{Q}{V_1}A_1-\frac{Q}{V_2}A_2$$

The same transfer process appears as an output from one compartment and an input to the other. This is a general feature of mass-conserving mechanistic models.

08 · Formation and consumption

8. Mass Balance for Biochemical Reactions

Mechanistic models often contain processes in which one species is transformed into another. A simple reaction is:

$$A\rightarrow B$$

If the reaction occurs at rate \(v(A)\), then the same reaction has opposite effects on the two species:

$$\frac{dA}{dt}=-v(A)$$
$$\frac{dB}{dt}=+v(A)$$

For a first-order reaction with rate constant \(k\):

$$v(A)=kA$$

and therefore:

$$\frac{dA}{dt}=-kA,\qquad \frac{dB}{dt}=kA$$

This structure appears throughout systems pharmacology. Drug can inhibit a biological process, a substrate can be converted to a metabolite, or one signaling species can activate another.

09 · Nonlinear mechanisms

9. Mass Balance Does Not Require Linear Processes

The conservation principle remains valid even when the underlying rates are nonlinear.

For example, a saturable elimination process might follow Michaelis-Menten kinetics:

$$R_{\text{elim}}=\frac{V_{\max}C}{K_m+C}$$

The corresponding amount balance is:

$$\frac{dA}{dt}=-\frac{V_{\max}C}{K_m+C}$$

with \(C=A/V\) when a fixed volume relationship applies.

At low concentrations, the process can behave approximately like first-order elimination. At high concentrations, the elimination rate approaches \(V_{\max}\).

Important distinction: the mass-balance framework is general. What changes from model to model is the mathematical form used for the individual flow or reaction rates.
10 · Amount versus concentration

10. Converting Between Amount and Concentration

Mechanistic models frequently switch between amounts and concentrations. For a compartment with fixed volume \(V\):

$$C=\frac{A}{V}$$

Therefore:

$$A=VC$$

If volume is constant, differentiating gives:

$$\frac{dA}{dt}=V\frac{dC}{dt}$$

Thus, an amount-based balance can be converted into a concentration-based differential equation:

$$V\frac{dC}{dt}=R_{\text{in}}-R_{\text{out}}+R_{\text{formation}}-R_{\text{consumption}}$$

This distinction becomes particularly important in PBPK and QSP models because different compartments may have different volumes and because concentrations are often the quantities linked to biological effects.

11 · Inputs

11. How Dosing Enters a Mass-Balance Model

A dose is an amount, but a mechanistic model needs an input rate or an initial condition.

For an IV bolus dose \(D\), the dose may be represented as an instantaneous increase in the central amount:

$$A(0^+)=A(0^-)+D$$

For a constant infusion at rate \(R_0\), the input term is:

$$R_{\text{in}}(t)=R_0$$

For a time-varying infusion:

$$R_{\text{in}}(t)=R_0(t)$$

For an oral dose with a first-order absorption compartment, the dose can initially enter a depot compartment and subsequently flow into the systemic compartment.

$$\frac{dA_{\text{gut}}}{dt}=-k_aA_{\text{gut}}$$
$$\frac{dA_{\text{central}}}{dt}=k_aA_{\text{gut}}-\frac{CL}{V}A_{\text{central}}$$

This illustrates how an apparently simple dosing regimen can generate a system of linked mass-balance equations.

12 · Conservation

12. Conservation of Mass Across a Closed System

Mass balance becomes especially intuitive when considering a closed system. Suppose two compartments exchange material but there is no external input or elimination.

The equations might be:

$$\frac{dA_1}{dt}=-R_{12}+R_{21}$$
$$\frac{dA_2}{dt}=R_{12}-R_{21}$$

Adding the equations gives:

$$\frac{d}{dt}(A_1+A_2)=0$$

Therefore:

$$A_1(t)+A_2(t)=\text{constant}$$

The transfer changes where the material is located, but it does not create or destroy material.

Model-checking principle: conservation relationships provide powerful debugging tools. If a closed system is supposed to conserve mass but the simulated total changes, the model equations or implementation contain an inconsistency.
13 · QSP connection

13. Mass Balance in Quantitative Systems Pharmacology

QSP models extend the same principle from drug disposition to biological systems.

For example, suppose a biomarker \(B\) is produced at rate \(k_{\text{prod}}\) and eliminated at a first-order rate \(k_{\text{deg}}B\):

$$\frac{dB}{dt}=k_{\text{prod}}-k_{\text{deg}}B$$

Now suppose drug suppresses production through an inhibitory function \(I(C)\):

$$\frac{dB}{dt}=k_{\text{prod}}I(C)-k_{\text{deg}}B$$

The model can become progressively richer by adding receptors, signaling intermediates, immune cells, disease compartments, or feedback loops.

The underlying modeling rule remains the same: identify each state, identify the processes that change it, and write the corresponding balance.

14 · PBPK connection

14. Mass Balance in Physiologically Based Pharmacokinetic Models

PBPK models apply mass-balance principles to physiologically defined compartments such as liver, kidney, muscle, adipose tissue, and blood.

A simplified tissue balance can be written conceptually as:

$$\frac{dA_{\text{tissue}}}{dt}=\text{drug entering tissue}-\text{drug leaving tissue}-\text{drug metabolized}$$

Blood flow, tissue volumes, partition coefficients, binding, and organ-specific metabolism can determine the individual terms.

The important distinction is that the compartments in a PBPK model have explicit physiological interpretations, whereas compartments in a traditional compartmental PK model are often kinetic abstractions.

15 · Building the equations

15. A Step-by-Step Method for Writing Mass Balances

  1. Define the system boundary. Decide what is inside the modeled system and what is outside it.
  2. Identify the state variables. List the amounts or concentrations that need to be tracked.
  3. Draw the flows. Identify inputs, outputs, transfers, formation, consumption, and reactions.
  4. Define each rate. Specify the mathematical function describing each process.
  5. Write one balance per state. Every state should have an equation describing its rate of change.
  6. Check units. Every term in an amount balance must have units of amount/time.
  7. Check signs. A process leaving one state should generally enter another with the corresponding opposite sign.
  8. Check conservation. Determine whether the model conserves mass when it should.
  9. Specify initial conditions. State the amount or concentration at the starting time.
  10. Link the states to observations. Define how model states generate measurable concentrations or biomarkers.
Best practice: draw the mechanistic diagram before writing the differential equations. The diagram often makes missing flows, duplicated processes, and sign errors much easier to identify.
16 · Dimensional analysis

16. Use Units to Check the Equations

Dimensional analysis is one of the simplest ways to detect errors in a mechanistic model.

For an amount balance:

$$\frac{dA}{dt}=R_{\text{in}}-R_{\text{out}}$$

Every term must have units of amount/time.

QuantityExample units
Amount \(A\)mg
Concentration \(C\)mg/L
Clearance \(CL\)L/h
Rate constant \(k\)1/h
Elimination rate \(CL\cdot C\)mg/h
Infusion rate \(R_0\)mg/h

For example:

$$CL\cdot C=\frac{L}{h}\cdot\frac{mg}{L}=\frac{mg}{h}$$

which is exactly the required unit for an elimination rate in an amount balance.

17 · Worked example

17. Worked Example: A Two-Compartment Mass Balance

Consider a hypothetical drug administered as a \(100\) mg IV bolus into a central compartment. Suppose:

  • Central volume: \(V_1=10\) L
  • Peripheral volume: \(V_2=20\) L
  • Clearance: \(CL=2\) L/h
  • Intercompartmental clearance: \(Q=4\) L/h

Step 1: Initial conditions

Immediately after the bolus:

$$A_1(0)=100\text{ mg},\qquad A_2(0)=0\text{ mg}$$

Step 2: Write the central-compartment balance

$$\frac{dA_1}{dt}=-\frac{CL}{V_1}A_1-\frac{Q}{V_1}A_1+\frac{Q}{V_2}A_2$$

Substituting the numerical values:

$$\frac{dA_1}{dt}=-\frac{2}{10}A_1-\frac{4}{10}A_1+\frac{4}{20}A_2$$

or:

$$\frac{dA_1}{dt}=-0.6A_1+0.2A_2$$

Step 3: Write the peripheral-compartment balance

$$\frac{dA_2}{dt}=\frac{Q}{V_1}A_1-\frac{Q}{V_2}A_2$$

Substituting the values gives:

$$\frac{dA_2}{dt}=0.4A_1-0.2A_2$$

Step 4: Check the initial rates

At \(t=0\), \(A_1=100\) mg and \(A_2=0\) mg:

$$\left.\frac{dA_1}{dt}\right|_{t=0}=-0.6(100)+0.2(0)=-60\text{ mg/h}$$
$$\left.\frac{dA_2}{dt}\right|_{t=0}=0.4(100)-0.2(0)=40\text{ mg/h}$$

The central compartment initially loses drug at \(60\) mg/h, while the peripheral compartment gains \(40\) mg/h. The remaining \(20\) mg/h is eliminated through systemic clearance.

Step 5: Verify the total balance

Add the two equations:

$$\frac{d(A_1+A_2)}{dt}=-0.2A_1$$

Thus, intercompartmental transfer cancels out, leaving only systemic elimination. This is exactly what a mass balance should show.

Key lesson: the equations reveal the mechanism. Drug is redistributed between compartments, while clearance removes drug from the overall system. The transfer terms cancel when the total amount is considered.
18 · Steady state

18. Mass Balance and Steady State

A steady state occurs when the net rate of change of a state is zero.

For a simple one-compartment model receiving a constant infusion:

$$\frac{dA}{dt}=R_0-CL\cdot C$$

At steady state:

$$0=R_0-CL\cdot C_{ss}$$

Therefore:

$$C_{ss}=\frac{R_0}{CL}$$

This result is a direct consequence of balancing input against output. At steady state, drug continues to enter and leave the system, but the amount in the compartment remains constant because the two rates are equal.

19 · Model interpretation

19. What Mass-Balance Equations Do—and Do Not—Guarantee

Writing a mechanistic mass balance gives the model a clear structural interpretation, but it does not automatically make every parameter identifiable from data.

  • Mechanistic structure does not guarantee parameter identifiability. Different parameter combinations may produce similar predictions.
  • Unobserved states can be difficult to estimate. A model may contain biologically meaningful states that are not directly measured.
  • More mechanisms require more information. Adding pathways or compartments can increase the number of parameters that must be estimated.
  • Good conservation does not prove biological correctness. A model can conserve mass while still using an incorrect biological mechanism.
  • Observation models remain important. Experimental measurements may represent only selected states, transformed states, or noisy observations.

The strength of mass-balance modeling is that it makes assumptions explicit. That allows those assumptions to be examined, tested, modified, and connected to experimental evidence.

20 · From equations to simulation

20. From Mass Balances to Computational Models

Once the mass-balance equations and initial conditions are specified, the model becomes a system of ordinary differential equations:

$$\frac{d\mathbf{x}}{dt}=f(\mathbf{x},t,\boldsymbol{\theta})$$

where:

  • \(\mathbf{x}\) is the vector of model states,
  • \(t\) is time,
  • \(\boldsymbol{\theta}\) is the vector of model parameters, and
  • \(f\) contains the mass-balance relationships.

A numerical ODE solver can then integrate the system forward in time to calculate the predicted trajectory of every state.

For a mechanistic model, the computational workflow is therefore:

$$\text{Biological assumptions}\rightarrow\text{mass balances}\rightarrow\text{ODE system}\rightarrow\text{simulation}\rightarrow\text{comparison with data}$$

This same workflow underlies many PK, PK/PD, QSP, and PBPK applications.

21 · Common mistakes

21. Common Mass-Balance Modeling Mistakes

1. Forgetting a pathway

If a biological or physical process changes a state but is omitted from the balance, the model may systematically misrepresent the dynamics.

2. Using the wrong sign

A process that removes material from a state must appear with a negative sign in that state's balance.

3. Double-counting a transfer

A transfer between two compartments should generally appear once as an output from the source and once as an input to the destination—not twice in either balance.

4. Mixing amounts and concentrations incorrectly

Clearance multiplied by concentration produces an amount/time rate. Adding that directly to a concentration/time equation without the appropriate volume conversion creates a dimensional inconsistency.

5. Ignoring changing volumes

If volume changes with time, the simple relationship \(A=VC\) requires additional care when converting between amount and concentration.

6. Adding complexity without information

Every additional state and pathway introduces assumptions and often additional parameters. Complexity should be justified by the scientific question and available data.

Debugging habit: for every equation, ask three questions: What enters? What leaves? What is created or consumed? Then check whether the units and signs are consistent.
22 · Practical workflow

22. A Practical Workflow for Building a Mechanistic Model

  1. Define the scientific question. Decide what biological or pharmacological behavior the model needs to explain.
  2. Draw the system. Represent compartments, species, pathways, and interactions.
  3. Define state variables. Decide whether each state is an amount, concentration, cell population, or another quantity.
  4. List all flows and reactions. Identify inputs, outputs, transfers, production, degradation, and transformation.
  5. Write mass balances. Construct one differential equation for each state.
  6. Specify rate laws. Choose linear, saturable, receptor-mediated, enzymatic, or other appropriate functions.
  7. Check dimensions. Confirm that all terms in each equation have compatible units.
  8. Check conservation. Verify that internal transfers cancel appropriately.
  9. Specify initial conditions and dosing. Define how the system starts and how external interventions enter.
  10. Implement and simulate. Solve the resulting ODE system numerically.
  11. Compare with observations. Connect model states to measured concentrations, biomarkers, or clinical outcomes.
  12. Evaluate and refine. Assess parameter identifiability, diagnostics, biological plausibility, and predictive performance.

23. Key Takeaways

  • A mass-balance equation describes how a quantity changes through inputs, outputs, formation, and consumption.
  • The fundamental principle is conservation: accumulation equals the net rate of material entering, leaving, being formed, or being consumed.
  • Mechanistic models are often constructed by writing one mass balance for each state variable.
  • Drug compartments, biochemical species, biomarkers, receptors, and cell populations can all be represented as states in mechanistic models.
  • First-order PK equations are direct consequences of particular mass-balance assumptions.
  • Intercompartmental transfer appears as an output from one compartment and a corresponding input to another.
  • Clearance converts concentration into an elimination rate through \(R_{\text{elim}}=CL\cdot C\).
  • Nonlinear mechanisms such as Michaelis-Menten elimination can be incorporated simply by changing the rate law while retaining the same balance framework.
  • Amount and concentration must be distinguished carefully, particularly when constructing equations with clearance and compartment volumes.
  • Conservation relationships provide powerful model-development and debugging checks.
  • QSP and PBPK models use the same mass-balance principles while applying them to increasingly detailed biological and physiological systems.
  • Writing a mechanistic balance does not guarantee parameter identifiability or biological correctness; model structure still needs to be evaluated against data and scientific knowledge.
  • The final ODE system provides the mathematical foundation for simulation, parameter estimation, exposure-response modeling, and mechanistic prediction.
Next step

Where to Go Next

A natural progression is to study ordinary differential equations in QSP models, where multiple mass balances are linked through biological production, degradation, activation, inhibition, feedback, and signaling pathways.

From there, the same framework can be extended to PBPK models, nonlinear PK, mechanistic PK/PD models, receptor occupancy, turnover models, indirect-response models, and full QSP systems.

The central modeling habit remains the same: identify the states, identify the processes that change them, express those processes as rates, and let the resulting system of equations describe how the biological system evolves over time.

← Back to Pharmacokinetics Tutorials