Simulation of deterministic compartmental models for infectious diseases dynamics

Infectious diseases are caused by pathogenic microorganisms and can spread through different ways. Mathematical models and computational simulation have been used extensively to investigate the transmission and spread of infectious diseases. In other words, mathematical model simulation can be used to analyse the dynamics of infectious diseases, aiming to understand the effects and how to control the spread. In general, these models are based on compartments, where each compartment contains individuals with the same characteristics, such as susceptible, exposed, infected, and recovered. In this paper, we cast further light on some classical epidemic models, reporting possible outcomes from numerical simulation. Furthermore, we provide routines in a repository for simulations.


Introduction
Infectious diseases have caused epidemics with devastating effects, for instance influenza A virus sub-type H1N1 [1] and smallpox [2]. Infectious disease with pandemic potential is one of the greatest challenges of the health system. Recently, the World Health Organization declared COVID-19 [3,4] as a pandemic. The mortality depends on many factors such as number of infected people, virulence, and prevention efforts [5]. Various infectious diseases can come in waves, e.g., the first three waves of avian influenza A (H7N9) virus circulation [6]. Kissler et al. [7] projected that recurrent outbreaks of COVID-19 will probably happen.
Epidemiological models [8] have been proposed to analyse the spread of infectious diseases in host populations [9]. In 1760, Bernoulli [10] proposed a model to describe the impact of variolation. In 1906, a mathematical model to explain the epidemic of measles was introduced by Hamer [11].
The SI model [12] describes the evolution of susceptible S and infected I individuals, respectively. A model * kiarosz@gmail.com was proposed by Ross [13] in 1916 for malaria. In the Ross model, known as SIS model [14], susceptible become infected and infected recover without immunity. Kermack and McKendrick [15] introduced a model, known as SIR model, in which the removed can be recovered, immune, or dead. The SIRS model [16] was obtained when a waning immunity was incorporated. In the SEIR model [17] there are four states, where E corresponds to exposed, namely a latency period is considered. It has been applied to measles [18] and rubella [19]. The SEIRS model [20] considers individuals that are transferred from the recovered to the susceptible compartments.
One of the different types of controls of epidemic is the vaccination. The vaccination controls have as main objective to remove by immunity the population from the susceptible state [21]. Gao et al. [22] demonstrated that pulse vaccination can be an effective strategy for the elimination of infectious diseases. Investigating the transmission of tuberculosis by means of epidemiological models, Liu et al. [23] reported that mixed vaccination gives a rapid control.
When there is no vaccine for the infectious disease, the control strategies are based on quarantine and isolation, for instance the COVID-19 epidemics [24]. Law et al. [25] studied a time-varying SIR model for the transmission dy-namics of COVID-19. Prem et al. [26] reported that the magnitude of the epidemic peak can be reduced through sustained physical distancing. Feng [27] analysed the final and peak epidemic sizes considering quarantine and isolation in SEIR models. Recently, Boldog et al. [28] analysed the risk assessment of novel coronavirus outbreaks outside China by means of an extension of a standard SEIR model. Stochastic mathematical models have been considered in prediction of the spread of several infectious diseases [29]. The law of mass-action has been used for almost a century in epidemiology to describe the contact rate of individuals. This law originated in practice and theory of chemical reaction kinetics [30]. Tomé and Oliveira [14] presented models for epidemic spreading and showed the analogy between the spreading of a disease with a critical phase transition. They also analysed the epidemic curve, which is a graphical representation of the number of identified cases over a period of time.
In this work, we focus on the simulation of different deterministic models that have been used to describe infectious disease dynamics. We provide routines in a repository [31] to assist students with their first steps about computer simulations of mathematical models in epidemiology. The reader can find mathematical details in Ref. [14]. We show the dynamical behaviours predict by some mathematical models, such as SI, SIS, SIR, SIRS, SEIR, and SEIRS. We present an application of the SIR model in COVID-19 for the parameters obtained from China according to Ref. [32]. Considering the SEIR model, we show the impact of easing restriction on the infection rate that was reported in Ref. [33].

The SI model
The SI model describes the dynamical behaviour of transmitted diseases [34] with interactions among infected and susceptible people. In this model, vital processes are not considered, such as rates of birth and mortality.  The SI model is given by where N = S + I is the total population and β is the effective contact rate of the disease. Figure

The SIS model
In the SIS model [35,36], which was studied recently [14,29], the infected individuals can become susceptible, however, there is no long-lasting immunity. Due to this fact, an individual can have recurrent infections, such as common cold (rhinoviruses) and influenza, as well as sexually transmitted diseases, for instance chlamydia and gonorrhoea. In Fig. 3, we see a schematic representation of the compartment diagram related to the SIS model. The SIS model is written as where the infected individual goes to the susceptible state with a rate δ. In Fig. 4, we consider β = 0.1 and δ = 0.01 for N = 1000. The SIS model has two stable equilibria, one for I = 0 and another for I = N (1 − δ/β).

The SIR model
In 1927, Kermack and McKendrick [15] proposed the SIR model, a mathematical model of spread of an infectious disease within a population, studied recently [14,29].  The SIR model was introduced to explain the rapid increase of infected individuals, as verified in epidemics such as the cholera and the plague. The mathematical model is given by where γ is the recovery rate and N = S + I + R. The behaviour of the infectious class has a dependence on the parameter R 0 = β/γ, known as reproduction ratio. R 0 is an important threshold quantity that describes the transmissibility or contagiousness of pathogenic microorganisms [37]. In a susceptible group of individuals, it gives the expected number of secondary cases of infections due to an infected individual. The pathogenic microorganism is able to invade the population of susceptible individuals if R 0 > 1. The births and deaths are not considered due to the fact that the infection and recovery rates are fast. Figure 6 shows the time evolution (in days) of S (blue line), I (red line), and R (green line) for N = 1000, β = 0.2, and γ = 0.05. As initial conditions, we consider S(0) = 995 and I(0) = 5. We see that the infected population reaches a peak while the susceptible individuals decrease and recovered ones increase. After the peak, the number of infected individuals decreases. In 2020, the SIR model was utilised by Cooper et al. [32] to study the spread of COVID-19 in different communities. They analysed data recorded between January and June 2020 from China, South Korea, India, Australia, Italy, and the state of Texas in the USA. It was demonstrated that the SIR model can provide a theoretical framework to study how the COVID-19 virus spreads within communities. Figure 7

The SIRS model
The SIRS model has been studied by various authors [38,39] and studied recently [14,16,29]. Figure 8 exhibits the process diagram for the SIRS model. In this model, the recovery can generate temporary immunity, and as a consequence the recovered individuals return to the susceptible class after some time. The loss of immunity is observed in smallpox, tetanus, and influenza.
The SIRS model is given by where δ is the rate in which the recovered individuals return to the susceptible class after losing the immunity and N = S + I + R. In Fig. 9, the blue, red, and green lines correspond to the time evolution (in days) of S, I, and R, respectively. We see the persistence of the infected population due to the transfer of individuals from the recovery class to the susceptible one.

The SEIR model
One of the compartmental models of infectious diseases is the SEIR model, studied recently [14,29]. In this model, the individuals are separated into four compartments. The SEIR model assumes people in the susceptible (S), exposed (E), infected (I), and recovered (R) states, as shown in Fig.  10.
The people move from S to E due to direct or indirect contact. In the E stage, the people are infected but are not infectious, namely an latent period. The infected individuals are recovered. The SEIR model was used by Carcione et al. [40] to simulate the COVID-19 epidemic.
The SEIR model is written as Figure 10: Compartment diagram of the SEIR model, where S, E, I, and R are the numbers of susceptible, exposed, infected, and removed individuals, respectively, β (in units of 1/day) is the infectious rate, ω (in units of 1/day) is the coefficient of migration rate, and γ (in units of 1/day) is the rate in which the infected individuals recover.
where β is the coefficient of infection rate, ω is the coefficient of migration rate of latency, γ is the coefficient of migration rate, and N = S + E + I + R is the total population. Figure 11 displays the temporal evolution (in days) of S (blue line), E (black line), I (red line), and R (green line) for β = 0.5, γ = 0.01, ω = 0.1. Initially, S decreases and E, I, and R increase. S is depleted by the epidemic and goes to zero. Both E and I exhibit peaks and R saturates when they go to zero. Recently, Souza et al. [33] considered the SEIR model to analyse the impact of easing restriction on the infection rate during COVID-19 pandemic. They included a parameter related to the restriction r in the SEIR model, β → β(1 − r). By increasing r, the peak of infectious is delayed and the curve peak is flattened, as shown in Fig.  12(a). Figure 12(b) shows that changes in the value of r can generate a second wave, namely the increase of the number of infected individuals after few cases.

The SEIRS model
In the SEIRS model, the susceptible individuals first go through the exposed class before infected one. After the infectious, they are transferred to the recovered compartment and become susceptible again, as shown in Fig. 13. Denphedtnong et al. [41] used the SEIRS epidemic model to describe the spread of diseases by transports. They investigated the data of SARS (severe acute respiratory syndrome) outbreak in 2003. The SEIRS model is given by where δ is the rate in which the recovered individuals return to the susceptible class after losing the immunity. In Fig. 14, we calculate S (blue line), E (black line), I (red line), and R (green line) for N = 1000, S(0) = 995, I(0) = 5, β = 0.5, ω = 0.1, γ = 0.1, and δ = 0.03. We see that the susceptible, exposed, and infected individuals do not go to the value equal to zero over time. This occurs due to the fact that recovered individuals become susceptible again.

Conclusions
Investigations about infectious diseases play a crucial role in reducing negative consequences and improving the recovery of individuals. Scientists have been carried out research in epidemiology to understand how the people are affected by transmissible diseases over time. Many different mathematical models were proposed to find epidemiological parameters and manners to prevent illness.
In this work, we present some mathematical models that have been used to describe the dynamical behaviour of infectious diseases. The models are based on individuals that are separated into compartments, such as susceptible (S), exposed (E), infected (I), and recovered (R). They focus on the prediction of the population growth or reduction in each compartment. The models depend on the parameters related to the rate in which individuals are transferred between the classes.
The SI model considers that the individuals go from the susceptible to infected states, while the SIS model assumes that there is no immunity and the infected individuals return to the susceptible compartment. In the SIR and SIRS model, it is included the class of the recovered individuals. The SEIR and SEIRS models have not only the susceptible, infected, and recovered individuals, but also the exposed ones. Recently, the SIR and SEIR models have been used in studies about the COVID-19 epidemic. The SIR, SIRS, SEIR, and SEIRS models exhibit a peak of infected people that was observed in different infection spread.
It has been demonstrated that through the intensity of restrictions associated with the control policies to reduce the infection spread, it is possible to flat the curve associated with the temporal evolution of the infected people [33]. However, the results depend on the duration and specific time in which the restriction is applied. The peak of infections can be reduced by means of restrictions or another peak can appear after suspending the restrictions.
We provide routines in a repository for the SI, SIS, SIR, SIRS, SEIR, and SEIRS models [31].