This is a simple SIR model, built to reproduce the one that we made in InsightMaker.

This version also starts in a state that allows us to compare a discrete model with the solution of the differential equation, per De Vries, et al., A Course in Mathematical Biology.

Andy Long
Spring, 2018

Starting parameters from De Vries, et al. (p. 5, with graph on p. 6.):

Clear["Global`*"]

Manipulate[
lv=
NDSolve[
{(*  susceptible: *)
sus'[t]==ResusceptibleRate  rec[t]- InfectionRate sus[t] inf[t],
(* infected: *)
inf'[t]==InfectionRate sus[t] inf[t]-RecoveryRate inf[t],
(* recovered: *)
rec'[t]==RecoveryRate inf[t]-ResusceptibleRate  rec[t],
sus[0]==pop,
inf[0]==infected,
rec[0]==0
},
{sus[t],inf[t],rec[t]},
{t,0,tend}];
p1=ListPlot[Table[{ti/nsteps,infected(1-RecoveryRate/nsteps)^ti},{ti,0,nsteps*tend}]];
p2=Plot[Evaluate[{sus[t],inf[t],rec[t]}/.lv],{t,0,tend},
PlotRange->All,AxesOrigin->{0,0}];
Show[p2,p1],
{{lv,{}},None},
{{tend,15},2,2000,10},
{{nsteps,2},1,5,1},
{{infected,100},0,2000,10},
{{pop,0},0,2000,10},
{{RecoveryRate,0.3},0.0,.7,.01},
{{InfectionRate,0.008},0,.01,.001},
{{ResusceptibleRate,0.0},0,.1,.001}
]