SIR epidemic model coding in Octave
see details coding in SSBTR Think Tank dated 2018 October 19.
Enjoy!!!
Below is the theoretical background.
It is an epidemic model. it is also called SIR model, proposed by Kermack and Mckendrick in 1927 when studying the propagation law of the Black Death in London from 1655-1666 and the plague in Mumbai in 1906.
The famous SIR model is as follow,
dS(t)/dt = − αS(t)*I(t),
dI(t)/dt = αS(t)*I(t) - βI(t), ------------------------------------------------- (1)
dR(t)/dt = βI(t).
where,
S(t) : susceptible individuals which has not yet infected, but may be infected by bacteria at time t
R(t) : number of the removed individuals at time t
α : infected rate
β : cure rate
A basic assumption of above model is that the birth and the death was not considered in a closed environment and there is no inflow and outflow in the system, then the total number of the individuals keeps constant. Further, it is supposed that the infected individuals have permanent immune capacity after the cure.
If the individuals suffer from a certain incurable epidemic, then the corresponding model degenerates to the following SI model,
dS(t)/dt = − αS(t)*I(t),
dI(t)/dt = αS(t)*I(t) - DI(t), ------------------------------------------------- (2)
where, D : death rate due to illness.
If the individuals suffer from a certain curable epidemic, but have no immune capacity after cure, then the corresponding model should be following SIS model,
dS(t)/dt = -αS(t)*I(t) + βI(t),
dI(t)/dt = αS(t)*I(t) - βI(t) - DI(t) ---------------------------------------- (3)
If the individuals suffer from a certain curable epidemic and have a temporary immune capacity after cure, there are a number of δR(t) removed will become infected again per unit time, then the corresponding model can be described by following SIRS model,
dS(t)/dt = -αS(t)*I(t) + δR(t),
dI(t)/dt = αS(t)*I(t) - βI(t), ------------------------------------------------ (4)
dR(t)/dt = -δR(t) + βI(t).
where δ : average immune period.
If the infected individuals have permanent immune capacity after the cure, then the corresponding model becomes following SEIR model,
dS(t)/dt = -αS(t)*I(t),
dE(t)/dt = -αS(t)*I(t) - ωE(t),
dI(t)/dt = - βI(t) + ωE(t), -------------------------------------------------- (5)
dR(t)/dt = βI(t),
where E(t) : incubation period when no infection happens
ω : average latency during which infected individuals transform to the manifestation of infection.