Compartmental models are a mathematical framework used to simulate how populations move between different states or "compartments." While widely applied in various fields, they have become particularly fundamental to the
mathematical modelling of infectious diseases
Mathematical models can project how infectious diseases progress to show the likely outcome of an epidemic (including Plant disease forecasting, in plants) and help inform public health and plant health interventions. Models use basic assumptions ...
. In these models, the population is divided into compartments labeled with shorthand notation – most commonly S, I, and R, representing Susceptible, Infectious, and Recovered individuals. The sequence of letters typically indicates the flow patterns between compartments; for example, an SEIS model represents progression from susceptible to exposed to infectious and then back to susceptible again.
These models originated in the early 20th century through pioneering epidemiological work by several mathematicians. Key developments include Hamer's work in 1906,
Ross Ross may refer to:
People and fictional characters
* Ross (name), including a list of people and fictional characters with the surname or given name Ross, as well as the meaning
* Clan Ross, a Highland Scottish clan
Places Antarctica
* Ross Sea
...
's contributions in 1916, collaborative work by Ross and
Hudson
Hudson may refer to:
People
* Hudson (given name)
* Hudson (surname)
* Hudson (footballer, born 1986), Hudson Fernando Tobias de Carvalho, Brazilian football right-back
* Hudson (footballer, born 1988), Hudson Rodrigues dos Santos, Brazilian f ...
in 1917, the seminal
Kermack and McKendrick model in 1927,
and
Kendall's work in 1956.
The historically significant
Reed–Frost model
The Reed–Frost model is a mathematical model of epidemics put forth in the 1920s by Lowell Reed and Wade Hampton Frost, of Johns Hopkins University. While originally presented in a talk by Frost in 1928 and used in courses at Hopkins for two d ...
, though often overlooked, also substantially influenced modern epidemiological modeling approaches.
Most implementations of compartmental models use
ordinary differential equations
In mathematics, an ordinary differential equation (ODE) is a differential equation (DE) dependent on only a single independent variable. As with any other DE, its unknown(s) consists of one (or more) function(s) and involves the derivatives ...
(ODEs), providing deterministic results that are mathematically
tractable. However, they can also be formulated within
stochastic frameworks that incorporate randomness, offering more realistic representations of population dynamics at the cost of greater analytical complexity.
Epidemiologists and public health officials use these models for several critical purposes: analyzing disease transmission dynamics, projecting the total number of infections and recoveries over time, estimating key epidemiological parameters such as the
basic reproduction number
In epidemiology, the basic reproduction number, or basic reproductive number (sometimes called basic reproduction ratio or basic reproductive rate), denoted R_0 (pronounced ''R nought'' or ''R zero''), of an infection is the expected number ...
(R₀) or
effective reproduction number
In epidemiology, the basic reproduction number, or basic reproductive number (sometimes called basic reproduction ratio or basic reproductive rate), denoted R_0 (pronounced ''R nought'' or ''R zero''), of an infection
An infection is th ...
(R
t), evaluating potential impacts of different
public health interventions before implementation, and informing evidence-based policy decisions during disease outbreaks. Beyond infectious disease modeling, the approach has been adapted for applications in
population ecology
Population ecology is a sub-field of ecology that deals with the dynamics of species populations and how these populations interact with the environment (biophysical), environment, such as birth rate, birth and death rates, and by immigration an ...
,
pharmacokinetics
Pharmacokinetics (from Ancient Greek ''pharmakon'' "drug" and ''kinetikos'' "moving, putting in motion"; see chemical kinetics), sometimes abbreviated as PK, is a branch of pharmacology dedicated to describing how the body affects a specific su ...
,
chemical kinetics
Chemical kinetics, also known as reaction kinetics, is the branch of physical chemistry that is concerned with understanding the rates of chemical reactions. It is different from chemical thermodynamics, which deals with the direction in which a ...
, and other fields requiring the study of transitions between defined states.
SIR model
The SIR model
is one of the simplest compartmental models, and many models are derivatives of this basic form. The model consists of three compartments:
:S: The number of susceptible individuals. When a susceptible and an infectious individual come into "infectious contact", the susceptible individual contracts the disease and transitions to the infectious compartment.
:I: The number of infectious individuals. These are individuals who have been infected and are capable of infecting susceptible individuals.
:R for the number of removed (and immune) or deceased individuals. These are individuals who have been infected and have either recovered from the disease and entered the removed compartment, or died. It is assumed that the number of deaths is negligible with respect to the total population. This compartment may also be called "recovered" or "resistant".
This model is reasonably predictive
for infectious diseases that are transmitted from human to human, and where recovery confers lasting resistance, such as
measles
Measles (probably from Middle Dutch or Middle High German ''masel(e)'', meaning "blemish, blood blister") is a highly contagious, Vaccine-preventable diseases, vaccine-preventable infectious disease caused by Measles morbillivirus, measles v ...
,
mumps
MUMPS ("Massachusetts General Hospital Utility Multi-Programming System"), or M, is an imperative, high-level programming language with an integrated transaction processing key–value database. It was originally developed at Massachusetts Gen ...
, and
rubella
Rubella, also known as German measles or three-day measles, is an infection caused by the rubella virus. This disease is often mild, with half of people not realizing that they are infected. A rash may start around two weeks after exposure and ...
.

These variables (S, I, and R) represent the number of people in each compartment at a particular time. To represent that the number of susceptible, infectious, and removed individuals may vary over time (even if the total population size remains constant), we make the precise numbers a function of ''t'' (time): S(''t''), I(''t''), and R(''t''). For a specific disease in a specific population, these functions may be worked out in order to predict possible outbreaks and bring them under control.
Note that in the SIR model,
and
are different quantities – the former describes the number of recovered at ''t'' = 0 whereas the latter describes the ratio between the frequency of contacts to the frequency of recovery.
As implied by the variable function of ''t'', the model is dynamic in that the numbers in each compartment may fluctuate over time. The importance of this dynamic aspect is most obvious in an
endemic
Endemism is the state of a species being found only in a single defined geographic location, such as an island, state, nation, country or other defined zone; organisms that are indigenous to a place are not endemic to it if they are also foun ...
disease with a short infectious period, such as measles in the UK prior to the introduction of a
vaccine
A vaccine is a biological Dosage form, preparation that provides active acquired immunity to a particular infectious disease, infectious or cancer, malignant disease. The safety and effectiveness of vaccines has been widely studied and verifi ...
in 1968. Such diseases tend to occur in cycles of outbreaks due to the variation in number of susceptibles (S(''t'')) over time. During an
epidemic
An epidemic (from Greek ἐπί ''epi'' "upon or above" and δῆμος ''demos'' "people") is the rapid spread of disease to a large number of hosts in a given population within a short period of time. For example, in meningococcal infection ...
, the number of susceptible individuals falls rapidly as more of them are infected and thus enter the infectious and removed compartments. The disease cannot break out again until the number of susceptibles has built back up, e.g. as a result of offspring being born into the susceptible compartment.

Each member of the population typically progresses from susceptible to infectious to recovered. This can be shown as a flow diagram in which the boxes represent the different compartments and the arrows the transition between compartments (see diagram).
Transition rates
For the full specification of the model, the arrows should be labeled with the transition rates between compartments. Between ''S'' and ''I'', the transition rate is assumed to be
, where
is the total population,
is the average number of contacts per person per time, multiplied by the probability of disease transmission in a contact between a susceptible and an infectious subject, and
is the fraction of all possible contacts that involves an infectious and susceptible individual. (This is mathematically similar to the
law of mass action
In chemistry, the law of mass action is the proposition that the rate of a chemical reaction is directly proportional to the product of the activities or concentrations of the reactants. It explains and predicts behaviors of solutions in dy ...
in chemistry in which random collisions between molecules result in a chemical reaction and the fractional rate is proportional to the concentration of the two reactants.)
Between ''I'' and ''R'', the transition rate is assumed to be proportional to the number of infectious individuals which is
. If an individual is infectious for an average time period
, then
. This is also equivalent to the assumption that the length of time spent by an individual in the infectious state is a random variable with an
exponential distribution
In probability theory and statistics, the exponential distribution or negative exponential distribution is the probability distribution of the distance between events in a Poisson point process, i.e., a process in which events occur continuousl ...
. The "classical" SIR model may be modified by using more complex and realistic distributions for the I-R transition rate (e.g. the
Erlang distribution
The Erlang distribution is a two-parameter family of continuous probability distributions with Support (mathematics), support x \in ).
For the special case in which there is no removal from the infectious compartment (
), the SIR model reduces to a very simple SI model, which has a
logistic solution, in which every individual eventually becomes infected.
The SIR model without birth and death

The dynamics of an epidemic, for example, the Influenza">flu
Influenza, commonly known as the flu, is an infectious disease caused by influenza viruses. Symptoms range from mild to severe and often include fever, runny nose, sore throat, muscle pain, headache, coughing, and fatigue. These sympto ...
, are often much faster than the dynamics of birth and death, therefore, birth and death are often omitted in simple compartmental models. The SIR system without so-called vital dynamics (birth and death, sometimes called demography) described above can be expressed by the following system of ordinary differential equations:
:

where
is the stock of susceptible population in unit number of people,
is the stock of infected in unit number of people,
is the stock of removed population (either by death or recovery) in unit number of people, and
is the sum of these three in unit number of people.
is the infection rate constant in the unit number of people infected per day per infected person, and
is the recovery rate constant in the unit fraction of a person recovered per day per infected person, when time is in unit day.
This model was for the first time proposed by
William Ogilvy Kermack
William Ogilvy Kermack FRS FRSE FRIC (26 April 1898 – 20 July 1970) was a Scottish biochemist. He made mathematical studies of epidemic spread and established links between environmental factors and specified diseases. He is noteworthy for b ...
and
Anderson Gray McKendrick
Anderson Gray McKendrick DSc FRSE (8 September 1876 – 30 May 1943) was a Scottish military physician and epidemiologist who pioneered the use of mathematical methods in epidemiology. Irwin (see below) commented on the quality of his work, "Al ...
as a special case of what we now call
Kermack–McKendrick theory
Kermack–McKendrick theory is a hypothesis that predicts the number and distribution of cases of an immunizing infectious disease over time as it is transmitted through a population based on characteristics of infectivity and recovery, under a st ...
, and followed work McKendrick had done with
Ronald Ross
Sir Ronald Ross (13 May 1857 – 16 September 1932) was a British medical doctor who received the Nobel Prize for Physiology or Medicine in 1902 for his work on the transmission of malaria, becoming the first British Nobel laureate, and the f ...
.
This system is
non-linear
In mathematics and science, a nonlinear system (or a non-linear system) is a system in which the change of the output is not proportional to the change of the input. Nonlinear problems are of interest to engineers, biologists, physicists, mathe ...
, however it is possible to derive its analytic solution in implicit form.
Firstly note that from:
:
it follows that:
:
expressing in mathematical terms the constancy of population
. Note that the above relationship implies that one need only study the equation for two of the three variables.
Secondly, we note that the dynamics of the infectious class depends on the following ratio:
:
the so-called
basic reproduction number
In epidemiology, the basic reproduction number, or basic reproductive number (sometimes called basic reproduction ratio or basic reproductive rate), denoted R_0 (pronounced ''R nought'' or ''R zero''), of an infection is the expected number ...
(also called basic reproduction ratio). This ratio is derived as the expected number of new infections (these new infections are sometimes called secondary infections) from a single infection in a population where all subjects are susceptible.
This idea can probably be more readily seen if we say that the typical time between contacts is
, and the typical time until removal is
. From here it follows that, on average, the number of contacts by an infectious individual with others ''before'' the infectious has been removed is:
By dividing the first differential equation by the third,
separating the variables and integrating we get
:
where
and
are the initial numbers of, respectively, susceptible and removed subjects.
Writing
for the initial proportion of susceptible individuals, and
and
for the proportion of susceptible and removed individuals respectively in the limit
one has
:
(note that the infectious compartment empties in this limit).
This
transcendental equation
In applied mathematics, a transcendental equation is an equation over the real (or complex) numbers that is not algebraic, that is, if at least one of its sides describes a transcendental function.
Examples include:
:\begin
x &= e^ \\
x ...
has a solution in terms of the
Lambert function, namely
:
This shows that at the end of an epidemic that conforms to the simple assumptions of the SIR model, unless
, not all individuals of the population have been removed, so some must remain susceptible. A driving force leading to the end of an epidemic is a decline in the number of infectious individuals. The epidemic does not typically end because of a complete lack of susceptible individuals.
The role of both the basic reproduction number and the initial susceptibility are extremely important. In fact, upon rewriting the equation for infectious individuals as follows:
:
it yields that if:
:
then:
:
i.e., there will be a proper epidemic outbreak with an increase of the number of the infectious (which can reach a considerable fraction of the population). On the contrary, if
:
then
:
i.e., independently from the initial size of the susceptible population the disease can never cause a proper epidemic outbreak. As a consequence, it is clear that both the basic reproduction number and the initial susceptibility are extremely important.
The force of infection
Note that in the above model the function:
:
models the transition rate from the compartment of susceptible individuals to the compartment of infectious individuals, so that it is called the
force of infection. However, for large classes of communicable diseases it is more realistic to consider a force of infection that does not depend on the absolute number of infectious subjects, but on their fraction (with respect to the total constant population
):
:
Capasso
and, afterwards, other authors have proposed nonlinear forces of infection to model more realistically the contagion process.
Exact analytical solutions to the SIR model
In 2014, Harko and coauthors derived an exact so-called analytical solution (involving an integral that can only be calculated numerically) to the SIR model.
In the case without vital dynamics setup, for
, etc., it corresponds to the following time parametrization
:
:
:
for
:
with initial conditions
: