You can change infection rate (transmission rate) and see how spread is affected (flatten the curve). Infection rate = beta = number of social contacts x probability of contracting virus each contact. When we socially isolate we reduce beta and therefore spread.
An individual is infectious for approximately 7 days. During this time they pass covid19 to approximately 2.5 people. These 2 basic parameters determine the model dynamics.
Simulink model is of the following system of three odes:
dS/dt = -β(I/N)S
dI/dt = β(I/N)S – γI
dR/dt = γI
S = Number Susceptible Individuals
I = Number Infectious Individuals
R = Number Recovered Individuals
N= Total Population
β = Ep = Number Social contacts x probability of transmitting disease each contact = Infection rate
γ = Recovery Rate
Key scenarios of dynamics:
If, during 7 days of being infectious, a person passes to 1 person then the disease will not grow, i.e., number of infectious individuals stays the same.
If, during 7 days of being infectious, a person passes to 2 or more people the disease grows, i.e., number of infectious individuals grows.
If, during 7 days of being infectious, a person does not pass to another person (or, say 10 people are sick at exact same time and pass to 9 people over 7 days) the disease will reduce, i.e., number of sick individuals goes to zero.
As individuals recover, the number of susceptible people decline, and therefore spread slows and eventually reduces to zero.
Tom Beekhuysen (2020). SIR Math Model of Virus Spread (Coronavirus or other) (https://www.mathworks.com/matlabcentral/fileexchange/74697-sir-math-model-of-virus-spread-coronavirus-or-other), MATLAB Central File Exchange. Retrieved .
Very good submission. Shall set it up in VBA and try the model. See what I can learn out of it
please save and share it by "Previous Version"
Could you kindly share the code in Matlab?
Dear Tom Beekhuysen,
I have MatlabR2018b but couldn't open the file. I got a message saying that file has to be opened using Matlab2019b.
Can you help in this regard.
Thank you for your assistance.
Exported to R2018a.
Exported to version R2018a.
Updated beta and gamma based on more recent data.
Added notes in description and model about specific parameters to covid19. Typical individual is infectious 2-4 weeks. Rate of recovery is 25 days (3 weeks plus 4 days safety factor). Reported reproduction number is 2-3 (2.5).
Added note in slx model about when beta<gamma (infection rate is less than recovery rate) spread stops.
updated preview image
Exported to earlier version; 2018a.
Added system of odes to description and updated slx file