Improvement of SEIR Epidemic Dynamics Model and Its Matlab Implementation

: In the context of resuming education, the application of infectious disease dynamics models can describe the transmission mechanism of infectious disease viruses. This article is based on the SEIR infectious disease dynamics model, and based on the description of the entire process of susceptible individuals from infection to isolation and transformation, establishes an infectious disease dynamics model suitable for analyzing the evaluation of rehabilitation and death populations. At the same time, this article introduces two major influencing factors, namely intervention and control by schools or governments, and virus mutation, to discover changes in the population in various states in the model. This change provides favorable strategies for guiding infectious disease prevention and control. The algorithm simulation shows the feasibility of the proposed method in the risk assessment of infectious diseases, which can provide theoretical decision-making basis for controlling the spread of diseases and also provide theoretical basis for the decision to resume work, production, and study. This risk assessment is not only applicable to COVID-19, but also can play the role of risk assessment in various epidemics.


Introduction 1.Research Background and Significance
Severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) is the pathogen of coronavirus disease COVID-19, which first appeared in Wuhan, China at the end of December 2019.By February 2020, it had been declared a pandemic.The COVID-19 pandemic has overwhelmed the healthcare systems of most countries and caused significant economic losses.Virus transmission usually occurs through respiratory droplets, with main symptoms including fever, cough, difficulty breathing, muscle pain or fatigue.
In recent years, as the epidemic has worsened, universities across the country have adopted different methods of epidemic prevention and control to start classes.With the opening of classes, student gatherings, increased exposure, and the risk of coronavirus transmission have also increased.The consequences of the second outbreak of the epidemic caused by the start of school are also particularly serious.How to effectively prevent and control the resumption of school and ensure the physical health and life safety of students and teachers is an extremely important issue [1].Therefore, in the context of the resumption of schooling, this paper applies the infectious disease dynamics model to describe the transmission mechanism of the novel coronavirus epidemic, and this model is also suitable for other infectious diseases.

Current Research Status at Home and Abroad
In December 2019, COVID-19 pneumonia cases began to appear in Wuhan, Hubei, China.On January 24, 2020, the National Health Commission of the People's Republic of China confirmed that this novel coronavirus can be transmitted from person to person [2].In response to public health incidents caused by the spread of the epidemic, Wuhan has suspended all transportation and tens of thousands of residents have been required to undergo quarantine at home.With the spread of the epidemic, many cities in China have also implemented quarantine measures and stopped all recreational activities.
During the emergency period of the epidemic, the strictest control measures taken by the Chinese government have now brought the epidemic in China to a controllable stage.We need to review the outbreak process of the epidemic, further analyze the effectiveness and sensitivity of various control measures, and quantitatively evaluate the role of implemented prevention and control policies.Currently, many scholars are studying the impact of public health interventions on epidemic control from different perspectives [3][4][5].The SEIR susceptibility Exposed disease removal model is one of the most popular mathematical models for infectious disease dynamics today, which can be used to evaluate the effectiveness of various intervention and control strategies and plays a key role in various infectious disease models [6].Some studies quantitatively evaluated the impact of COVID-19 transmission and control work on the Chinese epidemic, and the author found that the incubation period and duration of the illness period are important simulation parameters in the SEIR model [7].However, these studies did not consider the proportion of recure and deceased populations.Therefore, in order to improve the SEIR model, this article introduces the recure and dead populations related to the quarantine state [8][9][10].During the outbreak stage of the epidemic in China, the prevention and control measures implemented in Wenzhou have attracted the attention of the whole country.Many migrant workers have gone to Wenzhou, resulting in many imported cases, with an estimated number of people returning to work and school reaching 20000.In addition, many local people were infected in the early stages of the epidemic outbreak.Faced with this challenge, the Wenzhou health department has introduced a series of active and effective measures to control the epidemic.In July 2020, the Wenzhou Municipal Health Commission reported that the number of local cases had dropped to zero, with no increase in local cases for 14 consecutive days, indicating that the epidemic has been basically under control.At the same time, in order to evaluate the effectiveness of epidemic prevention measures, many studies only focus on the comprehensive evaluation of all prevention and control measures or the role of only one measure.A person proposed a SEIR model, which, although considering the use of population mobility as an influencing factor to simulate the development of the epidemic, did not consider the impact of epidemic intervention and control, as well as virus variation, on the model [11].Another scholars simulated the spread of novel coronavirus in China, and confirmed the impact of travel restrictions in Wuhan, China.Maier and Brockmann used a simpler susceptibility disease removal (SIR) model to study the utility value of various prevention and control measures in China in controlling the spread of COVID-19 [12,13].Based on the above issues, this article considers two major influencing factors: school epidemic intervention and control, and virus mutation, further confirming the effectiveness and rationality of our model.At the same time, this article aims to model the time delay of COVID-19 transmission dynamics based on the improved SEIR model, quantitatively evaluate the control measures implemented during the epidemic, and provide reference for epidemic prevention and control in China and even globally.

The Main Research Content of the Paper
This article divides the paper into four parts, and the following is a brief explanation of the content of these four parts: The first is the introduction, which mainly introduces the research background and significance of the article, elaborates on the current situation at home and abroad, and then provides the framework of the main research content of this paper.
The second is to introduce the basic knowledge and algorithms related to this paper, specifically the SIR and SEIR models related to infectious disease dynamics models, in order to introduce the algorithm and model of this paper.
Thirdly, introduce the model method used in this article, and add certain deterministic parameters to improve the accuracy of the algorithm to optimize it.At the same time, introduce two influencing factors: school control and virus mutation to verify the effectiveness and rationality of the algorithm.Secondly, evaluate our algorithm model in order to be applied in practice.
The fourth is conclusion and outlook.Summarize the algorithm in this article and provide some prospects for future work.
The main purpose of this paper is to concretize the R (removed state) in the original SEIR model into a recur state R and a dead state D, forming a new model -the SEIDR model.At the same time, it introduces two influencing factors: school control and virus mutation, in order to predict and evaluate the probability of these risks as much as possible within the limited functionality.

SIR Related Theories of Infectious Disease Dynamics Model
In the past period, major universities have adopted a strict management method of strict entry and exit at the beginning of the school year.Therefore, the entire school can be regarded as a closed warehouse, and the spread of the school epidemic can be described using a warehouse dynamics model.The most common infectious disease model is the SIR model [14][15][16].The SIR model categorizes the population in a certain epidemic area into the following three categories: 1. Susceptibles, denoted as S(t), which refers to the population that has not yet been infected at time t but is highly likely to be infected by already infected individuals; 2. Infected individuals, denoted as I(t), refer to the population who have been infected with the virus at time t and have the ability to transmit the disease; 3. Removed, denoted as R(t), refers to the population that has been removed from the diseased category at time t, which may be a recovered population or a population that has already died without being recure.
The SIR model is a very simple model.This model is based on the following three basic conditions: (1) It does not pay attention to the birth rate and mortality rate of the population, nor does it consider factors such as population inflow and outflow.Assuming that many people are in a closed area, such as a strictly controlled school environment after the start of school, the total population in the school is a constant that remains constant, that is, S(t)+I (t)+R(t)=K (a constant that remains constant).( 2) Anyone who comes into contact with a susceptible population must have the ability to transmit the virus.Here, assuming that the probability of a susceptible person being infected with the virus within a unit time at time t is b, which is directly proportional to the susceptible person S(t).Therefore, the number of people infected with all the susceptible individuals (i.e.new cases) within a unit time at time t is bS(t)I(t).(3) At time t, the number of diseased individuals converted to removed isolators per unit time is directly proportional to the number of diseased individuals, with a probability of c, which is called the removal rate.Therefore, the number of displaced individuals per unit time is cI(t).Based on the above three basic conditions, the process of susceptible individuals from illness to removal can be described in Figure 1 below:

SEIR Related Theories of Infectious Disease Dynamics Model
The infectious disease dynamics model SEIR is a further improvement of the most basic infectious disease dynamics model SIR, often used in infectious diseases with a certain incubation period [17][18][19].The standard SEIR epidemiological model has four components: susceptibility S, exposed E, disease I, and removed R (including cure and death).Represents the total number of people.Similarly, "Susceptible" refers to individuals who are not infected but are susceptible to infection after contact with infected individuals."Exposed" refers to asymptomatic individuals carrying the virus."Infected" refers to patients who have indeed been infected with the virus and tested positive for their nucleic acid.'Removed' refers to the group of people who have recovered or have died without being recure.Over time, all individuals in the model will have these four roles.The SEIR model has certain limitations for practical situations, but it provides a basic model for studying different types of epidemics.
This work aims to use a new SEIR model to predict the development of the epidemic under different quarantine restrictions.Finally, the model was modified based on the known transmission characteristics of COVID-19, as well as school intervention and virus mutation.In order to have a good connection with our model, we changed the SEIR in the classic model to SEIQ, which is quarantined, denoted as Q(t), indicating the number of people who have recovered or died from the patient population category at time t.The merging of the recure state R and the dead state D into one is called the quarantine state Q, and its kinetic equation can be expressed as:

Algorithm Model Framework
This article divides the quarantine state Q into two parts: the recure state R and the dead state D. Among them, there is a probability that c in the diseased state I will become the recure state R, and there is a probability that j will become the dead state D. The dead state refers to a person who has already died due to infection with the virus, and the recure state refers to a person who has obtained antibodies and will not be infected again.The dynamic logic diagram is shown in Figure 3: Firstly, the algorithm for susceptibility states is shown in the following formula: (3) Among them, S(t) is referred to as the number of people who may not have contracted the virus during time t, while I(t) is the number of people who have already contracted the virus and shown relevant symptoms and have the ability to infect others during time t, that is, the number of people who are in a sick state.E(t) refers to the number of people who have already been infected with the virus but are temporarily unable to infect others during the t time, which is the number of people in the incubation period.A represents the probability of susceptible individuals being infected by Exposed individuals, while b represents the probability of susceptible individuals being infected by diseased individuals.By using this formula, we can determine how many susceptible individuals will become Exposed and diseased at a certain time, as Exposed and diseased individuals are derived from susceptible individuals, so we need to subtract the proportion of the two states.
Afterwards, let's take a look at the algorithm for Exposed states: Among them, d is the probability of Exposed individuals transforming into diseased individuals.Because the Exposed person is transformed from the susceptible person, the transformed part needs to be added, but there is still a part that transforms into the sick person, so the part that transforms into the sick state needs to be subtracted.Once again, let's take a look at the algorithm for pathological conditions: Among them, c represents the probability of a sick person becoming a quarantine person.By using this formula, we can determine how many susceptible individuals directly become diseased, how many Exposed individuals become diseased, and how many diseased individuals become isolators at a certain time.Finally, let's take a look at the algorithm for isolators: Among them, Q(t) Represent Q as the number of people in the removed state at time t, that is, the number of people in the quarantine state.By using this formula, it is possible to determine how many diseased individuals have become removed at a certain time, as after being removed, they will not be infected with the virus again for a period of time.Therefore, these four states can form a closed loop.
Although the above four formulas can already roughly demonstrate the embryonic form of the algorithm, they are not particularly perfect.Therefore, this article further strengthens and improves this algorithm by adding the average number of contacts to the sick and Exposed individuals.Meanwhile, the quarantine state Q is specifically divided into two parts: the recur state R and the dead state D. As mentioned earlier, there is a probability that c in the diseased state I will become a recure state R, and a probability that j will become a dead state D. Therefore, this article refers to the optimization algorithm as the SEIDR algorithm.After adding the above data, equation (3.1) can be changed to: Equation ( 4) can be changed to: Equation ( 5) can be changed to: Equation ( 6) can be transformed into two equations: In this way, the inclusion of two states of death and recure, as well as the average number of daily contacts between sick and Exposed individuals, can to some extent improve the accuracy of the algorithm and make it closer to theoretical values.The overall dynamic equation is:

Experimental Result
The experimental results of the SEIQ model and SEIDR model are shown in Figure 4 and Figure 5: As shown in the above figure, this article found that between 12 and 13 days, infected individuals I and Exposed E will reach their peak, while susceptible individuals S will continue to decrease.However, after 13 days, the quarantine state will continue to rise, and diseased individuals I and Exposed E will gradually approach zero.From the figure 5, it can be seen that the quarantined person Q is divided into the recure person R and the deceased person D, which intuitively shows that the probability of cure is much higher than the probability of death.It can also be observed that both the Exposed person and the sick person reach their peak in 12-13 days, and the recure person and the deceased gradually stop growing after about 40-60 days, and stop growing after 60 days.Prove that this model is indeed derived from the Q-state separation in the SEIQ model, which uses the recure state R and the death state D to represent the quarantine state.Therefore, this enables the chart to represent the changes in the five states over a certain period of time with higher accuracy.

Algorithm Analysis
Consider the addition of two influencing factors, the first being school control.In situations where the impact of infectious diseases is relatively severe, schools will use different methods and measures to control them, and their different methods and measures will affect certain parameters.For example, if schools take measures to limit personnel contact, it will directly affect the number of susceptible individuals and the number of recure individuals in the model per unit time.This model assumes that the simulation starts to restrict personnel contact on the third day, that is, the parameters k1 and k2 in the model decrease after three days.The operation results shown in Figure 6 are as follows: Figure 6: SEIDR infectious disease dynamics model with school control influencing factors added From the figure 6, it can be seen that around the 12th to 13th day, the growth rate of diseased states significantly decreases and the Exposed state increases, but the two peaks are basically similar, indicating that school management and intervention have to some extent reduced the occurrence of diseased states and increased the situation of the Exposed state directly transforming into a healing state.
Another influencing factor is virus mutation.According to the time span, COVID-19 has undergone two major mutations.For example, in the impact of this Covid-19 epidemic, from the initial strain, the later variant to the more infectious Delta strain, and the later Omikron strain, its infectivity has gradually become stronger, but its mortality has gradually decreased.Considering the impact of viral mutations, during the transmission of infectious diseases, the virus will undergo mutations, resulting in changes in its infectivity and mortality rate.Therefore, introducing virus mutations in the time dimension will directly affect the infection rate and mortality rate in the model.Assuming that the mutation occurs from the 30th day, during which the mortality rate decreases and the infectivity increases, and a secondary mutation occurs from the 60th day, the mortality rate further decreases and the infectivity further strengthens.Based on this, Figure 7 is obtained: From the Figure 7, it can be seen that the number of deaths has indeed decreased compared to the previous chart, but due to the mutation, there was a small increase in the diseased state between 30 and 60 days, and the recure state also had a small increase during these two periods.The dead state did not increase after the 30 day mutation, indicating that the mutation did increase infectivity and reduce lethality.Compared with the above chart, this chart is more accurate and can more accurately express the risk of COVID-19 epidemic at the beginning of school.
The algorithm in this article mainly contributes to the following aspects: (1) The proposed model takes into account the healing state R and the death state D, thus more in line with the COVID-19 infectious disease dynamics model.
(2) Based on the addition of two influencing factors, the chart can more clearly display the current situation of the epidemic in a time dimension, allowing medical professionals to quickly grasp the direction of the virus.

Summary
This article first introduces two classic infectious disease dynamics models, and then introduces multiple variables to examine the epidemic patterns of infectious diseases from the perspective of partial differential equations.Thus, the established model is more in line with reality and can better study the epidemic patterns of infectious diseases.In recent years, especially since the outbreak of the COVID-19 epidemic, China has suppressed the epidemic very well, including the risk assessment of the COVID-19 epidemic.Although the COVID-19 epidemic has ended, this risk assessment is not only applicable to COVID-19, but also can play the role of risk assessment in various epidemics.In the future environment, risk assessment will become increasingly valuable and meaningful, and it is certain that within a limited time, this field will make significant progress.These models will also become more complex, adding more factors that we cannot add, greatly improving accuracy, and making effective prevention and prediction for future epidemics, enabling correct risk assessment.Although this paper is mainly about COVID-19, the model built in it is an epidemic dynamics model.If the parameters set are different, the results will be very different.Therefore, not only COVID-19, but also most epidemics can be controlled and predicted by adjusting the parameters, so as to prevent the spread of the virus before the outbreak.So, in the future environment, through the efforts of scholars, this model can ultimately make risk assessment more accurate, and also make the construction of the model more perfect.It will also make risk assessment more valuable and meaningful.

Figure 1 :
Figure 1: SIR Model Then, establish an equilibrium equation for the population change rate of each warehouse, and obtain the following model:

Figure 2 :
Figure 2: SEIQ Model 3. Construction of Dynamic Algorithm for Re-education Risk Assessment in the Post Epidemic Era of COVID-19

Figure 3 :
Figure 3: SEIDR Model This article first lists the algorithm models of SEIQ and further optimizes them into SEIDR models.

54 1 k
represents the average number of contacts per day for each patient, and 2 k represents the average number of contacts per day for each Exposed individual.

Figure 4 :
Figure 4: Epidemic Dynamics Model of SEIQ Model

Figure 5 :
Figure 5: Epidemic Dynamics Model of SEIDR Model

Figure 7 :
Figure 7: Epidemic Dynamics Model of SEIDR with Factors Influencing Virus Mutation