Math

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.

8 minLevel 3/3The interactive stage stays ad-free.
R₀3.50Peak infected36.0%Peak day23Final susceptible3.3%Day0

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

1

Susceptible people become infected at rate βSI. Infected people recover at rate γI.

2

The basic reproduction number R₀ = β / γ estimates how many people one infection would cause in a fully susceptible population.

3

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.