N = S + I + R = const (conservation)
Drag β and γ to watch R₀ change in real time. Raise vaccination coverage until herd immunity kicks in. Compare COVID-19, influenza, and measles to see just how contagious each disease really is.
N = S + I + R = const (conservation)
The core SIR model is a set of coupled Ordinary Differential Equations (ODEs) that track the flow of people between three compartments: Susceptible (S), Infectious (I), and Recovered (R). The rate of new infections depends on the contact rate (β) and the probability that a contact is with a susceptible person (S/N).
$$ \begin{align*}\frac{dS}{dt}&= -\frac{\beta S I}{N}\\[6pt] \frac{dI}{dt}&= \frac{\beta S I}{N}- \gamma I \\[6pt] \frac{dR}{dt}&= \gamma I \end{align*}$$β is the transmission rate (per day). γ is the recovery rate (per day); its inverse, 1/γ, is the average infectious period. N is the total constant population (S + I + R = N).
From these equations, we derive the critical threshold for herd immunity and the basic reproduction number R₀. The outbreak peaks when the effective reproduction number R_t = R₀ * (S/N) falls to 1.
$$ R_0 = \frac{\beta}{\gamma}, \quad \text{Herd Immunity Threshold}= 1 - \frac{1}{R_0} $$R₀: Basic reproduction number. If R₀ > 1, epidemic grows. Herd Immunity Threshold: The fraction of the population that must be immune (via recovery or vaccination) to stop sustained transmission. For measles (R₀=15), over 93% must be immune.
Public Health Policy & Vaccination Campaigns: This model is the bedrock for planning vaccine rollout. Officials use it to calculate the coverage needed to achieve herd immunity for diseases like measles, mumps, and polio. During the COVID-19 pandemic, SIR and SEIR models were used daily to project hospital bed needs and evaluate the impact of social distancing (which lowers β).
Pharmaceutical & Clinical Trial Planning: Drug companies use epidemic models to forecast the potential market size for a new vaccine or antiviral drug. They also model trial outcomes in different transmission scenarios to determine optimal trial size and location.
CAE & Computational Simulation: The ODEs in the SIR model are solved numerically using Runge-Kutta methods—the exact same solvers used in engineering CAE for simulating car crashes (structural dynamics), airflow over a wing (CFD), and chemical reactions in a battery. This simulator is a direct example of using computational methods to solve a real-world "physics" problem of population dynamics.
Economic Impact Forecasting: Governments and financial institutions couple SIR model outputs with economic models to estimate the cost of outbreaks and the economic benefit of intervention measures. This helps in weighing the cost of a lockdown against the projected healthcare cost of an unmitigated wave.
When you start using this simulator, there are a few key points to keep in mind. First, understand that "the basic reproduction number R₀ is not an absolute constant." For example, the R₀≈2.5 for COVID-19 is a value based on an environment where people interact normally. In reality, measures like avoiding crowds or wearing masks will lower the effective reproduction number R_t. In this tool, lowering the "infection rate β" simulates precisely the effect of such interventions.
Next, consider the realism of your parameter settings. For instance, setting the "recovery rate γ" to 1/5 (=0.2) implies an average infectious period of 5 days, but this often refers to the entire symptomatic period. The actual "period of being contagious" might be shorter. If tweaking parameters produces unrealistic curves (e.g., where the number of infected individuals I exceeds the total population N), get into the habit of reviewing your settings.
Finally, hold the understanding that "the herd immunity threshold is not the goal." While reaching a threshold like 60% will stop the epidemic, what matters is the magnitude of the infection peak (the healthcare burden) that occurs before that point. For example, relying solely on natural infection without vaccination could lead to over 20% of the population being infected simultaneously at the peak, potentially causing healthcare system collapse. A practical way to use this simulation is to observe how increasing the vaccination rate can alleviate the "peak pressure."
Model an influenza outbreak: population 500,000, initial infections 50, β=0.25 (contact rate), γ=0.33 (recovery rate 3 days). Without vaccination, R₀ ≈ 0.75, peak occurs at day 45 with 89,500 concurrent infections and 32% attack rate. Introducing 60% vaccination coverage reduces peak to 21,000 infections by day 38; at 70% vaccination (above flu's herd immunity threshold of 60%), peak drops below 8,000. Measles requires 95% coverage due to R₀≈12–18.