Biology · Mathematics · simulator made with AI

Epidemic and vaccination

The SIR model divides the population into Susceptible, Infected, and Recovered. Move the controls and find out why vaccinating part of the class also protects those who were not vaccinated.

How many people, on average, one infected person infects in an unprotected population.
Average time until the person recovers and stops spreading it.
Share of the population immunized before the first case.
Approximate values, for teaching purposes.
Susceptible Infected Recovered Vaccinated
—
sick at the same time, at the peak
—
day of the peak
—
caught the disease in total

The math behind it

S, I, and R are fractions of the population, from 0 to 1 (0.3 = 30% of the people). The symbol Δ means "how much it changes from one day to the next."

1

Each day, the population changes like this

ΔS=−β·S·I

The susceptible go down: each meeting between a susceptible person and an infected one can become a new case.

ΔI=β·S·Iin−γ·Iout

New cases come in; those who recover go out.

ΔR=γ·I

Those who recover become immune and do not catch it again.

2

The two numbers of the model

γ=1days sick=17≈0.14

γ (gamma): the fraction of the sick who recover each day.

β=R0·γ=3·0.14≈0.43

β (beta): the strength of contagion per day.

3

When does the epidemic grow?

When more cases come in than go out:

β·S·I>γ·I ⟹ R0·S>1

(dividing both sides by γ · I and remembering that β / γ = R₀)

Vaccinating a fraction v of the population takes those people out of S. The epidemic stops growing when

R0·(1−v)≤1⟹v≥1−1R0
Now: 1−13≈0.67 → you need to vaccinate 67%. You are at 0%.
The plain-language request that generated this simulator
Create an interactive simulator in a single HTML file (HTML, CSS, and
JavaScript together, no external libraries and no server), in English.

TOPIC: the SIR model of epidemics, with vaccination.
FOR WHOM: 11th grade students, Biology and Mathematics.
WHAT THE STUDENT CAN CHANGE: R₀, days sick, and % vaccinated; buttons with
  examples for flu, mumps, and measles.
WHAT APPEARS ON SCREEN: a chart of the S, I, and R curves over 180 days,
  the infection peak, the day of the peak, and the total number of people
  who got sick.
QUESTION THE SIMULATOR HELPS ANSWER: why does vaccinating part of the
  population protect those who were not vaccinated?
EXTRAS: a message that tells when vaccination has passed the herd immunity
  threshold, the equations explained step by step with the current values
  of the controls, large fonts for projecting in class, light and dark mode.