SIR Model Calculator
Model viral infection spread using the SIR compartmental model. Calculate R₀, peak infected, and epidemic curve with interactive charts. Free online epidemiology tool.
About This Calculator
The SIR Model Calculator simulates the spread of a viral infection through a population using the classic Susceptible-Infectious-Recovered (SIR) compartmental model. This mathematical framework, developed by Kermack and McKendrick in 1927, remains one of the most fundamental tools in epidemiology for understanding how infectious diseases propagate through communities.
The model divides the population into three compartments: Susceptible (S) — individuals who can catch the disease; Infectious (I) — individuals who are infected and can transmit the disease; and Recovered (R) — individuals who have recovered and gained immunity. The transition between compartments is governed by two key parameters: the transmission rate (β), which controls how quickly the disease spreads through contacts between susceptible and infected individuals, and the recovery rate (γ), which determines how fast infected individuals recover. The basic reproduction number R₀ = β/γ indicates whether an epidemic will grow (R₀ > 1) or die out (R₀ < 1).
The calculator numerically solves the SIR differential equations using Euler's method, generating time-series data for all three compartments. Results include the basic reproduction number (R₀), the peak number of infected individuals and when it occurs, the final number of susceptible and recovered individuals, and an interactive epidemic curve chart showing the complete trajectory of the outbreak.
This tool is educational and demonstrates fundamental epidemic dynamics. Real-world disease modeling typically requires more complex models (SEIR, age-structured, spatially explicit) that incorporate additional factors such as latent periods, variable contact rates, non-pharmaceutical interventions, and demographic processes.
Frequently Asked Questions
What is the SIR model in epidemiology?
The SIR model is a compartmental epidemiological model that divides a population into three groups: Susceptible (S), Infectious (I), and Recovered (R). It uses differential equations to simulate how an infectious disease spreads through a population over time, making it one of the most fundamental tools in mathematical epidemiology.
How is the basic reproduction number (R₀) calculated?
R₀ is calculated as the ratio of the transmission rate (β) to the recovery rate (γ), expressed as R₀ = β/γ. It represents the average number of secondary infections caused by one infected individual in a fully susceptible population. An R₀ above 1 indicates the epidemic will spread, while below 1 indicates it will die out.
What do β (transmission rate) and γ (recovery rate) mean?
β (beta) represents the transmission rate, or the probability that a contact between a susceptible and infected person results in transmission. γ (gamma) is the recovery rate, equal to 1 divided by the average infectious period. For example, if the infectious period is 10 days, γ = 0.1, meaning 10% of infected individuals recover each day.
How does herd immunity relate to the SIR model?
In the SIR model, herd immunity is reached when enough of the population is immune (through recovery or vaccination) that R₀ × S/N < 1, causing infections to decline. The herd immunity threshold is 1 - 1/R₀. For COVID-19 with R₀ of 2.5, approximately 60% immunity is needed.
What are the limitations of the SIR model?
The classic SIR model assumes homogeneous mixing, constant transmission rates, no latent period, lifelong immunity after recovery, and no population birth or death. Real-world diseases often require extended models like SEIR (adding Exposed), SIRS (waning immunity), or age-structured models for more accurate predictions.
What is a typical R₀ for common infectious diseases?
Typical R₀ values vary widely: seasonal influenza 1.2-1.6, COVID-19 (original) 2.5-3.0, smallpox 3.5-6, polio 5-7, measles 12-18, and pertussis (whooping cough) 12-17. These values depend on population density, social behavior, and mitigation measures.
Can I use this SIR calculator for real-world disease modeling?
This calculator provides a simplified educational SIR model using Euler's numerical method. While it demonstrates epidemic dynamics effectively, real-world public health decisions require more sophisticated models that account for age structure, spatial distribution, non-pharmaceutical interventions, and stochastic effects. Always consult epidemiologists for policy decisions.
What is the epidemic curve and why does the infected population peak?
The epidemic curve shows the number of infected individuals over time. Infections peak when the number of susceptible individuals drops enough that each infected person infects fewer than one new person on average. After the peak, infections decline because susceptible depletion outweighs new transmissions, leading to the epidemic's natural end.