This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

A control theory approach to optimal pandemic mitigation

P. Godara, S. Herminghaus, K. M. Heidemann Max Planck Institute for Dynamics and Self-Organization, Am Fassberg 17, 37073 Göttingen, Germany
Abstract

In the framework of homogeneous susceptible-infected-recovered (SIR) models, we use a control theory approach to identify optimal pandemic mitigation strategies. We derive rather general conditions for reaching herd immunity while minimizing the costs incurred by the introduction of societal control measures (such as closing schools, social distancing, lockdowns, etc.), under the constraint that the infected fraction of the population does never exceed a certain maximum corresponding to public health system capacity. Optimality is derived and verified by variational and numerical methods for a number of model cost functions. The effects of immune response decay after recovery are taken into account and discussed in terms of the feasibility of strategies based on herd immunity.

I Introduction

The recent outbreak of the illness COVID-19, caused by the SARS-CoV-2 virus, has resulted in a pandemic with unprecedented impact on societies all over the globe. Mitigation measures included complete lockdowns of societal life, with severe psychic, social, and economic consequences et al. (2020); Enserink and Kupferschmidt (2020). Hence a major focus of governments is on designing containment strategies which are as mild as possible, but substantial enough to limit the severity of the outbreak in order not to overwhelm the health service system (HSS). This requires reliable forecast, based on careful collection of data on the fraction of infected citizens, as well as extensive simulation Enserink and Kupferschmidt (2020); Dehning et al. (2020).

We discuss the system in terms of a so-called SIR model Hethcote (2000), referring to the fraction of susceptible (S), infected (I), and recovered (R) citizens in the population. We identify the recovered with all those who are neither susceptible nor infected (R=1SIR=1-S-I); the dynamics are thus fully described by a set of two equations:

tS=βSI,tI=βSIIτ,\begin{array}[]{r c l}\partial_{t}S&=&-\beta SI\,,\\ &&\\ \partial_{t}I&=&\beta SI-\frac{I}{\tau}\,,\\ \end{array} (1)

where S,I[0,1]S,I\in[0,1] are the fraction of susceptible and infected individuals in the population, respectively. Note that I(t)I(t) denotes the actual fraction of acutely infected citizens at time tt, no matter whether or not the infection has been realized by the individual, or has even been recorded. The infection of a susceptible individual by an infected is described by the infection rate β>0\beta>0, while τ\tau is the average duration of the infection of an individual until her recovery.

The task we address in this study is to limit, during the whole period of the pandemic, the current number of infected individuals such as to prevent the number of those needing intensive care from exceeding the capacity of the deployed HSS. Such control may be described by a control parameter α(t)\alpha(t), which quantifies the effect of mitigation strategies upon the infection rate. We may write β=β0(1α)\beta=\beta_{0}(1-\alpha), such that α=0\alpha=0 and α=1\alpha=1 correspond to usual societal life and complete mutual isolation of citizens, respectively.

In order to define α\alpha in a general way, we state that a certain value of α=1β/β0\alpha=1-\beta/\beta_{0} denotes the subset of all possible mitigation measures which lead to an infection rate ββ0\beta\leq\beta_{0}. We thus do not need to refer to any specific measures, but can formulate our approach in a very general way. The (more or less) accurate determination of these subsets is then the task of careful social (e.g., infection history) data analysis among citizens. This is illustrated in Fig 1, where mitigation strategies, followed by the public authorities, are indicated by the dashed and dotted curves, within a space spanned by the effect of the measures upon the infection rate, α\alpha, and the cost incurred for economy and society as a whole, f(α)f(\alpha).

Refer to caption
Figure 1: Space of mitigation measures. Sketch of the space of possible mitigation measures (grey shade), spanned by their effect on the infection rate, α\alpha, and their socio-economic cost, f(α)f(\alpha). Normal societal life is at the origin, while the upper right corner corresponds to total mutual isolation of all citizens, which is the strongest possible intervention. The dashed and dotted curves depict possible choices for mitigation measures. Such curves correspond to the cost functions referred to in the manuscript (see Eq (7).

As indicated by the explicit time dependence of α(t)\alpha(t), we follow a control theoretic approach. This is in some contrast to earlier treatments which have assumed mitigation measures to be constant over time Harko et al. (2014); Gros et al. (2020); Zlatic et al. (2020); Ferguson et al. (2020). Instead, we aim at determining the optimal function α(t)\alpha(t) which minimizes the impact on society, while at the same time avoiding the HSS to become overloaded. At the end of the mitigation scenario, herd immunity shall be reached, so that the epidemic comes to an end without further control. We do not consider potential vaccination scenarios here (as is done elsewhere Perkins and Espana (2020); Djidjou-Demasse et al. (2020)), so immunization can only be achieved via infection with the virus in the present study.

A dimensionless quantity which is frequently used in epidemiology is the reproduction number, RβτSR\coloneqq\beta\tau S, which denotes the average number of susceptibles infected by one infected individual. At the beginning of an epidemic (S1S\approx 1) and without mitigation measures deployed (β=β0\beta=\beta_{0}), one observes the basic reproduction number R0=β0τR_{0}=\beta_{0}\tau. In case of the COVID-19 pandemic, typical estimates are R03R_{0}\approx 3 Liu et al. (2020) and τ\tau\approx ten days et al. (2020); He et al. (2020). It has been shown before that the inherently random, network-like structure of interactions between individuals mainly results in a readjustment of R0R_{0} Parshani et al. (2010). Hence we follow a mean field approach, disregarding small scale inhomogeneities of the system. We consider a homogeneous scenario, where β(t)\beta(t) depends on time, but is spatially constant. Defining a normalized time variable, θ:=βt\theta:=\beta t, we can rewrite Eq (1) as

θS=SI,θI=SIIR0(1α).\begin{array}[]{r c l}\partial_{\theta}S&=&-SI\,,\\ &&\\ \partial_{\theta}I&=&SI-\frac{I}{R_{0}(1-\alpha)}\,.\\ \end{array} (2)

The trajectory of the system in the SS-II-plane, I(S)I(S), can be obtained by dividing the equations displayed in Eq (2) by each other. This yields

dIdS=1R0(1α)S1,\frac{dI}{dS}=\frac{1}{R_{0}(1-\alpha)S}-1\,, (3)

which has the solution:

I(S)=lnSR0(1α)S+C,I(S)=\frac{\ln S}{R_{0}(1-\alpha)}-S+C\,, (4)

where CC is a constant of integration. When no mitigation measures are in place (α=0\alpha=0), we have I(1)=0I(1)=0 and thus obtain

I(S)=lnSR0S+1.I(S)=\frac{\ln S}{R_{0}}-S+1\,. (5)

This is plotted as the dashed curve in Fig 2 for the case R0=3R_{0}=3. The maximum turns out to occur at Speak=1/R0S_{\textrm{peak}}=1/R_{0}, where it reaches a value of

Ipeak=1lnR0R01R0.I_{\textrm{peak}}=1-\frac{\ln R_{0}}{R_{0}}-\frac{1}{R_{0}}\,. (6)

At S=Speak=1/R0S=S_{\textrm{peak}}=1/R_{0}, the population has reached herd immunity since from then on the number of infected citizens decreases until zero.

Refer to caption
Figure 2: Trajectories in the (S,I)\bm{(S,I)}-plane. Dashed curve: trajectory with no mitigation starting at (S,I)=(1,0)(S,I)=(1,0), R0=3R_{0}=3. Horizontal dashed line: maximum load of the HSS, IhI_{h} (here we have set Ih=0.1I_{h}=0.1 for clarity, although this is unrealistically large). Solid curve: trajectory, (S(t),I(t))(S^{*}(t),I^{*}(t)), for an optimal choice of α(t)\alpha(t) (see Eq 16). The corresponding characteristic of α(S)\alpha(S) follows the dash-dotted curve in phase II, the mitigation phase. There is no mitigation in phases I and III (α=0\alpha=0).

If the disease is serious, one is faced with the problem that with a fraction of IpeakI_{\textrm{peak}} people being infected, the number of those in need of hospitalization or even intense care may exceed the capacity of the HSS. We denote by IhI_{h} <Ipeak<I_{\textrm{peak}} the maximum fraction of infected citizens which can be managed by the HSS. It is limited by infrastructural aspects, such as the availability of staff or the size and areal density of hospitals, and is indicated by the horizontal dotted line in Fig 2. Any substantial overshoot of the dashed curve over the dotted line constitutes a catastrophe, as a major fraction of the population will then not receive proper health care or treatment. This must clearly be avoided by means of suitable measures, such as reducing mutual contacts between individuals, banning major assemblies, reducing mobility etc., thus reducing the infection rate. Such measures are described by the parameter α(t)\alpha(t), which is to be discussed next.

II Optimal control problem

It is clear that the aforementioned measures will have a more or less substantial impact on society, mainly through their detrimental effects on economy, but also through other societal (e.g., cultural) damage. This may be described by means of a cost functional,

K{α}f(α(t))𝑑t,K\{\alpha\}\coloneqq\int f(\alpha(t))\,dt\,, (7)

where the cost function ff corresponds to the mitigation strategy chosen, i.e., the curve chosen in Fig 1. It denotes the cost incurred at a given control α\alpha, along with the assumption f/α0α\partial f/\partial\alpha\geq 0\ \forall\alpha; later we will require 2fα20\frac{\partial^{2}f}{\partial\alpha^{2}}\geq 0 111Convexity of the cost function is a reasonable assumption since one can imagine that chosen mitigation measures become more and more costly as α\alpha approaches unity. 222In principle, f()f(\cdot) could depend on time tt explicitly or involve memory, e.g., because prolonged measures cause disproportinally higher cost. For simplicity, we do not treat such cases here..

The control problem we choose to address is to find a control trajectory, denoted by the function α(t)\alpha(t), such that the impact on society, as described by KK, is being minimized under the constraint that I(t)I(t) never exceeds IhI_{h} (capacity of the HSS) and at the end of mitigation—at unknown terminal time tet_{e}—herd immunity is reached, i.e., S(te)=1/R0S(t_{e})=1/R_{0} (end of phase II in Fig 2).

We thus need to

minimizeK{α}=0tef(α(t))𝑑t,such that𝒙˙(t)=𝒉(𝒙,α(t)),𝒙(0)=𝒙0,I(t)Ih,S(te)=1/R0,\begin{split}\textrm{minimize}\quad&K\{\alpha\}=\int_{0}^{t_{e}}f(\alpha(t))\,dt\,,\\ \textrm{such that}\quad&\dot{\bm{x}}(t)=\bm{h}(\bm{x},\alpha(t))\,,\,\bm{x}(0)=\bm{x}_{0}\,,\\ &I(t)\leq I_{h}\,,\,S(t_{e})=1/R_{0}\,,\end{split} (8)

where 𝒙=(S,I)\bm{x}=(S,I), and 𝒉(𝒙,α(t))\bm{h}(\bm{x},\alpha(t)) as given by Eq 1 (with β=β0(1α)\beta=\beta_{0}(1-\alpha)). Minimization of mitigation time is covered by setting f()constf(\cdot)\equiv\mathrm{const}.

Solving Eq 8 can be recast into minimization of the following functional:

J0tef(α(t))+𝝀(t)[𝒙˙(t)𝒉(𝒙,α(t))]+μ(t)(IIh)dt,J\coloneqq\int_{0}^{t_{e}}f(\alpha(t))+\bm{\lambda}(t)\cdot[\dot{\bm{x}}(t)-\bm{h}(\bm{x},\alpha(t))]+\mu(t)(I-I_{h})\,dt\,, (9)

where 𝝀(t)=(λS(t),λI(t))\bm{\lambda}(t)=(\lambda_{S}(t),\lambda_{I}(t)), μ(t))\mu(t)) are Lagrange multipliers. The introduction of μ(t)\mu(t) for the inequality constraint introduces additional constraints on μ(t)\mu(t), namely μ(t)0\mu(t)\geq 0 and the complementary slackness condition μ(t)(IIh)=0\mu(t)(I^{*}-I_{h})=0. These are also known as KKT conditions Kuhn and Tucker (1951). The star () represents the optimal quantities. Additionally, S(te)=1/R0S(t_{e})=1/R_{0} and 𝒙(0)=𝒙0\bm{x}(0)=\bm{x}_{0} need to be enforced.

The necessary conditions for optimality can be evaluated by setting the first variation of Eq 9 to zero (for a detailed derivation see appendix A), we obtain:

f(α(te))𝝀(te)𝒉(𝒙(te),α(te))=0,\displaystyle f(\alpha^{*}(t^{*}_{e}))-\bm{\lambda}(t^{*}_{e})\cdot\bm{h}(\bm{x}^{*}(t^{*}_{e}),\alpha^{*}(t^{*}_{e}))=0\,, (10)
𝝀˙(t)=𝝀(t)𝒙𝒉|𝒙(t)+μ(t)𝒙(IIh)|𝒙(t),\displaystyle\dot{\bm{\lambda}}(t)=-\bm{\lambda}(t)\cdot\bm{\nabla}_{\bm{x}}\bm{h}|_{\bm{x}^{*}(t)}+\mu(t)\,\bm{\nabla}_{\bm{x}}(I-I_{h})|_{\bm{x}^{*}(t)}\,, (11)
αf|α(t)𝝀(t)α𝒉|α(t)=0,\displaystyle\partial_{\alpha}f|_{\alpha^{*}(t)}-\bm{\lambda}(t)\cdot\partial_{\alpha}\bm{h}|_{\alpha^{*}(t)}=0\,, (12)
λI(te)=0,\displaystyle\lambda_{I}(t^{*}_{e})=0\,, (13)
μ(t)0,\displaystyle\mu(t)\geq 0\,, (14)
μ(t)(IIh)=0.\displaystyle\mu(t)(I^{*}-I_{h})=0\,. (15)

In addition to these, one also has the optimal system dynamics 𝒙˙(t)=𝒉(𝒙,α(t))\dot{\bm{x}}^{*}(t)=\bm{h}(\bm{x}^{*},\alpha^{*}(t)). The necessary conditions become sufficient conditions if 𝒉(𝒙,α)\bm{h}(\bm{x},\alpha) and f(α)f(\alpha) are convex in 𝒙\bm{x} and α\alpha Mangasarian (1966). The former can be checked to be valid for the SIR model and the latter implies that 2fα20\frac{\partial^{2}f}{\partial\alpha^{2}}\geq 0.

The task remains to find Lagrange multipliers 𝝀(t){\bm{\lambda}}(t) and μ(t)\mu(t) which simultaneously satisfy the above conditions. This task usually involves a numerical search for the initial conditions of the Lagrange multipliers and evolve the system of ODE’s until the terminal conditions given by Eqs 10 and 13 are met. We escape the numerical difficulties arising with this procedure by first guessing a solution and then finding the appropriate Lagrange multipliers which verify optimality.

II.1 Heuristic approach

Let us first consider what is necessary to keep the fraction of infected citizens at a constant value, IcI_{c}. Since SS varies with time, dI/dt=0dI/dt=0 entails dI/dS=0dI/dS=0, and hence from Eq 3 we obtain

α(t)=11R0S(t).\alpha(t)=1-\frac{1}{R_{0}S(t)}\,. (16)

This is indicated by the dash-dotted curve in Fig 2. Note that α(t)\alpha(t) does not depend on the value of IcI_{c}.

Next we consider the cost function for proceeding from some S=S0S=S_{0} to some S=S1<S0S=S_{1}<S_{0} while maintaining I=IcI=I_{c}. Inserting Eq 16 in Eq 1, we find

dS=Icdtτ.dS=-I_{c}\frac{dt}{\tau}\,. (17)

We use this substitution to express the cost function as

K=t(S0)t(S1)f(α(t))𝑑t=τIcS1S0f(α(S))𝑑S.K=\int\limits_{t(S_{0})}^{t(S_{1})}f(\alpha(t))\,dt=\frac{\tau}{I_{c}}\int\limits_{S_{1}}^{S_{0}}f(\alpha(S))\,dS\,. (18)

Hence if S0S_{0} and S1S_{1} are fixed, IcI_{c} must be as large as possible to minimize KK. This now guides our heuristic: we should control α\alpha such as to maintain I=IhI=I_{h} for as long as possible.

If our guess is valid, the trajectory we have to follow in order to optimally control the pandemic is the one indicated as the solid curve in Fig 2. It starts at (S,I)=(1,0)(S,I)=(1,0) and proceeds until I=IhI=I_{h} is reached. This completes phase I of the process, during which we set α=0\alpha=0. Mitigation measures are then deployed, such that α\alpha jumps upwards to the dash-dotted curve. It follows that curve all through phase II, hence keeping I=IhI=I_{h} constant. As SS decreases, α\alpha is gradually reduced until it reaches zero at the end of phase II. All through phase III, α\alpha is maintained at zero, while II gradually decays to zero because R<1R<1. This ends the pandemic.

II.2 Validation of the solution

We now proceed to verify our heuristic solution. We focus on phase II, as this is where the pandemic will spend the most amount of time. To do this we ask the question: Is it true that if the pandemic starts with I0=IhI_{0}=I_{h}, then for all S0>1/R0S_{0}>1/R_{0} and for all the cost functions f(α(t))f(\alpha(t)) such that fα,2fα20\frac{\partial f}{\partial\alpha},\frac{\partial^{2}f}{\partial\alpha^{2}}\geq 0, optimal pandemic control must keep I(t)=IhI(t)=I_{h} until S(te)=1R0S(t_{e})=\frac{1}{R_{0}} is reached?

As we will see, the answer to the above question is yes. We proceed by setting α(t)=11R0S(t)\alpha^{*}(t)=1-\frac{1}{R_{0}S^{*}(t)} and S(t)=S0IhτtS^{*}(t)=S_{0}-\frac{I_{h}}{\tau}t for t[0,te]t\in[0,t^{*}_{e}] and te=(S01R0)τI0t^{*}_{e}=(S_{0}-\frac{1}{R_{0}})\frac{\tau}{I_{0}}. The terminal conditions for the dynamics are given by 𝒙(te)=(1R0,Ih)\bm{x}^{*}(t^{*}_{e})=(\frac{1}{R_{0}},I_{h}). We can substitute the terminal conditions in Eq 10 and get the terminal condition for λS\lambda_{S} (the terminal condition for λI\lambda_{I} is given by Eq 13). The task remains to find μ(t)\mu(t) such that Eqs 11 and 12 are satisfied simultaneously.

Let’s have a look at Eqs 11 and 12 after making the substitutions. We have

λ˙S(t)=IhτS(t)[λSλI],λ˙I(t)=1τλS+μ(t),\begin{split}\dot{\lambda}_{S}(t)=\frac{I_{h}}{\tau S^{*}(t)}[\lambda_{S}-\lambda_{I}]\,,\\ \dot{\lambda}_{I}(t)=\frac{1}{\tau}\lambda_{S}+\mu(t)\,,\end{split} (19)

and

fα|α(t)=(λS(t)λI(t))βIhS(t).\left.\frac{\partial f}{\partial\alpha}\right|_{\alpha^{*}(t)}=(\lambda_{S}(t)-\lambda_{I}(t))\beta I_{h}S^{*}(t)\,. (20)

One can hence find the Lagrange parameter μ(t)\mu(t) as

μ(t)=λSτ+2fα21R02S3.\begin{split}\mu(t)=-\frac{\lambda_{S}}{\tau}+\frac{\partial^{2}f}{\partial\alpha^{2}}\frac{1}{R_{0}^{2}S^{*3}}\,.\end{split} (21)

Lastly, there is also the issue of non-negativity of μ\mu. If we assume the convexity of ff we have 2fα20\frac{\partial^{2}f}{\partial\alpha^{2}}\geq 0. Hence the second summand in Eq 21 is non-negative. fα0\frac{\partial f}{\partial\alpha}\geq 0 also implies that λS\lambda_{S} is monotonically increasing (Eqs 19, 20). If the cost of zero control is zero, then the terminal condition Eq 10 implies that λS(te)=0\lambda_{S}(t^{*}_{e})=0, thereby implying λS(t)0\lambda_{S}(t)\leq 0 in the interval [0,te][0,t^{*}_{e}]. This shows that for time independent cost functions ff under the assumptions that fα,2fα20\frac{\partial f}{\partial\alpha},\frac{\partial^{2}f}{\partial\alpha^{2}}\geq 0 and f(0)=0f(0)=0 our heuristic solution is optimal in phase II.

II.3 Numerical results

We have shown that an optimal trajectory starting on the boundary (I0=IhI_{0}=I_{h}) remains on that boundary. To obtain optimal control trajectories for arbitrary initial conditions, we perform direct numerical optimization using the software library PSOPT Becerra (2010). In Fig 3 we show the numerical solutions to the control problem Eq (8) for various cost functions fi(α(t)){α(t),α2(t),α3(t)}f_{i}(\alpha(t))\in\{\alpha(t),\alpha^{2}(t),\alpha^{3}(t)\}.

Refer to caption
Figure 3: Numerical solutions for optimal control. Optimal control trajectories for different cost functions fi(α(t)){α(t),α2(t),α3(t)}f_{i}(\alpha(t))\in\{\alpha(t),\alpha^{2}(t),\alpha^{3}(t)\}. The corresponding optimal terminal times, tet_{e}^{*}, are determined as {65.99τ,66.13τ,66.31τ}\{65.99\tau,66.13\tau,66.31\tau\}. I0=0.0025I_{0}=0.0025, Ih=0.01I_{h}=0.01, R0=3R_{0}=3, S(te)=R01S(t_{e}^{*})=R_{0}^{-1}. RR_{\infty} is the asymptotic reproduction number for tt\to\infty, given by R=W(exp(1R0Ih))R_{\infty}=-W(\exp(-1-R_{0}I_{h})), with the Lambert WW function.

Clearly, in all scenarios the optimal trajectory II^{*} reaches the threshold value IhI_{h} and remains there until S(te)S^{*}(t^{*}_{e}) is reached (phase II). Phase I, however, depends on the cost function applied. For linear costs, α(t)=0\alpha(t)=0 until I=IhI=I_{h} 333The same holds for a constant cost function, i.e. if we assume societal costs to be independent of α(t)\alpha(t); numerical data not shown here.. With higher order cost terms, we observe non-zero control from the very beginning (see Fig 3). This is to reduce the amount of time spent at large control values α\alpha and thereby the total integrated costs. The optimal terminal time tet_{e}^{*} increases with the order of the cost function (see Fig 3). We should note, however, that the influence of the functional form of f(α(t))f(\alpha(t)), as expressed in the different shapes of the numerically derived curves, is minute, since the time axis is logarithmic, and the deviations are noticeable only during a very small fraction of time. Hence we see that the influence of the cost function, which corresponds to the chosen mitigation strategy, is finite, but can be regarded as negligible for practical purposes.

III Duration of the pandemic

If immune response acquired after recovery from an infection is permanent, the pandemic will last until herd immunity is reached at the end of phase II. This is when S(t)=S1=1/R0S(t)=S_{1}=1/R_{0}, as indicated by the left vertical dotted line in Fig 2. This is the start of phase III, in which the number of infected citizens decays with no mitigation measures anymore in place (i.e., at α=0\alpha=0). We will now discuss the time we expect it to take until this point is reached. Using Eq (17) with Ic=IhI_{c}=I_{h}, we can write

dt=τIhdSdt=-\frac{\tau}{I_{h}}\,dS (22)

and hence for the total duration of the pandemic, T0T_{0}, until herd immunity is reached,

T0=τIhS0S1𝑑SτIh(11R0).T_{0}=-\frac{\tau}{I_{h}}\int\limits_{S_{0}}^{S_{1}}dS\approx\frac{\tau}{I_{h}}\left(1-\frac{1}{R_{0}}\right)\,. (23)

Here we have exploited the fact that in all cases of practical relevance, IhI_{h} will be very small as compared to unity. Consequently, the duration of phase I will be very small as compared to phase II, such that the evaluation of the true duration of phase I is of minor importance. As a very good approximation, we have simply set S0=1S_{0}=1 and neglected the impact of α(t)\alpha(t) on the dynamics for the short period of phase I.

III.1 Influence of immune response decay

The introductory discussion was based on the idea that recovered patients stay immune for all times. However, it is well known that for some diseases, in particular of the SARS-CoV type, the immune response tends to decay after some time Wu (2007). Hence there is some finite probability that recovered patients become susceptible again.

We now assume that the transition from the recovered to the susceptible state can be described as a Poisson process. In other words, we assume the probability that a randomly chosen, formerly infected citizen becomes susceptible in a time interval [t,t+dt][t,t+dt] to be proportional to dtdt and independent of tt. This modifies the dynamical system (1) to

tS=βSI+1ρ(1SI),tI=βSIIτ,\begin{array}[]{r c l}\partial_{t}S&=&-\beta SI+\frac{1}{\rho}\left(1-S-I\right)\,,\\ &&\\ \partial_{t}I&=&\beta SI-\frac{I}{\tau}\,,\\ \end{array} (24)

with β=β0(1α)\beta=\beta_{0}(1-\alpha), and ρ\rho the average life time of the immune state, averaged over all formerly infected individuals. Note that we conceptually include those who fell victim to the disease and thus do not become susceptible again. Their contribution to the average resusceptibilization frequency is zero, which merely increases the average immune lifetime, ρ\rho. From the data in Wu (2007), we find that after three years the average IgG immune response against SARS-CoV had decayed to 55.6 percent. For a corresponding Poissonian process we can estimate ρ931\rho\approx 931 days.

In Eq 24, we see immediately that the conditions to fulfill tI=0\partial_{t}I=0 have not changed with respect to Eq 1. Hence the optimal control trajectory still obeys α(t)=11R0S(t)\alpha(t)=1-\frac{1}{R_{0}S(t)}. In phase II, with optimal control, we obtain

tS=Ihτ+1ρ(1Ih)1ρS\partial_{t}S=-\frac{I_{h}}{\tau}+\frac{1}{\rho}\left(1-I_{h}\right)-\frac{1}{\rho}S (25)

with the solution

S(t)=Ih(1+ρτ)[et/ρ1]+1.S(t)=I_{h}\left(1+\frac{\rho}{\tau}\right)\left[e^{-t/\rho}-1\right]+1\,. (26)

Again, herd immunity (and hence the end of the pandemic) is reached when S=1/R0S=1/R_{0}, at a time we call TrT_{r}, referring to resusceptibilization (i.e., decaying immune response). Inserting this into Eq 26 yields

1eTr/ρ=11/R0Ih(1+ρ/τ)1-e^{-T_{r}/\rho}=\frac{1-1/R_{0}}{I_{h}(1+\rho/\tau)} (27)

and hence

Tr=ρln[111/R0Ih(1+ρ/τ)].T_{r}=-\rho\ln\left[1-\frac{1-1/R_{0}}{I_{h}(1+\rho/\tau)}\right]\,. (28)

Although this looks rather awkward, it can be rewritten conveniently in terms of the pandemic duration, T0T_{0}, which we would find for infinite ρ\rho. Defining the variable X=T0/(τ+ρ)X=T_{0}/(\tau+\rho), we find

TrT0=1Xln[1X].\frac{T_{r}}{T_{0}}=-\frac{1}{X}\ln\left[1-X\right]\,. (29)

XX is the total duration of the pandemic if no loss of immunity occurs, divided by the average time it takes for a patient from her infection to the loss of immunity after recovery, τ+ρ\tau+\rho. If immunity lasts very much longer than T0T_{0}, XX is small. In this case, the logarithm in Eq 29 can be expanded and we recover TrT0T_{r}\approx T_{0}. If, however, ρ\rho is of order T0T_{0} (remember that T0τT_{0}\gg\tau in all relevant cases), TrT_{r} diverges. This behavior is summarized in Fig 4a, in which XX is chosen as the abscissa. We see that the duration of the pandemic becomes uncomfortably large when the total time from infection to resusceptibilization, τ+ρ\tau+\rho, comes close to the pandemic duration with infinite immunity, T0T_{0} (vertical dotted line).

Refer to caption
Figure 4: Duration of the pandemic and minimum health system capacity. (a) The normalized duration of the pandemic, Tr/T0T_{r}/T_{0}, as a function of the variable X=T0/(τ+ρ)X=T_{0}/(\tau+\rho) (Eq 29). (b) Solid curves: The minimum required health system capacity I^h\hat{I}_{h} to reach herd immunity (Eq 30) as a function of the duration of immunity after recovery, for different values of R0R_{0} (from 1.51.5 to 4.04.0 in steps of 0.50.5). Dotted curve: limit R0R_{0}\rightarrow\infty. Circles represent the scenario for ρ=93τ\rho=93\tau. Open: Ih=0.01I_{h}=0.01. Closed: Ih=0.0025I_{h}=0.0025.

We might now ask how many acute infections the health system must be able to deal with in order to reach herd immunity at all. This can be derived by demanding limtS(t)=1/R0\lim_{t\to\infty}S(t)=1/R_{0} in Eq 26. It is readily shown that the health system capacity required for reaching herd immunity is given by

I^h=11R01+ρτ.\hat{I}_{h}=\frac{1-\frac{1}{R_{0}}}{1+\frac{\rho}{\tau}}. (30)

This is shown in Fig 4b for different values of R0R_{0}. The dotted curve represents the (unrealistic) limiting case R0R_{0}\longrightarrow\infty.

Only with infinite immune response lifetime (ρ\rho\to\infty), we observe an exponential decay of II after herd immunity has been reached (see also Fig 3). To understand the long time dynamics after mitigation (phase III) for finite ρ\rho, we draw the phase portrait (see Fig 5).

Refer to caption
Figure 5: Phase portrait of the uncontrolled SIR model. Phase portrait, (I˙(S,I),S˙(S,I))(\dot{I}(S,I),\dot{S}(S,I)), for the uncontrolled SIR model (α=0\alpha=0) with finite immune response (Eq 24). The solid green curve shows a trajectory in phase III, with initial conditions (circle) I0=IhI_{0}=I_{h} (capacity limit) and S0=1/R0S_{0}=1/R_{0} (herd immunity), The dashed curves (orange) show the nullclines, I˙=0\dot{I}=0 (for S=1/R0S=1/R_{0} or I=0I=0), and S˙=0\dot{S}=0 (for S=(1I)/(IR0ρ/τ+1)S=(1-I)/(IR_{0}\,\rho/\tau+1)). The stable fixed point (diamond) is given by I=I^hI_{\infty}=\hat{I}_{h}, S=1/R0S_{\infty}=1/R_{0}. Parameters: R0=3R_{0}=3, ρ/τ=93\rho/\tau=93, Ih=0.01I_{h}=0.01.

There exist two fixed points, (I1,S1)=(0,1)(I_{1},S_{1})=(0,1), a saddle for R01R_{0}\geq 1, and (I,S)=(I^h,1/R0)(I_{\infty},S_{\infty})=(\hat{I}_{h},1/R_{0}), a stable fixed point for R01R_{0}\geq 1 (see appendix B for details on the linear stability analysis). So for any initial conditions with I0>0I_{0}>0, the uncontrolled system will approach the stationary state, (I,S)(I_{\infty},S_{\infty}). Interestingly, the stationary fraction of infected coincides with the minimal HSS capacity I^h\hat{I}_{h} needed to reach herd immunity.

We have thus shown that given Ih>I^hI_{h}>\hat{I}_{h}, herd immunity can be reached in finite time during mitigation phase II. After mitigation measures have been released (phase III), II converges to I^h\hat{I}_{h} in the long time limit. Moreover, II remains below IhI_{h} (see Fig 5) since re-entering the regime I<IhI<I_{h} from above would require a trajectory to cross itself (not possible for an autonomous system of ODEs (Eq 24) with unique solutions).

IV A few scenarios

Let us finally consider a few scenarios for some typical parameters, as we have in the current COVID-19 pandemic. The maximum number of known acute infections in Germany in spring 2020 was around 100.000, which was well tolerable for the HSS. Depending upon the percentage of cases which are officially recorded, the actual number of infected citizens may be considerably larger. If we assume a factor of two here, corresponding to 200.000 cases, we have Ih0.0025I_{h}\approx 0.0025 (given 80\approx 80 million citizens in Germany). On the other hand, if there are more, and if we also take into account that the HSS could well take a few more patients, we might also consider a scenario with 800.000 acute infections at a time, corresponding then to Ih0.01I_{h}\approx 0.01. In both cases we also have to vary the average lifetime of the immune state, ρ\rho, and observe its effect on the duration of the pandemic.

The two sets of scenarios are represented in the graphs in Fig 6. The remaining fraction of susceptible citizens is shown as the solid curves, while the dashed curves represent the control parameter, α\alpha. As before, we have assumed R0=3R_{0}=3 for the basic reproduction number. We take the value ρ=931\rho=931 days mentioned above for another SARS-CoV strain as a reasonable estimate. Using τ=\tau= ten days, this corresponds to ρ=93τ\rho=93\tau. In order to cover this case, we have used the values ρ/τ={50,93,200,}\rho/\tau=\{50,93,200,\infty\}. For Germany, an HSS capacity of Ih=0.01I_{h}=0.01 (top (a) graph) would correspond to roughly 32%32\% of hospital beds 444We do not consider the need for intensive care units here, one reason being lack of knowledge about the fraction of ICU cases. (500.000500.000 in total) utilized for patients with COVID-19, if we assume a hospitalization rate of 20%20\% 555This is a conservative estimate given that the number published by the Robert Koch Institute Robert Koch Institute (2020) (17%) is based on reported cases only; the true hospitalization rate might be significantly lower.. The bottom (b) graph corresponds to a smaller HSS capacity (Ih=0.0025I_{h}=0.0025), for Germany, corresponding to 8%8\% utilization of hospital beds.

Refer to caption
Figure 6: Typical pandemic scenarios for different average immunity loss times. ρ/τ{50,93,200,}\rho/\tau\in\{50,93,200,\infty\}, corresponding to curves from right to left (or see color code), and different values for IhI_{h}, namely 0.010.01 in the top (a) graph and 0.00250.0025 in the bottom (b) graph. Solid curves: S(t)S(t). Dashed curves: α(t)\alpha(t). The fraction of acutely infected citizens is kept at IhI_{h} in phase II until herd immunity is reached (S=1/R0S=1/R_{0}, horizontal dashed line). If this is successful (if Ih>I^hI_{h}>\hat{I}_{h}, see Eq. 30) phase III begins, i.e., mitigation measures are being released (α=0\alpha=0). For finite immune response (ρ/τ<\rho/\tau<\infty), S(t)S(t) oscillates around its limiting value S=1/R0S_{\infty}=1/R_{0}. In the limit of infinite immune response (ρ/τ=\rho/\tau=\infty), there are no oscillations and S(t)S(t) converges to S=1R=1+W(exp(1R0Ih))S_{\infty}=1-R_{\infty}=1+W(\exp(-1-R_{0}I_{h})), with the Lambert WW function (see also Fig. 3). Parameters: R0=3R_{0}=3, τ=10\tau=10 days.

From the steadily decreasing dashed curves representing α(t)\alpha(t), it is obvious that the mitigation measures can be gradually alleviated as time proceeds. In the top (a) graph (Ih=0.01I_{h}=0.01) for infinite immunity (ρ\rho\to\infty), one would reach the end of mitigation measures after about two years (=66.7τ=66.7\tau, with τ=10\tau=10 days). This is, however, hardly realistic. For the more realistic case, ρ/τ=93\rho/\tau=93, it would take about three years (114.9τ\approx 114.9\tau). For an HSS capacity of Ih=0.0025I_{h}=0.0025, bottom (b) graph, clearly, there would be no chance to ever reach herd immunity for ρ/τ=93\rho/\tau=93. Instead, one would not reach any further than α0.5\alpha\approx 0.5, which still corresponds to rather harsh measures.

It should finally be noted that the number of fatalities is limited for all cases where herd immunity is reached. In particular, if ϕ\phi is the fraction of fatalities among those which are infected, the fraction of fatalities with respect to the population is F=ϕ(1R01)F=\phi(1-R_{0}^{-1}) for infinite ρ\rho. If ρ\rho is finite, we find

F=ϕTrT0(11R0)=(11R0)ϕln(1X)X.F=\frac{\phi T_{r}}{T_{0}}\left(1-\frac{1}{R_{0}}\right)=\left(1-\frac{1}{R_{0}}\right)\frac{\phi\ln(1-X)}{X}. (31)

This is precisely the scaling described by the curve displayed in Fig 4a, which shows that already well below X=1X=1, the death toll incurred by the herd immunity strategy becomes prohibitively high if immune response decay plays a significant role.

V Conclusions

We have shown that for a wide class of cost functions, in order to reach herd immunity without vaccination, it provides an optimal control strategy to keep the effective reproduction number, RR, at unity during the majority of the duration of the pandemic. Deviations which depend upon the specific form of the cost function are limited to a narrow time window and can be considered negligible for practical purposes.

Reducing RR can be achieved through various measures, e.g., increased hygiene, physical distancing, or contact tracing Bulchandani et al. (2020). Keeping RR at the critical value of unity—above which epidemic spreading sets in—is, however, hardly feasible in practice, due to uncertainties as well as observation delays concerning the effects of mitigation measures. Development of robust optimal control scenarios taking such uncertainties into account is left for future investigations.

In this study, costs incurred at time tt have been considered local in time. Cost functions nonlocal in time (with a memory kernel) would be an interesting extension but go beyond the scope of this work. Costs associated with the number of infections have not been considered explicitly. Instead we kept the number of infections below an upper bound, e.g., the capacity limit of the health service system (HSS). Of course there are societal costs due to infections even below the limit of the HSS. However, if herd immunity is the goal and vaccination is not available, then there is no way around a fraction of 11/R01-1/R_{0} of the population going through the infection. Moreover, the effectiveness of specific mitigation measures can depend on the number of infections; while contact tracing is an efficient measure for low case numbers, local health authorities can be overwhelmed if case numbers are high Contreras et al. (2020, 2021). Therefore, the socio-economic costs for establishing a given reproduction number RR might depend on II as well. Here we focused on simple costs functions as a starting point allowing for analytical treatment.

Explicit expressions for the expected duration of the pandemic have been given, and we have seen that the duration of the pandemic increases strongly as the average lifetime of the immune state decreases. In particular, we can conclude that in case the immune response to SARS-CoV2 decays in a similar manner as for the formerly encountered SARS-CoV1 strain Wu (2007), using infection mediated herd immunity as a vaccination strategy for SARS-CoV2 would require a substantial fraction of health system capacity dedicated to COVID-19 patients (see Fig 6). However, as a consequence of global mobility there may be more pandemics coming which show different infection and immune response behavior. We therefore think that our results should be borne in mind for future use, as they are of rather general nature.

References

  • et al. (2020) W. H. O. et al., Report of the who-china joint mission on coronavirus disease 2019 (covid-19), Tech. Rep. (2020).
  • Enserink and Kupferschmidt (2020) M. Enserink and K. Kupferschmidt, Science 367, 1414 (2020).
  • Dehning et al. (2020) J. Dehning, J. Zierenberg, F. P. Spitzner, M. Wibral, J. P. Neto, M. Wilczek,  and V. Priesemann, Science 369 (2020), 10.1126/science.abb9789.
  • Hethcote (2000) H. W. Hethcote, SIAM Review 42, 599 (2000).
  • Harko et al. (2014) T. Harko, F. Lobo,  and M. Mak, Appl. Math. and Comput. 236, 184 (2014).
  • Gros et al. (2020) C. Gros, R. Valenti, L. Schneider, K. Valenti,  and D. Gros, “Containment efficiency and control strategies for the corona pandemic costs,”  (2020).
  • Zlatic et al. (2020) V. Zlatic, I. Barjasic, A. Kadovic, H. Stefancic,  and A. Gabrielli, “Bi-stability of sudr+k model of epidemics and test kits applied to covid-19,”  (2020).
  • Ferguson et al. (2020) N. Ferguson, D. Laydon, G. Nedjati Gilani, N. Imai, K. Ainslie, M. Baguelin, S. Bhatia, A. Boonyasiri, Z. Cucunuba Perez, G. Cuomo-Dannenburg, A. Dighe, I. Dorigatti, H. Fu, K. Gaythorpe, W. Green, A. Hamlet, W. Hinsley, L. Okell, S. Van Elsland, H. Thompson, R. Verity, E. Volz, H. Wang, Y. Wang, P. Walker, P. Winskill, C. Whittaker, C. Donnelly, S. Riley,  and A. Ghani, Report 9: Impact of non-pharmaceutical interventions (NPIs) to reduce COVID19 mortality and healthcare demand, Tech. Rep. (Imperial College London, 2020).
  • Perkins and Espana (2020) A. Perkins and G. Espana, Optimal control of the COVID-19 pandemic with non-pharmaceutical interventions, preprint (Epidemiology, 2020).
  • Djidjou-Demasse et al. (2020) R. Djidjou-Demasse, Y. Michalakis, M. Choisy, M. T. Sofonea,  and S. Alizon, Optimal COVID-19 epidemic control until vaccine deployment, preprint (Infectious Diseases (except HIV/AIDS), 2020).
  • Liu et al. (2020) Y. Liu, A. A. Gayle, A. Wilder-Smith,  and J. Rocklöv, Journal of Travel Medicine 27, taaa021 (2020).
  • He et al. (2020) X. He, E. H. Lau, P. Wu, X. Deng, J. Wang, X. Hao, Y. C. Lau, J. Y. Wong, Y. Guan, X. Tan, et al., Nat Med 26, 672 (2020).
  • Parshani et al. (2010) R. Parshani, S. Carmi,  and S. Havlin, Phys. Rev. Lett. 104, 258701 (2010).
  • Note (1) Convexity of the cost function is a reasonable assumption since one can imagine that chosen mitigation measures become more and more costly as α\alpha approaches unity.
  • Note (2) In principle, f()f(\cdot) could depend on time tt explicitly or involve memory, e.g., because prolonged measures cause disproportinally higher cost. For simplicity, we do not treat such cases here.
  • Kuhn and Tucker (1951) H. W. Kuhn and A. W. Tucker, in Proceedings of the Second Berkeley Symposium on Mathematical Statistics and Probability (University of California Press, Berkeley, Calif., 1951) pp. 481–492.
  • Mangasarian (1966) O. L. Mangasarian, SIAM Journal on Control 4, 139 (1966)https://doi.org/10.1137/0304013 .
  • Becerra (2010) V. M. Becerra, in 2010 IEEE International Symposium on Computer-Aided Control System Design (IEEE, 2010) pp. 1391–1396.
  • Note (3) The same holds for a constant cost function, i.e. if we assume societal costs to be independent of α(t)\alpha(t); numerical data not shown here.
  • Wu (2007) L.-P. Wu, Emerging Infectious Diseases 13, 1562 (2007).
  • Note (4) We do not consider the need for intensive care units here, one reason being lack of knowledge about the fraction of ICU cases.
  • Note (5) This is a conservative estimate given that the number published by the Robert Koch Institute Robert Koch Institute (2020) (17%) is based on reported cases only; the true hospitalization rate might be significantly lower.
  • Bulchandani et al. (2020) V. B. Bulchandani, S. Shivam, S. Moudgalya,  and S. L. Sondhi, “Digital Herd Immunity and COVID-19,”  (2020), arXiv: 2004.07237.
  • Contreras et al. (2020) S. Contreras, J. Dehning, S. B. Mohr, F. P. Spitzner,  and V. Priesemann, “Towards a long-term control of covid-19 at low case numbers,”  (2020).
  • Contreras et al. (2021) S. Contreras, J. Dehning, M. Loidolt, J. Zierenberg, F. P. Spitzner, J. H. Urrea-Quintero, S. B. Mohr, M. Wilczek, M. Wibral,  and V. Priesemann, Nat Commun 12, 1 (2021).
  • Robert Koch Institute (2020) Robert Koch Institute, Coronavirus Disease 2019 (COVID-19). Daily Situation Report of the Robert Koch Institute 29/04/2020, Tech. Rep. (Robert Koch Institute, 2020).

Appendix A First order necessary conditions for optimality

The problem of optimal control is given in Eq. (8). Defining ψ(𝒙(t))=I(t)Ih\psi(\bm{x}(t))=I(t)-I_{h} we rewrite the functional in Eq. 9:

J{α}=0tef(α(t))+𝝀(t)[𝒙˙(t)𝒉(𝒙,α(t))]+μ(t)ψ(𝒙(t))dt,\begin{split}J\{\alpha\}=\int_{0}^{t_{e}}f(\alpha(t))+\bm{\lambda}(t)\cdot[\dot{\bm{x}}(t)-\bm{h}(\bm{x},\alpha(t))]\\ +\mu(t)\psi(\bm{x}(t))\,dt\,,\end{split} (32)

with the complimentary slackness condition μ(t)ψ(𝒙(t))=0\mu(t)\psi(\bm{x}^{*}(t))=0 and μ(t)0\mu(t)\geq 0. The slackness condition can be seen as activation of the constraint, i.e., in the region when the optimal trajectory satisfies ψ(𝒙(t))<0\psi(\bm{x}^{*}(t))<0 the Lagrange multiplier is 0, or in other words the constraint is inactive.

The first order conditions for optimality can be found by setting the first variation of the functional δJ=0\delta J=0. To this end we consider the variations 𝒙(t)=𝒙(t)+η𝝈(t)\bm{x}(t)=\bm{x}^{*}(t)+\eta\,\bm{\sigma}(t), α(t)=α(t)+ηθ(t)\alpha(t)=\alpha^{*}(t)+\eta\,\theta(t) and te=te+ηχt_{e}=t^{*}_{e}+\eta\,\chi for some infinitesimal scalar parameter η\eta. Upon making the substitutions we have:

J=J+ηδJ=0te+ηχf(α(t))+αf|α(t)ηθ(t)+𝝀(t)[𝒙˙(t)+η𝝈˙(t)𝒉(𝒙(t),α(t))𝒙𝒉|𝒙(t)η𝝈(t)α𝒉|α(t)ηθ(t)]+μ(t)ψ(𝒙(t))+𝒙ψ|𝒙(t)η𝝈(t)μ(t)dt,\begin{split}J=J^{*}+\eta\,\delta J=\int_{0}^{t^{*}_{e}+\eta\chi}f(\alpha^{*}(t))+\partial_{\alpha}f|_{\alpha^{*}(t)}\eta\,\theta(t)\\ +\bm{\lambda}(t)\cdot\big{[}\dot{\bm{x}^{*}}(t)+\eta\,\dot{\bm{\sigma}}(t)-\bm{h}(\bm{x}^{*}(t),\alpha^{*}(t))-\\ \bm{\nabla}_{\bm{x}}\bm{h}|_{\bm{x}^{*}(t)}\cdot\eta\,{\bm{\sigma}}(t)-\partial_{\alpha}\bm{h}|_{\alpha^{*}(t)}\cdot\eta\,\theta(t)\big{]}\\ +\mu(t)\psi(\bm{x}^{*}(t))+\bm{\nabla}_{\bm{x}}\psi|_{\bm{x}^{*}(t)}\cdot\eta\,{\bm{\sigma}}(t)\mu(t)\,dt\,,\end{split} (33)

where J=0tef(α(t))+𝝀(t)[𝒙˙(t)𝒉(𝒙(t),α(t))]+μ(t)ψ(𝒙(t))dtJ^{*}=\int_{0}^{t^{*}_{e}}f(\alpha^{*}(t))+\bm{\lambda}(t)\cdot[\dot{\bm{x}^{*}}(t)-\bm{h}(\bm{x}^{*}(t),\alpha^{*}(t))]\\ +\mu(t)\psi(\bm{x}^{*}(t))\,dt. Now noting that 0te+ηχA(t)𝑑t=0teA(t)𝑑t+tete+ηχA(t)𝑑t\int_{0}^{t^{*}_{e}+\eta\chi}A(t)\,dt=\int_{0}^{t^{*}_{e}}A(t)\,dt+\int_{t^{*}_{e}}^{t^{*}_{e}+\eta\chi}A(t)\,dt and tete+ηχA(t)𝑑t=A(te)ηχ\int_{t^{*}_{e}}^{t^{*}_{e}+\eta\chi}A(t)\,dt=A(t^{*}_{e})\eta\chi and considering terms only up to first order in η\eta, we have

δJ=[f(α(te))+𝝀(te)[𝒙˙(te)𝒉(𝒙(te),α(te))]+μ(te)ψ(𝒙(te))]χ+0teαf|α(t)θ(t)+𝝀(t)[𝝈˙(t)𝒙𝒉|𝒙(t)𝝈(t)α𝒉|α(t)θ(t)]+𝒙ψ|𝒙(t)𝝈(t)μ(t)dt.\begin{split}\delta J=\bigg{[}f(\alpha^{*}(t^{*}_{e}))+\bm{\lambda}(t^{*}_{e})\cdot[\dot{\bm{x}}(t^{*}_{e})-\bm{h}(\bm{x}(t^{*}_{e}),\alpha^{*}(t^{*}_{e}))]\\ +\mu(t^{*}_{e})\psi(\bm{x}^{*}(t^{*}_{e}))\bigg{]}\chi\\ +\int_{0}^{t^{*}_{e}}\partial_{\alpha}f|_{\alpha^{*}(t)}\theta(t)+\bm{\lambda}(t)\cdot\big{[}\dot{\bm{\sigma}}(t)-\bm{\nabla}_{\bm{x}}\bm{h}|_{\bm{x}^{*}(t)}\cdot{\bm{\sigma}}(t)\\ -\partial_{\alpha}\bm{h}|_{\alpha^{*}(t)}\theta(t)\big{]}+\bm{\nabla}_{\bm{x}}\psi|_{\bm{x}^{*}(t)}\cdot{\bm{\sigma}}(t)\mu(t)\,dt\,.\end{split} (34)

Making use of the slackness condition, performing integration by parts on the 𝝀(t)𝝈˙(t)\bm{\lambda}(t)\cdot\dot{\bm{\sigma}}(t) term and rearranging the terms we get:

δJ=[f(α(te))+𝝀(te)[𝒙˙(te)𝒉(𝒙(te),α(te))]]χ+0teθ(t)[αf|α(t)𝝀(t)α𝒉|α(t)]𝑑t+0te𝝈(t)[𝝀˙(t)𝝀(t)𝒙𝒉|𝒙(t)+𝒙ψ|𝒙(t)μ(t)]𝑑t+[𝝀(t)𝝈(t)]0te.\begin{split}\delta J=\bigg{[}f(\alpha^{*}(t^{*}_{e}))+\bm{\lambda}(t^{*}_{e})\cdot[\dot{\bm{x}^{*}}(t^{*}_{e})-\bm{h}(\bm{x}^{*}(t^{*}_{e}),\alpha^{*}(t^{*}_{e}))]\bigg{]}\chi\\ +\int_{0}^{t^{*}_{e}}\theta(t)\bigg{[}\partial_{\alpha}f|_{\alpha^{*}(t)}-\bm{\lambda}(t)\cdot\partial_{\alpha}\bm{h}|_{\alpha^{*}(t)}\bigg{]}dt\\ +\int_{0}^{t^{*}_{e}}\bm{\sigma}(t)\cdot\bigg{[}-\dot{\bm{\lambda}}(t)-\bm{\lambda}(t)\cdot\bm{\nabla}_{\bm{x}}\bm{h}|_{\bm{x}^{*}(t)}+\bm{\nabla}_{\bm{x}}\psi|_{\bm{x}^{*}(t)}\mu(t)\bigg{]}dt\\ +[\bm{\lambda}(t)\cdot\bm{\sigma}(t)]_{0}^{t^{*}_{e}}\,.\end{split} (35)

For the last term we make use of the initial conditions 𝒙(0)=𝒙0\bm{x}(0)=\bm{x}_{0}, hence we require 𝝈(0)=𝟎\bm{\sigma}(0)=\bm{0}. The terminal constraint implies R01=S(te)=S(te+ηχ)=S(te)+η(S˙(te)χ+σs(te))+𝒪(η2)R_{0}^{-1}=S(t_{e})=S(t^{*}_{e}+\eta\chi)=S^{*}(t_{e}^{*})+\eta(\dot{S}^{*}(t^{*}_{e})\chi+\sigma_{s}(t^{*}_{e}))+\mathcal{O}(\eta^{2}), and therefore S˙(te)χ+σs(te)=0\dot{S}^{*}(t^{*}_{e})\chi+\sigma_{s}(t^{*}_{e})=0. Taking these into account we finally get the first order necessary conditions for optimal control:

f(α(te))𝝀(te)𝒉(𝒙(te),α(te))=0,\displaystyle f(\alpha^{*}(t^{*}_{e}))-\bm{\lambda}(t^{*}_{e})\cdot\bm{h}(\bm{x}^{*}(t^{*}_{e}),\alpha^{*}(t^{*}_{e}))=0\,, (36)
𝝀˙(t)=𝝀(t)𝒙𝒉|𝒙(t)+𝒙ψ|𝒙(t)μ(t),\displaystyle\dot{\bm{\lambda}}(t)=-\bm{\lambda}(t)\cdot\bm{\nabla}_{\bm{x}}\bm{h}|_{\bm{x}^{*}(t)}+\bm{\nabla}_{\bm{x}}\psi|_{\bm{x}^{*}(t)}\mu(t)\,, (37)
αf|α(t)𝝀(t)α𝒉|α(t)=0,\displaystyle\partial_{\alpha}f|_{\alpha^{*}(t)}-\bm{\lambda}(t)\cdot\partial_{\alpha}\bm{h}|_{\alpha^{*}(t)}=0\,, (38)
λI(te)=0.\displaystyle\lambda_{I}(t^{*}_{e})=0\,. (39)

Appendix B Stability analysis of the uncontrolled SIR model with finite immune response

The uncontrolled SIR model with finite immune response (Eq. 24 with α=0\alpha=0) can be written as:

tS=1τR0SI+1ρ(1SI),tI=1τ(R0SII).\begin{array}[]{r c l}\partial_{t}S&=&-\frac{1}{\tau}R_{0}SI+\frac{1}{\rho}\left(1-S-I\right)\,,\\ &&\\ \partial_{t}I&=&\frac{1}{\tau}(R_{0}SI-I)\,.\\ \end{array} (40)

It has a fixed point at

x=(S,I)=(1R0,11/R01+ρ/τ).\displaystyle x_{\infty}=(S_{\infty},I_{\infty})=\left(\frac{1}{R_{0}},\frac{1-1/R_{0}}{1+\rho/\tau}\right)\,. (41)

Linear stability analysis requires computation of the Jacobian of the dynamical system evaluated at the fixed point. It is given via:

J|x=[1R0τ+ρ1/ρ1/τ1/ρR01τ+ρ0].\displaystyle J|_{x_{\infty}}=\begin{bmatrix}\frac{1-R_{0}}{\tau+\rho}-1/\rho&-1/\tau-1/\rho\\ \frac{R_{0}-1}{\tau+\rho}&0\end{bmatrix}\,. (42)

Its eigenvalues are given by:

λ1,2=ρR0+τ2ρ(τ+ρ)±(ρR0+τ2ρ(τ+ρ))+1R0τρ.\displaystyle\lambda_{1,2}=-\frac{\rho R_{0}+\tau}{2\rho(\tau+\rho)}\pm\sqrt{\left(\frac{\rho R_{0}+\tau}{2\rho(\tau+\rho)}\right)+\frac{1-R_{0}}{\tau\rho}}\,. (43)

The first term is always negative, we thus have three regimes:

λ1,2λ1,2<0:stable nodeλ1,2λ1>0,λ2<0:saddleIm(λ1,2)0Re(λ1,2)<0:stable spiral\begin{array}[]{rl}\lambda_{1,2}\in\mathbb{R}\;\land\;\lambda_{1,2}<0:&\quad\text{stable node}\\ \lambda_{1,2}\in\mathbb{R}\;\land\;\lambda_{1}>0,\,\lambda_{2}<0:&\quad\text{saddle}\\ \operatorname{Im}(\lambda_{1,2})\neq 0\;\land\;\operatorname{Re}(\lambda_{1,2})<0:&\quad\text{stable spiral}\end{array} (44)

In Fig. 7 we show the different regimes of stability. The fixed point xx_{\infty} is stable for any R01R_{0}\geq 1. The stable node regime is limited to a very small, rather unrealistic parameter regime (mainly ρτ\rho\leq\tau, i.e., loss of immunity is faster than recovery from the infection). So for most cases, the fixed point is a stable spiral, in particular for the estimated values for SARS-CoV-2 (ρ/τ93\rho/\tau\approx 93, R03R_{0}\approx 3).

Refer to caption
Figure 7: Stability of the fixed point xx_{\infty} of the uncontrolled (α=0\alpha=0) SIR model with finite immune response (Eq. 40) for different values of R0R_{0} and ρ/τ\rho/\tau. The color encodes the three different regimes.