notesonly.in

One notebook for every subject — open it anywhere.

Log in

Compartmental Models: Concepts, Formulas and Examples

A compartmental model divides a population into compartments — groups defined by their status — and writes equations for the flows between them. The SIR epidemic model is one example; the same idea models chemical reactions, animal life stages, and even rumour spreading.

This matters because compartmental thinking is a universal modelling language. Once you learn to draw the boxes, label the arrows with rates, and write one balance equation per box, you can model systems far beyond diseases.

Key Concepts

  • Compartment — a group of identical individuals, e.g. Susceptible, Exposed, Infectious, Recovered.
  • Flow rate — how fast individuals move along an arrow between compartments (units: 1/time).
  • Balance equation — rate of change of a compartment = inflows − outflows.
  • SEIR model — SIR plus an Exposed (latent) compartment for diseases with an incubation period.
  • Conservation — if nobody enters or leaves the system, the compartment sizes always sum to the total population.

How It Works

Building a compartmental model follows a recipe:

  1. Choose compartments. Split the population by the statuses that matter. For a disease with a latent period: S, E, I, R.
  2. Draw arrows. Infection moves S → E; progression moves E → I at rate σ; recovery moves I → R at rate γ.
  3. Write balance equations. One differential equation per compartment: dS/dt = −βSI/N, dE/dt = βSI/N − σE, dI/dt = σE − γI, dR/dt = γI.
  4. Find equilibria. Set all derivatives to zero. The disease-free equilibrium (everyone in S) and possibly an endemic equilibrium (disease persists) emerge.
  5. Analyze stability. The basic reproduction number decides which equilibrium the system settles into: R₀ = β/γ for SEIR (the latent period does not change R₀, only the timing).
  6. Simulate and validate. Solve numerically, compare with data, and refine compartments or rates as needed.

Worked Example

Model a rumour spreading through a school of N = 1,000 students with compartments: Ignorant (S), Spreaders (I), Stiflers (R). Contact rate β = 0.5 per day, stifling rate γ = 0.2 per day. Start: I₀ = 5.

  1. Step 1: Equations — dS/dt = −βSI/N, dI/dt = βSI/N − γI, dR/dt = γI. (Same shape as SIR — rumours spread like infections.)
  2. Step 2: R₀ = β/γ = 0.5/0.2 = 2.5. Each spreader converts 2.5 others on average — the rumour takes off.
  3. Step 3: Peak spreaders occur when S/N = 1/R₀ = 0.4, i.e. when 600 students have heard the rumour.
  4. Step 4: The rumour dies out with some students never hearing it — the final-size logic applies to gossip exactly as it does to germs.

Common Misconceptions

  • "More compartments always means a better model." Each compartment adds parameters you must estimate. An SEIR model with a badly measured latent period can predict worse than a well-fitted SIR.
  • "Compartmental models only work for diseases." The framework is general: chemical species in reactions, age classes in ecology, and even stages of a sales pipeline follow the same box-and-arrow mathematics.
  • "The arrows have to be one-directional." They do not. Waning immunity adds an R → S arrow (SIRS); reinfection, relapse and migration all appear as extra arrows.

Real-World Applications

  • COVID-19 modelling — extended compartments (hospitalized, ICU, vaccinated, variants) guided policy worldwide.
  • Pharmacokinetics — drug concentration in blood, tissue and organs is modelled as compartments with transfer rates.
  • Ecology — stage-structured models (eggs, juveniles, adults) predict pest outbreaks and fishery yields.

Compartmental modelling is a way of thinking: name the groups, draw the flows, balance the books. From that simple discipline come the SIR model, drug-dosing schedules and ecosystem forecasts alike. Master the recipe and you can model any system where things move between states.