All published worksheets from http://sagenb.org
Image: ubuntu2004
SIR epidemic model (Kermack-McKendrick)
In this model, there are three classes of individuals: Susceptible, Infected, and Recovered (or Removed). Susceptible individuals are infected at a rate of β times the number of infected individuals, I. Infected individuals recover at a rate of ν. Vital dynamics have been added using the parameter μ, which is the rate at which new susceptibles are introduced and susceptibles, infecteds, and recovereds are depleted (birth and death rate).
This demo plots the number of infected (red) and susceptible (blue) individuals over time, as well as a phase plot (fraction of susceptibles vs fraction of infecteds) in green. You can set β, ν, and the initial number of susceptible and infected individuals.