Interactive
One to four compartments
An interactive tour of one- to four-compartment pharmacokinetic models: their equations, three ways to write their parameters, what each means for exposure, and how variability between people spreads the curve.
Most pharmacokinetic models in everyday use are built from the same few pieces: a central compartment that the drug is dosed into, sampled from and eliminated from, and up to three peripheral compartments that exchange drug with it. This post builds them up one compartment at a time, writes each in the three common parameterizations, and shows what they mean for exposure. Every chart is live: the curves are computed in your browser as you move the sliders.
The mammillary model. Drug is dosed into, measured in and eliminated from the central compartment (), which exchanges drug with up to three peripheral compartments ( out, back). The one-compartment model is the central box alone; each added peripheral compartment adds a box.
One compartment
After an intravenous bolus dose , a one-compartment model declines as a single exponential (1):
Here is the plasma concentration (mg/L), the dose (mg), the volume of distribution (L), the clearance (L/h) and the elimination rate constant (1/h). The half-life is , and the area under the curve is .
The same curve can be written three ways:
- Clearance and volume: and . Each has a physiological meaning and varies for its own reasons: clearance with the function of the liver or kidneys, volume with body size and composition (2).
- Micro-constants: and , the rates in the differential equation for the amount in the body.
- Macro-constants: the intercept and slope of the line on a log axis, which is what the data show directly.
Clearance and volume are the usual choice for modelling, because a change in one does not drag the other along. Doubling halves and doubles the half-life, but leaves , and so the , unchanged.
View data
| Time (h) | Current (mg/L) |
|---|---|
| 0 | 2 |
| 0.5 | 1.902 |
| 1 | 1.81 |
| 1.5 | 1.721 |
| 2 | 1.637 |
| 2.5 | 1.558 |
| 3 | 1.482 |
| 3.5 | 1.409 |
| 4 | 1.341 |
| 4.5 | 1.275 |
| 5 | 1.213 |
| 5.5 | 1.154 |
| 6 | 1.098 |
| 6.5 | 1.044 |
| 7 | 0.9932 |
| 7.5 | 0.9447 |
| 8 | 0.8987 |
| 8.5 | 0.8548 |
| 9 | 0.8131 |
| 9.5 | 0.7735 |
| 10 | 0.7358 |
| 10.5 | 0.6999 |
| 11 | 0.6657 |
| 11.5 | 0.6333 |
| 12 | 0.6024 |
| 12.5 | 0.573 |
| 13 | 0.5451 |
| 13.5 | 0.5185 |
| 14 | 0.4932 |
| 14.5 | 0.4691 |
| 15 | 0.4463 |
| 15.5 | 0.4245 |
| 16 | 0.4038 |
| 16.5 | 0.3841 |
| 17 | 0.3654 |
| 17.5 | 0.3475 |
| 18 | 0.3306 |
| 18.5 | 0.3145 |
| 19 | 0.2991 |
| 19.5 | 0.2845 |
| 20 | 0.2707 |
| 20.5 | 0.2575 |
| 21 | 0.2449 |
| 21.5 | 0.233 |
| 22 | 0.2216 |
| 22.5 | 0.2108 |
| 23 | 0.2005 |
| 23.5 | 0.1907 |
| 24 | 0.1814 |
A 100 mg intravenous bolus with one compartment (CL 5 L/h, V 50 L; illustrative values, not a drug). Freeze the curve, then double V: the new curve starts lower and falls more slowly, and AUC₀–∞ stays the same. Switch the parameterization: the values convert and the curve stays put.
| Metric | Current |
|---|---|
| Cmax (mg/L) | |
| Tmax (h) | |
| AUC0–24 (mg·h/L) | |
| AUC0–∞ (mg·h/L) | |
| Vss (L) | |
| t½ (h) |
Oral absorption
An oral dose adds a depot compartment that empties into the central one at a first-order rate (1/h), of which a fraction reaches the circulation. The concentration is the Bateman function (3,4):
It peaks at , which does not depend on the dose.1
Repeated doses
Linear models add: the concentration after several doses is the sum of the single-dose curves, each shifted to its own dose time. Below, the oral model ( = 1.2 1/h, CL = 5 L/h, V = 50 L) is given 100 mg every 12 h, and the curve builds up one dose at a time.
Dose 1. The first 100 mg dose peaks at 1.60 mg/L, about 2.3 h after the dose. By 12 h the concentration has fallen to 0.66 mg/L, not to zero.
Dose 2. The second dose lands on what is left of the first. The two curves add, so the peak rises to 2.13 mg/L and the trough at 24 h to 0.86 mg/L.
Dose 3. Each dose adds less than the one before, because less of the earlier doses remains: the half-life is = 6.9 h, so about 30% of a dose is left after one 12 h interval. The peak is now 2.29 mg/L.
Dose 4. The peak is 2.34 mg/L and the trough 0.93 mg/L. The curve in this interval is hard to tell from the one before it.
Dose 5. After 48 h, about seven half-lives, the amount eliminated in each interval nearly equals the dose: peak 2.35 mg/L, trough 0.94 mg/L.
Steady state. With more doses the curve settles between a peak of 2.36 mg/L and a trough of 0.94 mg/L, the dashed lines. That is = 1.43 times the single-dose trough: the accumulation ratio for = 12 h.
At steady state the amount eliminated over a dosing interval equals the amount absorbed, so the average concentration depends on clearance alone:
Here that is 100 / (5 × 12) = 1.67 mg/L, whatever and are. They set how far the peak and trough swing around it.
View data
| Time (h) | Current (mg/L) |
|---|---|
| 0 | 0 |
| 1.75 | 1.564 |
| 3.5 | 1.505 |
| 5.25 | 1.287 |
| 7 | 1.083 |
| 8.75 | 0.9095 |
| 10.5 | 0.7635 |
| 12.25 | 1.153 |
| 14 | 2.126 |
| 15.75 | 1.927 |
| 17.5 | 1.635 |
| 19.25 | 1.375 |
| 21 | 1.154 |
| 22.75 | 0.9689 |
| 24.5 | 1.691 |
| 26.25 | 2.278 |
| 28 | 2.018 |
| 29.75 | 1.707 |
| 31.5 | 1.434 |
| 33.25 | 1.204 |
| 35 | 1.011 |
| 36.75 | 1.986 |
| 38.5 | 2.303 |
| 40.25 | 2.011 |
| 42 | 1.698 |
| 43.75 | 1.426 |
| 45.5 | 1.198 |
| 47.25 | 1.005 |
| 49 | 2.161 |
| 50.75 | 2.285 |
| 52.5 | 1.976 |
| 54.25 | 1.666 |
| 56 | 1.399 |
| 57.75 | 1.175 |
| 59.5 | 0.9862 |
| 61.25 | 2.266 |
| 63 | 2.252 |
| 64.75 | 1.933 |
| 66.5 | 1.628 |
| 68.25 | 1.367 |
| 70 | 1.148 |
| 71.75 | 0.9635 |
| 73.5 | 2.326 |
| 75.25 | 2.211 |
| 77 | 1.888 |
| 78.75 | 1.589 |
| 80.5 | 1.334 |
| 82.25 | 1.12 |
| 84 | 0.9402 |
The same model, 100 mg every 12 h for seven doses, with an illustrative target range of 1–3 mg/L. At 100 mg the trough falls just below it. Find a dose that keeps the whole steady-state curve inside: only about 106 to 127 mg does.
| Metric | Current |
|---|---|
| Cmax (mg/L) | |
| Tmax (h) | |
| AUC0–84 (mg·h/L) | |
| AUC0–∞ (mg·h/L) | |
| Css,avg (mg/L) | |
| Vss (L) | |
| t½ (h) |
Two compartments
When the log concentration falls quickly at first and then more slowly, one compartment is not enough. A peripheral compartment takes up drug while the central concentration is high and returns it later. In amounts (central) and (peripheral):
with micro-constants , and , where (L/h) is the intercompartmental clearance. After a bolus the concentration is a sum of two exponentials, with macro-constants , (mg/L) and (1/h) (1):
The conversion runs the other way too. Given a fitted , , and :
is the distribution phase and the terminal phase; the terminal half-life is . With CL = 5 L/h, V₁ = 20 L, Q = 10 L/h and V₂ = 80 L, a 100 mg bolus gives A = 4.45 mg/L, α = 0.838 1/h, B = 0.548 mg/L and β = 0.0373 1/h: a distribution half-life of 0.83 h and a terminal half-life of 18.6 h.
View data
| Time (h) | Current (mg/L) |
|---|---|
| 0 | 5 |
| 1 | 2.454 |
| 2 | 1.342 |
| 3 | 0.8505 |
| 4 | 0.628 |
| 5 | 0.5221 |
| 6 | 0.4672 |
| 7 | 0.4346 |
| 8 | 0.4119 |
| 9 | 0.394 |
| 10 | 0.3783 |
| 11 | 0.3639 |
| 12 | 0.3503 |
| 13 | 0.3374 |
| 14 | 0.325 |
| 15 | 0.3131 |
| 16 | 0.3016 |
| 17 | 0.2906 |
| 18 | 0.2799 |
| 19 | 0.2697 |
| 20 | 0.2598 |
| 21 | 0.2503 |
| 22 | 0.2411 |
| 23 | 0.2323 |
| 24 | 0.2238 |
| 25 | 0.2156 |
| 26 | 0.2077 |
| 27 | 0.2001 |
| 28 | 0.1928 |
| 29 | 0.1857 |
| 30 | 0.1789 |
| 31 | 0.1723 |
| 32 | 0.166 |
| 33 | 0.16 |
| 34 | 0.1541 |
| 35 | 0.1485 |
| 36 | 0.143 |
| 37 | 0.1378 |
| 38 | 0.1327 |
| 39 | 0.1279 |
| 40 | 0.1232 |
| 41 | 0.1187 |
| 42 | 0.1143 |
| 43 | 0.1102 |
| 44 | 0.1061 |
| 45 | 0.1022 |
| 46 | 0.09849 |
| 47 | 0.09488 |
| 48 | 0.09141 |
Two compartments after a 100 mg bolus, on a log axis, written in micro-constants. Switch to macro-constants to see A, α, B and β, and drag them: any positive pair of coefficients with distinct exponents is a valid model.
| Metric | Current |
|---|---|
| Cmax (mg/L) | |
| Tmax (h) | |
| AUC0–48 (mg·h/L) | |
| AUC0–∞ (mg·h/L) | |
| Vss (L) | |
| t½, λ₁ (h) | |
| Terminal t½, λ₂ (h) |
Three and four compartments
Each added peripheral compartment adds an exponential phase, . The exponents solve
and its roots interlace the peripheral exit rates : one lies above the largest, one between each neighbouring pair and one below the smallest. So each root can be found in a bracket of its own, which is how the explorers here compute them. Three compartments also have a closed form through the trigonometric solution of the cubic (5), which the site’s tests use as a check. The coefficients are
Going back from macro-constants works the same way for any number of compartments (6,7). The central volume is . The are the roots of , one between each neighbouring pair of . Then , and each follows. Any set of positive coefficients with distinct exponents belongs to exactly one mammillary model, up to the order of its peripheral compartments: the curve cannot tell which peripheral compartment is which, so the explorers number them fastest first.
View data
| Time (h) | Current (mg/L) |
|---|---|
| 0 | 10 |
| 2 | 1.005 |
| 4 | 0.6253 |
| 6 | 0.4383 |
| 8 | 0.3192 |
| 10 | 0.2427 |
| 12 | 0.1932 |
| 14 | 0.1608 |
| 16 | 0.1394 |
| 18 | 0.1249 |
| 20 | 0.1148 |
| 22 | 0.1076 |
| 24 | 0.1022 |
| 26 | 0.09795 |
| 28 | 0.09447 |
| 30 | 0.0915 |
| 32 | 0.08886 |
| 34 | 0.08646 |
| 36 | 0.08421 |
| 38 | 0.08209 |
| 40 | 0.08007 |
| 42 | 0.07812 |
| 44 | 0.07623 |
| 46 | 0.0744 |
| 48 | 0.07262 |
| 50 | 0.07089 |
| 52 | 0.0692 |
| 54 | 0.06755 |
| 56 | 0.06594 |
| 58 | 0.06438 |
| 60 | 0.06285 |
| 62 | 0.06135 |
| 64 | 0.05989 |
| 66 | 0.05847 |
| 68 | 0.05708 |
| 70 | 0.05572 |
| 72 | 0.0544 |
| 74 | 0.05311 |
| 76 | 0.05185 |
| 78 | 0.05061 |
| 80 | 0.04941 |
| 82 | 0.04824 |
| 84 | 0.04709 |
| 86 | 0.04597 |
| 88 | 0.04488 |
| 90 | 0.04381 |
| 92 | 0.04277 |
| 94 | 0.04176 |
| 96 | 0.04076 |
Three compartments after a 100 mg bolus, written as three exponential phases. Switch to micro-constants or clearance and volume: the curve stays the same.
Coefficients A are for a dose of 100 mg; peripheral compartments are numbered fastest first.
| Metric | Current |
|---|---|
| Cmax (mg/L) | |
| Tmax (h) | |
| AUC0–96 (mg·h/L) | |
| AUC0–∞ (mg·h/L) | |
| Vss (L) | |
| t½, λ₁ (h) | |
| t½, λ₂ (h) | |
| Terminal t½, λ₃ (h) |
In practice, data seldom support more than three exponentials. The slowest phase shows only at low concentrations, long after the dose, so it needs sensitive assays and late samples. Three-compartment models are common for anaesthetics such as propofol, where the slow return of drug from fat matters after a long infusion (8).
Exposure
Distribution changes the shape of the curve, not the total exposure. With central elimination, every dose is eventually cleared at the rate , so and hold for any number of compartments. The explorers’ default models all have CL = 5 L/h, so a 100 mg bolus gives each an of 20 mg·h/L. They differ in everything else:
| Compartments | (L) | Terminal (h) | Terminal share of AUC | Dose 4 | Dose 14 |
|---|---|---|---|---|---|
| 1 | 50 | 6.9 | 100% | 99% | 100% |
| 2 | 100 | 18.6 | 73% | 88% | 100% |
| 3 | 230 | 57.6 | 54% | 70% | 93% |
| 4 | 730 | 254 | 35% | 57% | 76% |
The last two columns are for 100 mg every 12 h: the AUC over the 4th and the 14th dosing interval, as a share of the AUC over an interval at steady state.
The volume of distribution at steady state, , grows with each compartment, and so does the terminal half-life. But the terminal half-life overstates how long it takes to reach steady state when its phase holds only part of the AUC. With four compartments it is over ten days, yet three quarters of the steady-state exposure (the AUC over one interval) is reached within the first week, at dose 14. The last quarter takes weeks.
View data
| Time (h) | Current (mg/L) |
|---|---|
| 0 | 10 |
| 14 | 0.9197 |
| 28 | 0.6518 |
| 42 | 0.5405 |
| 56 | 0.4846 |
| 70 | 0.46 |
| 84 | 10.45 |
| 98 | 1.262 |
| 112 | 0.9451 |
| 126 | 0.7951 |
| 140 | 0.7072 |
| 154 | 0.6559 |
| 168 | 10.63 |
| 182 | 1.417 |
| 196 | 1.085 |
| 210 | 0.9214 |
| 224 | 0.8222 |
| 238 | 0.7614 |
| 252 | 10.72 |
| 266 | 1.507 |
| 280 | 1.169 |
| 294 | 0.9999 |
| 308 | 0.8959 |
| 322 | 0.8308 |
| 336 | 10.79 |
| 350 | 1.569 |
| 364 | 1.228 |
| 378 | 1.056 |
| 392 | 0.9494 |
| 406 | 0.8818 |
| 420 | 10.84 |
| 434 | 1.616 |
| 448 | 1.272 |
| 462 | 1.099 |
| 476 | 0.9904 |
| 490 | 0.9211 |
| 504 | 10.88 |
| 518 | 1.652 |
| 532 | 1.307 |
| 546 | 1.132 |
| 560 | 1.023 |
| 574 | 0.9521 |
| 588 | 10.91 |
| 602 | 1.68 |
| 616 | 1.335 |
| 630 | 1.159 |
| 644 | 1.048 |
| 658 | 0.9766 |
| 672 | 0.9289 |
Four compartments on 100 mg every 12 h for four weeks, on a log axis. Most of the rise is over in the first few days; the troughs then creep up for weeks. Compare Css,avg with the one-compartment model above: the same dose and clearance give the same 1.67 mg/L.
| Metric | Current |
|---|---|
| Cmax (mg/L) | |
| Tmax (h) | |
| AUC0–672 (mg·h/L) | |
| AUC0–∞ (mg·h/L) | |
| Css,avg (mg/L) | |
| Vss (L) | |
| t½, λ₁ (h) | |
| t½, λ₂ (h) | |
| t½, λ₃ (h) | |
| Terminal t½, λ₄ (h) |
Variability between people
A model’s parameters describe a typical person. Real people differ, and population models describe that with between-subject variability: each person’s clearance is the typical value times a random factor, , where is normally distributed with mean 0 and variance . That makes log-normal, with a coefficient of variation of .
The explorer below simulates 1,000 people on the oral regimen from above, at 115 mg, a dose that keeps the typical person inside the 1–3 mg/L range at steady state. The band is where the middle 90% of them are at each time.
View data
| Time (h) | Typical subject (mg/L) |
|---|---|
| 0 | 0 |
| 1.75 | 1.799 |
| 3.5 | 1.731 |
| 5.25 | 1.48 |
| 7 | 1.245 |
| 8.75 | 1.046 |
| 10.5 | 0.878 |
| 12.25 | 1.325 |
| 14 | 2.445 |
| 15.75 | 2.216 |
| 17.5 | 1.88 |
| 19.25 | 1.581 |
| 21 | 1.327 |
| 22.75 | 1.114 |
| 24.5 | 1.945 |
| 26.25 | 2.62 |
| 28 | 2.32 |
| 29.75 | 1.963 |
| 31.5 | 1.649 |
| 33.25 | 1.385 |
| 35 | 1.163 |
| 36.75 | 2.284 |
| 38.5 | 2.648 |
| 40.25 | 2.313 |
| 42 | 1.952 |
| 43.75 | 1.64 |
| 45.5 | 1.377 |
| 47.25 | 1.156 |
| 49 | 2.485 |
| 50.75 | 2.628 |
| 52.5 | 2.272 |
| 54.25 | 1.916 |
| 56 | 1.609 |
| 57.75 | 1.351 |
| 59.5 | 1.134 |
| 61.25 | 2.606 |
| 63 | 2.589 |
| 64.75 | 2.223 |
| 66.5 | 1.872 |
| 68.25 | 1.572 |
| 70 | 1.32 |
| 71.75 | 1.108 |
| 73.5 | 2.675 |
| 75.25 | 2.543 |
| 77 | 2.171 |
| 78.75 | 1.827 |
| 80.5 | 1.534 |
| 82.25 | 1.288 |
| 84 | 1.081 |
1,000 simulated people on 115 mg every 12 h: the median and the 90% prediction interval, with between-subject variability of 30% on CL, 20% on V and 40% on ka (illustrative). Once at steady state the typical person stays inside the range; many people do not.
The median of the simulated people need not match the typical person’s curve, because log-normal parameters make the concentrations skewed. Raise the variability on CL and watch the band widen at the trough, where clearance matters most.
How the numbers are made
The curves come from a pharmacokinetic engine written in TypeScript that runs in your browser. Linear models use the closed-form sums of exponentials above, and doses are added by superposition. The population simulation runs in a background thread so the page stays responsive while you drag. The engine is tested against mrgsolve, an established R package for pharmacokinetic simulation, on bolus, infusion and oral doses for one to four compartments, within stated tolerances. How this site is made has more.
Notes
-
When the formula is ; its limit is . When the formula still holds, but the terminal slope then reflects absorption rather than elimination: “flip-flop” kinetics. ↩