key: cord-0817303-hintk3yy authors: Ballesteros, Angel; Blasco, Alfonso; Gutierrez-Sagredo, Ivan title: Hamiltonian structure of compartmental epidemiological models date: 2020-07-23 journal: Physica D DOI: 10.1016/j.physd.2020.132656 sha: 4170bdddec6802bf09a351fc69f7d319da825bc4 doc_id: 817303 cord_uid: hintk3yy Any epidemiological compartmental model with constant population is shown to be a Hamiltonian dynamical system in which the total population plays the role of the Hamiltonian function. Moreover, some particular cases within this large class of models are shown to be bi-Hamiltonian. New interacting compartmental models among different populations, which are endowed with a Hamiltonian structure, are introduced. The Poisson structures underlying the Hamiltonian description of all these dynamical systems are explicitly presented, and their associated Casimir functions are shown to provide an efficient tool in order to find exact analytical solutions for epidemiological models, such as the ones describing the dynamics of the COVID-19 pandemic. The recent COVID-19 pandemic has showed that a deeper understanding of the dynamics of the outbreaking and spreading of an infectious disease is necessary [1, 2, 3, 4, 5, 6] . Specially urgent is the need for models that accurately predicts the first stages of an epidemic outbreak [7] , in order to guide a safe reopening of countries and thus avoiding new outbreaks that could be devastating [8] . The origin of the mathematical modeling for epidemics can be traced back to the works of Daniel Bernouilli regarding the spreading of smallpox [9] . Since then the field of mathematical epidemiology has experienced a great development, mainly in the form of very concrete models describing epidemics with specific features [10, 11] . Among them, the so-called compartmental models [12, 13, 14, 15, 16] are based on the classification of the individuals of a given total population in a number of compartments, each of them representing a different stage in the infectious process. In these models, population transitions among different compartments can be assumed to be either deterministic or stochastic. For deterministic models, the movement from one compartment to another is governed by an ordinary differential equation. So, mathematically, these compartmental models are just systems of (nonlinearly) coupled ordinary differential equations (ODEs). Among these models, a prominent role is played by the original SIR model proposed by Kermack and McKendrick [17] , which is expressed by a 3-dimensional dynamical system defined bẏ S(t) = −β S(t) I(t), which is subjected to the initial conditions S(0) = S 0 , I(0) = I 0 and R(0) = R 0 . In this very schematic model the population is divided into 3 compartments: • Susceptible individuals S(t): not infected individuals at time t who could potentially be infected. -Individuals that have been infected at time t < t in the past and have developed immunization to the disease. -Individuals that have died at time t < t. The original SIR model assumes that both the transmission rate β (the probability of any susceptible individual being infected when meeting an infected individual) and the recovery rate α are constants. Moreover, it is also assumed that the immunization is perpetual, so recovered individuals cannot be reinfected. Of course, since there is no transference from the recovered compartment to the other two ones, deaths are considered as 'recovered' individuals. Moreover, the SIR model also assumes that the total population is constant, sinceṠ +İ +Ṙ = 0, and thus S + I + R = N. Note that there is no loss of generality in assuming that N = 1 and therefore thinking of S, I and R as fractions of the total population. This will be the case during the rest of the paper, unless otherwise stated. To be more precise, this model should be interpreted as describing an epidemic whose dynamics is fast enough in order to assume that the size of the population is constant (so no 'vital dynamics' are considered) and such that the recovered individuals are immunized for a long enough time. In this way the change in the total population by causes different from the infection can be neglected. The dynamics of this simple model, which is given in Figure 2 , can be schematically represented by the diagram depicted in Figure 1 . Note that in this kind of diagrams, an arrow going out from a given compartment implies a negative sign for the corresponding term in the r.h.s. of the differential equation for the derivative of the population for such compartment. Since each arrow provides two terms with opposite signs, any model constructed through an arbitrary number of arrows between pairs of compartments will be such that the total population is constant (the sum over all compartments of all the terms at the r.h.s. of the system of ODEs vanishes). Despite its great simplicity, the SIR model of Kermack and McKendric has proved to provide the essential qualitative features of several complex epidemics. In fact, it has been proved to give an accurate quantitative description of the COVID-19 pandemic for some countries [18] . A generalization of the original SIR model that is sensible for viral infections [19, 20] (see also [21, 22] ) consists in substituting the constant transmission rate by a function that depends on the sum of susceptible and infected populations, namely with φ : R + → R + an strictly positive function such that In what follows we will consider this generalization, since all our results will also hold in this case. A large number of compartmental models have been proposed, most of them being extensions of the original SIR system since more complex epidemics may require extra terms in the system of ODEs. For instance, endemic diseases characterized by a non-permanent immunization could be considered, in which an extra arrow connecting the R and S compartments has to appear in the diagram generalizing Figure 1 . Other diseases may present a passive immunity, like maternal passive immunity, in which newborns receive maternal antibodies. This feature is typically modeled by adding an extra compartment to the model. All these models have been shown to be successful in order to model complex epidemics, and they are usually solved through standard numerical techniques for nonlinear systems of ODEs. It is also well-known [23] that the original SIR system (1) admits a Hamiltonian description (for the sake of completeness, a summary of the basics on the theory of Hamiltonian dynamical systems is provided in the Appendix). In this approach, the Hamiltonian function is just the total population with respect to the Poisson structure Moreover, Nutku also proved [23] that the SIR system is bi-Hamiltonian, since there does exist a second Poisson structure which is compatible with the first one (in the sense that {·, ·} = {·, ·} 1 + {·, ·} 2 is a well-defined Poisson structure, see the Appendix), together with a second Hamiltonian function which is not the total population, namely but nevertheless the SIR dynamical system can be again written as the Hamilton's equationṡ which coincides with (10) in the hypersurface of constant population M = H −1 In this case we could have taken C 1 as the second Hamiltonian function. However, we choose not to do so since this will no longer be true in some of the examples presented in this paper. The fact that Casimir functions provide additional integrals for the dynamics is one of the essential features of the Hamiltonian description of dynamical systems. The aim of this paper is to show that a Hamiltonian structure in which the total population plays the role of the Hamiltonian function can be defined for a very large class of (deterministic) compartmental epidemiological models, including certain systems of interacting populations which, to the best of our knowledge, have not been previously considered in the literature. In general, interacting models should be relevant in the context of the current COVID-19 pandemic, where some regions/countries can be described by the same dynamical models of the infection, although with different parameters, and the exchange of individuals among regions must be taken into account for the joint evolution of the pandemic. We stress that, in general, the Poisson structures defining the Hamiltonian structures here presented could be helpful in order to find exact analytical solutions for the corresponding epidemiological models provided that the associated Casimir functions are found. The structure of the paper is the following. In Section 2 we study the most general compartmental model with three compartments and constant population, which we call the generalized SIR model, and we show that this is indeed a Hamiltonian system. Some outstanding instances of this model are considered and, moreover, we show that some compartmental models with non-constant population are equivalent to this system. In Section 3 we prove our main result stating that every compartmental model with constant population is Hamiltonian. In Section 4 we introduce a family of models consisting in an arbitrary number of generalized SIR systems whose compartments also interact by the exchange of individuals from one population to another, and the Hamiltonian structure for these interacting models with constant joint total population is presented. In Section 5 we show that an analogous result is valid, under a mild assumption, by taking arbitrary compartmental models as building blocks for the interacting system. In Section 6 we explicitly present the bi-Hamiltonian structure of several compartmental models, in particular of the SIR model with a vaccination function and the endemic SIRS system. Finally, in Section 7 we find exact analytical solutions for some of the examples previously considered, which reduce to the exact analytical solution of the SIR model when the relevant parameters vanish. A Section including some comments and open questions closes the paper. The basic SIR system (1) of Kermack and McKendrick can be extended in order to include more general interactions among the susceptible, infected and recovered compartments. In fact, the most general 3dimensional dynamical system containing the original SIR (with the generalized transmission rate β(S + I) given by (4) ) and maintaining the total population constant, which we call the generalized SIR system, can be written asṠ = −βSI − ϕ S→I (S, I, R) − ϕ S→R (S, I, R), where ϕ A→B (S, I, R) represents the transfer function from the compartment A to the compartment B, which in general are allowed to be arbitrary functions of S, I and R. Obviously the original terms of the SIR system could be absorbed in ϕ A→B (S, I, R), but for the sake of clarity we choose not to do so. This system is represented by the following schematic diagram: where the direction of an arrow simply shows the transference of individuals given by the positive part of the corresponding function. Of course, composition of arrows is allowed, and blue arrows are the corresponding ones to the original SIR model. Indeed, such a generic system does not need to be biologically relevant, since not all choices for ϕ A→B (S, I, R) describe sensible epidemiological models. However, different choices of these functions do lead to systems catching key features of different epidemiological situations. In any case, in the sequel we show that such a generalized SIR (13) system admits a unified description as a Hamiltonian system. For concreteness, we consider the generalized SIR model (13) , with β = β(S + I) of the form (4) and α constant. However we should stress that the following result is valid for α(S, I) and β(S, I) arbitrary functions of S and I. We have the following with Proof. Hamilton's equations for (14) and (15) which agrees with (13) under the identification (16) . Moreover, it is easy to check that {·, ·} is a well-defined Poisson structure, since the Jacobi identity holds. The total phase space for the system is thus R 3 + . However, the fact that the Hamiltonian function H : together with the fact that the Hamiltonian is just the total population implies that the dynamics of the system takes place on M = H −1 (1) (recall that local coordinates S, I, R are interpreted as fractions of the total population, which is conserved). Therefore, the restriction of any function F : , thus proving that the Hamiltonian system allows to include arbitrary functions of R. With this notation, which is the one that we will use throughout the paper, the explicit dependence of R can be avoided, and the generalized SIR model is represented by the following diagram: Note that the fact that ϕ 1 (S, I) and ϕ 2 (S, I) can be arbitrary functions of S, I, while satisfying Jac(S, I, R) = 0, can be traced back to the fact that {S, I} vanishes (15). The following particular examples will play an important role in the rest of the paper. Example 1 (Original SIR model). The original SIR system (1) is recovered by setting β(S + I) = β and ϕ 1 (S, I) = ϕ 2 (S, I) = 0. ♦ Example 2 (Endemic SIRS model). An endemic disease is characterized by a non-permanent immunization, in such a way that the individuals that have been infected can be re-infected after a sufficiently large amount of time. A simple model capturing this feature is recovered from (17) by setting ϕ 1 (S, I) = µI and ϕ 2 (S, I) = −µI. The ODE system becomesṠ = −βSI + µ I, The SIRS endemic model, whose typical dynamics is shown in Figure 4 , is represented by the diagram of Figure 3 . Figure 2 ) the infection disappears. However, due to the temporal immunization, the susceptible population does not vanish for t large, thus making future outbreaks possible. Example 3 (SIR model including a vaccination function). Systems that model vaccinated populations are specially interesting, since they allow to design optimal vaccination strategies (see for example [24, 25] ). Setting ϕ 1 (S, I) = −v(S, I) and ϕ 2 (S, I) = 0 in the generalized SIR (17) we have the systeṁ If v : R 2 + → R + is a strictly positive function, this model describes a population that is receiving a vaccination during the epidemic outbreak. The diagram of a SIR model including vaccination, together with an example of its dynamics are given in Figures 5 and 6 , respectively. The following choices for the vaccination function will play a prominent role in the following: a) v(S, I) = vI and b) v(S, I) = vS, with v ∈ R + . ♦ Example 4 (SIR with vital dynamics). Models that include vital dynamics, i.e. models that take into account the deaths and newborns in the population during the epidemics, do also fit in the generalized SIR system (13) , provided that the total population remains constant. The dynamical system for such a model 7 J o u r n a l P r e -p r o o f Journal Pre-proof is given byṠ where d S , d I , d R are the death rates for each compartment, and the born rate is adjusted to keep the population constant. In fact, if d S = d I = d R = d, then the newborns would be proportional to the total population S + I + R, which is usually the assumption used for these kind of models. This system is thus represented by the diagram In order to rewrite this model in the form (15) we just have to set and we also have to restrict the dynamics to H = S + I + R = 1. The diagram of the system is given in Figure 7 while a possible dynamics is presented in Figure 8 . All the models considered so far have a constant population. However, some models with a non-constant population can be also considered in this framework. Let us set S(t)+I(t)+R(t) = N (t) the total population, which is a non-constant function of time. Thus we have d dt so let us define If we assume an exponential growth of the total population, we have thaṫ For instance this is the case for models including vital dynamics with equal death rates for each compartment. Under this assumption, the dynamics of a generalized SIR model with non-constant population readṡ If ϕ 1 , ϕ 2 are linear functions (most of the models do consider this assumption), we have that is thus satisfied. In this way, any generalized SIR model with ϕ 1 , ϕ 2 linear and with a non-constant population with exponential growth, turns out to be equivalent to a generalized SIR model (17) with constant population. Therefore, all the results presented in this paper are also valid for this type of systems. In general, being Hamiltonian is quite a restrictive property for a dynamical system. However, we have just proved that the generalized SIR model (13) is Hamiltonian with no restrictions, and this suggests that a deeper understanding of this result should be possible. In fact, it turns out that this is a particular case of a much more general finding, which essentially states that any compartmental model with constant population is a Hamiltonian system. J o u r n a l P r e -p r o o f be a system of ODEs, such thatẋ 1 + · · · +ẋ M = 0. This system is a Hamiltonian system, with and fundamental Poisson brackets given by Proof. Clearly, there are only M − 1 independent equations, sincė Hamilton's equations reaḋ so the dynamical system is recovered from the Hamiltonian structure, and all Jacobi identities are satisfied since {{·, ·}, ·} = 0, because the subalgebra defined by x 1 , . . . , x M −1 is Abelian: From this result, and taking into account that the Hamiltonian is a conserved quantity, we straightforwardly deduce the following Corollary 1. Every compartmental model with constant population is a Hamiltonian system. Moreover, we have that Proposition 1 is just a particular case of the previous Proposition 2, with M = 3, x 1 = S, x 2 = I and x 3 = R. Moreover, Proposition 2 shows that the generalized SIR system (13) can be naturally written as a Hamiltonian system for two extra Poisson structures, in both cases by keeping the same Hamiltonian. The first Poisson structure corresponds to take x 3 = I and reads while the second one corresponds to x 3 = S and is given by The existence of different Poisson structures will be relevant in the following Section, since each of them will allow us to define different interacting SIR models. J o u r n a l P r e -p r o o f Journal Pre-proof As an application of the result presented above, namely that every compartmental epidemiological model with constant population is a Hamiltonian system, we present the Hamiltonian structure for the SEIR system [13] . This model differs from SIR in the existence of an extra compartment, E, representing the individuals that have been exposed to the infection but are not infective yet. Therefore, this model accounts for infections that present an incubation period. As we did for the SIR model, we can define a family of generalized SEIR systems, defined by the following system of ODEṡ The aim of this Section is to show that we can define an epidemiological Hamiltonian system providing the dynamics of N populations P 1 , . . . , P N , each of them presenting the 'internal' dynamics of a generalized SIR model (13) , and such that the N populations interact through an arbitrary transference from one compartment of P a to the same compartment of P b . We stress that the model will allow for the transference function to be an arbitrary function τ ab (S a , I a , S b , I b ) of the variables of the populations involved. For the sake of brevity, we only present the results for the case in which the interacting compartments are R a (recovered individuals) which is the model constructed from the Hamiltonian description (1). However, the brackets (37) and (38) allow to construct Hamiltonian interacting systems with interacting compartments I a and S a , respectively. Proposition 3. Let us consider the Hamiltonian system defined by the 3N-dimensional Poisson algebra with fundamental Poisson brackets {S a , R a } = −β a S a I a + ϕ a,1 (S a , I a ), for a, b ∈ {1, . . . , N } and b = a, while the remaining Poisson brackets vanish. The Hamiltonian function defines a dynamical system with N interacting populations P 1 , . . . , P N , each of them evolving according to the dynamics of a generalized SIR model (17) . The generalized SIR dynamics for each population can be arbitrary and, in particular, different for each population. Each pair of populations P a and P b interact by means of the transference of recovered individuals from R a to R b given by τ ab (S a , I a , S b , I b ). Therefore, the dynamics of each population P a is that of a generalized SIR model, with arbitrary α a , β a , ϕ a,1 (S a , I a ) and ϕ a,2 (S a , I a ) for each of them. Moreover, the population P a interact with the population P b by means of the transfer function τ ab (S a , I a , S b , I b ) between R a and R b . The proof that (42) indeed defines a Poisson algebra is a direct consequence of the fact that {f 1 , f 2 } ⊂ C ∞ (S 1 , I 1 , . . . , S N , I N ) for any smooth functions f 1 , f 2 , and C ∞ (S 1 , I 1 , . . . , S N , I N ) is a Poisson commutative subalgebra. Note that the total population for this system is indeed kept constant under the chosen interactions, sinceṠ +İ +Ṙ = For example, taking N = 3 in the previous Proposition we obtain the system represented by the following diagram τ 21 (S 2 , I 2 , S 1 , I 1 ) An example of the dynamics for this kind of interacting systems is presented in Figure 9 . The previous Section presents the case of N interacting generalized SIR systems. We recall that in Section 3 we have proved that any compartmental model with constant population can be also written as a Hamiltonian system in a similar manner. Therefore, it seems natural to wonder whether we can define interacting Hamiltonian systems based on more general epidemiological models. This is indeed the case, if the dynamical system defining the dynamics of each population depends only on M − 1 out of the M compartments, in the form described in the following Proposition 4. Consider a system of M × N ODEs given bẏ This system is Hamiltonian with respect to the Poisson structure Proof. Hamilton's equations reaḋ which coincides with (46). The fact that {x 1 a , . . . , x M −1 a } are Abelian Poisson subalgebras for all a ∈ {1, . . . , N } implies that all the Jacobi identities are trivially satisfied, since the only non-trivial Poisson brackets are contained in some product of this commutative subalgebras, and therefore {{g, g }, g } = 0 for any functions g, g , g . Note that we have assumed that the functions defining the dynamical system do not depend of x M . This is similar to the assumption in Proposition 2, but there we argued that the system is the most general for models with constant population, since we can restrict the dynamics to H −1 (1) and we could write This is no longer true for interacting systems, since the population of each P a is not conserved. However, note that the total population for the complete system is indeed conserved, since 6 Bi-Hamiltonian structure of epidemic models As it was mentioned in the Introduction, the original SIR system is bi-Hamiltonian [23] . In fact, some specific generalizations of this system were proved to be bi-Hamiltonian in [26] . In this Section we show that the systems given in Examples 2-3 are bi-Hamiltonian. Moreover, by coupling N of those bi-Hamiltonian systems we obtain different families of 3N -dimensional bi-Hamiltonian systems. again define a Poisson structure with vanishing Jacobi identity. In fact, this is the generalization to µ = 0 of the Poisson structure considered in [23] . Proposition 6. The particular case of the Hamiltonian system defined in Proposition 3, with α a and β a constants, ϕ a,1 = µ a I a , ϕ a,2 = −µ a I a and τ ab (S a , I a , S b , I b ) = τ ab , is bi-Hamiltonian, with the second Poisson structure given by the non-zero fundamental Poisson brackets {I a , R a } 2 = −β a S a I a + µ a I a , and the Hamiltonian being Proof. The system defined by the second Hamiltonian structure is given bẏ which coincides with (44) setting ϕ a,1 = µ a I a , ϕ a,2 = −µ a I a and τ ab (S a , I a , S b , I b ) = τ ab . The proof that {·, ·} 2 is a Poisson structure is straightforward since the N Jacobi identities involving variables from a single population are satisfied by Proposition 5, while the rest of the Jacobi identities are fulfilled just by noting that {{X, Y }, Z} = 0 whenever X, Y, Z do not belong to the same population, due to the fact that the only non-vanishing bracket among different populations is a constant function. Finally, the compatibility between {·, ·} 1 and {·, ·} 2 is proven by computing the Jacobi identities for {S a , I a } = {S a , I a } 1 + {S a , I a } 2 = −β a S a I a + µ a I a , which was already proven in Proposition 5. Similar results to those of Propositions 5 and 6 can be obtained for the system from Example 3 a) and b), corresponding to a SIR system in which the susceptible population is vaccinated with a rate proportional to I and S, respectively. In particular, these systems are bi-Hamiltonian, and N such systems can be coupled by preserving a bi-Hamiltonian structure for the corresponding 3N -dimensional system. As the proofs of these results are similar to those of Propositions 5 and 6 we omit them for the sake of brevity. The particular case of the Hamiltonian system defined in Proposition 3, with α a and β a constants, ϕ a,1 = −v a I a , ϕ a,2 = 0 and τ ab (S a , I a , S b , I b ) = τ ab , is bi-Hamiltonian, with the second Poisson structure defined by the non-zero fundamental Poisson brackets and the Hamiltonian and the Hamiltonian Note that in Propositions 5, 7 and 9 the second Hamiltonian H 2 is not a Casimir for the first Poisson algebra {·, ·} 1 . However, in each case the Casimir of this first Poisson algebra is obtained from H 2 by substituting R → S + I, so these two functions indeed coincide on the hypersurface of constant population. Obviously, this Casimir could have been taken equivalently as the second Hamiltonian function. However, this is no longer true for the interacting case. Although the exact integrability of different epidemiological models has attracted some attention (see for instance [27, 28] ), only recently the exact analytical solution of the original SIR system has been found [11, 29] . In this Section we show that the Hamiltonian structure is useful in order to find exact analytical solutions for the systems from Examples 2 -3, which are generalizations of the original SIR system. In particular, we use the fact that any 3-dimensional Poisson manifold has one Casimir function in order to reduce the 3-dimensional dymensional system to a 1-dimensional problem, which can be always integrated by quadratures. For all the following systems, we solve the differential equations for the initial conditions S(0) = S 0 , I(0) = 1 − S 0 and R(0) = 0. This is equivalent to consider the dynamics restricted to the symplectic leaf given by the value C = 0 of the Casimir function. where we have fixed the level set C = 0 onto which the dynamics takes place by means of the abovementioned initial conditions. From here we have that The conservation of the Hamiltonian (the total population is constant under the dynamics) allows us to write Therefore, the first equation from (20) readṡ and therefore Setting we have that the solution of the SIRS endemic system (20) is given by ♦ Example 6 (Analytical solution of the SIR model with vaccination rate ∝ I). The procedure to find an exact solution to the system from Example 3 a) is similar. Recall from Proposition 7 that the Casimir reads so The very same integration procedure shows that the solution of the system from Example 3 a) reads where now Σ(t) is defined by ♦ Example 7 (Analytical solution of the SIR model with vaccination rate ∝ S). The system from Example 3 b) presents a further complication, and we can only obtain the analytical solution in terms of two inverse functions. From Proposition 9 we have that the Casimir, with the appropriate initial conditions, reads If we denote the solution of the equation C = 0 by R(t) = ρ(S(t)), we have that and the solution of the system from Example . (81) Note that in all these examples the limit µ → 0 or v → 0 is well defined and leads to the analytic solution to the original SIR system given in [11, 29] . This is a general fact for the generalized SIR system (13) , since it can be thought of as an integrable deformation of the original SIR model (1) , and therefore it can be expressed as a Hamiltonian system for a Poisson structure which is a deformation of (8). In turn, the corresponding Casimir functions are always deformations of (10) in terms of the parameters µ and v. Compartmental models are widely used to model the dynamics of epidemics. In this work we have proved that any compartmental model with constant population is a Hamiltonian system in which the total population plays the role of the Hamiltonian function. This general result implies that all the analytical and geometrical tools connected with Hamiltonian systems can be applied in order to tackle epidemiological dynamics. Moreover, we have also showed that a large number of models with non-constant population can be transformed into effective models with constant population, so all the previous results hold also for them. We have also found that compartmental models can be coupled, by keeping a Hamiltonian structure, in order to define interacting systems among different populations whose individuals can be interchanged. Moreover, three models which are generalizations of the original Kermack and McKendrick model have been proven to be bi-Hamiltonian, and their interacting analogues are shown to give rise to large families of bi-Hamiltonian systems. As a direct application of the Hamiltonian structures here presented, we have obtained the exact analytic solutions for these three bihamiltonian models by making use of Casimir function of each corresponding Poisson algebra. This method indeed leads to the solutions found in [29] for certain limiting cases, which are obtained provided the appropriate parameters vanish. Such Poisson-algebraic approach to analytical solutions for epidemiological models is indeed worth to be explored for other systems here presented, and becomes specially useful when the dimension and the number of parameters of the model increase, since analytic solutions have the potential to greatly simplify the analysis of the dynamical role played by each parameter. We stress that this approach strongly relies upon the characterization and explicit computation of the Casimir functions of the Poisson structure associated to each model, a problem which is currently under investigation. Moreover, the Hamiltonian nature of compartmental systems opens the path to the use of symplectic integrators [30, 31] as a natural and efficient tool in order to face the integration problem for these systems. Therefore, the use of the latter as benchmarks in order to compare the accurateness and efficiency of ordinary integrators versus symplectic integrators is also worth to be investigated. Finally, the Hamiltonian structure here presented allows us to apply the well-known machinery of integrable deformations of Hamiltonian systems in order to define new compartmental models as integrable deformations of the dynamical systems here studied, including coupled ones. In particular, deformations based on Poisson coalgebras [32] provide a suitable arena in order to face this problem by following the same techniques that have been previously used, for instance, in order to get integrable deformations and coupled versions of Lotka-Volterra, Lorenz, Rössler and Euler top dynamical systems [33, 34, 35] . Work on this line is in progress and will be presented elsewhere. Let M be a smooth manifold and let us denote its algebra of smooth functions by C ∞ (M ). A Poisson structure on M is given by a bivector field π ∈ Γ( 2 T M ) such that [π, π] = 0, where [·, ·] : Γ( A Poisson structure on M induces a vector bundle morphismπ : T * M → T M from the cotangent bundle to the tangent bundle of M . The linear morphismπ m : T * m M → T m M is not in general an isomorphism, since the Poisson structure can be degenerate. We call the rank of the Poisson structure π at m ∈ M to the rank of the linear mapπ m , which is always even due to the skew-symmetry of π. This vector bundle morphism defines a morphism between the respective spaces of sections of such bundles Γ(T * M ) = Ω 1 (M ) and Γ(T M ) = X(M ), which we denote by π : Ω 1 (M ) → X(M ). This morphism induces a map from functions to vector fields, given by for any f ∈ C ∞ (M ). The vector field X f is called the Hamiltonian vector field associated to f . We say that C ∈ C ∞ (M ) is a Casimir function if its exterior derivative belongs to the kernel of π , i.e. π (dC) = 0. In terms of the Poisson bracket we have that {C, f } = 0 for all f ∈ C ∞ (M ). Given a Poisson manifold (M, π) and a smooth function H : M → R called the Hamiltonian, the dynamical evolution of any any function is given by the Hamilton's equationṡ f = π (dH), f . A Poisson manifold together with a Hamiltonian function is called a Hamiltonian system. In this way, it is clear that the evolution of a Hamiltonian system is given geometrically by the integral curves of the Hamiltonian vector field X f . In terms of the Poisson bracket, Hamilton's equations reaḋ Given two Poisson structures π 1 and π 2 on the same manifold M we say that they are compatible if π = π 1 + π 2 is a Poisson structure. In fact, if there are two compatible Poisson structures on M we can find an infinite number of them, since π = (1 − λ)π 1 + λπ 2 is a Poisson structure. This family of Poisson structures is called the Poisson pencil. Essentially, bi-Hamiltonian systems are Hamiltonian systems whose (unique) dynamics can be endowed with two different Hamiltonian structures. We have that X H1 = π 1 (dH 1 ) = π 2 (dH 2 ) = X H2 (87) Therefore, Hamilton's equations readḟ = π 1 (dH 1 ), f = π 2 (dH 2 ), f , or equivalently,ḟ = {f, Among Hamiltonian systems, those that posses a sufficient number of conserved quantities are particularly interesting, since these quantities can be used to find the solutions of the system. Furthermore, the Hamiltonian system is called maximally superintegrable if, additionally, there exist g 1 , . . . , g n−1 ∈ C ∞ (M ) such that and {H, g a } = 0. Functions that Poisson commute with the Hamiltonian are called additional first integrals. Therefore, a system is completely integrable if it admits n − 1 functionally independent additional first integrals, while it is maximally superintegrable if it admits 2n − 2. For completely integrable systems, Liouville-Arnold theorem guarantees that the solution can be found by quadratures if the canonical transformation to actionangle coordinates is known. Maximally superintegrable systems are particular cases of completely integrable systems for which the dynamics is strictly unidimensional. For Hamiltonian systems defined on an arbitrary Poisson manifold (M, π) the notions of complete and maximal superintegrability are intimately related to the Casimir structure of the Poisson manifold, which is a geometrical property of (M, π) independent of the particular Hamiltonian system under consideration. In particular, any Casimir function is a first integral for any Hamiltonian system defined on (M, π). -Any epidemiological compartmental model with constant population is shown to be a Hamiltonian dynamical system. -The Hamiltonian function is the total population. -Some generalizations of the SIR system are shown to be bi-Hamiltonian. -A large family of (bi-)Hamiltonian coupled compartmental models is introduced. -Casimir functions associated to the Hamiltonian structures can be used to find analytical solutions to the models. Effective containment explains subexponential growth in recent confirmed COVID-19 cases in China. Science (80-. ) Analysis and forecast of COVID-19 spreading in China Estimating the infection horizon of COVID-19 in eight countries with a datadriven approach Mathematical Modeling of COVID-19 Transmission Dynamics with a Case Study of Wuhan A mathematical model for the novel coronavirus epidemic in Wuhan Dynamics of COVID-19 pandemic at constant and timedependent contact rates Mathematical models to characterize early epidemic growth: A review The effect of control strategies to reduce social mixing on outcomes of the COVID-19 epidemic in Wuhan, China: a modelling study Essai d'une nouvelle analyse de la mortalité causée par la petite vérole, et des avantages de l'inoculation pour la prévenir Non-linear incidence and stability of infectious disease models A Note on the Derivation of Epidemic Final Sizes Asymptotic behavior in a deterministic epidemic model Global dynamics of a SEIR model with varying total population size Modeling the Spread of Ebola with SEIR and Optimal Control Mathematical models of SIR disease spread with combined non-sexual and sexual transmission routes A contribution to the mathematical theory of epidemics Estimation of COVID-19 dynamics 'on a back-of-envelope': Does the simplest SIR model provide quantitative parameters and predictions? A generalization of the Kermack-McKendrick deterministic epidemic model Models for the spread of universally fatal diseases The Kermack-McKendrick epidemic model revisited Bi-Hamiltonian structure of the Kermack-McKendrick model for epidemics Immuno-epidemiological model of two-stage epidemic growth Effects of information-dependent vaccination behavior on coronavirus outbreak: insights from a SIRI model Poisson structure of dynamical systems with three degrees of freedom An integrable SIS model Application of Symmetry and Symmetry Analyses to Systems of First-Order Equations Arising from Mathematical Modelling in Epidemiology Exact analytical solutions of the Susceptible-Infected-Recovered (SIR) epidemic model and of the SIR model with equal death and birth rates Construction of higher order symplectic integrators Symplectic integrators for Hamiltonian problems: an overview A systematic construction of completely integrable Hamiltonians from coalgebras Integrable deformations of Lotka-Volterra systems Integrable deformations of Rössler and Lorenz systems from Poisson-Lie groups Poisson-Lie groups, bi-Hamiltonian systems and integrable deformations This work has been partially supported by Ministerio de Ciencia e Innovación (Spain) under grants MTM2016-79639-P (AEI/FEDER, UE) and PID2019-106802GB-I00/AEI/10.13039/501100011033, and by Junta de Castilla y León (Spain) under grants BU229P18 and BU091G19.