SIR Epidemic Model
The SIR model splits a population into susceptible, infected, and recovered groups. Adjust β and γ to see how R₀, the peak, and the final outbreak size change.
Cyan is susceptible, rose is infected, green is recovered. R₀ = β / γ. When R₀ > 1 the infection can grow; lowering β or raising γ flattens the peak. The outbreak slows once enough people have moved to the recovered group.
What you are seeing
Susceptible people become infected at rate βSI. Infected people recover at rate γI.
The basic reproduction number R₀ = β / γ estimates how many people one infection would cause in a fully susceptible population.
When R₀ > 1, infections can grow. Reducing β or increasing γ lowers and flattens the peak.
Why it matters
SIR is the starting point for epidemic modeling, vaccination strategy, and public-health planning. It shows why early action and transmission reduction matter so much.
Complexity & details
Simulating T days with step h costs O(T/h). The model has three state variables and two parameters.
Frequently asked questions
What does R₀ mean?+
It is the average number of secondary infections caused by one infected person in a fully susceptible population. R₀ > 1 allows an outbreak to grow.
Why does the curve fall before everyone is infected?+
As susceptible people become immune, the effective reproduction number drops below 1. This is herd immunity.