key: cord-0749080-krt9sycn authors: Sereno, J. E.; D’Jorge, A.; Ferramosca, A.; Hernandez-Vargas, E. A.; González, A. H. title: Model predictive control for optimal social distancing in a type SIR-switched model date: 2021-12-31 journal: IFAC-PapersOnLine DOI: 10.1016/j.ifacol.2021.10.264 sha: 1aef404d66ff9478c1c025e14ebfbcadcf366620 doc_id: 749080 cord_uid: krt9sycn Social distancing strategies have been adopted by governments to manage the COVID-19 pandemic, since the first outbreak began. However, further epidemic waves keep out the return of economic and social activities to their standard levels of intensity. Social distancing interventions based on control theory are needed to consider a formal dynamic characterization of the implemented SIR-type model to avoid unrealistic objectives and prevent further outbreaks. The objective of this work is twofold: to fully understand some dynamical aspects of SIR-type models under control actions (associated with second waves) and, based on it, to propose a switching non-linear model predictive control that optimize the non-pharmaceutical measures strategy. Opposite to other strategies, the objective here is not just to minimize the number of infected individuals at any time, but to minimize the final size of the epidemic while minimizing the time of social restrictions and avoiding the infected prevalence peak to overpass a maximum established by the healthcare system capacity. Simulations illustrate the benefits of the aforementioned proposal. Since its first outbreak in 2019, the novel coronavirus, named as SARS-CoV-2, has paralysed the world social and economic activities. The associated disease, named as COVID-19, widely infected the world population. Considering that initial cases were reported on December 31, 2019, in Wuhan, Chinese province of Hubei, by the date of march 31, 2020, the World Health Organization declared the COVID-19 disease as a pandemic and subsequently, SARS-CoV-2 virus reached the vast majority of countries around the world (WHO (2020)). As a response, governments tackled this first pandemic outbreak by applying social control measures known as Non-Pharmaceutical Interventions (NPIs). These are associated to measures such as social-distancing policy, face-mask requirement, university and school closure, and telework assignment. Certainly, these measures have proved their efficacy to lessens the disease transmission; however, their detrimental effects on social and economic activities have also been showed (Ferguson et al. (2020) ; Flaxman et al. (2020) ; Ngonghala et al. (2020) ). The way the aforementioned measures are decided relies on the so-called SIR-type epidemiological models. SIR-type models are based on the seminal work of ker-mack and McKendrick (Kermack and McKendrick (1927) ), which firstly established a compartmental relationship between the main variables of an epidemic: Susceptible (S), Infected (I) and Removed (C) individuals, and includes parameters that can be externally modified, as the transmission and recovery/death rates β and γ. Even when several extensions of the original model have been made (to include additional states describing new subcompartments (e.g., Giordano et al. (2020) )), the epidemiological objectives always aims to minimize three main indexes (Di Lauro et al. (2021) ): the total fraction infected (or final size of the epidemic, 1 − S(∞)), the peak of I (or infected peak prevalence) and the average time of the infection. Both, the minimization of infected peak (Sadeghi et al. (2020) ; Federico and Ferrari (2020) ; Morris et al. (2021) ) and the epidemic final size (Bliman and Duprez (2021) ; González et al. (2021) ) were proposed as control objectives in the context of single-interval control strategies; i.e., simple control strategies consisting in a fixed control action that reduces the transmission rate for a finite period of time. One step ahead are the optimal-control-based strategies, that consider a more complex sequence of control actions, together with explicit constraints on both, manipulated and controlled variables. In (Morato et al. (2020)) Model predictive control for optimal social distancing in a type SIR-switched model J.E. Sereno * A. D'Jorge * A. Ferramosca * * E.A. Hernandez-Vargas * * * A.H. González * Since its first outbreak in 2019, the novel coronavirus, named as SARS-CoV-2, has paralysed the world social and economic activities. The associated disease, named as COVID-19, widely infected the world population. Considering that initial cases were reported on December 31, 2019, in Wuhan, Chinese province of Hubei, by the date of march 31, 2020, the World Health Organization declared the COVID-19 disease as a pandemic and subsequently, SARS-CoV-2 virus reached the vast majority of countries around the world (WHO (2020)). As a response, governments tackled this first pandemic outbreak by applying social control measures known as Non-Pharmaceutical Interventions (NPIs). These are associated to measures such as social-distancing policy, face-mask requirement, university and school closure, and telework assignment. Certainly, these measures have proved their efficacy to lessens the disease transmission; however, their detrimental effects on social and economic activities have also been showed (Ferguson et al. (2020); Flaxman et al. (2020) ; Ngonghala et al. (2020) ). The way the aforementioned measures are decided relies on the so-called SIR-type epidemiological models. SIR-type models are based on the seminal work of ker-mack and McKendrick (Kermack and McKendrick (1927) ), which firstly established a compartmental relationship between the main variables of an epidemic: Susceptible (S), Infected (I) and Removed (C) individuals, and includes parameters that can be externally modified, as the transmission and recovery/death rates β and γ. Even when several extensions of the original model have been made (to include additional states describing new subcompartments (e.g., Giordano et al. (2020) )), the epidemiological objectives always aims to minimize three main indexes (Di Lauro et al. (2021) ): the total fraction infected (or final size of the epidemic, 1 − S(∞)), the peak of I (or infected peak prevalence) and the average time of the infection. Both, the minimization of infected peak (Sadeghi et al. (2020) ; Federico and Ferrari (2020) ; Morris et al. (2021) ) and the epidemic final size (Bliman and Duprez (2021) ; González et al. (2021) ) were proposed as control objectives in the context of single-interval control strategies; i.e., simple control strategies consisting in a fixed control action that reduces the transmission rate for a finite period of time. One step ahead are the optimal-control-based strategies, that consider a more complex sequence of control actions, together with explicit constraints on both, manipulated and controlled variables. In (Morato et al. (2020)) Model predictive control for optimal social distancing in a type SIR-switched model Since its first outbreak in 2019, the novel coronavirus, named as SARS-CoV-2, has paralysed the world social and economic activities. The associated disease, named as COVID-19, widely infected the world population. Considering that initial cases were reported on December 31, 2019, in Wuhan, Chinese province of Hubei, by the date of march 31, 2020, the World Health Organization declared the COVID-19 disease as a pandemic and subsequently, SARS-CoV-2 virus reached the vast majority of countries around the world (WHO (2020)). As a response, governments tackled this first pandemic outbreak by applying social control measures known as Non-Pharmaceutical Interventions (NPIs). These are associated to measures such as social-distancing policy, face-mask requirement, university and school closure, and telework assignment. Certainly, these measures have proved their efficacy to lessens the disease transmission; however, their detrimental effects on social and economic activities have also been showed (Ferguson et al. (2020); Flaxman et al. (2020) ; Ngonghala et al. (2020) ). The way the aforementioned measures are decided relies on the so-called SIR-type epidemiological models. SIR-type models are based on the seminal work of ker-mack and McKendrick (Kermack and McKendrick (1927) ), which firstly established a compartmental relationship between the main variables of an epidemic: Susceptible (S), Infected (I) and Removed (C) individuals, and includes parameters that can be externally modified, as the transmission and recovery/death rates β and γ. Even when several extensions of the original model have been made (to include additional states describing new subcompartments (e.g., Giordano et al. (2020) )), the epidemiological objectives always aims to minimize three main indexes (Di Lauro et al. (2021) ): the total fraction infected (or final size of the epidemic, 1 − S(∞)), the peak of I (or infected peak prevalence) and the average time of the infection. Both, the minimization of infected peak (Sadeghi et al. (2020) ; Federico and Ferrari (2020) ; Morris et al. (2021) ) and the epidemic final size (Bliman and Duprez (2021) ; González et al. (2021) ) were proposed as control objectives in the context of single-interval control strategies; i.e., simple control strategies consisting in a fixed control action that reduces the transmission rate for a finite period of time. One step ahead are the optimal-control-based strategies, that consider a more complex sequence of control actions, together with explicit constraints on both, manipulated and controlled variables. In (Morato et al. (2020)) Model predictive control for optimal social distancing in a type SIR-switched model Abstract: Social distancing strategies have been adopted by governments to manage the COVID-19 pandemic, since the first outbreak began. However, further epidemic waves keep out the return of economic and social activities to their standard levels of intensity. Social distancing interventions based on control theory are needed to consider a formal dynamic characterization of the implemented SIR-type model to avoid unrealistic objectives and prevent further outbreaks. The objective of this work is twofold: to fully understand some dynamical aspects of SIR-type models under control actions (associated with second waves) and, based on it, to propose a switching non-linear model predictive control that optimize the nonpharmaceutical measures strategy. Opposite to other strategies, the objective here is not just to minimize the number of infected individuals at any time, but to minimize the final size of the epidemic while minimizing the time of social restrictions and avoiding the infected prevalence peak to overpass a maximum established by the healthcare system capacity. Simulations illustrate the benefits of the aforementioned proposal. Keywords: Epidemic Control, Stability analysis, Switched System, Disease control, Model Predictive Control. Since its first outbreak in 2019, the novel coronavirus, named as SARS-CoV-2, has paralysed the world social and economic activities. The associated disease, named as COVID-19, widely infected the world population. Considering that initial cases were reported on December 31, 2019, in Wuhan, Chinese province of Hubei, by the date of march 31, 2020, the World Health Organization declared the COVID-19 disease as a pandemic and subsequently, SARS-CoV-2 virus reached the vast majority of countries around the world (WHO (2020)). As a response, governments tackled this first pandemic outbreak by applying social control measures known as Non-Pharmaceutical Interventions (NPIs). These are associated to measures such as social-distancing policy, face-mask requirement, university and school closure, and telework assignment. Certainly, these measures have proved their efficacy to lessens the disease transmission; however, their detrimental effects on social and economic activities have also been showed The way the aforementioned measures are decided relies on the so-called SIR-type epidemiological models. SIR-type models are based on the seminal work of ker-mack and McKendrick (Kermack and McKendrick (1927) ), which firstly established a compartmental relationship between the main variables of an epidemic: Susceptible (S), Infected (I) and Removed (C) individuals, and includes parameters that can be externally modified, as the transmission and recovery/death rates β and γ. Even when several extensions of the original model have been made (to include additional states describing new subcompartments (e.g., Giordano et al. (2020) )), the epidemiological objectives always aims to minimize three main indexes (Di Lauro et al. (2021)): the total fraction infected (or final size of the epidemic, 1 − S(∞)), the peak of I (or infected peak prevalence) and the average time of the infection. Both, the minimization of infected peak (Sadeghi et al. (2020) ; Federico and Ferrari (2020); Morris et al. (2021) ) and the epidemic final size (Bliman and Duprez (2021) ; González et al. (2021) ) were proposed as control objectives in the context of single-interval control strategies; i.e., simple control strategies consisting in a fixed control action that reduces the transmission rate for a finite period of time. One step ahead are the optimal-control-based strategies, that consider a more complex sequence of control actions, together with explicit constraints on both, manipulated and controlled variables. In (Morato et al. (2020)) Model predictive control for optimal social distancing in a type SIR-switched model Abstract: Social distancing strategies have been adopted by governments to manage the COVID-19 pandemic, since the first outbreak began. However, further epidemic waves keep out the return of economic and social activities to their standard levels of intensity. Social distancing interventions based on control theory are needed to consider a formal dynamic characterization of the implemented SIR-type model to avoid unrealistic objectives and prevent further outbreaks. The objective of this work is twofold: to fully understand some dynamical aspects of SIR-type models under control actions (associated with second waves) and, based on it, to propose a switching non-linear model predictive control that optimize the nonpharmaceutical measures strategy. Opposite to other strategies, the objective here is not just to minimize the number of infected individuals at any time, but to minimize the final size of the epidemic while minimizing the time of social restrictions and avoiding the infected prevalence peak to overpass a maximum established by the healthcare system capacity. Simulations illustrate the benefits of the aforementioned proposal. Since its first outbreak in 2019, the novel coronavirus, named as SARS-CoV-2, has paralysed the world social and economic activities. The associated disease, named as COVID-19, widely infected the world population. Considering that initial cases were reported on December 31, 2019, in Wuhan, Chinese province of Hubei, by the date of march 31, 2020, the World Health Organization declared the COVID-19 disease as a pandemic and subsequently, SARS-CoV-2 virus reached the vast majority of countries around the world (WHO (2020)). As a response, governments tackled this first pandemic outbreak by applying social control measures known as Non-Pharmaceutical Interventions (NPIs). These are associated to measures such as social-distancing policy, face-mask requirement, university and school closure, and telework assignment. Certainly, these measures have proved their efficacy to lessens the disease transmission; however, their detrimental effects on social and economic activities have also been showed The way the aforementioned measures are decided relies on the so-called SIR-type epidemiological models. SIR-type models are based on the seminal work of ker-mack and McKendrick (Kermack and McKendrick (1927) ), which firstly established a compartmental relationship between the main variables of an epidemic: Susceptible (S), Infected (I) and Removed (C) individuals, and includes parameters that can be externally modified, as the transmission and recovery/death rates β and γ. Even when several extensions of the original model have been made (to include additional states describing new subcompartments (e.g., Giordano et al. (2020) )), the epidemiological objectives always aims to minimize three main indexes (Di Lauro et al. (2021)): the total fraction infected (or final size of the epidemic, 1 − S(∞)), the peak of I (or infected peak prevalence) and the average time of the infection. Both, the minimization of infected peak (Sadeghi et al. (2020) ; Federico and Ferrari (2020); Morris et al. (2021) ) and the epidemic final size (Bliman and Duprez (2021) ; González et al. (2021) ) were proposed as control objectives in the context of single-interval control strategies; i.e., simple control strategies consisting in a fixed control action that reduces the transmission rate for a finite period of time. One step ahead are the optimal-control-based strategies, that consider a more complex sequence of control actions, together with explicit constraints on both, manipulated and controlled variables. In (Morato et al. (2020) (2020)). The way the aforementioned measures are decided relies on the so-called SIR-type epidemiological models. SIR-type models are based on the seminal work of ker-mack and McKendrick (Kermack and McKendrick (1927) ), which firstly established a compartmental relationship between the main variables of an epidemic: Susceptible (S), Infected (I) and Removed (C) individuals, and includes parameters that can be externally modified, as the transmission and recovery/death rates β and γ. Even when several extensions of the original model have been made (to include additional states describing new subcompartments (e.g., Giordano et al. (2020) )), the epidemiological objectives always aims to minimize three main indexes (Di Lauro et al. (2021)): the total fraction infected (or final size of the epidemic, 1 − S(∞)), the peak of I (or infected peak prevalence) and the average time of the infection. Both, the minimization of infected peak (Sadeghi et al. (2020) ; Federico and Ferrari (2020); Morris et al. (2021) ) and the epidemic final size (Bliman and Duprez (2021); González et al. (2021) ) were proposed as control objectives in the context of single-interval control strategies; i.e., simple control strategies consisting in a fixed control action that reduces the transmission rate for a finite period of time. One step ahead are the optimal-control-based strategies, that consider a more complex sequence of control actions, together with explicit constraints on both, manipulated and controlled variables. In (Morato et al. (2020)) a model predictive controller (MPC) is proposed, based on SIRD (Susceptible-Infected-Recovered-Dead) and SIR-ASD (SIRD + Asymptomatic-Symptomatic) models. The control objective consists in minimizing both, the number of infected individuals and the time of isolation, while some constraints account for the peak of the infected fraction (maximal values according to the available ICU beds) and for the the dwell-time of control actions (minimal times for both, isolation and no-isolation measurements are imposed to avoid unimplementable policies). In (Köhler et al. (2020) ) -which up to the authors knowledge is the more complete MPC approach -it is proposed a robust non linear MPC based on the SIDARTHE (Susceptible, Infected 2021)). The objectives of this manuscript are: (i) to present a dynamical-system perspective to formally analyze SIRtype models, their equilibrium sets and stability, and the second-waves scenarios; and (ii) to propose a Switching Nonlinear Model Predictive Control (swNMPC) strategy that minimizes the epidemic final size, while maintaining the infected peak prevalence under an upper bound imposed by the healthcare system capacity, and minimizing -as long as possible -the social restriction severity. In this work, a non-dimensional version of the typical SIR model (Kermack and McKendrick (1927) ; Brauer and Castillo-Chavez (2012); Sontag (2011)) is considered, which can be obtained by rescaling the original time units (Franco (2020) ):Ṡ in such a way that (S(τ ), I(τ ), C(τ )) ∈ X for all τ ≥ 0. Furthermore, note thatṠ(τ ) +İ(τ ) +Ċ(τ ) = 0, and, therefore S(τ ) + I(τ ) + C(τ ) = 1, for τ ≥ 0. Particularly, S(0) + I(0) + C(0) = 1, where τ = 0 is assumed to be the epidemic outbreak time, in such a way that (S(0), I(0), C(0)) := (1 − , , 0), with 0 < 1, i.e., the fraction of susceptible individuals is smaller than, but close to 1; the fraction of infected is close to zero and the fraction of removed is null. The solution of (1) -which was analytically determined in (Harko et al. (2014) ), for τ ≥ τ 0 > 0, depends on R and the initial conditions (S(τ 0 ), I(τ 0 ), C(τ 0 )) ∈ X. Since S(τ ) ≥ 0, I(τ ) ≥ 0, for τ ≥ τ 0 > 0, then S(τ ) is a decreasing function of τ (by (1.a)) and C(τ ) is an increasing function of τ , for all τ ≥ τ 0 . From (1.b) , it follows that if S(τ 0 )R ≤ 1,İ(τ ) = (RS(τ ) − 1)I(τ ) ≤ 0 at τ 0 . Furthermore, given that S(τ ) is decreasing, I(τ ) is also decreasing for all τ ≥ τ 0 . On the other hand, if S(τ 0 )R > 1, I(τ ) initially increases, then reaches a global maximum, and finally decreases to zero. In this latter case, the peak of I(τ ),Î, is given byÎ := S(τ 0 )+I(τ 0 ) − 1 R (1 + ln(S(τ 0 )R)), and it is reached atτ , whenİ = RSI −I = 0. This implies the peak of I is reached when S(τ ) = S(τ ) = S * , where S * := min{1, 1/R} (2) is a threshold or critical value, known as "herd immunity". This way, conditions S(τ 0 )R > 1 and S(τ 0 )R < 1 that determines if I(τ ) increases or decreases at τ 0 can be rewritten as S(τ 0 ) > S * and S(τ 0 ) < S * , respectively. For the sake of simplicity, we define S ∞ := lim τ →∞ S(τ ), I ∞ := lim τ →∞ I(τ ) and C ∞ := lim τ →∞ C(τ ), which are values that depend on initial conditions S(τ 0 ), I(τ 0 ), C(τ 0 ), and R. Taking τ → ∞ for the solutions proposed in (Harko et al. (2014) ), I ∞ = 0, C ∞ = 1 − S ∞ and: The equilibria of System (1) is obtained by zeroing each of the differential equations. For initial conditions (S(τ 0 ), I(τ 0 ), C(τ 0 )) ∈ X , this set is given by: Next, a key theorem concerning the asymptotic stability of (a subset of) X s is introduced. Theorem 1. (Asymptotic Stability). Consider System (1) with arbitrary initial conditions (S(τ 0 ), I(τ 0 ), C(τ 0 )) ∈ X , for some τ 0 ≥ 0. Then, the minimal (smallest) asymptotically stable equilibrium set in X is given by Proof: The proof is given in ). Figure 1 shows a Phase Portrait for System (1), with R = 2.5, and initial conditions summing 1. (1) with arbitrary initial conditions (S(τ 0 ), I(τ 0 ), C(τ 0 )) ∈ X , for some τ 0 ≥ 0. Then • S ∞ → 0 for any value of S(τ 0 ) > 0 and I(τ 0 ) > 0, when R → ∞. • S ∞ remains close to S(τ 0 ) for any value of S(τ 0 ) > 0 and I(τ 0 ) > 0, when R → 0. and S ∞ < S * . • If S(τ 0 ) = S * and I(τ 0 ) ≈ 0, S ∞ ≈ S * , for any value of R (note that S * = 1 for R < 1). Figure 2 shows a plot of S ∞ (S(τ 0 ), I(τ 0 )), corresponding to R = 2.5 and fixed values of I(τ 0 ). Quarantine and isolation, as well as regulations for wearing face masks and avoiding non-essential interactions, are typical non-pharmaceutical measures that the local governments take to reduce infection transmission rates. Social distancing measures affect (decrease) parameter β or, directly, parameter R in System (1). In this work, this control action is modeled as follows (Péni et al. (2020))Ṡ (τ ) = −R(τ )S(τ )I(τ ) (4a) where R(τ ) is a signal ranging from R(0) (the initial value of R which is assumed to be R(0) > 1) to R min , with R(0) > R min > 0, which is a minimal value corresponding to the hardest social distancing. In line with other works, it is reasonable to assume that R(0) = 3.0 and R min = 0.85 for simulation proposes (Flaxman et al. (2020) ; Li et al. (2020) ; Ferguson et al. (2020)). One critical point concerning social distancing measures is that they are always bounded temporary control actions, not permanent ones (as clearly stated in (Sadeghi et al. (2020) ) and (Köhler et al. (2020) )). It is not possible to maintain efficient (or full) social distancing actions for ever (neither for a time long enough to make the infection to disappear) since population fatigue due to psychological or economical problems would systematically relax its effectiveness. 1−S(∞) dt. However, there is not yet a consensus in the optimal control literature about what is better to minimize and to consider as constraints for the system variables. We will assume first a single-interval control action scenario, to reinforce the importance of minimizing the EFS, while keeping the control of the IPP for a second stage. The single-interval control action is given by two times τ i < τ f defining the initial and final time of social distancing (with τ i <τ ), and a fixed value In such a context, and according to ), there exist a quasi optimal single interval minimizing the EFS. Theorem 2. (Quasi optimal sing. inter. control). Consider System (4) and a given initial time τ i <τ . Then, a quasi optimal single interval control (producing S ∞ ≈ S * , which is the maximal value S ∞ ) is given by: R i such that S ∞ (S(τ i ), I(τ i )) = S * (we denote this value as R op s ), and τ f large enough for the system to approach a QSS (S(τ f ) → S * , I(τ f ) → 0). Any other single interval control produces S ∞ < S * and, if S(τ f ) > S * , a second wave will appear for someτ > τ f . The proof is given in ). Figure 3 shows the time evolution of S(τ ) and I(τ ) under single-interval social distancing measures lasting long enough for the system to reach a QSS before the measure is interrupted. The initial and final times are given by τ i = 2 and τ f = 20 (non dimensional units), respectively, while R(0) = 2.5. For a strong social distancing, R i = 0.5 < R op i = 1.412 (blue lines), the infected fraction experiences a second wave atτ = 32.5, 12 times units after the social distancing is interrupted. Furthermore, and more important, S ∞ = 0.1601, which is significantly 2172, which is also significantly smaller than S * . Finally, for the optimal social distancing, R op i = 1.42, as expected, S ∞ = S * and second waves do not take place. In ), other simulation examples can be seen, concerning shorttime single interval controls, i.e., those such that τ f is not large enough for the system to reach a QSS. As stated in Theorem 2, all these cases produces values of S ∞ significantly smaller than S * . Note that among them, one case is particularly interesting: the one consisting in starting or interrupting any social distancing R i > 0 (R = 0 is not a realistic measure) at the very timeτ , when S(τ ) reaches S * from above. This strategy, suggested by some works are far to be optimal from the EFS perspective. Theorem 2 establishes an upper bound for the steady state fraction of susceptible individuals (after the end of social distancing interventions) in the real scenario of temporary control actions of any kind. Furthermore, it states that any social distancing interrupted before a QSS is reached, will produce also a suboptimal value of S ∞ . However, the conditions in Theorem 2 only determine QSS at the end of the interventions, while the transitory values of the variables remains undetermined. In short, EFS optimal conditions just fixes the area under the curve (AUC) of I, but its peaks and general time evolutioncorresponding to an arbitrary sequence of social distancing -are not determined. These degrees of freedom for the control actions allows us to propose an optimal control strategy (MPC) that also fulfill maximal conditions for the IPP, I max , while minimizing -as long as possible -the side effects of social distancing measures. Social distancing is considered here as a quantified variable that can take only some specific values in a given range. We modeled it as where u(τ ) ∈ U is the control input (manipulated variable), where U = {0, 1/4, 1/2, 3/4, 1} is the set of possible social distancing, being u = 0 the no social distancing scenario, u = 1 the hardest social distancing (lockdown), and u = 1/4, u = 1/2 and u = 3/4, intermediary measures. As an example, u = 1/4 may correspond to social distancing and mask wearing requirements, u = 1/2 to telework and closure of schools and universities, and u = 3/4 could be interpreted as a combination of the two. This may have correspondence, for instance, to the classification region system implemented by the Italian Ministry of Health, in which the regions and autonomous provinces are classified into four areas -red, orange, yellow and white-corresponding to three risk scenarios, for which specific restrictive measures are foreseen, (Italian Ministry of Health (2021)). This way, System (4) together with (5), can be seen as a switching system, in which the control signal u selects one of 5 possible subsystems, that represents the original system at a given time (Anderson et al. ( , 2020 ) where σ(τ ) ∈ Σ := {1, 2, . . . , 5} is the switching signal, and To obtain a discrete-time system to be used by the MPC controller, System (4) together with (5) is sampled in the general form x k+1 = F (x k , u k ), k ∈ N, where F (·), is the discrete-time non-linear function, x k is the state vector at the sampled time k (s.t. x k := x(kT s ), being T s > 0 the sampling time), and u k stands for a piece-wise constant input in the form u(t) = u k , t ∈ [kT s , (k + 1)T s ]. Function F (·) is obtained by the standard explicit Runge-Kutta fourth-order (RK4) method. For the simulation of the non-linear system, the actual trajectory are computed by the backward differentiation formula (BDF) using CVODES solver from the SUNDIALS suite (Hindmarsh et al. (2005) ). Here, a model-based controller -which take explicit advantage of the equilibrium/stability characterization (made in Section 3) and the switching scheme (made in Sections 5.1 and 5.2) is designed. From an epidemiological perspective, the control objective is to minimize the EFS while maintaining the IPP below an upper bound determined by the health care system and reducing -as much as possible -the time each control action is implemented. The cost function to be minimized online by the NMPC controller is then given by: where N is the control horizon, Q, R and P are penalizing positive constants, x = x k = (S k , I k , C k ) is the current state at time k and u := {u 0 , u 1 , · · · , u N −1 } is the predicted control sequence. The optimization problem to be solved at each sampling time k is given by: where U = {0, 0.25, 0.5, 1} and constraints I j ≤ I max is devoted to impeded that the infected population overpasses a maximum I max . Once the optimal solution is computed, then the first optimal input u 0 0 is applied to the system, k → k + 1, and the iteration continues with a new solution of the optimization problem (receding horizon control (RHC) strategy). The main advantages of the proposed swNMPC are summarized next. (i) The cost function is null at the optimal behavior (according to the EFS). If other kind of cost functions is used (i.e. to directly minimize I(τ )), this is not necessarily true and the problem will not be well posed. (ii) The upper bound for the IPP, I max can be arbitrary selected. The simulations were run on a laptop computer with i7-4510U (2 cores, 4 threads, 2.0-3.1 GHz) processor and 8GB RAM under MATLAB R2021a using the BONMIN solver, and CasADi version 3.5.5 (Andersson et al. (2019) ). We solved the swNMPC optimization Problem 5.3 under the switched System (6) for a time period τ = 30 considering different levels of restrictions for the Infected peak prevalence, IP P = I max , even the unconstrained scenario (see Figure 4 a-d). As it was already said, R(0) is assumed to be 3, while R min = 0.85, The starting time for the social distancing sequence is fixed at 2 times units. Prediction horizon value is fixed in 7 times units, penalty matrices is setting in: Q = 1 × 10 4 for states, R = 1 × 10 −3 for input, and P = 1 × 10 6 for the final state. The simulations show that, under the swNMPC social distancing strategy, not further epidemics outbreaks were observed. In fact, this is a key result of the present work. It is important to note that other works present a significant increase of the infected compartments once the control action is dropped and social distancing restrictions interrupted (e.g., Péni et al. (2020) ; Morato et al. (2020) ; Carli et al. (2020) ). Simulations also show that the harder the infected peak prevalence is, the longer will be the social distancing period. Consequently, unconstrained scenario (Figure 4 , a-e) has a total of 13 units of time under social distancing restrictions, and reaches the optimal steady state (herd immunity) at τ = 16. On the other hand, the IPP constraint for I max = 0.05, shows a total period of 25 units of time under social distancing restrictions, and reaches the optimal steady state at τ = 25. Accordingly, these results show that the broader is the capacity of the health care system, the greater is the capacity of governments to manage the pandemic and the shorter is the time spent in lockdown periods. As it can be seen, the strategy tries to minimize -in all cases -the permanence time under strong social distancing (R = R min ). In this work, a formal dynamical analysis of SIR-type models is presented to consider their equilibrium set and stability into the design of a Switching Model Predictive Control to scheduling social distancing policies. The proposed strategy perform the optimal social distancing policy that minimize the EFS, while maintaining the IPP under an upper bound (according to the healthcare capacity). Discrete levels of social distancing interventions were considered to avoid unrealistic continuous control actions. In the same vein, the IPP maximum were included as a constraint in the NMPC formulation so differences levels of restriction were analyzed showing is possible if the susceptible fraction is under the herd immunity value. The switched control signal applied as a social distancing measure R σ(τ ) in each restriction case (e-h), dashed-black horizontal line represent R = 1. From time τ = 2 to the end the social distancing intervention is computed by the swNMPC strategy, dashed-black line show the system evolution without interventions. i show how, in each case, the swNMPC reach the optimal herd immunity value S * , dashed black line represent the normalized susceptible population without social distancing measurements. Green-solid vertical line represent the herd immunity value S * . Discrete-time switching MPC with applications to mitigate resistance in viral infections Discrete-time MPC for switched systems with applications to biomedical problems CasADi -A software framework for nonlinear optimization and optimal control How best can finite-time social distancing reduce epidemic final size Mathematical models for communicable diseases Model predictive control to mitigate the COVID-19 outbreak in a multi-region scenario Optimal timing of one-shot interventions for epidemic control Impact of nonpharmaceutical interventions (NPIs) to reduce COVID-19 mortality and healthcare demand Estimating the effects of nonpharmaceutical interventions on COVID-19 in europe A feedback SIR (fSIR) model highlights advantages and limitations of infection-based social distancing Modelling the covid-19 epidemic and implementation of population-wide interventions in italy Dynamic characterization of control SIR-type systems and optimal single-interval control Exact analytical solutions of the susceptible-infected-recovered (SIR) epidemic model and of the SIR model with equal death and birth rates SUNDIALS: Suite of nonlinear and differential/algebraic equation solvers Covid-19, situation in italy. Classification of Regions in Italy The size of epidemics in populations with heterogeneous susceptibility A contribution to the mathematical theory of epidemics. Proceedings of the royal society of london. Series A, Containing papers of a mathematical and physical character Robust and optimal predictive control of the COVID-19 outbreak Substantial undocumented infection facilitates the rapid dissemination of novel coronavirus (SARS-CoV-2) Generality of the final size formula for an epidemic of a newly invading infectious disease An optimal predictive control strategy for covid-19 (sars-cov-2) social distancing policies in brazil Optimal, near-optimal, and robust epidemic control Mathematical assessment of the impact of non-pharmaceutical interventions on curtailing the 2019 novel coronavirus Nonlinear model predictive control with logic constraints for COVID-19 management Universal features of epidemic models under social distancing guidelines Lecture notes on mathematical systems biology An explicit formula for minimizing the infected peak in an SIR epidemic model when using a fixed number of complete lockdowns Coronavirus disease 2019 (covid-19): situation report