Abstract

In this study, two types of epidemiological models called “within host” and “between hosts” have been studied. The within-host model represents the innate immune response, and the between-hosts model signifies the SEIR (susceptible, exposed, infected, and recovered) epidemic model. The major contribution of this paper is to break the chain of infectious disease transmission by reducing the number of susceptible and infected people via transferring them to the recovered people group with vaccination and antiviral treatment, respectively. Both transfers are considered with time delay. In the first step, optimal control theory is applied to calculate the optimal final time to control the disease within a host’s body with a cost function. To this end, the vaccination that represents the effort that converts healthy cells into resistant-to-infection cells in the susceptible individual’s body is used as the first control input to vaccinate the susceptible individual against the disease. Moreover, the next control input (antiviral treatment) is applied to eradicate the concentrations of the virus and convert healthy cells into resistant-to-infection cells simultaneously in the infected person’s body to treat the infected individual. The calculated optimal time in the first step is considered as the delay of vaccination and antiviral treatment in the SEIR dynamic model. Using Pontryagin’s maximum principle in the second step, an optimal control strategy is also applied to an SEIR mathematical model with a nonlinear transmission rate and time delay, which is computed as optimal time in the first step. Numerical results are consistent with the analytical ones and corroborate our theoretical results.

1. Introduction

Seasonal and pandemic influenza A virus (IAV) infection causes severe morbidity and mortality worldwide [1]. There are many drugs to treat influenza, but the immune system is naturally the first defensive line against the disease. Therefore, it is essential to understand the mechanisms that trigger the immune system response and how this response affects the overall spread of the disease. The innate immune response plays an important role in the control and clearance of pathogens following viral infection inside an individual’s body. However, in the majority of virus-infected individuals, the innate immune response is insufficient because viruses use different evasion strategies to escape the immune response. Innate immunity plays a critical role in the control of viral infection because most infectious pathogens are eliminated through innate immune response without necessarily requiring the activation of adaptive immunity [2].

Since innate immunity is an important part of the body for dealing with viral infections, some methods have been determined to model different aspects of the human immune system. Differential equation models are the most popular methods to simulate critical diseases’ immunological and epidemiological dynamics [3]. In addition, the use of mathematical modeling of the innate immune response interpreting experimental results has made a significant contribution to this field. Many mathematical models of the immune response to IAV infection have been introduced that considered both different aspects of the immune system and different detail levels. The first mathematical model to illustrate the within-host dynamic of IAV in infected mice was developed in 1976 by Larson et al. [4]. The proposed compartmental model includes seven compartments with five associated rate parameters. Also, the virus population dynamic was introduced in mathematical terms. Another model introduced by Bocharov and Romanyukha [5] studied immune responses to viral infections in human infections, such as the influenza A virus, and considered 12 immune populations. Also, Baccam et al. [6] described the viral kinetics of influenza A during infection in the human body, including target cell and the innate interferon response with delayed virus production through infected cells. However, as opposed to previous papers, which did not consider a complete model of the innate immune system, we used a more comprehensive one adapted from [7].

However, the disease’s impact within the community and the relationship between people in society also need to be examined. Mathematical models are instrumental in explaining and quantifying epidemic dynamics. Hence, various mathematical models have been proposed in the following for between-hosts epidemic models to provide a general overview of strategies to be employed in the period of influenza virus infection. Kermack and McKendrick created one of the simplest types to explain epidemic dynamics that is called SIR (susceptible, infected, and recovered individuals, respectively). The proposed model was described in three papers in 1927 [8], 1932 [9], and 1933 [10]. Moreover, in [11], another type of epidemic model (SIS) is considered with a nonlinear incidence rate and time delay. In addition, four different control strategies are investigated and compared, including optimal control to decrease the density of infected individuals, increase that of susceptible ones, and reduce relevant costs. Besides these, in [12], a model of the relationship between two types of systems is formulated and analyzed. The first dynamic is the within-host model dynamic and focuses on cellular interactions. The second is the between-hosts model dynamic that focuses on transmission and infection statuses that are governed by the susceptible-exposed-infected-recovered (SEIR) model. Likewise, in this study, motivated by the previous paper, a combined model with different relationships is presented that will be discussed in detail in the following sections. The authors in [13] have used the sliding mode control on the SEIAR dynamic to overcome the uncertainty of parameters. However, they have not considered the optimal time to eradicate the infection in society, and they only refer to the between-hosts dynamic. For this reason, since time is one of the priorities in order to control disease, we use an optimal control strategy to get the optimal time to cure the infected person and recover the susceptible person.

Optimal control is a mathematical method derived from the calculus of variations. There are different methods for computing the optimal control for mathematical models [14]. Pontryagin’s maximum principle, first formulated in 1956 by L. S. Pontryagin [15], is to calculate the optimal control for an ordinary differential equation model system with a given constraint. In [16], an optimal control method is applied to a generic model of a pathogenic attack on the innate immune system. The minimization of a quadratic cost function is generated by numerical optimization. Terminal optimal time control is also investigated. For further studies, the readers are referred to [2], and the references therein introduce an optimal control model based on an ordinary differential equation system. Some studies have investigated the optimal control of SIR and SEIR models, but we mention just some of them in the following. The authors in [17] used an optimal control approach to an SIR epidemic model with a time delay to minimize the spread of infected individuals and maximize the number of susceptible and recovered individuals. Likewise, in [18, 19], optimal control is considered to minimize the level of infection at the terminal time for an SIR and SEIR model, respectively, where the incidence rate is an unspecified nonlinear function, while their models only consider one aspect of the impact of the disease that affects the community and the relationship between susceptible, infected, and recovered people. They do not take into account the effects of the disease inside the body, and the relationship between cells is not considered.

Epidemic mathematical models can be used for several epidemic diseases like COVID-19 by modifying the parameter and adding or eliminating some states. In this regard, the authors in [20] considered a SEIAR epidemic model for the COVID-19 pandemic. Also, some new SIR-type models are introduced in [2124]. The authors in [21] have considered “isolated,” “vaccinated,” and “quarantined” people groups due to several different conditions (after and before vaccine development). Moreover, “hospitalized” and “ICU-admitted” people groups are introduced in [22] to express the spread of coronavirus between the healthcare workers. Also, in [23], a new epidemic model (called SIDARTHE) is studied that considers the distinction between diagnosed and nondiagnosed infected individuals with and without symptoms detected acutely symptomatic infected ones. Besides, the discrete-time SEIR epidemic models can be used in such studies instead of continuous ones [25, 26], to name a few. To further study about optimal control with time delay, readers refer to [2731] and references therein.

Optimal control theory can be used to control other diseases like HIV [32] and especially COVID-19. In this regard, the authors in [33] used optimal control theory based on the SQEIAR epidemic model (Susceptible, Quarantined, Exposed, Infected, Asymptomatic, and Recovered) for the eradication of infection considering quarantine and treatment policies in China and Spain for different types of disease (COVID-19, Ebola, and influenza). Also, according to travel between cities that cause an increase in the outbreak, the authors in [33] investigated the impact of travel or immigration and impulsive change of population. These changes lead to generate impulsive epidemic models and impulsive control strategies [34]. Also, the authors in [35] have considered an optimal control strategy in the age-structured SEIRQ model for the COVID-19 epidemic in Brazil, where the quarantine entrance parameters are the control efforts of the system. In the same way, to explore the dynamic of the COVID-19 pandemic in Pakistan, the necessary optimality conditions are introduced in [36] using the optimal control theory in a mathematical model. Some optimal control strategies with application to COVID-19 are also introduced in [37], for further study.

This paper investigates the correlation between two modeling aspects: the effect of the disease on society and inside the individual’s body, which is an important issue. The community includes four groups (SEIR), all of which relate to each other in a community. All communications occur only in the community and among individuals. In contrast, there are some interactions among the cells inside an individual’s body. Recovering the susceptible by vaccination takes time that is considered as delay caused by the length of converting the healthy cells into resistant-to-infectious cells. Also, the infected people need to be treated with antiviral treatment to recover, which is also considered as a delay (the length of time to kill the infected and partially infected cells and viruses and convert the healthy cells into resistant-to-infection cells simultaneously).

The goal of the present paper will be presented clearly and thoroughly regarding the reviewed papers. This paper introduces a multiscale model in which both innate immune responses (within-host model) and the SEIR dynamic (between-hosts model) are used simultaneously to define a single system. A multiscale-type model has already been presented in [12], with the difference that the proposed model in the present study is more comprehensive and concisely describes the relationships between the virus, cells, and the immune system. The model is also more realistic and closer to the real world. Moreover, a nonlinear sinusoidal transmission rate (contact rate) is considered, which varies in time according to changes in contacts between people throughout day and night. In this study, the optimal control is used to eradicate the infection at the optimal time in the community. As discussed in Introduction, different papers have been published on the subject of optimal control. However, to the best of the authors’ knowledge, an optimal control approach that simultaneously tackles both types of dynamics (within-host and between-hosts) for epidemic models has never been considered in the literature before.

1This paper is organized as follows. Section 2 describes the preliminaries. After that, we propose an innate immune response dynamic in Section 3. The optimal control of innate immune response is introduced in Section 4, followed by the SEIR dynamic model with delay and nonlinear transmission rate in Section 5. In Section 6, we apply optimal control of the SEIR epidemic model. The results of simulations of different cases and sensitivity analysis are presented in Section 7. Finally, Section 8 summarizes the conclusions.

2. Preliminaries

In this section, we first look at the relationship between the two models considered in this paper. According to Figures 1 and 2, our multiscale model considers two scales: the first is the interaction of the virus and innate immune response within a host (inside the body), and the second is the contact between susceptible, exposed, infected, and recovered individuals in society. The dynamic of the innate immune response and relationship between cells and other components are now described in detail. The within-host model dynamic is the innate immune response to the influenza virus using a mathematical model. This model is based on interferon-induced resistance to infection of respiratory epithelial cells and the clearance of infected cells by natural killers with seven state variables (the numbers of healthy (), partially infected (), infected (), and resistant-to-infection cells () and IFN-I molecules ([IFN]), natural killer cells , and virus particles ). Also, a nonlinear epidemiological model for influenza is given where the nonnegative state variables , and are the susceptible, exposed, infected (symptomatic), and recovered compartments, respectively. Here, represents the number of people that are susceptible but not infected with influenza, denotes the number of people exposed to influenza (infected but not yet infectious), denotes the population of infected humans with infectious influenza symptoms, is the number of recovered people from influenza, and is the total population size. The relationship between the two epidemic models is shown in Figures 1 and 2. The dynamics of the innate immune response and epidemiological model is described further in the following sections.

The general strategy for this study is described by the following Algorithm 1.

Step1. Optimal control design (vaccination strategy) for within-host model to convert healthy cells to resistant-to-infection cells in the optimal time .
Step2. Optimal control design (antiviral treatment strategy) for within-host model to convert healthy cells to resistant-to-infection cells at the same time as destroying the virus particles in the optimal time .
Step3. Optimal control design for between-hosts model to eradicate the infection, considering delays in the community.

3. The Innate Immune Response Dynamic Model

In this section, we consider innate immune system dynamics for dealing with the influenza virus, which is derived from [7]. There are seven components to the dynamic states, and the following equations govern the dynamics. For brevity, we suppress the notation “” for variables at the current time. where is the number of healthy cells that increase with cell growth rate . These cells become partially infected cells via the virus particles with rate . They also convert to resistant-to-infection cells by the rate with IFN-I molecules that increase by the rate of . Partially infected cells are in the eclipse phase. This means that they cannot spread the virus in the body and they infect the other healthy cells by the term . When the partially infected cells pass through the eclipse phase, they will become infected cells and can spread the virus and cause other healthy cells to become infected. Partially infected and infected cells are destroyed by natural killers at a rate of . Once the cells are infected , they broadcast thousands of similar cells a day, which is denoted by the parameter . The natural death rates of healthy, infected, infection-resistant cells, and IFN-I molecules are denoted byand respectively, and the clear rate of virus particles is . The number of NKs (natural killers) increases with a constant cell growth rate . In the same way, NKs die at the rate of . After inflammatory stimulation caused by infected cells, natural killers are recruited from the blood indicated by . Figure 3 shows a schematic diagram of the innate immune system response to the influenza virus, which shows the cells’ relation very well.

After introducing the model, we now introduce the controller and investigate how to influence the vaccine and antiviral treatment on the cells. As mentioned earlier, the vaccination is used to make healthy cells resistant to infection in a susceptible person’s body and by using the antiviral treatment, the virus particles, infected, and partially infected cells are removed inside the infected body as discussed in detail in the next section.

3.1. Equilibrium Points and the Basic Reproduction Number

To determine the disease spread and the number of secondary infections, an infected individual would produce in his/her infectious period the most important threshold criterion named “the basic reproduction number” can be calculated as the follows.

According to the definition of , where is calculated as .

The disease-free equilibrium point is calculated by equating Equations (1)–(7) to zero and solving for as . To find the endemic equilibrium point , Equations (1)–(7) are equated to zero, , , , , , and . Therefore, by replacing the states, the following equations can be calculated: , , , , , , and . The last equation has four solutions that one of them is and can be achieved by . The other three solutions are obtained using the parameter values in Table 1, one of which is , and the other two solutions are negative and unacceptable, because the number of cells is a positive value. Therefore, the other equilibrium points are given as , in which, , , , and .

Then, the Jacobian of Equations (1)–(7) is given by

Theorem 1. The DFE is locally stable if while it is unstable if .

Proof. By calculating the seventh-order characteristic equation of about its DFE and according to the Routh-Hurwitz criterion, the following inequality must be satisfied: Therefore, it can be concluded that For , there exists a positive eigenvalue for the characteristic equation and the equilibrium point is unstable.

Theorem 2. The EE is locally stable if and unstable if .

Proof. In the same way and by calculating the characteristic equation of about its EE and according to the negative eigenvalues obtained from Jacobian, the EE is stable if , otherwise it is unstable.

3.2. Sensitivity Analysis

In this subsection, the sensitivity of is investigated. Therefore, to check the sensitivity, , we have

It can be concluded that is directly related to the change of parameters , , , , and . That is, if the parameters , , andincrease by 10%, also changes accordingly (10%) and is inversely related to the parameters and .

3.3. Positivity Analysis

In this subsection, the positivity of solutions is investigated with Theorem 3.

Theorem 3. If , and , then solutions of the model are positive for all

Proof. According to the positivity of all the parameters of the model, Equation (4) can be written as . Multiplying into two both side gives ; then, integrating from to gives . Therefore is positive . In the same way, the other states and (Equations (5)–(7)) are also positive states and can be written as and According to the positivity of and and according to Equation (3), ; therefore, Similarly, and . Therefore, all solutions are positive.

3.4. Existence of Solutions

In this subsection, the existence of solutions is investigated with Theorem 4.

Theorem 4. The proposed model with the initial conditions and has a unique solution.

Proof. The model can be rewritten as where and diag and .
The function satisfies Assumed that all parameters have the maximum value which is a bounded value: Replacing by and similarly for others, Therefore, The maximum value of states is equal to (bounded value); therefore, It can be concluded that . Therefore, , where . Thus, is uniformly Lipschitz continuous, and the solutions exist.

4. Optimal Control of Within-Host Epidemic Model

Optimal control techniques are used to improve optimal strategies to control numerous kinds of diseases. The flexibility and relative simplicity of optimal control techniques can lead to the development of the optimal strategies to control the monitoring and treating of various kinds of diseases [14]. Therefore, the optimal control theory is applied to the innate immune dynamic in this part of the paper. In the first subsection, the optimal control is used to vaccinate susceptible people and cure infected people.

4.1. Vaccination Strategy

In this subsection, the optimal control is applied to the innate immune response to convert healthy cells to resistant-to-infection cells. The vaccine works with the innate immune to develop protection (immunity) to the disease. This subsection is aimed at minimizing the number of healthy cells by converting them to resistant-to-infection cells with the control input (vaccination) at a rate of in the optimal time. It is obvious that injecting a vaccine into the susceptible person’s bodies takes time to vaccinate them (recovered) against the disease. Unlike [13, 19], in the current paper, this time is considered as a delay in moving susceptible people to the recovered people group in the society, which is investigated in Section 5 in detail. As long as the healthy cells have not become resistant-to-infection cells in the susceptible body, the person has not been vaccinated against the disease, and there is still a risk of infection. The above description is given by the following model:

Figure 3 shows the diagram of the within-host dynamic model with vaccination. The susceptible individual’s body does not have the virus, infected, or partially infected cells. Therefore, the goal is to convert healthy cells into resistant-to-infection cells using the vaccination strategy in the optimal time.

Therefore, the optimal control problem is to minimize the cost (objective) function applied to Equations (18)–(24) given by in which a free terminal time is investigated, which gives a minimum duration of a vaccination. represent the duration of the vaccination. is a positive increasing function such that . In other words, the vaccination strategy is applied using the optimal control in optimal time such that where is control and is the set of admissible controls defined by

The necessary conditions for optimality are expressed by where or is vector of constant values (the final value of all states is known). The gradient is the derivative of . is unknown but is defined; therefore, . Also, a stationarity condition on the control is as follows: which are expressed using the Hamiltonian of the system. The Hamiltonian for the control problem is defined as follows: where and .

Therefore, and , and are the adjoint functions to be determined suitably. Then, the necessary conditions are computed as follows:

Then, the necessary conditions for optimality are computed, which are expressed by the mentioned Hamiltonian equations [38]. These equations include a linear, ordinary differential equation that are shown by

In order to derive the necessary conditions for this optimal control, the Pontryagin maximum principle [39] is applied to characterize the optimal control problem and the optimal final time, which is given as the following theorem.

Theorem 5. Given an optimal control , solutions , and for the optimal control problem . Then, there are adjoint variables , and that satisfy with transversality conditions as As a result, an optimal control is given by and the optimal final time is given by

Proof. Using Pontryagin’s principle, the adjoint equations and transversality conditions are obtained such that and using the optimality conditions, the optimal control is solved as in the following form: Thus, the control law is written as Using the property of the control space, the following equation is obtained: so, the optimal control is characterized as Now, according to Equation (28) and knowing , the optimal final time is computed using the following equation: Therefore, using the characterization of the optimal control, the following optimality system is presented to obtain the optimal control and the state. This optimal control problem consists of the state system Equations (18)–(24) with initial conditions at , the adjoint system Equations (34)–(40) with the final conditions Equation (41), and the characterization of the optimal control Equation (42). and the adjoint system is as follows: with , , , , , ,, , , , , , , , and which can be rewritten as in Equation (78). So, the proof is completed.

After examining the effect of the vaccine on the person’s body and the control strategy applied to the model for the best effect, it is necessary to investigate the efficiency of the optimal antiviral treatment strategy in an optimal time, which is considered in the following subsection.

4.2. Antiviral Treatment Strategy

This subsection is aimed at destroying the virus particles and converting healthy cells into resistant-to-infection cells simultaneously using the optimal antiviral treatment strategy. There are infected and partially infected cells within the infected individual’s body. Therefore, the control input (antiviral treatment) is used to eradicate the disease by converting healthy cells to resistant-to-infection cells at the rate of and destroying virus particles at a rate of . Figure 4 shows the conceptual flow diagram of the innate immune dynamics with the proposed control action (antiviral treatment). Moreover, the dynamic of the innate immune with antiviral treatment is considered as

To reach the proposed goal and minimize the cost of the optimal antiviral treatment strategy within an optimal duration, the following objective function with free terminal time has to be minimized: in which represent the duration of the antiviral treatment. is a positive increasing function such that . Also, to reach the optimal controls and an optimal terminal time , we considered where is the set of admissible controls defined by

Then, the necessary conditions for optimality are written as follows: in which is unknown while is fixed; therefore, . Then, the Hamiltonian for the control problem is defined as where , and are also the adjoint functions to be obtained. As discussed earlier, the following theorem is obtained to apply Pontryagin’s principle to the Hamiltonian.

Theorem 6. Given optimal control pair and solutions and for the optimal control problem , let , and be optimal state solutions with an associated optimal control pair . There are adjoint variables that satisfy the following equations: with transversality conditions: Furthermore, the optimal controls are given by and the optimal final time is given by

Proof. The adjoint equation and transversality conditions can be obtained using Pontryagin’s principle as similar to Equations (44)–(50). Then, by using the optimality conditions, the optimal controls are obtained using and . As a result, the control inputs are computed as Using the property of the control space, we obtain So, the optimal control is characterized as and according to Equation (74) and knowing that , the optimal final time is computed using the following equation: Therefore, using the characterization of the optimal control, we have the following optimality system to obtain the optimal states: and the adjoint equations are as follows: where , , , , , ,, , , , , , , and . Then, the proof is completed.

Remark 7. In the vaccination strategy, the healthy cells convert to resistant-to-infection cells using the proposed controller and their number converges to zero when and the rest remain at their initial zero value, while in the antiviral treatment strategy, in addition to converting healthy cells to resistant-to-infection cells, the virus particles decrease and converge to zero using the proposed controller. Meanwhile, the number of natural killers converges to the initial constant value. Then, after a while, Equation (59) becomes in which is constant and is considered as first-order linear differential equation that yields . As a result, converges exponentially to zero.

In this section, the effect of the optimal control on the within-host model is examined. At the same time, it is necessary to explore the controller’s influence on the between-hosts model (SEIR epidemic model). Thus, the impact of the delay computed in this section is discussed in the following section in detail.

5. SEIR Dynamic Model

In this section, a SEIR epidemic model is introduced with two additional properties. First is two time-delay that aroused from this fact that vaccination and antiviral treatment take time to impact a person’s body. Second is a nonlinear contact rate (transmission rate) function that is followed by this fact that the contact rate is varying throughout day and night. In this regard, the susceptible and infected individuals move to the recovered people group with time delays and (optimal times of vaccination and antiviral treatment within the body, which is computed in the previous section), respectively. The proposed SEIR epidemic model is presented as where . As shown in Figure 5, represents the number of susceptible individuals who are vulnerable and not infected, or exposed individual denotes the number of people that are infected but not infectious yet, signifies the population of infectious people with symptoms that can transmit the disease to others, and is the number of completely recovered (immune) people. is the total population size . is the rate of deaths from causes unrelated to the infection, and is the birth rate in each group, which is triple the mortality rate . is the vaccination time of susceptible people, and is the recovery time of infected people. In the case of births, in the susceptible, exposed, and recovered groups, newborns are susceptible to the disease and add to the susceptible group at the rate of . Fraction of the infected individuals’ infants goes to the infected compartment, and the others (fraction of infected individuals’ infants) move to the susceptible group. The exposed people get infected at a rate of , and infected people leave their compartment at the rate of .

The contact rate is that is purposefully variable throughout day and night. It is also obvious that this rate at night is higher than during the day, which makes it closer to the real world and is more effective in practice [40]. According to the basic definition of that is defined as “the average number of contacts between individuals in the population per unit time” [40], the contact rate must be more than one during the day due to the more relations between people in the community. Moreover, late at night and early in the morning, the transmission rate is less than one. Therefore, with trial and error and taking into account the assumptions below, the contact rate is obtained as . (a)00:00 midnight: (b)06:00 morning: (c)12:00 midday: (d)18:00 evening:

Thus, the contact rate is less than one late at night and at daybreak and is greater than one in the middle of the day because there are more social gatherings and offices and schools are also open.

In the next section, an optimal control is applied to the proposed model to overcome the disease outbreak.

6. Optimal Control of the Between-Hosts Epidemic Model

The aim of this section is twofold: first, minimizing the number of susceptible individuals and moving them to the recovered group by vaccination at a rate of in 25 days and second, moving the infected people to the recovered group at a rate of by antiviral treatment in 25 days, as shown in Figure 5. The SEIR dynamic model in the presence of the controller is presented as where for and for .

To this end, the optimal control strategy is used to achieve these goals. The objective function is considered as where , , and are gains of the infected, susceptible, and recovered individuals. Also, and are the gains of control inputs , and , respectively. Moreover, and are fixed. Tacking the Hamiltonian yields where , and are adjoint functions that satisfy the adjoint equations. Pontryagin’s maximum principle is applied to the Hamiltonian to derive the necessary conditions for the optimal control. The adjoint equation and transversality conditions are obtained by using Pontryagin’s maximum principle such that

Notice that the control can only influence the state variable on the time interval . Thus, it suffices to compute the optimal control on the interval . Therefore, we have which yields

Similarly, that can be written as which yields

So, the optimal controls are given as

Therefore, using the characterization of the optimal control and considering Equations (90) and (92), the following optimality system is obtained as

The adjoint equations are also obtained as where , , , , , , , , , , and .

Remark 8. According to the proposed controller, susceptible and infected persons converge to zero as ; then, Equation (83) becomes a first-order linear differential equation as in which is a positive constant and yields . Thereupon, converges exponentially to zero indirectly and as a result of zeroing infected and susceptible people.

After investigating the effect of the proposed controller on both models, the results of the controller actions should be illustrated. Therefore, the simulation results of the proposed work are outlined in the next section.

7. Simulation Results

In this section, a numerical simulation is given to prove the accuracy of the results obtained in the previous sections. First, the effect of the optimal controllers on the innate immune response and then on the SEIR epidemic model is assessed. The value of innate immune response parameters is based on experimental data from Hernandez-Vargas and Meyer-Hermann [7], and the parameter values of the SEIR epidemic model are and . The initial values of the SEIR epidemic model states and innate immune response model are shown in Tables 2 and 3, respectively.

This section is categorized as follows: (a)The influence of model parameters(b)The effect of the optimal controller on the within-host model. This section is divided into the following two subsections: (i)Within-host vaccination(ii)Within-host therapy(c)The effect of the optimal controller on the between-hosts model. This section is divided into the following two subsections: (i)Between-hosts vaccination(ii)Between-hosts therapy

7.1. Influence of Model Parameters

This section is aimed at conducting the sensitivity analysis to identify the factors that noticeably affect the number of people engaged in influenza. Therefore, the changes in the value of parameters andare investigated, respectively. The tremendous influence of contact rate cannot be neglected. The susceptible people get infected if they have more contact with infected people; as a result, the epidemic widely spreads. Thus, the contact rate has to be considered as a critical parameter in the epidemic containment process. To this end, the value of the contact rate is changed from to to observe its impact on the population size in each engaged group. As shown in Figures 6(a)6(d), by increasing in the value of contact rate to , as a result, the more contact between people, the number of susceptible people reduces regarding increment in the number of infected people, while the number of susceptible people does not decrease more because of the less contact between infected individuals . Obviously, the number of exposed and infected people decreases followed by nearly half decrement in the contact rate with susceptible people. Thus, few people get infected; as a result, few people have recovered.

In Figure 7, the impact of changes in the value of , which is the recovery rate of infected people, is presented. As shown in Figure 7(a), when the rate of is doubled, a greater number of susceptible people have recovered; as a result, fewer people get infected and the number of susceptible people is increased. Moreover, the number of infected people increases when the recovery rate decreases and decreases with increment in the value of recovery rate because more infected people are recovered. As a result, it is obvious that the number of recovered people is grown up followed by the rise in the recovery rate.

According to Figure 8, the exposed people are infected at a rate of ; therefore, increment in this rate leads to growth in the infected people number; as a result, there is growth in the number of recovered people. It is obvious that the number of susceptible people is decreased when increases.

As observed, for different values of and, the disease does not disappear in about 25 days; therefore, it is necessary to use vaccination and antiviral treatment strategies to overcome the epidemic. Thus, in the next sections, the model in the presence of vaccination and antiviral treatment is simulated compared to the model without the controller.

7.2. Optimal Control Results in the Within-Host Model

In the real world, susceptible people will not immediately become immune to the infection following vaccination because it takes time for all healthy cells (within the susceptible individual’s body) to become resistant-to-infection cells. Moreover, the destruction of the virus (and at the same time the transformation of healthy cells into resistant-to-infection cells) within the infected person’s body is not immediate with antiviral therapy; therefore, the infected person is treated after a while. To this end, two-time delay (the length of vaccination and antiviral treatment) is considered in the SEIR model.

7.2.1. Within-Host Vaccination

Vaccine injection into the susceptible individual’s body makes the healthy cells resistant-to-infection. Consequently, the susceptible individual, which includes healthy cells, will be recovered against the infection. Converting the healthy cells into the resistant-to-infection cells takes time, which is considered as delay in recovering process of susceptible individuals in the SEIR model. In Section 4, initially, the optimal time of healthy cells converting into resistant-to-infection cells in the susceptible individual’s body has been obtained. Numerical simulations suggest eight days as the optimal time to convert the healthy cells into the resistant ones in a susceptible person’s body (see Figure 9). The proposed optimal time will be considered as a delay of moving susceptible people to the recovered people group in the SEIR model in the next section.

Figures 10(a) and 10(b) show the effect of control input (vaccination) on the number of healthy and resistant-to-infection cells. There is a surge in the number of resistant-to-infection cells during vaccination in eight days. After vaccination, it can be deduced that rising in the resistant-to-infection cell numbers is associated with the reduction in the healthy cell numbers, indicating the controller efficacy. As mentioned, as the number of resistant-to-infection cells increases moment by moment, the susceptible person eventually becomes immune to the disease after eight days because the healthy cells in his/her body have all become resistant.

7.2.2. Within-Host Therapy

There are virus particles (as a result, infected and partially infected cells) in the infected person’s body. Therefore, the infected person needs to be treated with antiviral treatment. Thus, over the treatment process, the infected and partially infected cells and virus particles are killed, and the healthy cells become resistant-to-infection simultaneously, which also takes time.

In Figure 11, the final optimal time to eradicate disease computed in Section 4 is shown. As shown in Figures 12(a) and 12(b), using antiviral drugs, healthy cells become resistant-to-infection cells. The drug’s effect on infected and partially infected cells and viruses can also be seen in Figures 13 and 14, respectively. It is clear that the infected and partially infected cells are destroyed within six days, and the number of virus particles is also converged to zero, which indicates that the infected person is cured. Moreover, the evolution of IFN-I molecules and natural killer cells with and without the controller is shown in Figures 15(a) and 15(b).

7.3. Optimal Control Results between Hosts

In this section, we examine the effect of the optimal controller on the SEIR epidemic model, which was discussed in Section 7, in detail. First, the changes in the number of susceptible, exposed, infected, and recovered individuals in the absence of appropriate control are investigated. Then, the effect of the vaccination strategy and antiviral treatment on individuals in a community is examined. For the numerical simulations, the delay differential equation solver (dde23) is used. This solver does not solve the advance equations directly; therefore, it is necessary to convert the advance equations into delay differential equations. To this end, a new reversed-time variable is defined and new adjoint variables are introduced. Thus, this new system is solved numerically using dde23.

7.3.1. Between-Hosts Vaccination

As shown in Figures 16(a) and 16(b), the number of susceptible individuals in the absence of a controller (vaccination has not been applied) descends and converts to infected people. Eventually, it remains stationary at a constant value (less than 2,000 people). Besides, the number of recovered people without any controller is greater than their number in the control-based strategy. The number of recovered people has reached more than 10,000 because in the absence of effective treatment, more people become infected, and as a result, more people will be recovered. By injecting the vaccine into the susceptible person’s body, during the conversion of healthy cells to resistant cells, the susceptible person also vaccinates (direct transfer of individuals from the susceptible group to the recovered group). As a result, the number of susceptible individuals decreases and moves to the recovered individual group at the same time. This means the susceptible people vaccinate against the disease in almost 25 days (the healthy cells of the susceptible individual convert to resistant-to-infection cells in eight days as the delay time with vaccination), while in [13], the final time of the vaccination campaign of nearly 40 days is suggested without considering the delay in the vaccination of susceptible people.

7.3.2. Between-Hosts Therapy

When the infection spreads in the community without control over its prevalence, the number of infected people is increasing every day, as shown in Figure 17(a). It rose by over 3,000 people. Finally, their number decreases until the 25th day and reaches a little under 2,000 and remains unchanged, indicating the community’s disease persistence. Also, the exposed people number reaches a high number of 4,000 in only twelve days and ultimately converges to a stable population and remains at almost 1,500 (see Figure 17(b)).

In contrast, the number of infected people exceeds almost 500 with antiviral therapy, which is used to treat infected people (transfer them to a recovered group). During the computed optimal time (the same delay as six days), the healthy cells convert to resistant-to-infection cells; at the same time, virus particles are eradicated by antiviral treatment in the infected person’s body. Therefore, the infected people move to the recovered people group in almost 25 days. According to Remark 8, the number of exposed people also converges to zero as a result of decrement of infected people in 25 days.

8. Conclusion

In this paper, the optimal control theory was applied to two types of dynamic epidemic models: the innate immune response dynamic and the SEIR epidemic model. A nonlinear transmission rate and time delay were considered in the SEIR epidemic model. The aim of this paper was twofold: firstly, preventing the virus from spreading within the body of a host and secondly, curb the epidemic in the society and between hosts. To this end, two control strategies were introduced to satisfy the first goal in the susceptible and infected person’s bodies. In this regard, vaccination was used to convert healthy cells to resistant-to-infection cells inside the susceptible individual’s body that recovered them against the disease in society. In the following, antiviral treatment was used to reduce the concentration of viruses and convert healthy cells to resistant-to-infection cells at the same time inside the infected individual’s body to recover them. Moreover, to control the epidemic in society, the optimal control was used to increase the number of recovered people by reducing the number of susceptible and infected people in the fixed 25 days. Transferring occurred with a delay computed as the optimal time of disease eradication inside the infected individual’s body and the recovery of the susceptible individual’s body. Finally, numerical simulation was used to illustrate the usefulness of the obtained results.

Data Availability

The data used are included within the paper and cited accordingly.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

Acknowledgments

This work was supported in part by the Basque Government through project IT1207-19.