terican

Last verified · v1.0

Calculator · health

Sir Viral Infection Model Calculator

Model viral epidemic dynamics with the SIR framework. Input population size, R₀, and infectious period to simulate susceptible, infected, and recovered curves over time.

FreeInstantNo signupOpen source

Inputs

SIR Model Output

Explain my result

0/3 free

Get a plain-English breakdown of your result with practical next steps.

SIR Model Output

The formula

How the
result is
computed.

Understanding the SIR Viral Infection Model

The SIR model divides a closed population of size N into three compartments: S (Susceptible), I (Infected), and R (Recovered/Removed). First formalized by Kermack and McKendrick in their landmark 1927 paper in the Proceedings of the Royal Society A, this framework remains the gold standard for modeling directly transmitted viral diseases and underpins nearly every modern infectious disease model in public health use today.

The Core Differential Equations

Three coupled ordinary differential equations govern the flow of individuals between compartments:

  • dS/dt = −β(SI/N) — the rate at which susceptible individuals become infected through contact with infectious individuals
  • dI/dt = β(SI/N) − γI — the net rate of change in the infected compartment, balancing new infections against recoveries
  • dR/dt = γI — the rate at which infected individuals permanently recover or are removed from the transmission chain

The parameter β (beta) is the effective contact-transmission rate: the product of the average number of daily contacts and the per-contact probability of transmission. The parameter γ (gamma) is the recovery rate, equal to 1 divided by the mean infectious period in days. A 7-day infectious period yields γ = 0.143 per day; a 14-day period yields γ = 0.071 per day. Because S + I + R = N at all times, the system is fully determined by any two of the three equations.

The Basic Reproduction Number R₀

The most critical single output of any SIR analysis is the basic reproduction number: R₀ = β / γ. R₀ quantifies the average number of secondary cases generated by one infectious individual placed into a fully susceptible population. When R₀ exceeds 1 the epidemic grows exponentially; when R₀ falls below 1 the outbreak self-extinguishes. According to the CDC Principles of Epidemiology, R₀ is the primary threshold parameter for assessing epidemic potential and guiding interventions such as vaccination campaigns and contact tracing programs.

R₀ Reference Values for Common Viruses

  • Measles: R₀ ≈ 12–18 — among the most transmissible pathogens ever documented
  • SARS-CoV-2 (original Wuhan strain): R₀ ≈ 2.5–4
  • Seasonal Influenza: R₀ ≈ 1.2–1.4
  • Smallpox: R₀ ≈ 5–7
  • Ebola (West Africa 2014 outbreak): R₀ ≈ 1.5–2.5

Herd Immunity Threshold

The SIR framework yields the herd immunity threshold (HIT) directly from R₀ using the formula: HIT = 1 − 1/R₀. For measles with R₀ = 15, approximately 93% of the population must be immune to halt sustained transmission. For seasonal influenza with R₀ = 1.3, roughly 23% immunity suffices. For SARS-CoV-2 with R₀ = 3, the threshold sits near 67%. These figures make the viral infection SIR calculator a foundational planning tool for vaccine coverage targets and outbreak containment strategy.

Interpreting the Epidemic Curve

Simulating the SIR model over time produces three time-series curves: S(t), I(t), and R(t). The epidemic peak — the moment of maximum simultaneous infections — occurs when dI/dt = 0, precisely when S/N equals 1/R₀. For a city of 1,000,000 people with R₀ = 2.5 and a 7-day infectious period, unmitigated spread generates a peak exceeding 150,000 simultaneous infections near day 70. The total attack rate — the fraction of the population ever infected across the full outbreak — is always less than 1 and is governed by the implicit transcendental equation derived from the model's conservation law, not simply 1 − 1/R₀.

Methodology and Sources

The mathematical foundation rests on the original derivation by Kermack and McKendrick (1927), further validated in Nature Methods: Mathematical models of epidemics (2020), and formalized at Wolfram MathWorld. The classical SIR model assumes a homogeneous closed population, uniform random mixing, and lifelong immunity upon recovery. Real outbreaks involve age structure, spatial heterogeneity, behavioral adaptation, and waning immunity — factors addressed by SEIR, SIRS, and age-stratified model extensions. Use SIR outputs as directional estimates and complement them with local surveillance data for operational public health decision-making.

Reference

Frequently asked questions

What is the basic reproduction number R₀ and how does the viral infection SIR calculator use it?
R₀ (pronounced R-naught) is the average number of secondary infections caused by one case introduced into a fully susceptible population. The viral infection SIR calculator derives R₀ as β divided by γ — the transmission rate divided by the recovery rate. Values above 1 signal exponential epidemic growth; values below 1 indicate natural decline. The original SARS-CoV-2 strain carried R₀ ≈ 2.5–4, meaning each unmitigated case seeded 2.5 to 4 new infections on average before recovering.
What inputs are required to run the SIR model calculator?
The calculator requires five inputs: total population N (for example, 100,000 residents in a city), initial infected individuals I₀ (typically 1–10 seed cases to start the simulation), the Basic Reproduction Number R₀ (drawn from published pathogen literature), mean infectious period in days (5 days for influenza, 10 days for COVID-19), and simulation duration in days (commonly 180–365 days to capture a full epidemic wave). Selecting an output metric — Susceptible, Infected, or Recovered — determines which time-series curve is displayed as the result.
How does the mean infectious period affect the epidemic peak in the SIR model?
The mean infectious period directly controls the recovery rate γ = 1 divided by the infectious period in days. Shorter infectious periods raise γ and reduce the effective R₀ when β remains constant. Reducing the infectious period from 14 days to 7 days doubles γ from 0.071 to 0.143 per day, cutting R₀ in half. The result is a lower, earlier epidemic peak with fewer total infections — which is precisely why antiviral therapies that shorten illness duration can substantially blunt outbreak severity even without reducing the per-contact transmission probability.
What is the herd immunity threshold and how does the SIR calculator compute it?
The herd immunity threshold (HIT) is the minimum immune fraction of a population required to prevent sustained epidemic spread. The SIR model calculates HIT as 1 − 1/R₀. For measles with R₀ = 15, HIT ≈ 93%; for SARS-CoV-2 with R₀ = 3, HIT ≈ 67%; for seasonal influenza with R₀ = 1.3, HIT ≈ 23%. Once HIT is reached, each infectious case generates fewer than one new infection on average, causing the outbreak to decline naturally even when a fraction of susceptible individuals still remain in the population.
How accurate is the SIR model for predicting real-world viral outbreaks?
The SIR model provides reliable directional accuracy for outbreaks in relatively homogeneous populations with stable behavioral patterns. Research published in Nature Methods confirms that SIR-family models successfully reproduced the broad epidemic trajectory of the 1918 influenza pandemic and the 2014 West Africa Ebola outbreak. The model tends to overestimate peak size when population mixing is heterogeneous or when behavioral interventions reduce β mid-outbreak. Accuracy improves substantially when R₀ is calibrated from early case surveillance data rather than assumed from prior literature values alone.
Can the SIR model calculator simulate the impact of a vaccination campaign on an epidemic?
Yes. Vaccination reduces the effective susceptible pool before the epidemic begins. To simulate a vaccination campaign, subtract the immunized fraction from the initial S₀ value before running the model. For a population of 500,000 with 40% vaccination coverage, set S₀ = 300,000. The simulation then projects epidemic dynamics for the remaining unprotected group. When the vaccinated proportion exceeds the herd immunity threshold — for example, 67% coverage against a pathogen with R₀ = 3 — the epidemic curve collapses entirely, with I(t) declining from day one and total infections remaining negligible.