1 Introduction

Relatively simple epidemiological models typically either: (i) converge without oscillation to a disease-free equilibrium, (ii) spiral into an endemic equilibrium from most initial points, or (iii) move away from most initial points near either equilibria toward a periodic orbit. It has long been noted that historical disease data does not suggest that any of the above are typical. (See Brauer et al. [1] and Manfredi and d’Onofrio [2].) Many researchers, both theoretical and empirical, have introduced “extensions” to the simple models to explain observed irregular periods and amplitudes in disease outbreaks.

There have been many avenues of approach, including the introduction of: (i) age structure, following Schenzle [3], Bolker and Grenfell [4], Bolker [5]; (ii) sinusoidal seasonal forcing, which began in 1929 with the work of Soper [6] and is still active today in the work of Bartlett [7], Bailey [8], Aron and Schwartz [9], Acedo et al. [10], Billings and Schwartz [11], Katriel and Stone [12]; (iii) school term-time forcing, Earn et al. [13], Keeling et al. [14], Rohani et al. [15], Olinky et al. [16], Diedrichs et al. [17]; (iv) stochasticity, Bartlett [7], Zhao [18]; and delays from various sources, including (v) vaccination demand responding with delay to outbreaks, Buonomo et al. [19, 20], d’Onofrio et al. [21, 22]; (vi) vaccination giving temporary immunity, with recovered returning to susceptibility after delay, Greenhalgh et al. [23], and (vii) changes in peoples’ contact rates in response to the history of disease prevalence, d’Onofrio and Manfredi [24]. See [1, 2] for a more extensive review.

Researchers working on both sinusoidal seasonal forcing and discrete school-related term-time forcing models have found that irregular periods/amplitudes can exist when the forcing is strong, e.g., transmissibility must be much higher when school is in session than when it is not [4, 11, 12, 14, 15]. At the same time, simple distributed delay models including vaccination demand based on past prevalence with “weak” Erlangian kernels do not appear to give rise to irregular dynamics, though higher order Erlang functions (or discrete delay systems) can produce chaos when delay is long [25, 26]. Hence, either model extension can yield exotic dynamics, but only with strong forcing or long delay. In the present paper we are interested in combining discrete school-related term-time forcing with high order distributed delay between disease outbreaks and the vaccination demand to see if a model containing both effects yields irregular dynamics with more moderate levels of forcing strength and delay.

We are not the first to examine a SIR model with delay and temporal forcing. In 2009 d’Onofrio and Manfredi [24] modeled a SIR system where the contact rate is influenced by past levels of disease prevalence, and they mention at the end that chaos was found when sinusoidal seasonal forcing is attached to the resulting contact rate. And in 2013, d’Onofrio, Manfredi, and Salinelli [27] modelled a SIR system employing several different means of linking current vaccinations to past values of prevalence and with the contact rate incorporating sinusoidal forcing, noting “how complex the interplay between infection transmission and vaccinating behaviour might be” [2, p. 287]. We see our present work as an extension of the two previously mentioned papers [24, 27] to discrete term-time forcing and high-order distributed delay. Our main finding is that when both delay and term-time forcing are included in an SIR model, irregular dynamics occur with much lower values of both term-time forcing strength and delay duration.

In Sect. 2, we describe the SIR model used and give some general results. In Sect. 3, we look at equilibrium and stability issues. Section 4 contains numerical results. We explore a pure term-time forcing model in Sect. 4.1 and a pure delay model in 4.2. These provide a baseline for Sect. 4.3, in which we activate both factors and find irregular dynamics with moderate forcing strength and more reasonable mean delay durations. Section 5 offers conclusions.

2 The model

The general topic of temporal forcing has been studied for years in mathematical epidemiology. There are two main branches: sinusoidal forcing and term-time forcing. Sinusoidal forcing has been studied extensively [6,7,8,9,10,11,12]. In sinusoidal forcing models, we see equations for the transmission term at time t, \(\lambda \)(t), typically in the form \(\lambda (t)=\lambda _0 (1+\lambda _1 \cos (\frac{2\pi }{365}t)),\) for an annual forcing with t measured in days. This would be the natural way to include effects from mean area temperature, hours of daylight, and other smooth events which repeat annually. The second branch of temporal forcing is typically called “term-time forcing,” and it generally employs a step function, like f(t) below, to model the contact rates, with high rates when school is in session and low rates when it is not [3, 13,14,15,16,17].

In the following formulation, time, t, is continuous, and the model is calibrated in days. We assume that \(t = 0\) occurs on the first moment of the first day of the first (arbitrarily chosen) reference year. We further assume that a year is exactly 365 days long. If we let \(\llbracket {x}\rrbracket \) denote the largest integer less than or equal to x, then \(\llbracket {mod(t +1, 365)}\rrbracket \) maps all t onto the set of integers between 1 and 365. To illustrate: if \(t = 17.65\), mod(t + 1, 365) \(=\) 18.65, and we are 65% of the way through day 18 in first year; and 950 years later, when \(t =\,\)346,768, we are again in the \(18{\mathrm{th}}\) day of the year. It is handy to have a notation signifying the day of the year. We will use \(T \in \{1,2,{\ldots }, 365\}\). Subscripts under T will denote specific days of interest. Our term-time forcing function is given as follows:

$$\begin{aligned} f\left( t \right) =\left\{ {{\begin{array}{ll} \lambda _{2} &{}\quad if \, mod\left( {t+1,365} \right) \in \left[ {T_{Sb} ,T_{Se} } \right] \cup \left[ {T_{Fb} ,T_{Fe} } \right] \\ \lambda _{1} &{}\quad if \, mod\left( {t+1,365} \right) \notin \left[ {T_{Sb} ,T_{Se} } \right] \cup \left[ {T_{Fb} ,T_{Fe} } \right] \\ \end{array} }} \right. . \end{aligned}$$

The function f assigns either the disease transmission value \({\lambda }_{1}\) or \({\lambda }_{2}\) to every value of t,  depending upon whether or not school is in session. We assume that the Spring school term is in session between the days of the year \(T_{Sb}\) and \(T_{Se}\) and Fall term is in session between \(T_{Fb}\) and \(T_{Fe}\). When school is in session, the transmission term is \({\lambda }_{2}\). When school is not in session, the transmission term is \({\lambda }_{1}\). Weekends during the school term are counted as school time. For convenience, we assume, 0 \(<T_{Sb}< T_{Se}<T_{Fb}<T_{Fe}<365.\) Be sure to note that t is a continuous real variable increasing smoothly as time advances, while T is taken from the sub-set of the natural numbers between 1 and 365 designating to the day of the year.

The term-time forcing function is now embedded in an SIR model of childhood vaccination, where the vaccination uptake rate follows prior levels of disease prevalence with distributed delay. This follows Buonomo et al. [19, 20] and d’Onofrio et al. [21, 22].

$$\begin{aligned} \begin{array}{l} \displaystyle \frac{dS(t)}{dt}=bN-bN\min [k_1 +k_2 \frac{1}{N}\int \limits _0^\infty {I(t-\tau )G(\tau )} d\tau , V_m ]-f(t)\frac{S(t)I(t)}{N}-bS(t) \\ \displaystyle \frac{dI(t)}{dt}=f(t)\frac{S(t)I(t)}{N}-\gamma I(t)-bI(t) \\ \displaystyle \frac{dR}{dt}=\gamma I(t)+bN\min [k_1 +k_2 \frac{1}{N}\int \limits _0^\infty {I(t-\tau )G(\tau )} d\tau , V_m ]-bR(t) . \\ \end{array} \end{aligned}$$
(System 1)

SI,  and R give the number of persons in the susceptible, infectious and recovered classes, respectively. \(N=S+I+R\) is the population size. It is easy to verify that N is fixed, so we can drop R from the dynamic analysis, solving for R whenever interested by using \(R=N - S - I\). Parameter b is the birth rate; \(\gamma \) is the recovery rate; \(k_{1}\) is the fraction that vaccinates regardless of past levels of prevalence; \(k_{2}\) determines (in part) the size of the endogenous vaccination response to past prevalence; and \(V_{m}\) is a limiting value on the fraction of newborns that can (or will) vaccinate. The function G(\(\tau \)) comes about as follows: One can imagine different individuals with varying personal delay durations (\({\tau }_{i}, {\tau }_{j}, {etc}.\)) between a disease outbreak and their vaccination responses. These differences may be due to the dissimilarities in the timeliness of their receipt of information on outbreaks of disease, their personal risk assessments, proclivity to procrastinate, and many other factors. G(\(\tau \)) is the probability distribution characterizing the array of personal delay times over the whole population. The expression \(\int \limits _0^\infty {I(t-\tau )G(\tau )} d\tau \) in the above set of integro-differential equations has G(\(\tau \)) assigning weights to all past levels of disease prevalence according to how long ago (\(\tau \)) that prevalence level existed. We assume that G(\(\tau \)) is an Erlang function, which is given by

$$\begin{aligned} G(\tau )=\frac{a^{n}\tau ^{n-1}e^{-a\tau }}{(n-1)!}. \end{aligned}$$

Here, \(\tau \) is a delay interval, e is the base of the natural logs, n is a positive integer called the “shape” parameter, and a is a positive number often called the “rate.” Parameters a and n determine the position of the distribution. The mean delay is given by n / a, and the standard deviation is \(\sqrt{n}/a.\) The coefficient of variation, the ratio of the standard deviation to the mean, is then given by\(1/\sqrt{n}.\)Thus, n determines the concentration about the mean.

For concreteness, Fig. 1 plots three different Erlang specifications with the same mean delay, 90 days. We use \(n = 1\), 3, and 64, adjusting parameter a to ensure n/\(a = 90\). In the case of \(n = 1\), Erlang reduces to an exponential distribution, G(\(\tau \)\(=\) \(ae^{-a\tau }\). In this case, we have G(0) \(=\) \(a>\) 0, and \(G'\)(\(\tau \)) < 0. Thus, today’s prevalence has the largest impact on today’s vaccination uptake, and the longer the delay (the larger is \(\tau \)), the smaller is the influence on vaccination. Ruan [28] has referred to these models as having a “weak kernel,” and the n \(=\) 1 case is also often described as displaying “fading memory.” As n rises above one, the Erlang distribution becomes more Gaussian-looking and is more tightly packed around the mean. Further, when \(n>\) 1, the current state of I has no impact on current vaccination, since G(0) \(=\) 0 for all \(n>\) 1. When \(n \quad \rightarrow \quad \infty \), the Erlang distributed delay system approaches the discrete delay formulation.

Fig. 1
figure 1

This shows three Erlang distributions, all with mean delay of 90 days. The values of n are shown in the figure, and parameter a is adjusted to ensure that n/a (mean delay) is 90

Our preference in modelling the delayed response of vaccination to past prevalence is to employ \(n>\) 1. If it takes time for people to recognize that a disease outbreak is underway, and more time to respond by obtaining a vaccination, then we would rather not use the n \(=\) 1 case, where G(0) > 0. Almost all of what follows uses n \(=\) 3 or n \(=\) 64. From a theorist’s point of view, it is significant that as n increases from one, the delay system quickly gets very challenging to analyze. Numerically, this is not an insurmountable problem (though the programing and machine time grow), but analytically the challenge is daunting. The n \(=\) 1 case (“weak kernel or fading memory”) has been thoroughly studied in the context of delayed vaccination response to disease outbreaks, though discrete school-related term-time forcing is not present in the models. See Buonomo et al. [19, 20] and d’Onofrio et al. [21, 22]. In the interest of linking with those results, we do look briefly at the n \(=\) 1 case with moderate levels of delay and term-time forcing. The result, as we will see, can be chaos.

Thanks to the work of MacDonald [29], System (1) can be reduced, via the so-called “linear chain trick,” to the ordinary differential equations shown here:

$$\begin{aligned} {{dI}({t})}{{dt}}= & {} {f}({t})\frac{{S}({t}){I}({t})}{{N}}-\gamma {I}({t})-{bI}({t}) \nonumber \\ {{dY}_0 }({t}){{dt}}= & {} {a}({I}({t}){-Y}_{\mathrm{0}} ({t}))\nonumber \\ {{dY}_{\mathrm{j}} }({t}){{dt}}= & {} {a}({Y}_{\mathrm{j}} ({t})-{Y}_{\mathrm {j+1}} ({t})) {j}=0,1,\ldots ,{n}-1 \nonumber \\ {{dS}({t})}{{dt}}= & {} {bN}-{bNmin}[{k}_{\mathrm{1}} {+k}_{{2}} \frac{{Y}_{{n-1}} ({t})}{{N}}, {V}_{{m}} ]\nonumber \\&-{f}({t})\frac{{S}({t}){I}({t})}{{N}}-{bS}({t}) . \end{aligned}$$
(System 2)

The Y terms here are synthetic variables. See Smith [30]. Note that the fraction vaccinating at time t, which we call V(t), is given by \(V(t)={min}[{k}_{\mathrm{1}} {+k}_{\mathrm{2}} \frac{{Y}_{\mathrm {n-1}} ({t})}{{N}}, {V}_{\mathrm{m}} ]\).

System (2) is a hybrid dynamical system, where the differential equation driving S and I (and the synthetic variables) switch for two different types of reasons: (1) There is term-time forcing where f(t) switches the transmission term between \({\lambda }_{1}\) and \({\lambda }_{2}\) four times per year. (2) The min function in the dS/dt equation means that the rate of change in S is sometimes governed by \(V_{m}\) and sometimes by \(Y_{n-1}\), depending upon the state of the system. These issues, together with the relatively high dimensionality of the system, present serious obstacles to a complete general analysis, as has been noted by many others working in this general area [3, 4, 10, 14].

3 Equilibria and stability

Before we begin the equilibrium/stability analysis, we will collect a few assumptions. First, there are standard sign restrictions for these sorts of models

$$\begin{aligned} {b, \lambda }_{1}, \lambda _{2}, \gamma , k_{1}, k_{2}, a, n, N, V_{m} > 0, \end{aligned}$$
(A1)

to which we add

$$\begin{aligned} {\lambda }_{1}{} { \le \lambda }_{2},\quad k_{1}< V_{m}{} { \le }1, V_{m} < V_m^*. \end{aligned}$$
(A2)

The assumption that \({\lambda }_{1}{\le \lambda }_{2}\) means that the transmission rate during the school term is (at least weakly) higher than when school is out. Since \(k_{1}\) is the fraction of newborns vaccinating regardless of the past prevalence, and \(V_{m}\) is the maximum possible vaccination fraction, we get \(k_{1}< V_{m}{\le }1\). The inequality \(V_{m}<V_m^*\) rules out a type of endemic equilibrium where vaccination is at it ceiling value. We leave this possibility aside for reasons of space. (See [25, 26] for coverage.)

Let us define the weighted transmission rate \(\lambda _w =w_1 \lambda _1 +w_2 \lambda _2 \), where \(w_2 =\left( {T_{Se} -T_{Sb} +T_{Fe} -T_{Fb} } \right) /365\) and \(w_{1}\) = \(1 - w_{2}\). Thus, \({\lambda }_{w}\) combines \({\lambda }_{1 }\) and \({\lambda }_{2}\), weighing each according to how many days it applies over the year. We also define quasi-basic reproduction numbers:

$$\begin{aligned} R_0 (\lambda _w )= & {} \frac{\lambda _w }{b+\gamma } \quad \hbox { and } \end{aligned}$$
(1)
$$\begin{aligned} {R}'_0 (\lambda _w )= & {} \frac{\lambda _w (1-k_1 )}{b+\gamma }. \end{aligned}$$
(2)

Equation (1) applies to systems without vaccination and (2) takes account the fixed fraction vaccinating. We use \(R_0 (\lambda _w )\) and \({R}'_0 (\lambda _w )\), not to explain system behavior, but to constrain us as we consider various combinations of \({\lambda }_{1}\) and \({\lambda }_{2}\). For instance, if we fix values for \(T_{se}, T_{sb}, T_{fe}\), and \(T_{fb}\), and if we assume \(R_0 (\lambda _w )\) =16, when we pick a value for \({\lambda }_{2}\), the value for \({\lambda }_{1}\) is implied, since \({\lambda }_{w}\) is a convex combination of \({\lambda }_{1}\) and \({\lambda }_{2}\). We further assume both \(R_0 (\lambda _w )>\) 1 and \({R}'_0 (\lambda _w )>\) 1. Our intent is to study systems where the disease persists. Finally, it is sometimes convenient to express \({\lambda }_{2 }\)as a multiple of \({\lambda }_{1}\). Thus, we define \(m = {\lambda }_{2 }/{\lambda }_{1}\).

3.1 Disease-free equilibrium

System (2) will always have a disease-free equilibrium, \(E_{0}\). This is easily seen by setting I and all the time derivatives to zero. Holding notation down by assuming \(n = 3\), the result is:

$$\begin{aligned} E_{0} = (S_{0}, I_{0}, Y_{0,0}, Y_{1,0}, Y_{2,0}) = (N(1-k_{1}), 0, 0, 0, 0), \end{aligned}$$

where, for example, \(Y_{1,0}\) gives the disease-free equilibrium value for \(Y_{1}\).

Note that any equilibrium must have \(I = Y_{0} = Y_{1} = Y_{2}\). When we feel that no confusion will result, we will write \(E_{0}\) simply using (\(S_{0}\), \(I_{0})\) \(=\) (N(1 – \(k_{1})\), 0). Note that the term-time forcing presents no obstacle with respect to the determination of \(E_{0}\), since the same values for \(S_{0}\) and \(I_{0}\) result, regardless of whether school is in session or not, i.e., as far as the value of the \(E_{0}\) equilibrium is concerned, \({\lambda }_{1}\) and \({\lambda }_{2}\) play no role.

Stability of \(E_{0}\) is more complicated, however. Suppose that instead of f(t) in System (2), we had either \({\lambda }_{1}\) or \({\lambda }_{2}\), but no term-time switching. Referring to either \({\lambda }_{1}\) or \({\lambda }_{2}\) as \({\lambda }_{i}\), this specification will be defined as the “pure \({\lambda }_{i}\) sub-system” of System (2). Then it is not hard to show (see [25], Theorem 1) that the Jacobian of System (2) evaluated at \(E_{0}\) would be

$$\begin{aligned} J(E_0 )=\left( {{\begin{array}{ccccc} {-b-\gamma +(1-k_1 )\lambda _i }&{}\quad 0&{}\quad 0&{} \quad 0&{}\quad 0 \\ a&{}\quad {-a}&{}\quad 0&{}\quad 0&{} \quad 0 \\ 0&{}\quad a&{} \quad {-a}&{} \quad 0&{}\quad 0 \\ 0&{}\quad 0&{}\quad a&{} \quad {-a}&{} \quad 0 \\ {-(1-k_1 )\lambda _i }&{}\quad 0&{}\quad 0&{}\quad {-bk_2 }&{}\quad {-b} \\ \end{array} }} \right) , \end{aligned}$$

and the eigenvalues would be –a (multiplicity 3), – b, and – b\(\gamma \) + \({\lambda }_{i}\)(1 – \(k_{1})\). Clearly, \(E_{0}\) would be stable if – b\(\gamma \) + \({\lambda }_{i}\)(1 – \(k_{1})<\) 0. If we define\({R}'_0 (\lambda _i )=\frac{\lambda _i \left( {1-k_1 } \right) }{b+\gamma }\), then – b\(\gamma \) + \({\lambda }_{i}\)(1 – \(k_{1})<\) 0 is equivalent to\({R}'_0 (\lambda _i )<\) 1. Under our assumptions that  \({R}'_0 (\lambda _w )>\) 1 and \({\lambda }_{w}\) is a convex combination of \({\lambda }_{1}\) and \({\lambda }_{2}\), both of the \({R}'_0 (\lambda _i )\) cannot be less than 1. But with \(m(:={\lambda _{2}/\lambda }_{1})\) sufficiently large, meaning \(m>({R}'_0 (\lambda _w )-w_1 )/(1-w_1 ):=m_c \), we can get \({R}'_0 (\lambda _1 )<\) 1and \({R}'_0 (\lambda _2 )>\) 1. If this is the case, then under the hybrid given by System (2), during vacations the system would move on a path that would ultimately take it arbitrarily close to the disease-free equilibrium, if the vacation period did not end; but before the path could get to \(E_{0}\), school would re-start and the path would abandon the approach to\( E_{0}\) and come under the influence of the pure \({\lambda }_{2}\) sub-system, which does not approach \(E_{0}\). The end result is:

Theorem 1

Unless the hybrid System (2) has an initial point with I \(=\)  0, if \({R}'_0 (\lambda _w )> 1\), it cannot converge to a disease-free equilibrium

Hybrid systems are capable of strange things. Two stable sub-systems can “paste together” forming a hybrid that is unstable, and two unstable sub-systems can join to form a stable hybrid system. See Branicky [31] for an introduction. As we see next, the hybrid System (2) will have no endemic equilibria at all.

3.2 Endemic equilibria

Our assumption that \({R}'_0 (\lambda _w )>\) 1, forces \({R}'_0 (\lambda _2 )>\) 1. For sufficiently small values of m, meaning \(m <m_{c}\), we also have \({R}'_0 (\lambda _2 )>\) 1. We look at this case now. A pure \({\lambda }_{i}\) sub-system would have an endemic equilibrium given by

$$\begin{aligned} E_1 \left( {\lambda _i } \right) =\left( {S_1 \left( {\lambda _i } \right) ,I_1 \left( {\lambda _i } \right) } \right) =\left( {\frac{N\left( {b+\gamma } \right) }{\lambda _i },\frac{bN\left( {-b-\gamma +\lambda _i \left( {1-k_1 } \right) } \right) }{\lambda _i \left( {b\left( {1+k_2 } \right) +\gamma } \right) }} \right) \quad i=1,2. \end{aligned}$$

Notice that \(I_1 (\lambda _i )=\frac{bN\left( {{R}'_0 (\lambda _i )-1} \right) }{\lambda _i \left( {b\left( {1+k_2 } \right) +\gamma } \right) } \), so \(I_{1}\)(\({\lambda }_{i})>\) 0 if and only if \({R}'_0 (\lambda _i )>1\). In the case under consideration, both pure sub-systems will have endemic equilibria. In contrast with the pure \({\lambda }_{1}\) or \({\lambda }_{2}\) sub-systems, the full hybrid System (2) is periodically turning one sub-system off and another on via f(t). When f(t) turns on a sub-system, say, the \({\lambda }_{2}\) sub-system, the flow will temporarily go toward, away from, or around \(E_{1}({\lambda }_{2})\), depending on the stability properties of \(E_{1}({\lambda }_{2})\) in the \({\lambda }_{2}\) sub-system. In a sense,\(E_{1}({\lambda }_{i})\) is relevant in the hybrid, but it is not an equilibrium. Some authors call it a “ghost” (Crommelin [32]) or “phantom” equilibrium. That is because, even if the hybrid system were to arrive at \(E_{1}({\lambda }_{2})\), when f(t) switches the active sub-system (with \({\lambda }_{1} \ne \) \({\lambda }_{2})\), the path leaves\( E_{1}({\lambda }_{2})\). It is not a “rest point.” Still, it can be handy to think of the flow of the hybrid in light of the positions and properties of these phantom equilibria. The result of this section is:

Theorem 2

If \(m>m_{c}\), both pure sub-systems have “phantom” endemic equilibria, but there is no endemic equilibrium for the hybrid system.

Not all the news is odd, however. Using hybrid System (1), it is not hard to show:

Theorem 3

If the initial conditions (S(0),) I(0)) are in the closed bounded set \(\Omega = \{(S, I){\vert } S, I \ge 0, S + I \le N\}\), then the positive semi-path from that point remains in \(\Omega \).

Proof

We check the flow of System (1) on the border of \(\Omega \) and verify that it is never outward. (i) If S = 0, dS/d\(t=bN-bN\min [k_1 +k_2 \frac{1}{N}\int \limits _0^\infty {I(t-\tau )G(\tau )} d\tau , V_m ]>\) 0, since min[.] is a positive fraction. (ii) If I = 0, dI/dt = 0. (iii) If \(S+I=N,\) then R must be zero. If so, the last line of System (1) shows that dR/dt is positive, which causes \(S+I\) to fall. \(\square \)

To summarize this section so far: We see that unless the initial value is \(E_{0}\), we can expect positive semi-paths to always be moving in \(\varOmega \). We might see relatively simple periodic orbits or chaos, but not convergence to an equilibrium unless I(0) = 0 and the path slides toward \(E_{0}\). Also, since System (1) does not have a continuous vector field, we do not have access to the Poincare-Bendixson theorem, and we cannot be surprised to see a positive semi-path crossing itself as time advances. A segment of the path driven by the \({\lambda }_{1}\) pure sub-system will not cross another segment driven by the same sub-system, but it can cross a segment driven by the \({\lambda }_{2}\) pure sub-system, and vice versa.

We end this section with one more general result that is useful in the following section. The stability of the pure \({\lambda }_{i}\) sub-systems is easy to check numerically using results from [25]. Employing Routh–Hurwitz, Lienard–Ghipart, and the assumptions here, \(E_{1}\)(\({\lambda }_{i})\) is stable in the pure \({\lambda }_{i}\) sub-system iff det(\(H_{4})>\) 0, where det(\(H_{4}) = c_{1}c_{2}c_{3}c_{4 }- c_{3}^{2}c_{4 }- c_{1}^{2}c_{4}^{2 }- c_{1} c_{2}^{2}c_{5 }+ c_{2}c_{3}c_{5 }+ 2c_{1}c_{4}c_{5 }- c_{5}^{2}\), and

$$\begin{aligned} \begin{array}{l} c_1 =3a+b+g(k_2 ) \\ c_2 =3a^{2}+3a(b+g(k_2 ))+(b+\gamma )g(k_2 ) \\ c_3 =a^{3}+3a^{2}(b+g(k_2 ))+3a(b+\gamma )g(k_2 ) \\ c_4 =a^{3}(b+g(k_2 ))+3a^{2}(b+\gamma )g(k_2 ) \\ c_5 =a^{3}(b+bk_2 +\gamma )g(k_2 ), \\ \end{array} \end{aligned}$$

and \(g(k_2 )=\frac{b(R_0^{\prime } -1)(b+\gamma )}{b+bk_2 +\gamma }\).

This determinant is employed to some advantage in the following simulations.

4 Numerical results

Our strategy in the simulations is to hold most parameters constant throughout the series of cases as we vary the mean delay duration, n / a,  and the strength of term-time forcing as measured by m \(=\)  \({\lambda }_{2}/{\lambda }_{1}\).

We fix the following parameters in all of the subsequent exercises: The Spring school term starts on day 3 and ends on day 153, and the Fall term starts on day 244 and ends on day 354. Thus, \(w_{1}\) \(=\)  105/365 and \(w_{2}\) \(=\) 260/365. The birth rate, b, is 1/25,000, making the mean lifespan about 68.5 years. The recovery rate, \(\gamma \), is 7/100, so on average one is infected for about 14 days. \(V_{m}\), the ceiling on the vaccination fraction, is .95. The population is \(1 \times 10^{6}\). Parameter \(k_{1}\), which gives the fraction who get vaccinated regardless of the past values for the disease, is 1/5. Another “constant” is that initial conditions are always (S(0), I(0), \(Y_{0}\)(0), ..., \(Y_{n-1}\)(0)) = (60,000, 10, 10,..., 10). For ease in future discussion, we collect these assumptions in (A3).

$$\begin{aligned}&w_{1} = 105/365, w_{2} = 260/365, b = 1/25{,}000, {\gamma } = 7/100,\nonumber \\&\quad V_{m} = .95, N = 1m, k_{1} = 1/5, \hbox { and } \nonumber \\&\quad R_0 (\lambda _w )> 1. \hbox { Initial conditions are } \nonumber \\&\quad (S(0), I(0), Y_{0}(0), {\ldots }, Y_{n-1}(0)) = (60,000, 10, 10,{\ldots }, 10). \end{aligned}$$
(A3)

Other parameters are set for various situations and used for a sequence of exercises. For example, parameter \(k_{2}\), which is a metric for the strength of the delay effect, is usually set to 1800, except that we set it to zero when we look at the effect of turning delay off in order to isolate term-time forcing strength. The parameter n of the Erlang function is usually 3, though we give some examples of n \(=\) 64 and n \(=\) 1. Once these parameters are set, we consider variations in mean delay, n / a, and term-time forcing strength, \(m = {\lambda }_{2}/{\lambda }_{1}\).

Our plan is to look first at a model with term-time forcing but no delay. We then look at delay without term-time forcing, and finally, we examine a combined system with both term-time forcing and delay. We are particularly curious about the sizes of m and n / a required to induce chaos. We compare the required sizes of these terms in System (2) when both delay and term-time forcing exist, when only delay exists, and when only term-time forcing exists. All simulations were run under Mathematica version number 10.3.1.0.

4.1 Term-time forcing, but no delay

We now consider a case where term-time forcing is included, but delay is turned off in the hybrid System (2). A SIR or SEIR system with term-time forcing like this has been studied by others, though not with vaccination in the model [3, 4, 13,14,15]. There are several options available for removing, or nearly removing, delay: (i) Since mean delay is given by n/a, delay will approach zero as parameter a becomes large. Thus, we would “almost” eliminate delay by employing large a terms. In the hope of having a more complete break with delay, we do not use this option. (ii) We could retain the notion of prevalence demand while removing delay by linking the fraction vaccinating at time t, V(t), to contemporaneous prevalence, I(t). As a result, we would re-write System (1) using min[\(k_{1}+k_{2}I(t)\)/N, \(V_{m}\)] rather than min\([k_1 +k_2 \frac{1}{N}\int \nolimits _0^\infty {I(t-\tau )G(\tau )} d\tau , V_m ]\) for the V(t) component. This was the prevalence demand approach pioneered by Geoffard and Philipson [33]. The idea of prevalence demand has shed a lot of light on the difficulty of eradicating disease in that as prevalence approaches zero, the demand for vaccination diminishes (or vanishes, if \(k_{1}\) \(=\) 0) in this construct. Nevertheless, we prefer not to use this form, feeling uncomfortable with the circularity of the idea that those making the decision to vaccinate predicate their choice on current prevalence, while current prevalence itself depends upon their choices. This model is, however, quite tractable, and can be shown to have the same \(R_{0}\) values and stability conditions (though not the same paths) as we find when employing our preferred option, which follows. (iii) We choose to turn delay off by setting the endogenous response variable, \(k_{2}\), to zero. (Setting n \(=\) 0 would have an identical effect.) In this case the fraction vaccinating is given simply by \(V(t)=k_{1}\). Setting \(k_{2}\) \(=\) 0, like our previously discussed options, effectively collapses System (2) to two dimensions, since the synthetic variables \(Y_{0}\), \(Y_{1}\),...,\(Y_{n-1}\) no longer play a role. In this special case, we have

$$\begin{aligned} \begin{array}{l} \frac{dS(t)}{dt}=bN-bNk_1 - f(t)\frac{S(t)I(t)}{N}-bS(t) \\ \\ \frac{dI(t)}{dt}= f(t)\frac{S(t)I(t)}{N}-\gamma I(t)-bI(t). \\ \\ \end{array} \end{aligned}$$
(System 3)

The equilibria for System (3) are the same as those discussed above under System (2), but stability of the pure \({\lambda }_{i}\) sub-systems is much easier to investigate. The Jacobian of the pure \({\lambda }_{i}\) sub-system evaluated under System (3) at (SI) is now given by

$$\begin{aligned} J_{sys3} =\left( {{\begin{array}{ll} -b-\frac{\lambda _i I}{N}&{} -\frac{\lambda _i S}{N} \\ \frac{\lambda _i I}{N}&{} \frac{\lambda _i S}{N}-b-\gamma \\ \end{array} }} \right) . \end{aligned}$$

If we evaluate the Jacobians at (S,\( I)=E_{0}\) and (S,\( I)=E_{1}\), then use \({R}'_0 (\lambda _i )=\frac{\lambda _i (1-k_1 )}{b+\gamma }\), we can write the traces and determinants of \(J_{sys3}\) at the two equilibria as follows:

  • at \(E_{0}\): tr\((J_{sys3})=-b + (b + \gamma )({R}'_0 (\lambda _i ) - 1)\) and det\((J_{sys3}) = -b(b + {\gamma }) ({R}'_0 (\lambda _i ) - 1)\)

  • at \(E_{1}\): tr\((J_{sys3})=-b{R}'_0 (\lambda _i )\) and det\((J_{sys3}) = -b(b + {\gamma }) (1-{R}'_0 (\lambda _i ).)\)

Recall that both sub-systems have the same disease-free equilibrium and that a positive endemic equilibrium only exists for a \({\lambda }_{i}\) sub-system if \({R}'_0 (\lambda _i )>\) 1. It follows from application of Routh-Hurwitz to \(J_{sys3 }\) that if \({R}'_0 (\lambda _i )<\) 1 for the pure \({\lambda }_{i}\) sub-system, the disease-free phantom equilibrium, \(E_{0}\), will be attracting the path of the hybrid system when sub-system \({\lambda }_{i}\) is in force. Similarly, if \({R}'_0 (\lambda _i )>\) 1 for the pure \({\lambda }_{i}\) sub-system, the endemic phantom equilibrium, \(E_{1}\), will be attracting the path of the hybrid system when sub-system \({\lambda }_{i}\) is operative.

The two pure \({\lambda }_{i}\) sub-systems of System (3) can be configured in two ways: (i) If \(m >m_{c}\), then \({R}'_0 (\lambda _1 )<\) 1. In this case, the pure \({\lambda }_{1}\) sub-system, when it is active, will be attracted to \(E_{0}\). And a positive \(E_{1}({\lambda }_{1})\) will not exist. As for the pure \({\lambda }_{2}\) sub-system, (A3) implies that \({R}'_0 (\lambda _2 )>\) 1, so paths will be attracted to a positive \(E_{1}({\lambda }_{2})\) when that sub-system is operative. \({R}'_0 (\lambda _2 )>\) 1 also implies that \(E_{0}\) is unstable for the pure \({\lambda }_{2}\) sub-system. (ii) If \(m<m_{c}\), then \({R}'_0 (\lambda _1 )>\) 1, and a positive \(E_{1}({\lambda }_{1})\) exists. This is locally asymptotically stable by Routh-Hurwitz. And \(E_{0}\) is unstable in this case. Again, the pure \({\lambda }_{2}\) sub-system will be attracted to \(E_{1}({\lambda }_{2})\) when it is switched “on.” In either case, as the positive semi-path of the hybrid system moves through time and the operative sub-systems switch, it will be attracted alternately by two different phantom “equilibrium” points.

In addition to the parameters in (A3), we assume for this section:

$$\begin{aligned} R_0 (\lambda _w )= 24\;\hbox { and }\;{R}'_0 (\lambda _w ) = 19.2. \end{aligned}$$
(A4)

This assumption is weakened when delay is included in the following two sections. Assumption (A3) fixes \(m_{c}\) = 26.55. Most pure temporal forcing models that find chaos use large values for \(R_{0}\). (Katriel et al. [12] use 40; Olinky et al. [16] use 24) Most studies of this sort also find chaos or irregular dynamics only when the strength of forcing (m in the present paper) is high. The simulation in this section can be regarded as a benchmark for the following sections of the paper, where we find that irregular dynamics can occur with much lower values than needed here for \(R_{0}\) and forcing strength.

If \(m = 1\), there is no term-time forcing, and the hybrid under the above parameters converges to a single \(E_{1}\)-type endemic equilibrium. To include term-time forcing we consider cases where \(m>\)1.

We begin with the modest case of m \(=\) 1.1, i.e., when school is in session, the transmission rate, \({\lambda }_{2}\), is 10% higher than it is during school breaks, when \({\lambda }_{1}\) is relevant. Under our assumption that \(R_0 (\lambda _w )\) \(=\)  24, we get (\({\lambda }_{1}\), \({\lambda }_{2})\) \(=\) (1.57, 1.73), implying \(R_0 (\lambda _1 )\) \(=\) 22.40 and \(R_0 (\lambda _2 )\) \(=\) 24.64, and giving \({R}'_0 (\lambda _1 )\) \(=\) 17.92 and \({R}'_0 (\lambda _2)\) \(=\) 19.72 Thus, the disease-free equilibrium, which always takes the same value for both sub-systems, is unstable. The pure sub-system endemic equilibria are given by \(E_{1}({\lambda }_{1})\) \(=\) (44634.7, 431.4) and \(E_{1}({\lambda }_{2})\) \(=\) (40577, 433.7). Given our results on \(J_{sys3}\) above, we find both pure \({\lambda }_{i}\) sub-systems are stable.

Fig. 2
figure 2

One year cycle with m \(=\) 1.1. Plot runs over 200,000 days, beginning at t \(=\) 3.8 m days (in year 10411). Assumptions (A3) and (A4) apply, and \(k_{2}= 0\). Parameters n and a are not relevant

The long term result is an orbit with a 1-year period, which is shown in Fig. 2. This periodic orbit is attractive, given the initial conditions shown in assumption (A3). Notice in the figure that when the summer and Christmas breaks begin, the prior upward movement in prevalence immediately changes to a decline.

We can build a tool to help us see this convergence in both the 2-D case here and more complicated settings soon to follow. Define \({\varvec{\psi }}\)(t; \({\varvec{\psi }}\)(0)) to be the solution path of System (2) from initial conditions \({\varvec{\psi }}(0) = (S(0), I(0), Y_{0}(0),{\ldots }, Y_{n-1}(0))\). (In the present case, \({\varvec{\psi }}(0) = (S(0), I(0)))\). If \({\varvec{\psi }}(0)\) is a point on a periodic orbit of p-year duration, then \({\varvec{\psi }}(t; {\varvec{\psi }}(0)) = {\varvec{\psi }}(t + 365p; {\varvec{\psi }}(0))\), and p is the smallest natural number satisfying this condition.

It is not hard to show:

Theorem 4

If a periodic orbit exists, its period will be p years, with p a natural number

Proof

Let \(\Gamma \) be a generic periodic orbit in (S, I) space as shown in Fig. 3. (The graph is a heuristic sketch. Paths actually bend sharply at the “dots.”) Let \({\varvec{\psi }}\)(\(t_{0})\) be a point on this orbit. Without loss of generality, we set \({\varvec{\psi }}\)(\(t_{0})\) at the first day of the Spring term (day \(T_{Sb})\) in a reference year we call \(y_{0}\). On the outside of the cycle, this point is labeled \(T_{Sb},_{y0 }\)and on the inside of the orbit by \({\varvec{\psi }}\)(\(t_{0})\). Time advances counterclockwise around the orbit, and as it does, \({\varvec{\psi }}\)(t) passes dots marking the beginnings and ends of the school term over successive years. Starting at \(T_{Sb},_{y0 }\)we move along the path passing “signposts” for \(T_{Se},_{y0}\), \(T_{Fb},_{y0}\), \(T_{Fe},_{y0}\), \(T_{Sb},_{y1}\), ... By construction, \(T_{Fe }\)is always the last signpost before \(T_{Sb}\). Hence, the incoming path to \(T_{Sb},_{y0 }\)which closes the cycle, must be coming from the \(T_{Fe}\) point furthest around the cycle downstream of \(T_{Sb},_{y0. }\)Since we are assuming there is a periodic orbit, the path from \(T_{Fe,yp }\)under the pure \({\lambda }_{1}\) sub-system must terminate at \(T_{Sb},_{y0}=T_{Sb,yp}\), with \(p \in \{1, 2,{\ldots }\}\) being the natural number of years to complete one orbit. \(\square \)

Fig. 3
figure 3

A heuristic to support the argument that a closed orbit has a period which is an integer multiple of 365 days

Now suppose \({\varvec{\psi }}\)(0) is not a point on a periodic orbit, and consider the Euclidean distance between \({\varvec{\psi }}(t; {\varvec{\psi }}(0))\) and \({\varvec{\psi }}(t + 365p; {\varvec{\psi }}(0))\) for some particular value for p. Write this distance as the function dis(\({\varvec{\psi }}(t; {\varvec{\psi }}(0))\), \({\varvec{\psi }}(t + 365p; {\varvec{\psi }}(0)))\). We know under the present example, that \({\varvec{\psi }}(t; {\varvec{\psi }}(0))\) cannot converge to an equilibrium point as \( t \rightarrow \infty \), since \(E_{0}\) is unstable and the endemic equilibria are phantoms. If, as \(t \rightarrow \infty \), dis(.) \(\rightarrow \) 0 for a given p, then \({\varvec{\psi }}(t; {\varvec{\psi }}(0))\) is approaching a periodic orbit with period p years. Working numerically, this convergence is not hard to examine, and it is useful both for finding the period and for “seeing” the convergence in a high dimensional system. This distance function is depicted in Fig. 4, for the case of \(m = 1.1\).

Fig. 4
figure 4

Convergence to a 1-year cycle with m \(=\) 1.1. This shows the Euclidian distance between \({\varvec{\psi }}\)(t) and \({\varvec{\psi }}{(t + 365p)}, (i.e., dis({\varvec{\psi }}(t), {\varvec{\psi }}(t + 365p)))\), going to zero over time when p \(=\) 1. Parameters same as in Fig. 2

As we increase m beyond 1.1, we initially see annual cycles of the same general shape increasing in amplitude until \(m \approx \) 1.8. A sample of these is seen in Fig. 5.

Fig. 5
figure 5

This shows growth in amplitude of annual cycles as m increases from 1.1 to 18. Parameters same as in Fig. 2

When \(m = 1.9\), the system has a 2-year cycle. The 2-year cycles are then observed until \(m \approx \) 8, when 4-year cycles appear. The 4-year cycles last until \(m\approx \) 12. Between \(m =14\) and \(m = 15\), we have 8-year cycles. But simple period doubling toward chaos does not happen from then on. An 11-year cycle occurs at \(m = 16\). The cycle at \(m = 16\) is shown in Fig. 6, using Log(I) and S. Each dot in the figure marks the 153\(^{rd}\) day of the year, i.e., the end of the Spring term. Notice that there are long periods of time when I is very close to zero (below 10\(^{-5})\), and there are four substantial outbreaks in an 11 year period. Notice further that the path of the hybrid intersects itself several times during the periodic orbit, even though the path is continuous and 2-dimensional. Neither of the two pure sub-systems will cross themselves, but one sub-system path can cross the path of the other sub-system, e.g., a “school-was-is-in” path can cross a “school-was-is-out” path.

Fig. 6
figure 6

An 11 year cycle running from t \(=\) 3,651,098 to t \(=\)  3,655,113, with m \(=\) 16. Dots mark the end of the spring school term each year. Other parameters same as in Fig. 2

Fig. 7
figure 7

Term-time forcing but no delay. Time runs for 70 years, from t \(=\) 2,870,000 to t \(=\) 2,895,550 days. Parameter m \(=\) 17. Other parameters same as in Fig. 2. The boxed area is discussed in the text and following two graphics

Fig. 8
figure 8

Close-up of the boxed area in Fig. 7

Fig. 9
figure 9

Alternative view of the boxed area in Fig. 7 using Log(I) and S. Solid lines indicate school is in, and dotted lines are drawn when school is out

Chaos arrives at \(m \approx \)17. The time series of I(t) over 70 years is shown in Fig. 7. Note the uneven interval spacings and magnitudes of outbreaks. Some of the relevant values at \(m = 17\) are: (\({\lambda }_{1}\), \({\lambda }_{2})\) \(=\) (0.14, 2.31); \((R_0 (\lambda _1 ), R_0 (\lambda _2 ))\) \(=\) (1.94, 32.91); \(({R}'_0 (\lambda _1 ), {R}'_0 (\lambda _2 ))\) \(=\) (1.55, 26.33); \(E_{1}({\lambda }_{1}) = (516553, 161.88)\); and \(E_{1}({\lambda }_{2}) = (30385.4, 439.529)\). It follows (usingtr(\(J_{sys3})\) and det(\(J_{sys3})\) conditions) that both pure \({\lambda }_{i}\) sub-systems have positive and stable phantom endemic equilibria. Nevertheless, the hybrid formed from the two sub-systems is chaotic. See Branicky [31].

Figure 8 shows a close-up of two very different outbreaks that are highlighted in the box in Fig. 7. The dots (marked A to G) are placed at the start of each spring term. Figure 9 shows S and Log(I) for the same time interval. The two graphs should be examined together. The letters in both figures identify the same points in (t, S, I)-space. Note that for long periods of time prevalence is miniscule. The high amplitude outbreak on the left (beginning at point A) peaks prior to the end of the spring term, and “burns out” many susceptibles prior to the start of the Summer break at point 1 in Fig. 9. Prevalence then falls to very low values during the succeeding fall term and Christmas break. Disease prevalence in near zero for the 3 years running from B to E. Another outbreak begins at E, which is 4 years after A. Notice from Fig. 9 that both I and S are lower at point E than point A. This gives a weaker initial outbreak, which ends at the start of summer vacation (point 2), and then takes off again in the fall (point 3). Following the Christmas break (ending at F), prevalence initially rises slightly, while the susceptible class falls dramatically. This causes prevalence to begin falling in the spring term. Point 4 marks the beginning of the summer break, and prevalence again falls to very low levels for the next few years.

Three comments: (i) The low amplitude, multiple closely-spaced peaks that are seen in the sim between E and G, are also observed in the classic childhood disease data. See Fig. 10 below, which shows monthly measles data for New York. Note the timing of the double peaks starting in 1943. (ii) Note from Fig. 7 that these twin peaks can be quite common in the model. (iii) Interestingly, if one measures the number of cases in the two years between points A and C (the single large outbreak case) by forming \(\gamma \int \limits _A^C {I(t)dt} \), the result is 52926, while integrating between E and G (the “twin peak” case) gives \(\gamma \int \limits _E^G {I(t)dt} \)= 55059, a roughly 4% difference. Katriel and Stone [12], who modeled attack rates using sinusoidal forcing, showed something related to this, finding that attack rates over long time spans were very close whether or not seasonal forcing is included.

Fig. 10
figure 10

Source: http://ms.mcmaster.ca/~bolker/measdata/nycmeas.dat

Monthly data on measles in New York.

Fig. 11
figure 11

Bifurcation diagram for pure term-time forcing under assumptions of Fig. 2

A bifurcation summary diagram is shown in Fig. 11. The diagram is generated as follows: Simulations are run from \(t = 0\) to \(t = 4 \times 10^{6}\) for a multitude of values of m, from m \(=\) 1 to m \(=\) 50. Values of I are then taken over a 400 year interval between t \(=\) 3,651,248 and 3,797,248, and a dot is generated on the last day of the spring term for each year. If the system has a stable p-year cycle, p different dots appear. For example, if System (2) has a stable annual cycle, the algorithm will generate 400 dots, but they will all be the same. This would happen if the case shown in Fig. 2 cycled 400 times. When p is large, there may be a stable long-period cycle, or there may be chaos.

As m rises past 17, we continue to see chaos through at least m = 50. We are not aware of empirical studies that establish reasonable bounds for m in a SIR structure with vaccination, but we note that London and Yorke’s [34] measles study had ratios of high to low contact rates for measles, chickenpox, and mumps on the order of 1.7. Fine and Clarkson [35] found the ratios of contact rates for measles in the range of 2–3. See Keeling and Rohani [36] for further discussion. This section has a slight twist (inclusion of vaccination) on established results for term-time forcing models. Our admittedly arbitrary justification for not going past m \(=\) 50 is the following: When m increases \(S_{1}\)(\({\lambda }_{1})\) rises and \(I_{1}\)(\({\lambda }_{1})\) falls, with \(I_{1}\)(\({\lambda }_{1})\) reaching 0, when\(\lambda _1 =\frac{b+\gamma }{1-k_1 }\) \(=\) .08755 under our present parameters. This in turn requires m \(=\) 26.55, which eliminates a positive \(E_{1}\)(\({\lambda }_{1})\) and gives stability to \(E_{0}\)(\({\lambda }_{1})\). This, in turn, would mean the disease would ultimately disappear if school were never in session. Though we can’t rule this out, we feel that roughly doubling \(m = 26.55\) to \(m = 50\), will cover our area of interest.

We have examined this “no-delay” case in order to provide a benchmark for results we get later in this section, where we have both term-time forcing and delay in the response of vaccination demand to past prevalence. The key point so far from this section is that chaos can result from term-time forcing when both \(R_0 (\lambda _w )\) and m are “large” (24 and 18, respectively).

4.2 Delay, but no term-time forcing

In this section we look at two closely related SIR models with distributed delay between disease outbreaks and vaccination response, but without term-time forcing. We retain all assumptions in (A3), except that we now set \(k_{2} = 1800\) and reduce \(R_0 (\lambda _w )\) to 16. For ease of reference, we write this as

$$\begin{aligned} k_{2} = 1800, R_0 (\lambda _w )= 16. \end{aligned}$$
(A5)

We retain (A5) through the remainder of the paper. The idea in this section is to check the effects of delay in the absence of term-time forcing. This section provides a second benchmark prior to our results in the next section, where delay and term-time forcing are modeled together.

The first model of this section sets the degree of the Erlang function at \(n = 3\), and the second uses \(n = 64\). Recall that n (along with parameter a) gives the shape of Erlang function, which assigns weights to all past values of prevalence, and which then (along with parameters \(k_{1}\) and \(k_{2})\) determines the current fraction demanding vaccination. The mean delay duration of the Erlang distribution is given by n / a, and the standard deviation of the distribution is \(\sqrt{n}/a\). Thus, the ratio of the standard deviation to the mean delay is \(1/\sqrt{n}\), and the dispersion about a given mean falls as n increases. For example, if we are interested in a mean delay of 180 days, then if our model sets n at 3, the standard deviation around 180 will be 103.9 days, but if we model the same mean delay with \(n = 64\), the standard deviation would be 22.5 days.

Fig. 12
figure 12

Equilibrium values for Log \(_{10}(I_{1})\) when E\(_{1}\) is stable, or the maximum and minimum of Log \(_{10}(I_{1}\)) when \(E_{1}\) is unstable, shown as a function of the mean delay interval. There is no term-time forcing. Parameters from (A3) and (A5)

4.2.1 n = 3.

We start with the \(n = 3\) case, assuming there is no term-time forcing, (i.e., \({\lambda }_{1} = {\lambda }_{2} = 1.12\)). Other parameters are as given in (A3) and (A5). After many simulation runs using various delay durations, we get the bifurcation diagram shown in Fig. 12. Mean delay increases to the right along the horizontal axis. The vertical axis shows: (\(i) I_{1}\) as a solid line, if \(E_{1}\) is stable; (ii) \(I_{1}\) as a dashed line, if \(E_{1}\) is unstable; and (iii) the maximum and minimum values of I (noted \(I_{max}\) and \(I_{min}\), respectively) along a periodic orbit at various values for mean delay. For better optics, we use Log\(_{10}(I)\) of all I values.

To the far left of Fig. 12, when mean delay is between 0 and about 16 days, \(E_{1}\) is locally stable. Beyond a mean delay of about 1151 days, \(E_{1}\) is again locally stable. The “orbit” drawn is just a sketch indicating that periodic orbits form. The transition points, where mean delays are about 16 and about 1151, are found by numerically solving det\((H_{4}(a)) = 0\) for any real and positive roots. In this case, there are two real positive a values giving det\((H_{4}(a)) = 0\); these define the mean delay times where stability switches occur. We call them \(a_{L}\) and \(a_{H}\), for lower and higher, respectively. det\((H_{4}(a)) >0\) and \(E_{1}\) is stable for \(a <a_{L}\) and for \(a > a_{H}\). Otherwise det\((H_{4}(a))<0\) and \(E_{1}\) is unstable. The expression n / a then gives the associated mean delay, where \(n = 3\) in this case. Notice in Fig. 12 that as mean delay increases, \(I_{max}\) grows. This is to be expected, since delayed vaccination response allows the disease to proliferate. It is also the case that the interval between peak outbreaks rises as mean delay increases. The periods are shown as a function of mean delay in Fig. 13. As delay increases, the intensity of the outbreaks rise, while their frequency falls. This raises the question about the long term impact of the disease as the mean delay rises. We check this looking at \(\gamma \int \nolimits _{t_i }^{t_j } {I(t)dt} \) over a long interval, where \(t_{i} = 3 \times 10^{6}\) and \(t_{j} = 4 \times 10^{6}\) days. This gives the total number of cases (divided by 10\(^{7}\) in the figure) during a million-day span. These results are also displayed in Fig. 13. (Data in both Figs. 12 and 13 are discrete, but presented continuously to enhance optics.)

Fig. 13
figure 13

This shows the period of oscillations and the total number of cases (divided by \(10^{7}\)) over a million day interval as functions of mean delay. Parameters from (A3) and (A5)

Figure 14 shows a typical sim result projected to (S, I) space, where mean delay is 90 days. One sees a path spiraling out from an initial point near the unstable \(E_{1}\) and moving toward an orbit which is shown running from \(3.9 \times 10^{6}\) to \(4.0 \times 10^{6}\) days. Notice that we do not get irregular dynamics. Depending upon the value of mean delay, we see either convergence to \(E_{1}\) or to various sized cycles. After doing extensive simulations with plausible parameter sets, we have not been able to generate irregular dynamics with Erlang parameter \(n = 3\) and no term-time forcing. Of course, a finite number of trials does not establish impossibility. We will now see that irregular dynamics follows easily when higher levels of n are used.

Fig. 14
figure 14

Mean delay is 90 days and \(n\,=\,3\). A path is spiraling is out from an unstable \(E_{1}\) toward a periodic orbit. The inset shows prevalence levels/3000 for scaling (brown) and delayed vaccination response (blue)

4.2.2 n = 64.

While retaining for the moment our temporary assumption of no term-time forcing, we leave the parameters above intact, except that we increase n to 64. This allows us to tighten the standard deviation around the mean delay. As expected, this system yields a locally stable \(E_{1}\) for low values (about two weeks) of mean delay. With delay durations above (roughly) two weeks, \(E_{1}\) is unstable and approaches a periodic orbit much like that shown in Fig. 14. These cycles are at first single peaked, and on a period of a little more than 2000 days. But as mean delay rises past about 950 days, the post outbreak interval begins to show, at first, a wiggle and then a minor secondary peak. This secondary peak grows in size without substantially increasing the duration of the periodic orbit—it goes from about 2100 days at mean delay of 950 to about 2560 days with mean delay 1100 days. See Fig. 15.

Fig. 15
figure 15

Time series for various delay durations, with \(n\,=\) 64, no term-time forcing, and parameters in (A3) and (A5)

By mean duration delay of 1110 days, the period has roughly doubled to about 5200 days with 4 prevalence peaks appearing in the periodic orbit. This period doubling happens again as the mean delay hits about 1144 days. There are now 8 distinct peaks in a roughly 10,700 day periodic orbit. A cascade has begun, and by mean delay 1150 days, there are 16 prevalence peaks on a periodic orbit 21,712 days long. This is roughly the same length as the mean lifespan. See Fig. 16, where we show prevalence, I(t), and the fraction vaccinating, V(t), over 25,000 days, ending at day \(2 \times 10^{6}\). Here the reader can see the fraction vaccinating reaching its ceiling value of 0.95 following large outbreaks.

Fig. 16
figure 16

Mean delay is 1150, with \(n\,=\) 64, no term-time forcing, and parameters in (A3) and (A5). A cycle of duration 21,712 days having 16 different prevalence peaks occurs

Longer delays produce chaotic-looking outcomes, one of which we illustrate in Fig. 17. Here mean delay is 1160 days. The variable \(Y_{64}\) is one of the synthetic variables used with the linear chain trick.

Fig. 17
figure 17

Mean delay is 1160, with \(n\,=\,64\), no term-time forcing, and parameters in (A3) and (A5). Time runs from \(t = 1.8 \times 10^{6}\) to \(2\times 10^{6}\)

This and the previous section were meant to establish two benchmarks. In Sect. 4.1 we showed that, in the absence of delay, term-time forcing could cause irregular dynamics if the forcing is “strong,” i.e., a large difference between disease transmission parameters when school is out versus in. The main results of the numerical exercise in present sub-section are: (i) When term-time forcing is not present, the SIR model with vaccination responding to past prevalence under Erlang distributed delay with \(n = 3\) appears to give orderly dynamics for all values of mean delay. (ii) Chaotic dynamics are found to be possible without term-time forcing when n is large and mean delay is “long.” In the next section we investigate a model with both term-time forcing and delay.

4.3 Both term-time forcing and delay

Following in the path of d’Onofrio, Manfredi, and Salinelli [24, 27], who explored the combination of sinusoidal forcing of contact rates and prevalence induced vaccination choices of various forms, we now examine System (2) with both discrete school-related term-time forcing and distributed delay under a range of Erlangian parameters.

Recall from the discussion of Fig. 14 that when \({\lambda }_{1} = {\lambda }_{2}\), (equivalently,  when \(m = 1\)), and there is no term-time forcing, we get a simple periodic orbit when: the Erlang parameter \(n = 3\), mean delay is 90 days, and both assumptions (A3) and (A5) hold. We also learned there that in order to get more exotic dynamics n needs to be larger as does the mean delay. We begin this section using the result displayed in Fig. 14 as a baseline and introducing term-time forcing by gradually increasing m, while holding \(n = 3\) and mean delay equal to 90 days.

We hold all other parameters as they were, and we continue to constrain\(R_0 (\lambda _w )\) to 16. Thus, the weighted average of \({\lambda }_{2}\) and \({\lambda }_{1}\) is fixed.

Consider first the case where \({\lambda }_{2}\) is just 10% above \({\lambda }_{1}\), i.e., m \(=\) 1.1. Recall that the two pure \({\lambda }_{i}\) sub-systems might have endemic equilibria, but the full hybrid system will not. Nevertheless, the positions and stability properties of the “phantom” equilibria are of interest. In the present case, \(E_{1}({\lambda }_{1}) = (66952.1, 206.434)\) and \(E_{1}({\lambda }_{2}) = (60865.5, 208.148)\). In general, the two points separate as m increases beyond \(m = 1\). This can be seen by noting that

$$\begin{aligned} E_{1}({\lambda }_{i}) = (S_{1}({\lambda }_{i}), I_{1}({\lambda }_{i})) = \left( {\frac{N(b+\gamma )}{\lambda _i },\frac{bN(-b-\gamma +\lambda _i (1-k_1 )}{(b+bk_2 +\gamma )\lambda _i }} \right) \quad i = 1, 2. \end{aligned}$$

Since\(R_0 (\lambda _w )\)is a convex combination of \({\lambda }_{1}\) and \({\lambda }_{2}\), when \({\lambda }_{2}\) increases, \({\lambda }_{1}\) falls. Further, when the value of \({\lambda }_{2}\) rises, it is obvious that \(S_{1}({\lambda }_{2})\) falls and \(I_{1}({\lambda }_{2})\) rises. Similarly, when \({\lambda }_{1}\) falls, \(S_{1}({\lambda }_{1})\) rises, and \(I_{1}({\lambda }_{1})\) falls. It follows that when m increases from \(m = 1\), these changes cause \(E_{1}({\lambda }_{1})\) and \(E_{1}({\lambda }_{2})\) to move apart.

In the present example, both the pure \({\lambda }_{1}\) and \({\lambda }_{2}\) sub-systems are locally unstable. This is verified using det(H4). The result with \(m = 1.1\) is the 5-year periodic orbit shown in Fig. 18.

Fig. 18
figure 18

Assumptions (A3) and (A5) hold. Mean delay is 90 days, \(m\,=\) 1.1, and \(n\,=\) 3. Time runs once through a 5-year periodic orbit starting at \(t\,=\) 3,987,043. Dots mark the last day of the Spring term

Fig. 19
figure 19

Here we see period doubling beginning at about \(m\,=\) 1.2 with 90 day mean delay and \(n\,=\,3\). Other parameters are given in (A3) and (A5). Time runs for 10 years beginning at \(t\,=\) 3,907,843. Dots mark the end of each Spring term. There are 10 dots, the ones at the bottom nearly overlap

We now set \({\lambda }_{2}\) 20% above \({\lambda }_{1}\). The result is that the full hybrid system undergoes a period doubling bifurcation, as see in Fig. 19. The two phantom equilibria are \(E_{1}({\lambda }_{1})\) \(=\) (71404.1, 205.2) and \(E_{1}({\lambda }_{2})\) \(=\) (59503.4, 208.5). Both are unstable. The obvious kinks in the trajectory are due to the temporal forcing events, but the trajectory will also bend perceptibly when the vaccinating fraction switches betweenmin[\(k_{1 }+k_{2}Y_{2}\)/\(N, V_{m}\)\(=\) \(k_{1 }+k_{2}Y_{2}\)/N and the ceiling value min[.] \(=\) \(V_{m}\), as \(Y_{2}(t)\) moves through the state space under System (2). The path in Fig. 19 appears to cross itself, but it actually does not. The figure is really just a 2-D slice of a 5-D system.

We continue boosting the strength of the term-time forcing by increasing \({\lambda }_{2}\) modestly from 20% above \({\lambda }_{1}\) to 22% above \({\lambda }_{1}\). (Since we are holding \({\lambda }_{w}\) and \(R_0 (\lambda _w )\) constant, \({\lambda }_{1}\) falls slightly as \({\lambda }_{2}\) increases.) The result is shown in Fig. 20. Both phantom endemic equilibria (the two dots in the figure) are unstable. The hybrid system has undergone another period doubling bifurcation, with the period now 20 years long and with major outbreaks still occurring every 5 years.

Fig. 20
figure 20

Another period doubling with forcing strength now at \(m\,=\) 1.22 with 90 day mean delay and \(n\,=\) 3. Other parameters are given in (A3) and (A5). Time runs for 10 years beginning at \(t\,=\) 3,911,390

With \(m =1.225\), there is another period doubling bifurcation, with a 40 year period and 5 year intervals between outbreaks. Increasing m to 1.23, the hybrid begins to look chaotic. Figure 21 shows a 3-D slice of the hybrid (including one of the synthetic variables, \(Y_{2})\) with time running from \(t = 2.8 \times 10^{6}\) to \(3.0 \times 10^{6}\) days.

Fig. 21
figure 21

Chaos starts at about \(m\,=\) 1.23 with 90 day mean delay and \(n\,=\) 3. Other parameters are given in (A3) and (A5). Time runs for 200,000 days beginning at \(t\,=\) 2.8 m

When \(m = 2\), the chaos is much more evident. This is seen in the two following time series plots of I(t) shown in Figs. 22 and 23. The first spans 200,000 days following \(t = 3.8 \times 10^{6}\), and the second gives better resolution at a shorter time span.

Fig. 22
figure 22

Here term-time forcing strength is given by \(m\,=\) 2. There is 90 day mean delay with \(n\,=\) 3. Other parameters are given in (A3) and (A5). Time runs for 200,000 days beginning at t = 3.8\( \times 10^{6}\)

Fig. 23
figure 23

Parameters same as in Fig. 22, except time interval shown is only about 50 years, starting at \(t\,=\) 3,806,000

Figure 23 gives the fine structure of the time path of I, with t running from 3,806,000 to 3,825,000 days. The period between outbreaks is irregular, and the outbreaks themselves vary greatly in the height of the major peaks and in the number and arrangement of lesser peaks. Notice that we again see a mix of large outbreaks and closely-packed, relatively low amplitude peaks, as we did in Fig. 8.

Before we look at our final example, we recap the results of the previous sections. (i) In Sect. 4.1 we saw that term-time-generated changes in contact rates can engender irregular cycles in the absence of vaccination demand delay when both \(R_0 (\lambda _w )\) and the forcing strength are high. Specifically, we found this when \(R_0 (\lambda _w )\) \(=\) 24 and m \(=\) 17. (ii) In Sect. 4.2 we saw that when delay is employed, but term-time forcing is off, we cannot find irregular dynamics without employing high degree Erlang functions (\(n = 64\) in the case examined) and long (1150 day) mean delay, though we did get this result with \(R_0 (\lambda _w )\) equal to a more modest 16. (iii) So far in Sect. 4.3, where we have combined term-time forcing and vaccination response delay, we have found chaos with relatively low levels of term-time forcing strength (m equal 2 or less) and 90 day mean delay. We have shown this with Erlang distributions with n equal to 3. But the next example shows that moderate term-time forcing (\(m = 2\)) coupled with reasonable mean delay (90 days) can also produce chaos in the \(n = 1\) case. That is, term-time forcing substantially reduces the demands on the delay structure and moderate delay reduces the demands on term-time forcing strength in order to obtain irregular dynamics. Hence, the word “complementarity” in the title.

In Sect. 2 we gave reasons for thinking that values for n above one are more appropriate for vaccination delay. Our reasons were that: First, today’s level of prevalence should not be used to explain today’s vaccination demand, as it does when \(n = 1\). And second, a “bell-shaped” distribution seems reasonable, in that we conjecture that a few people respond quickly to an outbreak, then as the delay time rises, more people will respond, and then response trails off. But there is no denying that working with \(n = 1\) is more likely to yield analytical results, thanks to the work of Buonomo et al. [19, 20], d’Onofrio et al. [21, 22]. And empirically the \(n = 1\) case may produce good results.

With \(n = 1\) and all other parameters unchanged (except that parameter a is adjusted to maintain mean delay of 90 days), we again see irregular periods and amplitudes plus a mix of large single peaked outbreaks and longer-running multi-peak events. The example is shown in Fig. 24.

Fig. 24
figure 24

Term-time forcing coupled with delay with the “weak kernel.” Here \(n\,=\) 1, \(m\,=\) 2, mean delay \(=\) 90 days, and both (A3) and (A5) hold. The main graph shows six major outbreaks over a 50 year interval starting at \(t\,=\) 3,145,573, the first day of the Spring term of reference year 8618. The inset shows a longer time span (about 300 years) surrounding the main graph

5 Conclusion

Many researchers have made a strong case for term-time forcing. There is little doubt that the congregation of students during the school term enhances disease transmissibility. It seems undeniable, also, that individuals contemplating vaccination respond with a delay when a disease outbreak occurs. It also seems clear empirically that disease dynamics are irregular in the sense that neither convergence to an endemic equilibrium nor a simple periodic orbit is the norm. Researchers working with temporal forcing (both sinusoidal and discrete) in otherwise conventional SIR models have found that only “strong” forcing can bring about irregular dynamics. Similarly, delay models of many sorts seem to lead to irregular dynamics only when delay is “long” (See Buric and Todorovic [37], Canabarro et al. [38], Hao et al. [39], Jiang et al. [41], Mackey and Glass [40], and Vasegh et al. [42]). This exercise, along with [24, 27] has shown that models with both term-time forcing and vaccination delayed response to prevalence can display irregular dynamics with moderate forcing strength and reasonable mean delay durations.

Purely analytical result have been elusive in both simple term-time forcing models and simple delay models. No doubt that will change in time, but at the moment we can show numerically how the combination of forcing and delay can work with commonly used population/disease parameters. This may be helpful in statistical modelling, but that will be another story.