The following code finds the numerical solution to the following SIR model:
If we think of as the change in the susceptible population over one unit of time (a day), then is the rate of change of susceptibles per day. Let's drop the subscript notation and write Let's consider looking at time increments of half a day. Since is the rate of change of susceptibles per day, is the rate of change of susceptibles per half day. Let's think about this more generally... consider increments of , then ; t is the rate of change of susceptibles per whatever time increment you choose.
So, the code plots S,I,R over time using initial conditions and how the populations are changing over time.