1 Introduction

Social insect colonies are often considered to be highly efficient complex systems that dominate most terrestrial ecosystems across the planet (Hölldobler and Wilson 2009; Wilson 1971). The success of social insect colonies is often attributed to their sophisticated and complex mechanisms for organizing work leading to division of labor and efficient task allocation in dynamic environments, and as the colony grows (Gordon 1996; Robinson et al. 2009). Colony size plays an essential role in the development of social insect colonies, and profoundly affects many aspects of colony function, such as foraging (Beckers et al. 1989; Mailleux et al. 2003; Thomas and Framenau 2005); collective decision-making strategies (Franks et al. 2006; Ruel et al. 2012); workload distributions (Dornhaus et al. 2008) and social organization (Bourke 1999). Previous studies have shown that colony size plays a vital role in task allocation (ants (Holbrook et al. 2013, 2011; Tschinkel 1993); bees (Bourke 1999); wasps (Jeanne 2003) and termites (Hou et al. 2010)). There is significant empirical work looking at the internal relationship between colony size and task organization (Fewell and Harrison 2016; Gordon 1996; Fjerdingstad and Crozier 2006; Jeanson et al. 2007; Dornhaus et al. 2012), however, theoretical work remains limited. At the same time, the mechanisms through which colony size influences task allocation, are not well-understood. We know that metabolic rates do not scale linearly with body size in most living organisms (i.e., metabolic rates are proportionately lower in larger organisms (Kleiber 1932, 1947; Glazier 2010)). The same pattern has been shown to occur in social insect colonies (often conceived of as ’superorganisms’) where per-capita metabolic rates decrease with colony size (Fewell and Harrison 2016; Waters 2014; Shik 2010; Waters et al. 2010). Therefore, it is essential to include metabolic rates of workers performing varied tasks when studying the organization of work.

Inactivity has long been known to be one of the most common behaviors observed in social insect colonies (Hölldobler and Wilson 1990). Indeed, at any given moment, there are typically 40–70% of workers in a colony that are inactive (honey bees (Lindauer 1952; Moore et al. 1998; Muscedere et al. 2009); bumblebees (Jandt et al. 2012); wasps (Gadagkar and Joshi 1984); termites (Maistrello and Sbrenna 1999) and ants (Herbers and Cunningham 1983; Herbers 1983; Cole 1986; Corbara et al. 1989; Retana and Cerdá 1990; Dornhaus 2008; Charbonneau et al. 2015)). Additionally, some individuals appear to spend a disproportionate amount of time inactive, effectively specializing on inactivity (Herbers and Cunningham 1983; Fresneau 1984; Cole 1986; Retana and Cerdá 1990; Retana and Cerda 1991). Inactivity levels in the field have been shown to be comparable to those observed in lab colonies, suggesting that these high levels of inactivity are not simply an artifact of simplified conditions in the lab (Charbonneau et al. 2015).

Although inactivity is widespread in social insect colonies, its role in colony function is not well understood and rarely taken into account in the study of task allocation, which may cause potential bias (Charbonneau and Dornhaus 2015b). We do not currently know what shape of ’inactivity demand’ (i.e., the function describing the distribution of inactivity in a colony) might resemble in colonies. Individuals likely have a base requirement for rest which they need to attain to remain functional. There is evidence of decreased performance in sleep-deprived bees (Klein et al. 2010). Furthermore, the base amount of inactivity needed is probably a function of other factors, such as worker age (D. Charbonneau, unpublished results, also see Muscedere et al. 2009 for inactivity due to worker immaturity). However, there is most like an additional amount of inactivity that results from insufficient work (see Charbonneau and Dornhaus 2015a for conceptual framework). Thus, we should expect inactivity demand to result from both a constant function (base need for rest) as well as an increasing function (dependent on a combination of available work/colony needs and available workforce). Our modeling work incorporates both.

Mathematical models have been successfully applied to many aspects of social insect behavioral dynamics (Chen et al. 2020; Guo et al. 2020; Messan et al. 2018, 2020), such as genetic variability (Kang and Fewell 2015; Myerscough and Oldroyd 2004); foraging activities (Ramsch et al. 2012; Udiani et al. 2015); evolutionary dynamics (Kang et al. 2015) and task allocation (Bonabeau et al. 1997; Cornejo et al. 2014; Rodriguez et al. 2018; Rodriguez-Rodriguez and Kang 2016). Most of these models are useful and focusing on simulations to explore the dynamics of social insect colonies. They intuitively show the physical characteristics of social insect colonies and provide scientists with an inexhaustible motivation for a deeper understanding of social insect colonies. Differential equations have proven to be highly effective in revealing the principles and laws behind different representations. In recent years, differential equations have been gradually employed by scholars to study the dynamical processes of social insect colonies (see some interesting topics that have been explored in Kang and Theraulaz 2016, Sumpter and Pratt 2003). In this study, we would use ordinary differential equations (ODEs) and stochastic differential equations (SDEs) as our modeling tools.

Social insects live in a dynamic environment and are inevitably affected by random fluctuations (e.g., stochastic noises). Studies have shown that random fluctuations can potentially positively or negatively affect the dynamical outcomes of social insect colonies (Cammaerts and Cammaerts 2018; Dussutour et al. 2009; Feinerman and Korman 2017). Due to the ever-changing environment, there are many types of stochastic noises (e.g., white noise (DeLillo 1999); telegraph noise (Ranjan et al. 2016)). Currently, various methods have been developed to characterize different types of environmental noises such as Brownian motion (Saffman and Delbrück 1975) and also Markov switch (Slatkin 1978). In recent years, stochastic models based on random fluctuations have been successfully applied in many scientific fields, such as epidemic dynamics (Allen and Lahodny 2012; Britton 2010; Cai et al. 2020, 2017; Gray et al. 2011) and population dynamics (Benaïm and Schreiber 2019; Hening et al. 2018; Ovaskainen and Meerson 2010; Wu and Xu 2009). However, as far as we know, many current modeling frameworks for social insect colonies are mostly based on deterministic models (Banks et al. 2017; Kang and Theraulaz 2016; Magal et al. 2019; Sumpter and Pratt 2003) with few studies that have used stochastic models (but see Arcuri and Lanchier 2017; Dussutour et al. 2009). Thus, we will start with ODEs and then add random fluctuations through SDEs to study the impacts of random fluctuations.

This paper proposes a theoretical framework at the colony level to study task allocation dynamics of social insect colonies. Internal factors (e.g., the various threshold for different tasks) and external factors (e.g., task stimuli from the environment) that may affect task allocation are incorporated into the proposed theoretical framework. The theoretical output is expected to address the following issues: (i) how does metabolic scaling affect task allocation and resting probability of social insect colonies, as colony size increases? (ii) how does colony size affect working activity in different scenarios of working versus resting? (iii) how does random fluctuation affect working activity and task demand of social insect colonies?

The rest of the paper is organized as follows: Sect. 2 presents the model derivation of task allocation. Section 3 begins by laying out the mathematical analysis of the theoretical framework (i.e., the invariant set of positive solution and the existence of equilibrium), and addresses the scaling effects of colony size on resting probability and task allocation. Section 4 is concerned with the application of the theoretical framework: working activities versus resting models in four different scenarios. The global dynamics of the proposed models are studied theoretically, and the effects of factors (including colony size and metabolic scaling) on work activities are analyzed biologically. Section 5 assumes that task demand is subject to random fluctuations, and studies the effects of random fluctuations on task demand and work activities. Section 6 presents a summary of the results and discusses their related biological significance.

2 Model derivation of task allocation

Let \(N\ge 1\) be the total population size of the colony; \(m\ge 1\) be the number of tasks in a social insect colony; \(D=[D_0, D_1,D_2,\cdots ,D_m]\) be the task demand where \(D_0\) is the demand of inactive (i.e., resting) and \(D_i, i=1,..,m\) is the demand of the specific task i; \(X=[x_0, x_1,x_2,\cdots ,x_m]\) be the task allocation for m tasks where \(x_i,1\le i\le m\) is the ratio of workers performing task i and \(x_0\) is the portion of workers being inactive (i.e., resting). Therefore, for each task i, there are \(Nx_i\) workers performing the task i. In the case that \(N=1\) (e.g., when the single queen establishes her own colony), \(x_i\in [0,1]\) could be considered as the allocation of energy/time to perform task i when \(0\le i\le m\) or the resting time \(i=0\).

Let \(\theta _i\) be an average response threshold for task i for a colony, and we can define \(\frac{D_i}{\theta _i}\) as the relative stimulus of task i. Then, the larger demand \(D_i\) and/or the smaller average response threshold \(\theta _i\) gives the larger relative stimulus for task group i. Therefore, we can define \(f_i=\frac{\frac{D_ix_i}{\theta _i}}{\sum _{k=0}^m \frac{D_k x_k}{\theta _k}}\) as the recruitment ability of task i, and the dynamics of task i allocation, i.e., \(\frac{dx_i}{dt}\), can be modeled as follows:

$$\begin{aligned} \frac{dx_i}{dt}= & {} \underbrace{\sum _{k=0,k\ne i }^m f_i x_k}_{\text {workers performing other tasks switching to task i}}\\&-\underbrace{\sum _{k=0,k\ne i }^m f_k x_i}_{\text {workers performing task } i \text { switching to other tasks}}\\= & {} f_i(1-x_i)-x_i (1-f_i)=f_i-x_i=x_i\left[ \frac{\frac{D_i}{\theta _i}}{\sum _{k=0}^m \frac{D_k x_k}{\theta _k}}-1\right] . \end{aligned}$$

The demand of task i of the colony, i.e., \(D_i\), is determined by the following two factors:

  • The demand input \(\gamma _i N^{\delta _i}\) is an increasing nonlinear function of the colony size N, where \(\gamma _i\) represents the increase in demand intensity per unit time for task i and \(\delta _i\) denotes the nonlinear metabolic scaling of task i from the colony size N. The formulation of this demand input follows the metabolic scaling effects in ecology (Chown et al. 2007). Much literature reported that the values of \(\delta _i\) for social insect colonies are less than one (Waters et al. 2010), but for some species they could also be above one depending on caste and the related tasks (Shik 2010).

  • The depletion of demand \(\alpha _i N x_i D_i\) is an increasing function of the demand \(D_i\) and the size of task group \(Nx_i\), where \(\alpha _i\) denotes the average performance efficiency of task group i. This modeling approach is adopted from Kang and Theraulaz 2016 (but also see the work of Theraulaz et al. 1998), which gives the dynamics of the demand for task i that could be modeled by follows:

    $$\begin{aligned} D_i'=\gamma _i N^{\delta _i}-\alpha _{i} N x_i D_i=\gamma _iN^{\delta _i}\left[ 1-\frac{\alpha _i x_i N^{1-\delta _i}}{\gamma _i}D_i\right] =\gamma _iN^{\delta _i}\left[ 1-\frac{ x_i D_i}{\theta _i{\hat{D}}_i}\right] . \end{aligned}$$

    We assume that the relative stimulus of inactivity/resting could be either a constant, e.g., \(\frac{D_0}{\theta _0}=\varPhi N^{\delta _0}\), or an increasing function of working effort \(1-x_0\) such as \(\frac{D_0}{\theta _0}=w N^{\delta _0} (1-x_0)\).

The discussion above provides a general dynamical compartmental model of task allocation on the colony level that can be represented as the following set of nonlinear compartment model:

$$\begin{aligned} \begin{aligned} x_i'&=x_i\left[ \frac{\frac{D_i}{\theta _i}}{\sum _{k=0}^m \frac{D_k x_k}{\theta _k}}-1\right] , i\ge 0,\\\\ D_i'&=\gamma _iN^{\delta _i}\left[ 1-\frac{ x_i D_i}{\theta _i{\hat{D}}_i}\right] , i\ge 1,\\ \end{aligned} \end{aligned}$$
(1)

where \(\frac{D_0}{\theta _0}=\varPhi N^{\delta _0}\) or \(\frac{D_0}{\theta _0}=w N^{\delta _0} (1-x_0)\); and \({\hat{D}}_i=\frac{\gamma _i N^{\delta _i-1}}{\alpha _i\theta _i}\). The proposed general Model (1) incorporates both variation in task performance among workers and individual worker flexibility. The decision of an individual worker performing a task depends on both the internal factors (e.g., the varied thresholds for different tasks) and the external factors (e.g., task needs from the environment). Thus, the dynamical outcomes of Model (1) are expected to predict how colonies allocate workers in relation to the need for each task and adjust the allocation in response to environmental changes as well as its colony size N. As a note, we would like to point out that Model (1) can also model how the solitary foundress queen allocates her energy and time for different tasks when \(N=1\). And if \(m=1\), Model (1) models how social insect colonies decide on working \(x_1\) or resting \(x_0\) depending on the work demand \(D_1\) and the environmental changes.

Social insect colonies live in the ever-changing environment that is subject to random fluctuations (e.g., see Cammaerts and Cammaerts 2018; Dussutour et al. 2009; Feinerman and Korman 2017), especially the demand of each task \(D_i\). By using standard techniques (Evans et al. 2013; Hening et al. 2018), for any initial demand \(D_i(0)=D_0^i\) and time step \(0\le \varDelta t\ll 1\), the task demand \(D_i(t)\) can be described by a Markov process with conditional mean

$$\begin{aligned} {\mathbb {E}}[D_i(t+\varDelta t)-D_i(t)|D_i(t)=D_0^i]\approx \gamma _i N^{\delta _i}\left[ 1-\frac{x_iD_i}{\theta _i{{\hat{D}}}_i}\right] \varDelta t \end{aligned}$$

and conditional covariance

$$\begin{aligned} \text {Cov}[D_i(t+\varDelta t)-D_i(t)|D_i(t)=D_0^i]\approx \sigma _{ij}D_iD_j\varDelta t \end{aligned}$$

for some covariance matrix \(\varSigma =(\sigma _{ij}).\) More formally, it is natural to include random fluctuations into the demand dynamics through the following SDEs:

$$\begin{aligned} \begin{aligned} d x_i&=x_i\left[ \frac{\frac{D_i}{\theta _i}}{\sum _{k=0}^m \frac{D_k x_k}{\theta _k}}-1\right] dt, i\ge 0,\\\\ dD_i&=\gamma _iN^{\delta _i}\left[ 1-\frac{ x_i D_i}{\theta _i{\hat{D}}_i}\right] dt +\sigma _iD_i(t)dB_i(t), i\ge 1, \end{aligned} \end{aligned}$$
(2)

where \(B_i(t)\) is a standard one-dimensional independent Brownian motion defined on the complete probability space \((\varOmega ,{\mathscr {F}},{\mathbb {P}})\), and \(\sigma ^2_i\) is the intensity of \(B_i(t)\). The dynamics \(x_i\) is the ratio thus it is confined in [0,1), and the sum of all \(x_i\) should be 1. It is not reasonable to include environmental stochasticity by using the approach of modeling environmental stochasticity in \(D_i\). The dynamics of \(x_i\) is affected by \(D_i\) whose dynamics include environmental stochasticity, thus \(x_i\) in fact has demographic stochasticity from its demand dynamics \(D_i\). We assume that the parameters \(\theta _i, \gamma _i, \delta _i\) are constant but it would be realistic to include stochasticity in those parameter values.

In the next section, we will provide theoretical results of our ODE Model (1) predictions and the related biological implications. And the SDE Model (2) will be explored in Sect. 5.

3 Mathematical analysis

Notice that \(\sum _{k=0}^m x'_k=0\) in Model (1), therefore, \(S=\{\sum _{i=0}^m x_i=1: 0\le x_i\le 1\}\) is the invariant set. The state space of Model (1) could be defined as \(\varOmega = S\times {\mathbb {R}}_+^m\). Let \({\hat{D}}_i=\frac{\gamma _i N^{\delta _i-1}}{\alpha _i\theta _i}\) be the efficient demand for task i, and define \({\hat{D}}=\sum _{k=1}^m {\hat{D}}_k\) as the total efficient demand for all tasks in the colony.

Theorem 1

(Dynamical Properties) Assume that all parameters are strictly positive and \(\sum _{i=0}^m x_i(0)=1\) with \(x_i(0)>0\) for all \(i=0,..,m\). Then the model (1) is positively invariant and bounded in \(\varOmega \) with

$$\begin{aligned} \liminf _{t\rightarrow \infty } D_i(t)\ge \frac{\gamma _i N^{\delta _i-1}}{\alpha _i} =\theta _i{\hat{D}}_i \text{ for } \text{ any } i=1,..,m. \end{aligned}$$

Let \(\frac{D_0}{\theta _0}=\varPhi N^{\delta _0}\), then we have

  1. 1.

    If \(\varPhi N^{\delta _0}<{\hat{D}}\), Model (1) has a unique equilibrium \((X^*,D^*)\) with

    $$\begin{aligned}x_0^*=0,\,\,x_i^*=\frac{{\hat{D}}_i}{{\hat{D}}} \text{ and } D_i^*={\hat{D}}\theta _i, \text{ for } \text{ all } 1\le i\le m.\end{aligned}$$
  2. 2.

    If \(\varPhi N^{\delta _0}>{\hat{D}}\), Model (1) has a unique interior equilibrium \(({\hat{X}}^*,{\hat{D}}^*)\) with

    $$\begin{aligned} {\hat{x}}^*_0=1-\frac{{\hat{D}}}{\varPhi N^{\delta _0}},\,\,{\hat{x}}_i^*=\frac{{\hat{D}}_i}{\varPhi N^{\delta _0}} \text{ and } {\hat{D}}_i^*=\varPhi \theta _i N^{\delta _0}. \end{aligned}$$

Let \(\frac{D_0}{\theta _0}=w N^{\delta _0}(1-x_0)\), then we have

  1. 1.

    If \(wN^{\delta _0}<{\hat{D}}\), Model (1) has a unique equilibrium \((X^*,D^*)\) with

    $$\begin{aligned} x_0^*=0,\,\,x_i^*=\frac{{\hat{D}}_i}{{\hat{D}}} \text{ and } D_i^*={\hat{D}}\theta _i. \end{aligned}$$
  2. 2.

    If \(wN^{\delta _0}>{\hat{D}}\), Model (1) has a unique interior equilibrium \(({\hat{X}}^*,{\hat{D}}^*)\) with

    $$\begin{aligned} {\hat{x}}^*_0=1-\sqrt{\frac{{\hat{D}}}{w N^{\delta _0}}},\,\,{\hat{x}}_i^*=\frac{{\hat{D}}_i }{\sqrt{{\hat{D}}w N^{\delta _0}}} \text{ and } {\hat{D}}_i^*=\theta _i\sqrt{{\hat{D}}w N^{\delta _0}}. \end{aligned}$$

Moreover, if there exists an i such that \(wN^{\delta _0}<{\hat{D}}_i\) for \(\frac{D_0}{\theta _0}=wN^{\delta _0}(1-x_0)\) or \(\frac{D_0}{\theta _0}=\varPhi N^{\delta _0}<{\hat{D}}_i\) holds, we have

$$\begin{aligned} \lim _{t\rightarrow \infty } x_0(t)=0. \end{aligned}$$

Biological implications Theorem 1 suggests that our model (1) is well defined biologically. Numerical simulations suggest that for all initial conditions in the interior of S, i.e., \(\{\sum _{i=0}^m x_i(0)=1: 0< x_i(0)\le 1\}\), the unique equilibrium \((X^*,D^*)\) is always globally stable when the total efficient demand for all tasks is large (e.g., \(\varPhi N^{\delta _0}<{\hat{D}}\) or \(wN^{\delta _0}<{\hat{D}}\)). Otherwise, the unique interior equilibrium \(({\hat{X}}^*,{\hat{D}}^*)\) is always globally stable. More specifically, our results have the following implications:

  1. 1.

    If there is a task whose efficient demand (i.e., \({\hat{D}}_i, 1\le i\le m\)) is larger than the physiological resting demand \(\varPhi N^{\delta _0}\) (or \(wN^{\delta _0}\)), the colony has no allocation to resting due to the demand requirement.

  2. 2.

    If there is no allocation to resting due to high task demand, the specific allocation for task i is determined by the ratio of the efficient demand for task i to the total efficient demand for all tasks in the colony, i.e., \(x_i^*=\frac{{\hat{D}}_i}{{\hat{D}}} \).

  3. 3.

    If the physiological resting demand \(\varPhi N^{\delta _0}\) (or \(wN^{\delta _0}\)) is larger than the total efficient demand for all tasks, the allocation for task i is determined by the ratio of the efficient demand for task i to the physiological resting demand in the colony, i.e., \({\hat{x}}_i^*=\frac{{\hat{D}}_i}{\varPhi N^{\delta _0}}\) (for the case of \(\varPhi N^{\delta _0}\)) or \({\hat{x}}_i^*=\frac{{\hat{D}}_i}{\sqrt{{\hat{D}}w N^{\delta _0}}}\) (for the case of \(wN^{\delta _0}\)).

3.1 Scaling effects of the colony size N on the resting probability

Define \(G(N)=\frac{{\hat{D}}}{N^{\delta _0}}=\sum _{k=1}^m\frac{\gamma _k N^{\delta _k-\delta _0-1}}{\alpha _k\theta _k}\), then

$$\begin{aligned} \frac{dG(N)}{dN}=\sum _{k=1}^m\frac{\gamma _k (\delta _k-\delta _0-1)N^{\delta _k-\delta _0-2}}{\alpha _k\theta _k}. \end{aligned}$$
(3)

According to Theorem 1, we know that the value of \(\varPhi \) (or w) and G(N) determines whether the colony will rest, i.e.,

$$\begin{aligned} \frac{D_0}{\theta _0}=\varPhi N^{\delta _0}<{\hat{D}}\Leftrightarrow \varPhi< G(N) \text{ and } w N^{\delta _0}<{\hat{D}}\Leftrightarrow w <G(N). \end{aligned}$$

Note that \(\delta _i\) represents the nonlinear metabolic scaling of task i from the colony size N, the Eq. (3) implies follows:

  1. 1.

    If the nonlinear metabolic scaling of all tasks is larger than the sum of the nonlinear metabolic scaling of resting and 1, i.e., \(\delta _k>\delta _0+1\) for all \(1\le k\le m\), we have \(\frac{dG(N)}{dN}>0\), which implies that increasing the colony size N can increase the value of G(N), thus the inequality \( \varPhi <G(N)\) or \( w < G(N)\) is more likely to hold. Therefore, increasing the colony size N can decrease the probability of the colony resting.

  2. 2.

    If the nonlinear metabolic scaling of all tasks is smaller than the sum of the nonlinear metabolic scaling of resting and 1, i.e., \(\delta _k<\delta _0+1\) for all \(1\le k\le m\), we have \(\frac{dG(N)}{dN}<0\), which implies that increasing the colony size N can decrease the value of G(N), thus the inequality \( \varPhi <G(N)\) or \( w < G(N)\) is not likely to hold. Therefore, increasing the colony size N can increase the probability of the colony resting.

If there are some tasks whose nonlinear metabolic scaling is larger than \(\delta _0+1\) while some others is smaller than \(\delta _0+1\), the situation becomes complicated. To further investigate the effects of the colony size, we focus on the two task cases \(m=2\), e.g., the inside colony task (\(i=1\)) versus the outside colony task (\(i=2\)). For simplicity, we assume that \(\delta _1<\delta _0+1<\delta _2\). Then we have

$$\begin{aligned} \begin{aligned} \frac{dG(N)}{dN}&=\frac{\gamma _1 (\delta _1-\delta _0-1)N^{\delta _1-\delta _0-2}}{\alpha _1\theta _1} +\frac{\gamma _2 (\delta _2-\delta _0-1)N^{\delta _2-\delta _0-2}}{\alpha _2\theta _2}\\&=\frac{\gamma _1 (\delta _0+1-\delta _1)N^{\delta _1-\delta _0-2}}{\alpha _1\theta _1} \left[ -1+\frac{\gamma _2\alpha _1\theta _1(\delta _2-\delta _0-1)N^{\delta _2-\delta _1}}{\gamma _1\alpha _2\theta _2(\delta _0+1-\delta _1)}\right] , \end{aligned}\nonumber \\ \end{aligned}$$
(4)

which implies that

$$\begin{aligned} \frac{dG(N)}{dN}>0 \text{ if } N>\left( \frac{\gamma _1\alpha _2\theta _2(\delta _0+1-\delta _1)}{\gamma _2\alpha _1\theta _1 (\delta _2-\delta _0-1)}\right) ^{\frac{1}{\delta _2-\delta _1}} \end{aligned}$$

and

$$\begin{aligned} \frac{dG(N)}{dN}<0 \text{ if } N<\left( \frac{\gamma _1\alpha _2\theta _2(\delta _0+1-\delta _1)}{\gamma _2\alpha _1 \theta _1(\delta _2-\delta _0-1)}\right) ^{\frac{1}{\delta _2-\delta _1}}. \end{aligned}$$

Take \(N_c=\left( \frac{\gamma _1\alpha _2\theta _2(\delta _0+1-\delta _1)}{\gamma _2\alpha _1\theta _1(\delta _2-\delta _0-1)}\right) ^{\frac{1}{\delta _2-\delta _1}}\) as the population threshold of a colony that determines whether a colony is mature or not. Based on the discussions above, we can conclude that if the colony size is less than the threshold, i.e., \(N<N_c\) (e.g., immature colony), increasing the colony size N can increase the probability of the colony resting, while if \(N>N_c\), increasing the colony size N can decrease the probability of the colony resting.

Biological Scenarios 3.11

Because of the physiological need for rest, or behavioral sleep in insects (Klein et al. 2003, 2010), all workers should need to spend a certain amount of time inactive. Thus, all workers should be expected to have more or less similar needs, and consequently have comparable levels of inactivity. We also know that workers can vary in activity levels over the course of the day (circadian rhythms Charbonneau and Dornhaus 2015b; Klein and Seeley 2011) and between seasons (Fellers 1989), as well as specific tasks that they perform, complex activity patterns can arise when these interact (Pol and de Casenave 2004). Our theoretical results support that when the nonlinear metabolic scaling for active tasks is large enough (i.e., larger than 1 + the nonlinear metabolic scaling of resting; or the energetic input of tasks increases with colony size), that larger colonies will have proportionally less inactive workers. This could be explained, for example, by increased difficultly in moving around in and accessing different tasks in larger colonies (Naug 2009), decreased efficiency in communicating task demand/stimulus (Beckers et al. 1989), the need to exploit exponentially larger foraging areas to meet the needs of larger colonies (Tschinkel et al. 1995), all of which would result in overall decreased per capita efficiency (i.e., greater overhead costs) in larger groups. Empirical data shows that larger colonies typically have less per capita inactive workers (Schmid-Hempel 1990), suggesting that large nonlinear metabolic scaling effects may be common in social insect colonies.

Alternatively, our theoretical results also suggest that when the nonlinear metabolic scaling of all tasks is smaller than the sum of the nonlinear metabolic scaling of resting and 1 (i.e., tasks become less energetically costly as colonies increase in size/more efficient), larger colonies may have proportionally more inactive ants. One potential explanation is that ants in larger colonies may have decreased locomotor activity (Waters et al. 2010), which would result in lower metabolic costs (though, potentially, decreased locomotor activity may result in less efficient communication and task performance, which would have the inverse effect). Meanwhile, because the metabolic rate of inactive ants can be significantly lower than active ants (Lighton et al. 1987), increases in the proportion of inactive ants in larger colonies will result in lower mass-specific metabolic rate. Another potential explanation is that larger colonies can sometimes have on average heavier workers (Tschinkel 1993; Blanchard et al. 2000; Robinson et al. 2009), though it is unclear that whether and how body size correlates to colony size in social insects (Dornhaus et al. 2012).

3.2 Scaling effects of the colony size N on the task allocation

We now focus on the effects of colony size on task allocation in situations where there are two task groups (i.e., \(m=2\), an inside nest task group and outside nest task group).

3.2.1 Resting demand is constant and smaller than task demand

According to Theorem 1, we know that if the relative stimulus of resting \(\frac{D_0}{\theta _0}=\varPhi N^{\delta _0}\) is smaller than the relative stimulus of working \({\hat{D}}\), i.e., \(\frac{D_0}{\theta _0}=\varPhi N^{\delta _0}<{\hat{D}}\) (or \(w N^{\delta _0}<{\hat{D}}\) when the relative stimulus of resting is denoted by \(\frac{D_0}{\theta _0}=w N^{\delta _0}(1-x_0)\)), the colony works all the time with the following task allocation:

$$\begin{aligned} x_1^*=\frac{{\hat{D}}_1}{{\hat{D}}}=\frac{\frac{\gamma _1 N^{\delta _1-1}}{\alpha _1\theta _1}}{\frac{\gamma _1N^{\delta _1-1}}{\alpha _1\theta _1}+\frac{\gamma _2 N^{\delta _2-1}}{\alpha _2\theta _2}} =\frac{1}{1+\frac{\gamma _2\alpha _1\theta _1N^{\delta _2-\delta _1}}{\gamma _1\alpha _2\theta _2}}\,\, \text{ and } x_2^*=1-x_1^*. \end{aligned}$$

Therefore, we have

$$\begin{aligned} \frac{dx_1^*}{dN}=\frac{\gamma _1\gamma _2\alpha _1\alpha _2\theta _1\theta _2N^{\delta _2-\delta _1-1}}{\left( \gamma _1\alpha _2\theta _2+\gamma _2\alpha _1\theta _1N^{\delta _2-\delta _1}\right) ^2}(\delta _1-\delta _2) \text{ and } \frac{dx_2^*}{dN}=-\frac{dx_1^*}{dN}. \end{aligned}$$
(5)

The Eq. (5) indicates follows:

  1. 1.

    If the nonlinear metabolic scaling of the inside colony task \(\delta _1\) is the same as the outside colony task \(\delta _2\), i.e., \(\delta _2=\delta _1\), the Eq. (5) implies that the colony size N has no effects on the task allocation.

  2. 2.

    If the nonlinear metabolic scaling of the inside colony task \(\delta _1\) is smaller than the outside colony task \(\delta _2\), i.e., \(\delta _2>\delta _1\), the Eq. (5) implies that the colony size N has negative effects on the allocation of the inside colony task and positive effects on the allocation of the outside colony task since \(\frac{dx_1^*}{dN}<0\) and \(\frac{dx_2^*}{dN}>0\). In this situation, increasing the colony size, we can expect that the colony increases the allocation to the outside colony task group and decreases the allocation to the inside colony task group.

  3. 3.

    If the nonlinear metabolic scaling of the inside colony task \(\delta _1\) is larger than the outside colony task \(\delta _2\), i.e., \(\delta _2<\delta _1\), the Eq. (5) implies that the colony size N has positive effects on the allocation of the inside colony task and negative effects on the allocation of the outside colony task since \(\frac{dx_1^*}{dN}>0\) and \(\frac{dx_2^*}{dN}<0\). In this situation, increasing the colony size, we can expect that the colony decreases the allocation to the outside colony task group and increases the allocation to the inside colony task group.

Biological Scenarios 3.21

In the case where work stimulus is greater than the stimulus for rest, the amount of work allocated to inside or outside tasks will vary according to their nonlinear metabolic scaling. That is, the task group with the lowest metabolic scaling will have fewer workers/less work time allocated to them in larger colonies. This scenario assumes that the demand for rest is constant for a given colony size, and lower than the cost of performing tasks. Thus, the remaining amount of work that can be done is split among tasks according to the energetic costs of each task. Effectively, larger colonies will have proportionally more workers allocated to more energetically demanding tasks. Like Biological Scenario 3.11, these effects could represent cases where some tasks have more overhead (or alternatively, are more efficient) than others as colony size scales, and colonies compensating for differences in overhead/efficiency.

3.2.2 Resting demand is constant and greater than task demand

If the relative stimulus of resting \(\frac{D_0}{\theta _0}=\varPhi N^{\delta _0}\) is larger than that of working \({\hat{D}}\), by Theorem 1 the colony rests with the probability \(1-\frac{{\hat{D}}}{\varPhi N^{\delta _0}}\) and works with the probability \(\frac{{\hat{D}}}{\varPhi N^{\delta _0}}\) which has the following task allocation:

$$\begin{aligned} x_1^*=\frac{{\hat{D}}_1}{\varPhi N^{\delta _0}}=\frac{\frac{\gamma _1 N^{\delta _1-1}}{\alpha _1\theta _1}}{\varPhi N^{\delta _0}}=\frac{\gamma _1 N^{\delta _1-\delta _0-1}}{\alpha _1\theta _1\varPhi } \end{aligned}$$

and

$$\begin{aligned} x_2^*=\frac{{\hat{D}}_2}{\varPhi N^{\delta _0}}=\frac{\frac{\gamma _2 N^{\delta _2-1}}{\alpha _2\theta _2}}{\varPhi N^{\delta _0}}=\frac{\gamma _2 N^{\delta _2-\delta _0-1}}{\alpha _2\theta _2\varPhi }. \end{aligned}$$

Therefore, we have

$$\begin{aligned} \frac{dx_1^*}{dN}=\frac{\gamma _1 (\delta _1-\delta _0-1)N^{\delta _1-\delta _0-2}}{\alpha _1\theta _1\varPhi },\,\,\frac{dx_2^*}{dN}=\frac{\gamma _2 (\delta _2-\delta _0-1)N^{\delta _2-\delta _0-2}}{\alpha _2\theta _2\varPhi },\,\, \end{aligned}$$

and

$$\begin{aligned} \frac{dx_0^*}{dN}=-\frac{dx_1^*}{dN}-\frac{dx_2^*}{dN}= \frac{\gamma _1 (1+\delta _0-\delta _1)N^{\delta _1-\delta _0-2}}{\alpha _1\theta _1\varPhi }+\frac{\gamma _2 (1+\delta _0-\delta _2)N^{\delta _2-\delta _0-2}}{\alpha _2\theta _2\varPhi }. \end{aligned}$$

The calculations above indicate the following three scenarios:

  1. 1.

    If the nonlinear metabolic scaling of each task is larger than the sum of the nonlinear metabolic scaling of resting and 1, i.e., \(\delta _k>\delta _0+1\), we have \(\frac{dx_k^*}{dN}>0\), \(k=1,2\), and \(\frac{dx_0^*}{dN}<0\), which indicates that increasing colony size N will increase allocation to all tasks and decrease allocation to resting.

  2. 2.

    If the nonlinear metabolic scaling of each task is smaller than the sum of the nonlinear metabolic scaling of resting and 1, i.e., \(\delta _k<\delta _0+1\), we have \(\frac{dx_k^*}{dN}<0\), \(k=1,2\), and \(\frac{dx_0^*}{dN}>0\), which implies that increasing colony size N will decrease allocation to all tasks and increase allocation to resting.

  3. 3.

    Assume that \(\delta _1<\delta _0+1<\delta _2\), then we have \(\frac{dx_1^*}{dN}<0,\,\, \frac{dx_2^*}{dN}>0,\) and

    $$\begin{aligned} \frac{dx_0^*}{dN}= & {} -\frac{dG(N)}{dN}\frac{1}{\varPhi }=\frac{\gamma _1 (\delta _0+1-\delta _1)N^{\delta _1-\delta _0-2}}{\alpha _1\theta _1\varPhi }\\&\left[ 1-\frac{\gamma _2\alpha _1\theta _1(\delta _2-\delta _0-1)N^{\delta _2-\delta _1}}{\gamma _1\alpha _2\theta _2(\delta _0+1-\delta _1)}\right] . \end{aligned}$$

    According to the Eq. (4), we can conclude that the colony size N has negative effects on the allocation of the inside colony task (\(k=1\)) and positive effects on the allocation of the outside colony task (\(k=2\)) since \(\frac{dx_1^*}{dN}<0\) and \(\frac{dx_2^*}{dN}>0\). In this situation, as colony size increases, we can expect that the colony increases allocation to the outside task group and decreases allocation to the inside task group. However, the allocation to resting depending on the maturity of the colony. If a colony is immature, i.e., \(N<N_c=\left( \frac{\gamma _1\alpha _2\theta _2(\delta _0+1-\delta _1)}{\gamma _2\alpha _1\theta _1(\delta _2-\delta _0-1)}\right) ^{\frac{1}{\delta _2-\delta _1}}\), increasing the colony size N can decrease the resting allocation, while if a colony is mature, i.e., \(N>N_c\), increasing the colony size N can increase the resting allocation.

Biological Scenarios 3.22

If the metabolic scaling for each task is either more or less than resting demand, allocation to rest will either be more or less, as colony size increases. Similarly to Biological Scenario 3.11, this could be explained by the reduction in per capital efficiency due to the reduced communication efficiency (or increased difficulty in accessing tasks) as the colony size increases. However, if the metabolic scaling for one task, e.g., the inside task, is less than that of resting, and the other task, e.g., the outside task, is greater, allocation to the inside task should increase and allocation to the outside task decreases as colony size increases. Allocation to resting, however, will depend on colony maturity, where mature colonies will have more allocation to resting than immature colonies.

3.2.3 Resting demand scales with work effort

Assume that the relative stimulus of resting is an increasing function of the working effort \((1-x_0)\), i.e., \(\frac{D_0}{\theta _0}=wN^{\delta _0} (1-x_0)\). If the relative stimulus of resting \(wN^{\delta _0}\) is larger than the relative stimulus of working \({\hat{D}}\), i.e., \(wN^{\delta _0}>{\hat{D}}\), the colony rests with the probability \(1-\sqrt{\frac{{\hat{D}}}{wN^{\delta _0}}}\) and works with the probability \(\sqrt{\frac{{\hat{D}}}{wN^{\delta _0}}}\) which has the following task allocation:

$$\begin{aligned} x_1^*=\frac{{\hat{D}}_1}{\sqrt{wN^{\delta _0}{\hat{D}}}}=\frac{\frac{\gamma _1 N^{\delta _1-1}}{\alpha _1\theta _1}}{\sqrt{wN^{\delta _0}\left( \frac{\gamma _1 N^{\delta _1-1}}{\alpha _1\theta _1}+\frac{\gamma _2 N^{\delta _2-1}}{\alpha _2\theta _2}\right) }} \end{aligned}$$

and

$$\begin{aligned} x_2^*=\frac{{\hat{D}}_2}{\sqrt{wN^{\delta _0}{\hat{D}}}}=\frac{\frac{\gamma _2 N^{\delta _2-1}}{\alpha _2\theta _2}}{\sqrt{wN^{\delta _0}\left( \frac{\gamma _1 N^{\delta _1-1}}{\alpha _1\theta _1}+\frac{\gamma _2 N^{\delta _2-1}}{\alpha _2\theta _2}\right) }}. \end{aligned}$$

Therefore, we have

$$\begin{aligned} \frac{dx_i^*}{dN}= & {} \frac{\gamma _i N^{\delta _i-2}\left( \delta _i-\delta _0-1-\frac{\gamma _j\alpha _i\theta _i(\delta _0+\delta _j +1-2\delta _i)N^{\delta _j-\delta _i}}{\gamma _i\alpha _j\theta _j}\right) }{2\sqrt{w\gamma _i\alpha _i\theta _iN^{\delta _0+\delta _i-1} \left( 1+\frac{\gamma _j\alpha _i\theta _iN^{\delta _j-\delta _i}}{\gamma _i\alpha _j\theta _j}\right) } \left( 1+\frac{\gamma _j\alpha _i\theta _iN^{\delta _j-\delta _i}}{\gamma _i\alpha _j\theta _j}\right) },\nonumber \\&i,j=1,2, i\ne j\,\, \end{aligned}$$
(6)

and \(\frac{dx_0^*}{dN}=-\frac{1}{2}\sqrt{\frac{N^{\delta _0}}{\omega {\hat{D}}}}\frac{dG(N)}{dt}.\) Assume that \(\delta _2\ge \delta _1\), then the calculations above indicate that

  1. 1.

    If the inequality \(\delta _1>\frac{\delta _2+\delta _0+1}{2}\) holds, we have

    $$\begin{aligned} \frac{dx_1^*}{dN}>0,~\frac{dx_2^*}{dN}>0~\text {and}~\frac{dx_0^*}{dN}<0. \end{aligned}$$

    Therefore, increasing the colony size, the colony increases the allocation to all the tasks and decreases the allocation to the resting.

  2. 2.

    If the inequality \(\delta _2<\frac{\delta _1+\delta _0+1}{2}\) holds, we have

    $$\begin{aligned}\frac{dx_1^*}{dN}<0,~\frac{dx_2^*}{dN}<0~\text {and}~\frac{dx_0^*}{dN}>0.\end{aligned}$$

    Therefore, increasing the colony size, the colony decreases the allocation to all the tasks and increases the allocation to the resting.

  3. 3.

    If the inequality \(\delta _0+1<\delta _1<\frac{\delta _2+\delta _0+1}{2}<\delta _2\) holds, we have \(\frac{dx_2^*}{dN}>0\), \(\frac{dx_0^*}{dN}>0\) and there exists \(N_{c1}^1=\left( \frac{\gamma _1\alpha _2\theta _2(\delta _1-\delta _0-1)}{\gamma _2\alpha _1\theta _1(\delta _2+\delta _0+1-2\delta _1)}\right) ^{\frac{1}{\delta _2-\delta _1}}\), such that if \(N<N_{c1}^1\), we have

    $$\begin{aligned}\frac{dx_1^*}{dN}>0.\end{aligned}$$

    In this case, increasing the colony size, the colony increases the allocation to all the tasks and decreases the allocation to the resting. However, if \(N>N_{c1}^1\), we have \(\frac{dx_1^*}{dN}<0\), \(\frac{dx_2^*}{dN}>0\) and \(\frac{dx_0^*}{dN}>0\), which implies that when the colony size increases, the allocation to the inside colony task \(x_1\) and the resting decreases, but the allocation to the outside colony task \(x_2\) increases.

  4. 4.

    If the inequality \(\delta _1<\delta _0+1<\delta _2\) holds, we have

    $$\begin{aligned}\frac{dx_1^*}{dN}<0~\text{ and } \frac{dx_2^*}{dN}>0,\end{aligned}$$

    which implies that when the colony size increases, the allocation to the inside colony task \(x_1\) decreases, but the allocation to the outside colony task \(x_2\) increases. Moreover, the allocation to resting depends on the maturity of the colony. By Eq. (4), if \(N<N_c=\left( \frac{\gamma _1\alpha _2\theta _2(\delta _0+1-\delta _1)}{\gamma _2\alpha _1\theta _1(\delta _2-\delta _0-1)}\right) ^{\frac{1}{\delta _2-\delta _1}}\) (e.g., immature colony), increasing the colony size N can increase the allocation of resting, while if \(N>N_c\), increasing the colony size N can decrease the allocation of resting.

  5. 5.

    If the inequality \(\delta _1<\frac{\delta _1+\delta _0+1}{2}<\delta _2<\delta _0+1\) holds, we have \(\frac{dx_1^*}{dN}<0\), \(\frac{dx_0^*}{dN}>0\) and there exists \(N_{c2}^1=\left( \frac{\gamma _1\alpha _2\theta _2(2\delta _2-\delta _1-\delta _0-1)}{\gamma _2\alpha _1\theta _1(\delta _0+1-\delta _2)}\right) ^{\frac{1}{\delta _2-\delta _1}}\), such that if \(N>N_{c2}^1\), we have

    $$\begin{aligned} \frac{dx_2^*}{dN}<0. \end{aligned}$$

    In this case, increasing the colony size, the colony decreases the allocation to all the tasks and increases the allocation to the resting. However, if \(N<N_{c2}^1\), we have \(\frac{dx_1^*}{dN}<0,\frac{dx_2^*}{dN}>0\) and \(\frac{dx_0^*}{dN}>0\), which implies that when the colony size increases, the allocation to the inside colony task \(x_1\) decreases, but the allocation to the outside colony task \(x_2\) and the resting increases.

Biological Scenarios 3.23

In addition to physical needs, inactivity can also result from not having enough work to do (a review for why that might be (Charbonneau and Dornhaus 2015a)). Therefore, the demand/stimulus for inactive may be an increasing function related to the available workforce or available work/colony needs. In this scenario, our theoretical result shows that there are multiple ways in which colony size can affect the allocation of tasks, depending on the level of the nonlinear metabolic scaling and the maturity of the colony (see the results above).

Summary We have been addressing how nonlinear metabolic scaling affects the task allocation and resting probability with respect to changes of the colony size. Our study shows complicated dynamic relationship between the nonlinear metabolic scaling, the colony size, the task allocation, and the resting probability. Our findings have many profound biological significances such as: (1) In the scenario where the resting demand is large enough, if the nonlinear metabolic scaling of the active tasks is large enough, i.e., \(\delta _k>\delta _0+1\), larger colonies are expected to have a smaller proportion of resting workers. Otherwise, if the nonlinear metabolic scaling of the active tasks is small enough, i.e., \(\delta _k<\delta _0+1\), larger colonies are expected to have a larger percentage of resting workers (see Biological Scenarios 3.11). (2) In the scenario where the resting demand is constant and lower than the cost of performing tasks, larger colonies are expected to allocate more workers proportionally to perform more demanding tasks (see Biological Scenarios 3.21). (3) In the scenario where the resting demand is constant and higher than the cost of performing tasks, if the nonlinear metabolic scaling of outside tasks (e.g., foraging) and inside tasks (e.g., breeding) are large and small enough respectively, as the colony size increases, the allocation of outside tasks and inside tasks is expected respectively to increase and decrease (see Biological Scenarios 3.22). (4) In the scenario where the resting demand is increasing with the working effort, if the nonlinear metabolic scaling of inside and outside tasks is large enough, i.e., \(\delta _2>\delta _1>\frac{\delta _0+\delta _2+1}{2}\), larger colonies are expected to have a greater proportion of workers performing tasks and a smaller proportion of workers resting (see Biological Scenarios 3.23).

4 Dynamics of work activities versus resting

In this section, we apply the modeling framework of System (1) to the case when the number of task groups being 1, i.e., \(m=1\). This is the case corresponding to studying the task allocation of the working effort x versus resting \(1-x\) where \(x\in [0,1]\) be the working effort, and \((1-x)\in [0,1]\) be the resting. We denote by D the demand of work (or work stimulus), and \(\theta \) be the response threshold of work. Then we have the following four models:

  1. 1.

    Model I is the case when the resting demand \(D_0\) is a constant function depending on the colony size, i.e., \(\frac{D_0}{\theta _0}=\varPhi N^{\delta _0}\). We assume that the larger the colony size is, the more the work is needed, thus the resting demand is higher as well.

    $$\begin{aligned} \begin{aligned} x'&=x\left[ \frac{\frac{D}{\theta }}{ \frac{D x}{\theta }+\varPhi N^{\delta _0}(1-x)}-1\right] ,\\\\ D'&=\gamma N^\delta -\alpha N x D. \end{aligned} \end{aligned}$$
    (7)
  2. 2.

    Model II is the case when we assume that the resting demand is an increasing function of the working effort x, i.e., \(\frac{D_0}{\theta _0}=w x N^{\delta _0}\), which reflects that more work requires more resting to recover.

    $$\begin{aligned} \begin{aligned} x'&=x\left[ \frac{\frac{D}{\theta }}{ \frac{D x}{\theta }+w N^{\delta _0}x (1-x)}-1\right] ,\\\\ D'&=\gamma N^\delta -\alpha N x D. \end{aligned} \end{aligned}$$
    (8)
  3. 3.

    Model III is the case when we assume that the more work a worker does, the more efficient she becomes, and thus her threshold \(\theta \) for the work decreased to \(\frac{\theta }{1+bx}\). We call this model as The enhanced response threshold model.

    $$\begin{aligned} \begin{aligned} x'&=x\left[ \frac{\frac{D}{\frac{\theta }{1+bx}}}{ \frac{D x}{\frac{\theta }{1+bx}}+\varPhi N^{\delta _0}(1-x)}-1\right] ,\\\\ D'&=\gamma N^\delta -\alpha N x D. \end{aligned} \end{aligned}$$
    (9)
  4. 4.

    Model IV is the case that we assume that the working demand has a carrying capacity \(KN^\delta \).

    $$\begin{aligned} \begin{aligned} x'&=x\left[ \frac{\frac{D}{\theta }}{ \frac{D x}{\theta }+\varPhi N^{\delta _0}(1-x)}-1\right] ,\\\\ D'&=\gamma N^\delta \left( 1-\frac{D}{KN^\delta }\right) -\alpha N x D. \end{aligned} \end{aligned}$$
    (10)

The dynamics of Models I–IV can be summarized by the following theorem:

Theorem 2

(Summary of dynamics) The dynamics of Models I–IV is summarized in Table 1. Moreover, for Model III-The enhanced response threshold model, its interior equilibrium \({\hat{E}}^*=({\hat{x}}^*,{\hat{D}}^*)\) is locally asymptotically stable if \(N\ge \frac{b}{\alpha }\), while if \(N<\frac{b}{\alpha }\) we have the following results:

  1. 1.

    Let \(\varPhi \) be the bifurcation parameter: \({\hat{E}}^*\) is locally asymptotically stable if \(\varPhi <\varPhi ^*\), while it is unstable if \(\varPhi >\varPhi ^*\), and a Hopf bifurcation occurs at \(\varPhi =\varPhi ^*,\) where \(\varPhi ^*=\frac{\gamma b(1+b)N^{\delta -\delta _0-1}}{\alpha \theta (b-\alpha N)}.\)

  2. 2.

    Let b be the bifurcation parameter: (1) when \(\bigtriangleup =\left( \gamma N^{\delta -\delta _0-1}-\varPhi \alpha \theta \right) ^2-4\gamma \alpha ^2\varPhi \theta N^{\delta -\delta _0}<0\), \({\hat{E}}^*\) is locally asymptotically stable; (2) when \( \bigtriangleup >0\), \({\hat{E}}^*\) is locally asymptotically stable if \(b<b_1^*\) or \(b>b_2^*\), while it is unstable if \(b_1^*<b<b_2^*\), and two Hopf bifurcations occur at \(b_1^*\) and \(b_2^*\), respectively, where \(b_1^*=\frac{\varPhi \alpha \theta -\gamma N^{\delta -\delta _0-1}-\sqrt{\bigtriangleup }}{2\gamma N^{\delta -\delta _0-1}}\) and \(b_2^*=\frac{\varPhi \alpha \theta -\gamma N^{\delta -\delta _0-1}+\sqrt{\bigtriangleup }}{2\gamma N^{\delta -\delta _0-1}}\).

  3. 3.

    Let N be the bifurcation parameter: (1) when \(\delta >\delta _0+1\), \({\hat{E}}^*\) is unstable if \(N<N^*\), while it is locally asymptotically stable if \(N>N^*\), and a Hopf bifurcation occurs at \(N=N^*\), where \(N^*\) is the unique positive root of function \(f(N)=b(1+b)\gamma N^{\delta -\delta _0-1}+\alpha ^2\varPhi \theta N-\alpha b\varPhi \theta \)=0; (2) when \(\delta <\delta _0+1\), we have:

    1. (a)

      if \(N_1=\frac{\alpha ^2\varPhi \theta }{(1+\delta _0-\delta )b(1+b)\gamma }^{\frac{1}{\delta -\delta _0-2}} <N_0=\frac{\varPhi \alpha \theta }{\gamma (1+b)}^{\frac{1}{\delta -\delta _0-1}}\) or \(N_1>N_0, f(N_1)>0\), \({\hat{E}}^*\) is locally asymptotically stable;

    2. (b)

      if \(N_1>N_0\) and \(f(N_1)<0\): \({\hat{E}}^*\) is locally asymptotically stable if \(N<N_1^*\) or \(N>N_2^*\), while it is unstable if \(N\in (N_1^*,N_2^*)\), and two Hopf bifurcations occur at \(N=N_1^*\) and \(N=N_2^*\), respectively, where \(N_1^*, N_2^*\) are the positive roots of function \(f(N)=0.\)

Table 1 Existence and stability of equilibria where GAS is an abbreviation for globally asymptotically stable

Notes The proof of Theorem 2 is given in Sect. 7. Theorem 2 shows us the global dynamics of Models I–IV. It shows that Models I, II, and IV have only equilibrium dynamics, while Model III-The enhanced response threshold model has both equilibrium dynamics and periodic dynamics. In addition, we provide the following findings:

  1. 1.

    The dynamics of Model I can be determined by the value of resting demand. If \(\varPhi <\frac{\gamma N^{\delta -\delta _0-1}}{\alpha \theta }\), Model I has a unique equilibrium \(E^*\) which is globally asymptotically stable. Otherwise, if \(\varPhi >\frac{\gamma N^{\delta -\delta _0-1}}{\alpha \theta }\), \(E^*\) is unstable, and Model I has an interior equilibrium \(\hat{E^*}\) which is globally asymptotically stable. This result suggests that: if the resting demand is small enough, i.e., \(\varPhi <\frac{\gamma N^{\delta -\delta _0-1}}{\alpha \theta }\), the colony works all the time, i.e., \(x=1\) (see area A1 of Fig. 1a). Otherwise, if the resting demand is large enough, i.e., \(\varPhi >\frac{\gamma N^{\delta -\delta _0-1}}{\alpha \theta }\), the colony rests at a certain level (see area A2 of Fig. 1a). By Theorem 2, the working level \(\hat{x^*}=\frac{\gamma N^{\delta -\delta _0-1}}{\varPhi \alpha \theta }\) is decreasing with respect to the resting demand, is decreasing with respect to the colony size if \(\delta <\delta _0+1\), and is increasing with respect to the colony size if \(\delta >\delta _0+1\). This result indicates that: (i) the larger the resting demand, the workers work less (see area A2 of Fig. 1a); (ii) if the metabolic scaling of work is large enough, i.e., \(\delta >\delta _0+1\), the larger colony size N, the workers work more (see Fig. 1b, this result is consistent with the results of Schmid-Hempel 1990), while if the metabolic scaling is small enough, i.e., \(\delta <\delta _0+1\), the larger colony size N, the workers work less (Fig. 1c, which echoes the results of Houston et al. 1988 and Franks and Partridge 1993).

  2. 2.

    The global dynamics of Model II are very similar to that of Model I, so we will not go into details here. The readers can see the full dynamics of Model II through Fig. 2. The only difference between Model I and Model II is that when the resting demand is large enough, the resting ratio of Model I (\(1-x^*\)) is lower than the resting ratio of Model II (\(1-\sqrt{x^*}\)).

  3. 3.

    Model IV always has a working-free equilibrium \(E_0^*\) and a resting-free equilibrium \(E_1^*\), and can have an interior equilibrium \(\hat{E^*}\) under certain conditions. The global dynamics of Model IV is determined by the value of resting demand \(\varPhi \): if \(\varPhi <\frac{K N^{\delta -\delta _0}}{\theta }\frac{\gamma }{\gamma +\alpha KN}\), \(E_0^*\) being unstable and \(E_1^*\) being globally asymptotically stable; if \(\varPhi >\frac{K N^{\delta -\delta _0}}{\theta }\), \(E_0^*\) being globally asymptotically stable and \(E_1^*\) being unstable. Otherwise, if \(\frac{K N^{\delta -\delta _0}}{\theta }\frac{\gamma }{\gamma +\alpha KN}<\varPhi <\frac{K N^{\delta -\delta _0}}{\theta }\), \(E_0^*\) and \(E_1^*\) are unstable and Model IV has an interior equilibrium \(\hat{E^*}\) which is globally asymptotically stable. This analytical result suggests that: if the resting demand is small enough, i.e., \(\varPhi <\frac{K N^{\delta -\delta _0}}{\theta }\frac{\gamma }{\gamma +\alpha KN}\), the colony works all the time, i.e., \(x=1\) (see area A1 of Fig. 3a); if \(\frac{K N^{\delta -\delta _0}}{\theta }\frac{\gamma }{\gamma +\alpha KN}<\varPhi <\frac{K N^{\delta -\delta _0}}{\theta }\), the colony rests at a certain level, i.e., \(0<x_0<1\) (see area A2 of Fig. 3a). Otherwise, if the resting demand is large enough, i.e., \(\varPhi >\frac{K N^{\delta -\delta _0}}{\theta }\), the colony rests all the time, i.e., \(x_0=1\) (see area A3 of Fig. 3a). By Theorem 2, when \(\hat{E^*}\) exists, the workers working at the level \(\hat{x^*}=\frac{\gamma (KN^{\delta -\delta _0}-\varPhi \theta )}{K\alpha \varPhi \theta N}\), indicating that: (i) the larger the resting demand, the colony works less; (ii) if the metabolic scaling is large enough, i.e., \(\delta >\delta _0+1\), the larger colony size N, the workers work more (see area A2 of Fig. 3b); (iii) if the metabolic scaling is small enough, i.e., \(\delta <\delta _0+1\), the relationship between colony size and the working activity depends on the value of colony size: when the colony size is small enough, i.e., \(N\le \frac{\varPhi \theta }{K(1+\delta _0-\delta )}^{\frac{1}{\delta -\delta _0}}\), the larger colony size N, the workers work more (see area A2 of Fig. 3c); when the colony size is large enough, i.e., \(N>\frac{\varPhi \theta }{K(1+\delta _0-\delta )}^{\frac{1}{\delta -\delta _0}}\), the larger colony size N, the workers work less (see area A4 of Fig. 3c). Note that Model IV can be derived from Model II by adding a carrying capacity for the working demand. When the carrying capacity \(\frac{K}{\gamma }\) is large enough, we can approximate \(\gamma +\alpha KN\) to \(\alpha KN\), and therefore \(\frac{KN^{\delta -\delta _0}}{\theta }\frac{\gamma }{\gamma +\alpha KN}\approx \frac{\gamma N^{\delta -\delta _0-1}}{\alpha \theta }\). In this situation, Model II and Model IV have similar dynamics. However, when the carrying capacity is not large enough, Model II and Model IV have different dynamics: if the resting demand is large enough, the colony of Model II would do resting at a certain ratio (see area A2 of Fig. 2a), while the colony of Model IV rests all the time (see area A3 of Fig. 3a).

  4. 4.

    Model III - The enhanced response threshold model has rich dynamics. If the resting demand is small enough, i.e., \(\varPhi <\frac{\gamma (1+b) N^{\delta -\delta _0-1}}{\alpha \theta }\), the colony works all the time, i.e., \(x=1\) (see area A1 of Fig. 4a, b). If the resting demand is large enough but the colony size is not very large, i.e., \(\varPhi >\frac{\gamma (1+b) N^{\delta -\delta _0-1}}{\alpha \theta }\) and \(N<\frac{b}{\alpha }\), the colony rests in varied patterns (see areas A2 and A3 of Fig. 4a, c, d). Otherwise, if the resting demand and colony size are large enough, i.e., \(\varPhi >\frac{\gamma (1+b) N^{\delta -\delta _0-1}}{\alpha \theta }\) and \(N>\frac{b}{\alpha }\), the colony rests in equilibrium patterns (see area A2 of Fig. 4b).

    By Theorem 2 and the simulations, the working level \(\hat{x^*}=\frac{\gamma N^{\delta -\delta _0-1}}{\varPhi \alpha \theta -b\gamma N^{\delta -\delta _0-1}}\) is increasing with respect to the colony size if \(\delta >\delta _0+1\) and is decreasing with respect to the colony size if \(\delta <\delta _0+1\). This result suggests that: (i) if the metabolic scaling is large enough, i.e., \(\delta >\delta _0+1\), the larger colony size N, the workers work more, and the colony works in varied patterns (Fig. 5a); (ii) if the metabolic scaling is small enough, i.e., \(\delta <\delta _0+1\), the larger colony size N, the workers work less, and the intermediate values of N destabilize the system (Fig. 5b). In addition, Theorem 2 shows that the threshold regulator b has a significant effect on the dynamics of Model III: (i) the working level \(\hat{x^*}\) is increasing with respect to the threshold regulator b, indicating that the larger threshold regulator b, the workers work more; (ii) under the conditions of Theorem 2 2(2), the interior equilibrium \(\hat{E^*}\) is locally stable if \(b<b_1^*\) or \(b>b_2^*\) and is unstable if \(b_1^*<b<b_2^*\), indicating that the intermediate values of b destabilize the system (Fig. 6). The dynamic process looks like a bubble, so it is called bubble phenomenon by Liu et al. 2015. This is the first time we observed bubbles in the dynamics of social insect colonies; and (iii) when the threshold regulator of Model III becomes zero, i.e., \(b=0\), Model III becomes the same as Model I. Note that Model I has only equilibrium dynamics and Model III has rich dynamics, which means that the enhanced response threshold b can destabilize the equilibrium and lead to periodic dynamics.

Fig. 1
figure 1

Bifurcation diagram of Model I, where the blue and green lines denote the sink and saddle points, respectively. In Fig. 1a, the parameters are given by \(\theta =0.1,\delta _0=0.3,\gamma =1,\alpha =0.2,N=5000, \delta =0.7\). In area A1, Model I has a unique equilibrium \(E^*\) which is globally asymptotically stable. In area A2, \(E^*\) is unstable, and Model I has an interior equilibrium \({\hat{E}}^*\) which is globally asymptotically stable. In Fig. 1b, the parameters are given by \(\theta =0.8,\delta _0=0.01,\gamma =0.3,\alpha =0.35,\varPhi =1.5, \delta =1.07\). In area A1, Model I has two equilibria: \(E^*\) being unstable and \({\hat{E}}^*\) being globally asymptotically stable. In area A2, Model I has a unique equilibrium \(E^*\) which is globally asymptotically stable. In Fig. 1c, the parameters are given by \(\theta =0.2,\delta _0=0.3,\gamma =0.5,\alpha =0.15,\varPhi =0.5, \delta =0.7\). In area A1, Model I has a unique equilibrium \(E^*\) which is globally asymptotically stable. In area A2, \(E^*\) is unstable, and Model I has an interior equilibrium \({\hat{E}}^*\) which is globally asymptotically stable

Fig. 2
figure 2

Bifurcation diagram of Model II, where the blue and green lines denote the sink and saddle points, respectively. In Fig. 2a, the parameters are given by \(\theta =0.1,\delta _0=0.3,\gamma =1,\alpha =0.2,N=5000, \delta =0.7\). In area A1, Model II has a unique equilibrium \(E^*\) which is globally asymptotically stable. In area A2, \(E^*\) is unstable, and Model II has an interior equilibrium \({\hat{E}}^*\) which is globally asymptotically stable. In Fig. 2b, the parameters are given by \(\theta =0.8,\delta _0=0.01,\gamma =0.3,\alpha =0.35,\omega =1.5, \delta =1.07\). In area A1, Model II has two equilibria: \(E^*\) being unstable and \({\hat{E}}^*\) being globally asymptotically stable. In area A2, Model II has a unique equilibrium \(E^*\) which is globally asymptotically stable. In Fig. 2c, the parameters are given by \(\theta =0.2,\delta _0=0.3,\gamma =0.5,\alpha =0.15,\omega =0.5, \delta =0.7\). In area A1, Model II has a unique equilibrium \(E^*\) which is globally asymptotically stable. In area A2, \(E^*\) is unstable, and Model II has an interior equilibrium \({\hat{E}}^*\) which is globally asymptotically stable

Fig. 3
figure 3

Bifurcation diagram of Model IV, where the blue and green lines represent the sink and saddle points, respectively. In Fig. 3a, the parameters are given by \(\theta =3.6,\delta _0=0.4,\gamma =1,\alpha =0.05,K=1,N=200,\delta =0.7\). In area A1, \(E_1^*\) is globally asymptotically stable and \(E_0^*\) is unstable. In area A2, \(E_0^*\) and \(E_1^*\) are unstable and Model IV has an interior equilibrium \({\hat{E}}^*\) which is globally asymptotically stable. In area A3, \(E_0^*\) is globally asymptotically stable and \(E_1^*\) is unstable. In Fig. 3b, the parameters are given by \(\theta =3.6,\delta _0=0.05,\gamma =1,\alpha =0.05,\varPhi =5.5,K=1,\delta =1.07\). In area A1, \(E_0^*\) is globally asymptotically stable and \(E_1^*\) is unstable. In area A2, \(E_0^*\) and \(E_1^*\) are unstable and Model IV has an interior equilibrium \({\hat{E}}^*\) which is globally asymptotically stable. In area A3, \(E_1^*\) is globally asymptotically stable and \(E_0^*\) is unstable. In Fig. 3c, the parameters are given by \(\theta =0.4,\delta _0=0.6,\gamma =8.5,\alpha =0.2,\varPhi =3.2, K=1,\delta =0.8\). In area A1, \(E_0^*\) is globally asymptotically stable and \(E_1^*\) is unstable. In areas A2 and A4, \(E_0^*\) and \(E_1^*\) are unstable and Model IV has an interior equilibrium \({\hat{E}}^*\) which is globally asymptotically stable. In area A3, \(E_1^*\) is globally asymptotically stable and \(E_0^*\) is unstable

Fig. 4
figure 4

Bifurcation diagrams and phase portraits of Model III- The enhanced response threshold model with parameters \(\theta =5,\delta _0=0.5,\gamma =0.05,\alpha =0.005,\delta =0.7,b=1.1\), where H denotes the Hopf bifurcation point. In Fig. 4a and b, the blue, red and green lines denote the sink, source and saddle points, respectively. In Fig. 4a, we choose \(N=200\). Area A1 indicates that Model III has a unique equilibrium \(E^*\) which is globally asymptotically stable. Area A2 indicates that \(E^*\) is unstable and Model III has an interior equilibrium \({\hat{E}}^*\) which is globally asymptotically stable. In area A3, \(E^*\) and \({\hat{E}}^*\) are unstable and Model III has a periodic solution. In Fig. 4b, we choose \(N=230\). Area A1 indicates that Model III has a unique equilibrium \(E^*\) which is globally asymptotically stable. Area A2 indicates that \(E^*\) is unstable and Model III has an interior equilibrium \({\hat{E}}^*\) which is globally asymptotically stable. In Fig. 4c, we choose \(N=200\) and \(\varPhi =0.2\), it shows that the unique interior equilibrium \({\hat{E}}^*\) is locally asymptotically stable. In Fig. 4d, we choose \(N=200\) and \(\varPhi =0.8\), it shows that the unique interior equilibrium \({\hat{E}}^*\) is unstable and a periodic orbit occurs

Fig. 5
figure 5

Bifurcation diagram of Model III-The enhanced response threshold model, where H denotes the Hopf bifurcation point, the blue, red and green lines denote the sink, source and saddle points, respectively. In Fig. 5a, we choose \(\theta =0.113, \varPhi =0.5, \gamma =0.00011, b=1.1, \alpha =0.0046, \delta _0=0.046, \delta =1.07\). Area A1 indicates that the equilibria \(E^*\) and \({\hat{E}}^*\) are unstable and Model III has a periodic solution. Area A2 indicates that \(E^*\) is unstable and Model III has an interior equilibrium \({\hat{E}}^*\) which is globally asymptotically stable. In area A3, Model III has a unique equilibrium \(E^*\) which is globally asymptotically stable. In Fig. 5b, we choose \(\theta =2.6, \varPhi =1, \gamma =0.1, b=1.1, \alpha =0.05, \delta _0=0.6, \delta =0.7\). Area A1 indicates that Model III has a unique equilibrium \(E^*\) which is globally asymptotically stable. Areas A2 and A4 indicate that \(E^*\) is unstable and Model III has an interior equilibrium \({\hat{E}}^*\) which is globally asymptotically stable. Area A3 indicates that the equilibria \(E^*\) and \({\hat{E}}^*\) are unstable and Model III has a periodic solution

Fig. 6
figure 6

Bifurcation diagram of Model III- The enhanced response threshold model with \(\varPhi =5, \theta =5, N=200, \delta _0=0.7, \gamma =1.1, \delta =0.9, \alpha =0.0035\), where H represents the Hopf bifurcation point, the blue, red and green lines denote the sink, source and saddle points, respectively. In areas A1 and A3, \(E^*\) is unstable and the unique equilibrium \({\hat{E}}^*\) is locally asymptotically stable. In area A2, \(E^*\) (green line) and \({\hat{E}}^*\) (red line) are unstable and Model III has a periodic solution (the black curves denote the maximum and minimum values of the periodic solution, respectively). In area A4, the unique equilibrium \(E^*\) is globally asymptotically stable. The dynamic process looks like a bubble, so it was named as bubble phenomenon by Liu et al. 2015

Summary: The theoretical and bifurcation analyses conducted in this section address the first two questions that we proposed in the introduction part: (i) how does the metabolic scaling affect the task allocation and resting probability of social insect colonies, as colony size increases? (ii) how does the colony size affect the working activity in different scenarios of working versus resting?

Based on our study, the colony size, metabolic rates and the demand for resting are working in synergistic and nonlinear ways to generate interesting task allocation dynamics. Some of the biological insights that we could illustrate here are: (1) More demand for the work, then workers of the colony work more. In the case that the colony size is small, then large demand may destabilize the system (see The enhanced response threshold model). (2) If the metabolic scaling of work is large enough, i.e., \(\delta >\delta _0+1\), the larger colony size N, the workers work more; while if the metabolic scaling is small enough, i.e., \(\delta <\delta _0+1\), the larger colony size N, the workers work less or work more at the beginning but less when the colony size is really large. And (3) the small size colony is prone to have fluctuating dynamics when the metabolic scaling of work is large enough, i.e., \(\delta >\delta _0+1\); while the intermediate size colony seems to have fluctuating dynamics when \(\delta <\delta _0+1\) (please see the dynamics of Model III as an example).

5 Effects of random noise on task allocation and demand

In this section, we explore how random noise affects the dynamics of task allocation and demand by taking Model III and IV as examples. We investigate three cases based on the dynamics of Models III and IV respectively (see Theorem 2). Specifically, for Model III: (i) Model III has a unique resting-free equilibrium \(E^*(1, \frac{\gamma N^{\delta -1}}{\alpha })\) which is global asymptotically stable; (ii) Model III has two equilibria: the resting-free equilibrium \(E^*(1, \frac{\gamma N^{\delta -1}}{\alpha })\) being unstable and the interior equilibrium \({\hat{E}}^*(\frac{\gamma N^{\delta -\delta _0-1}}{\varPhi \alpha \theta -b\gamma N^{\delta -\delta _0-1}},\varPhi \theta N^{\delta _0}-\frac{b\gamma N^{\delta -1}}{\alpha })\) being locally asymptotically stable; and (iii) Model III has a periodic solution.

Similarly, for Model IV: (i) Model IV has two equilibria: the working free equilibrium \(E_0^*(0, KN^{\delta })\) being unstable and the resting free equilibrium \(E_1^*(1, \frac{K\gamma N^{\delta }}{\alpha K N+\gamma })\) being globally asymptotically stable; (ii) Model IV has three equilibria: \(E^*_0,E^*_1\) being unstable and the interior equilibrium \({\hat{E}}^*(\frac{\gamma \left( KN^{\delta -\delta _0}-\varPhi \theta \right) }{K\varPhi \alpha \theta N},\varPhi \theta N^{\delta _0})\) being globally asymptotically stable; and (iii) Model IV has two equilibria: \(E^*_1\) being unstable and \(E^*_0\) being globally asymptotically stable.

Our numerical results are obtained using the Euler-Maruyama method (Higham 2001) and Matlab 2019b with the step size given by \(\varDelta t=10^{-3}\). The parameters for the following simulations are shown in Table 2.

Table 2 Parameters for the simulations of case studies 5.1 and 5.2

5.1 Case study: the enhanced response threshold Model

Assume that the random noise affects task demand of social insect colonies, and thus affects the whole colony dynamics. From the full system (2), we obtain the stochastic version of Model III as follows:

$$\begin{aligned} \begin{aligned} dx(t)&=x\left[ \frac{\frac{D}{\frac{\theta }{1+bx}}}{ \frac{D x}{\frac{\theta }{1+bx}}+\varPhi N^{\delta _0}(1-x)}-1\right] dt,\\\\ dD(t)&=(\gamma N^\delta -\alpha N xD)dt+\sigma D(t)dB(t), \end{aligned} \end{aligned}$$
(11)

where \(\sigma ^2\) is the intensity of random noise, B(t) is a standard one-dimensional independent Brownian motion defined on the complete probability space \((\varOmega ,{\mathscr {F}},{\mathbb {P}})\). We performed numerical simulations for cases \(\delta -\delta _0-1>0\) (not shown here) and \(\delta -\delta _0-1<0\), respectively. The results show that the size of \(\delta -\delta _0-1\) does not affect the way the noise affects the work activity and the task command, so we only show the numerical results of case \(\delta -\delta _0-1<0\) here. By Theorem 2, the dynamics of Model III can be summarized into the following three scenarios:

  1. (a)

    If \(\varPhi <0.06\), Model III has a unique resting-free equilibrium \(E^*=(x^*,D^*)=(1,2.04)\) which is globally asymptotically stable.

  2. (b)

    If \(0.06<\varPhi <0.67\), Model III has two equilibria: \(E^*\) being unstable and

    $$\begin{aligned} {\hat{E}}^*=({\hat{x}}^*,{\hat{D}}^*)=\left( \frac{0.72}{25\varPhi -0.79},70.71\varPhi -2.24\right) \end{aligned}$$

    being locally asymptotically stable.

  3. (c)

    If \(\varPhi >0.67\), the equilibria \(E^*\) and \({\hat{E}}^*\) are unstable and there is a periodic solution.

Next, we study the effects of random fluctuations on task allocation and demand in scenarios (a), (b) and (c), respectively.

We first consider the scenario (a). By choosing \(\varPhi =0.055\), we obtain results in Fig. 7 showing that: (i) the resting-free equilibrium \(E^*(x^*,D^*)=(1,2.04)\) of the deterministic form of Model III is globally asymptotically stable (red lines), this is in line with the theoretical results of Theorem 2; (ii) the empirical mean x(t) (over 500 replicates) of Model (11) fluctuates below \(x^*\) (Fig. 7a), while the empirical mean D(t) of Model (11) fluctuates above \(D^*\) (Fig. 7c); (iii) the amplitude of the fluctuation is positively correlated with the intensity of stochastic noise \(\sigma \); and (iv) when the time is large enough, the variance of the frequency of the stochastic solution (over 500 replicates) is positively correlated with the intensity of the noise (see Fig. 7b, d). The simulation result suggests that: although random fluctuation leads to an increase in average for task demand D, the working activity x of the colony decreases in average over 500 replicates.

Fig. 7
figure 7

Empirical mean and frequency of Model (11) and Model III with \(\varPhi =0.055\) over 500 replicates. The other parameters are given by \(\theta =5, b=1.1, \delta _0=0.5, \gamma =0.05, \delta =0.7,\alpha =0.005, N=200, x(0)=0.99, D(0)=2.\) Red line indicates the solution of Model III, blue, black and green lines denote the empirical mean of the stochastic solution with \(\sigma =0.5,0.6\) and 0.7, respectively. Figure 7b, d are the frequency of Model (11) at time \(t=200\)

Next, we study the scenario (b) by choosing \(\varPhi =0.07\). It follows from Theorem 2 that the unique interior equilibrium \({\hat{E}}^*({\hat{x}}^*,{\hat{D}}^*)=(0.72,2.71)\) of Model III is global asymptotically stable (see red lines in Fig. 8). Figure 8 indicates that the effects of random fluctuations on the task allocation and demand in scenario (b) are similar to that in scenario (a). Particularly, Figures 7b, d and 8b, d imply that there appears to be a stationary distribution of the stochastic system (see, for example Cai et al. 2015; Feng et al. 2019). It would be a future work to prove the existence of this stationary distribution theoretically.

Fig. 8
figure 8

Empirical mean and frequency of Model (11) and Model III with \(\varPhi =0.07\) over 500 replicates. The other parameters are given by \(\theta =5, b=1.1, \delta _0=0.5, \gamma =0.05, \delta =0.7,\alpha =0.005, N=200, x(0)=0.75, D(0)=2.7\). Red line indicates the solution of Model III, blue, black and green lines indicate the empirical mean of the stochastic solution (x(t), D(t)) with \(\sigma =0.2,0.3\) and 0.4. Figures 8b, d are the frequency of Model (11) at time \(t=200\)

Finally, we study the corresponding stochastic scenario where the deterministic Model III admits a periodic solution. By choosing \(\varPhi =0.8\) we obtain Figs. 9 and 10 where Fig. 9a shows that in the absence of random fluctuations, the task demand and work activity change periodically with the peaks/valleys of each cycle being equal. When random noise is introduced (Fig. 9b), the peaks/valleys of each cycle are different. This dynamics reflects the real data shown in Fig. 11 (working activity of a colony with 97 ants over 5 mins). Figure 10 also suggests that as the intensity of noise increases, the shape of the periodic solution becomes more and more disordered.

Fig. 9
figure 9

Time series of Model (11) and Model III with \(\varPhi =0.8\). The other parameters are given by \(\theta =5, b=1.1, \delta _0=0.5, \gamma =0.05, \delta =0.7,\alpha =0.005, N=200, x(0)=0.0473, D(0)=61.63\)

Fig. 10
figure 10

Phase diagrams of solutions of Model (11) and Model III under 500 replicates in one cycle. The parameters are given by \(\varPhi =0.8, \theta =5, b=1.1, \delta _0=0.5, \gamma =0.05, \delta =0.7,\alpha =0.005, N=200, x(0)=0.0449, D(0)=74.281\). The red lines and gray dots denote the solutions of the Model III and the stochastic Model (11), respectively

Fig. 11
figure 11

Time series diagram (in seconds) of working activity of a colony with 97 ants. The colony was collected from the field in June 2014 and house in an artificial observation nest in the lab. The data was collected from a 5 min video recorded between noon and 5pm on June 28, 2014

5.2 Case study: the working demand has a carrying capacity

The stochastic version of Model IV is given by:

$$\begin{aligned} \begin{aligned} dx(t)&=x\left[ \frac{\frac{D}{\theta }}{ \frac{D x}{\theta }+\varPhi N^{\delta _0}(1-x)}-1\right] dt,\\\\ dD(t)&=\left[ \gamma N^\delta \left( 1-\frac{D}{KN^\delta }\right) -\alpha N x D\right] dt+\sigma D(t)dB(t). \end{aligned} \end{aligned}$$
(12)

The previous subsection has shown that the size of \(\delta -\delta _0-1\) does not affect the way the noise affects the work activity and the task command. In the remaining, we only show the numerical results of case \(\delta -\delta _0-1<0\). By Theorem 2, the dynamics of Model IV can be summarized as:

  1. (a)

    If \(\varPhi <0.1238\), Model IV has two equilibria: the working-free equilibrium \(E_0^*=(x_0^*,D_0^*)=(0,40.8057)\) being unstable and the resting-free equilibrium \(E_1^*=(x_1^*,D_1^*)=(1,3.7096)\) being globally asymptotically stable.

  2. (b)

    If \(0.1238<\varPhi <1.3615\), Model IV has three equilibria: the working-free equilibrium \(E_0^*\) and the resting-free equilibrium \(E_1^*\) being unstable and

    $$\begin{aligned} {\hat{E}}^*=({\hat{x}}^*,{\hat{D}}^*)=\left( \frac{4.9013-3.6\varPhi }{36\varPhi },29.9719\varPhi \right) \end{aligned}$$

    being globally asymptotically stable.

  3. (c)

    If \(\varPhi >1.3615\), Model IV has two equilibria: \(E_0^*\) being globally asymptotically stable and \(E_1^*\) being unstable.

In the following, we study how random fluctuations affect task demand and work activity in scenarios (a), (b), and (c), respectively. By choosing \(\varPhi =0.1\) and \(\varPhi =1.3\), we explore the effects of random fluctuations on task demand and work activity in scenarios (a) and (b), respectively (see Figs. 12 and 13). We find that the effects of random fluctuations in these two scenarios are consistent with the effects of random fluctuations in scenarios (a) and (b) of Model III (see Sect. 5.1): although random fluctuation generates an increase in average for task demand D, the working activity x of the colony decreases in average over 500 replicates.

Fig. 12
figure 12

Empirical mean and frequency of Model (12) and Model IV with \(\varPhi =0.1\) over 500 trajectories. The other parameters are given by \(\theta =3.6, K=1, \delta _0=0.4, \gamma =1, \delta =0.7,\alpha =0.05, N=200, x(0)=0.99, D(0)=4\). Red lines indicate the solution of Model IV, blue and black lines indicate the empirical mean of the stochastic solution with \(\sigma =2.5\) and 3. Figure 12b, d are frequency of the stochastic model at time \(t=200\)

Fig. 13
figure 13

Empirical mean and frequency of Model (12) and Model IV with \(\varPhi =1.3\) over 500 trajectories. The other parameters are given by \(\theta =3.6, K=1, \delta _0=0.4, \gamma =1, \delta =0.7,\alpha =0.05, N=200, x(0)=0.2, D(0)=12\). Red lines indicate the solution of Model IV, blue and black lines indicate the empirical mean of the stochastic solution with \(\sigma =1\) and 2. Fig. 13b, d are frequency of the stochastic model at time \(t=200\)

Now, we study the scenario (c) by choosing \(\varPhi =3\). The simulations are shown in Fig. 14. Figure 14a indicates that the work activity x(t) in Model (12) and Model IV tends to zero, and the higher the intensity of noise, the later the solution tends to 0. This result suggests that although random fluctuations cannot prevent the tendency to rest at all times but have delay effects. Figure 14b shows that the stochastic solution D(t) fluctuates around the solution of Model IV, and the amplitude of fluctuation is positively related to the intensity of noise.

Fig. 14
figure 14

Empirical mean of Model (12) and Model IV with \(\varPhi =3\) over 500 trajectories. The other parameters are given by \(\theta =3.6, K=1, \delta _0=0.4, \gamma =1, \delta =0.7,\alpha =0.05, N=200, x(0)=0.01, D(0)=40\)

Our study of stochastic versions of Model III and IV provides us the following insights:

  1. 1.

    Noise can increase task demand and decrease the levels of working activity in average (i) By comparing to the dynamics of the the deterministic Model III or Model IV in three scenarios, the empirical mean of working activity x in the stochastic system (11) is almost certainly lower than its ODE model (see Figs. 7a, 8a, 12a and 13a), while the empirical mean of task demand D in the stochastic system (11) is almost certainly higher (see Figs. 7c, 8c, 12c, 13c). (ii) When the colony in Model IV spends all the time on resting, random fluctuations cannot change the colony being rest all the time but have delay effects (see Fig. 14a).

  2. 2.

    Effects of noise with different intensities The amplitude of the fluctuating solution for stochastic models is positively correlated with the intensity of the noise (see Figs. 7, 8, 9, 10, 11, 12, 13, 14). In addition, as the intensity of noise increases, the variance of the frequency (over 500 replicates) of stochastic solutions becomes larger. This suggests that large noise may lead to richer dynamics of the colony.

  3. 3.

    The existence of stationary distribution According to previous research experience (Cai et al. 2015; Feng et al. 2019), Figs. 7, 8, 12 and 13 suggest that there appears to be a stationary distribution of the stochastic system. This could be our future work to prove the existence of this stationary distribution even though it is challenging.

  4. 4.

    Random fluctuations can explain almost-cyclic dynamics observed in experiments Please see the experimental data in Fig. 11 and the simulation of Fig. 9b as an example for comparison.

6 Conclusion

In this paper, we have formulated a general dynamical compartmental model to explore the underlying mechanisms of task allocation in social insect colonies at the colony level. Our proposed deterministic model incorporates both internal factors (e.g., the varied thresholds for different tasks) and external factors (e.g., task demands/stimulus from the environment). The proposed model is also suitable for measuring the effects of nonlinear metabolic scaling on task allocation and rest probability, which in turn plays a role in improving our understanding of the dynamics of complex biological systems. This work is a nice extension of a mathematical framework introduced by Kang and Theraulaz 2016 that study how colony size and social communication affect the task allocation and division of labor.

Our theoretical results and the related biological implications provide us some answers to the three questions proposed in the Introduction: (i) how the metabolic scaling affects the task allocation and resting probability of social insect colonies, as colony size increases? (ii) how colony size affects the working activity in different scenarios of working versus resting? (iii) how the random fluctuation affects the working activity and task demand of social insect colonies?

We first explored the scaling effects of colony size on the resting probability. The theoretical result (Sect. 3.1) suggests that the colony size can affect the likelihood of resting in several ways: (a) when the nonlinear metabolic scaling of all tasks is large enough (i.e., larger than the nonlinear metabolic scaling of resting + 1), increasing the colony size can decrease the probability of resting; (b) when the nonlinear metabolic scaling of all tasks is small enough (i.e., smaller than the nonlinear metabolic scaling of resting + 1), increasing the colony size can increase the probability of resting; (c) when there are two tasks (namely the inside colony task and the outside colony task), if the nonlinear metabolic scaling of the inside colony task and the outside colony task is small and large enough, respectively (i.e., smaller and larger than the nonlinear metabolic scaling of resting + 1, respectively), the relationship between the colony size and the resting probability depending on whether the colony is mature or not: if the colony is immature, increasing the colony size can increase the probability of resting. Otherwise, increasing the colony size can decrease the probability of resting.

These theoretical outputs are supported by experimental evidence. Indeed, empirical studies show that increasing group size can either increase or decrease the proportion of inactive workers in the group. For example, in the ant Aphaenogaster senilis, the amount of work performed by workers is highly correlated with the number of workers: the proportion of inactive individuals increases from 33% to 55% when the number of workers increases from 50 to 200 (Ruel et al. 2012), while in the social spider Mallos gregalis, larger colonies usually have a lower proportion of inactive workers (Tietjen 1986). Broadly, these different relationships between group size and inactivity can be explained by context-specific differences in how group size affects overall efficiency. As discussed in Sect. 3.11, larger groups may be more efficient which should lead to a higher proportion of inactive workers as they have more opportunities to rest (Jeanson et al. 2007), or large groups may have more overhead costs and thus the colony must work more to meet its needs resulting in fewer inactive workers.

Highly inactive workers are found among all taxa of social insects, typically making up more than 50% of the colonies (Charbonneau et al. 2017a). Inactivity has been shown to decrease with worker age in two distantly related species of ants with different life histories, suggesting that the broad pattern of worker inactivity among social insect taxa may result from age-related constraints (e.g., inexperience or still developping neurophysiologies)(D. Charbonneau, unpublished results). However, in addition to age-related constraints, inactive workers have been shown to play additional roles and sometimes provide benefits to the colony. Perhaps one of the most commonly suggested functions of inactive workers is acting as a pool of reserve labor that allows colonies to buffer against short term changes in demand or available workforce. This function has been both rejected in some species/contexts

(Fewell and Winston 1992; Jandt et al. 2012; O’Donnell 1998; Gardner et al. 2007; Johnson 2002)(reviewed in Charbonneau and Dornhaus 2015a, Charbonneau et al. 2017a), and supported in others (Charbonneau et al. 2017b; Hasegawa et al. 2016), suggesting that inactive workers may only act as ’reserves’ in specific contexts. Our theoretical results suggest that perhaps inactives may only act as ’reserves’ in species that can afford to have them (i.e., colonies of sufficient size, whose efficiency increases with colony size), while colonies whose overhead increases with colony size may not be able to utilize the already present (due to their young age) inactive workers.

When multiple tasks appear in the colony, the situation can become very complicated. For the sake of simplicity, we focused on the scenario with two task groups (i.e., the inside colony task and the outside colony task) to illustrate how the nonlinear metabolic scaling affects the task allocation, as colony increases. The theoretical results (Sect. 3.2) support that: when the relative stimulus of resting is constant and lower than the relative stimulus of working, increasing the colony size can increase the allocation of the task group with larger nonlinear metabolic scaling and decrease the allocation of the task group with smaller nonlinear metabolic scaling; when the relative stimulus of resting is constant and higher than the relative stimulus of working: (i) if the nonlinear metabolic scaling of both task groups is large (resp. small) enough, increasing the colony size can increase (resp. decrease) the allocation of all task groups and decrease (resp. increase) the allocation of resting; (ii) if the nonlinear metabolic scaling of the inside and out task groups is large enough and small enough respectively, the increase of colony size can increase (resp. decrease) the allocation of the task group with larger (resp. smaller) nonlinear metabolic scaling, and the allocation of resting depends on the maturity of the colony; when the relative stimulus of resting is an increasing function of the working effort, there are several ways in which the nonlinear metabolic scaling can affect the allocation of tasks and resting, depending on the maturity and colony size.

Generally, larger decentralized groups are expected to have more specialized individuals and increasingly sophisticated mechanisms for allocating tasks (e.g., cellular differentiation in multicellular organisms). As such social insects have long been theorized to follow similar trends of larger colonies to have more complex division of labor (Oster and Wilson 1978), however, empirical data has yet to satisfactorily show this (Dornhaus et al. 2012). Furthermore, we often assume that greater specialization leads to increased efficiency, but that is not necessarily the case. Indeed, increased specialization, such as via morphologically specialized workers, often leads to decreased flexibility (Charbonneau and Dornhaus 2015a). For example, colonies of Pogonomyrmex badius ants were unable to compensate for the loss of half of their foragers from experimental removal and consequently lost half of their brood as a result (Kwapich and Tschinkel 2013). Thus, the effects of group size on collective behaviors are again entirely context specific. Our theoretical outputs follow a similar trend where the effects of group size on task allocation, and on the proportion of inactive workers is dependent on the relative increase in efficiency as colony size increases.

We applied our general model to study the dynamics of the working effort versus resting at four different scenarios, namely: (i) The resting demand is a constant function depending on the colony size. (ii) The resting demand is an increasing function of the working effort. (iii) The working demand has an enhanced response threshold. (iv) The working demand has a carrying capacity. Our theoretical result (Theorem 2) shows that:

  1. 1.

    Cases (i) and (ii) have similar dynamics (Figs. 1, 2): if the resting demand is small enough, the colony works all the time, while if the resting demand is large enough, the colony rests in equilibrium patterns (i.e., the ratio of resting workers remains at a certain level). One difference between cases (i) and (ii) is that when the resting command is large enough, case (i) has a lower probability of resting than case (ii) under the same conditions (i.e., all parameters are the same).

  2. 2.

    When the working demand has a carrying capacity (i.e., case (iv), see Fig. 3): if the resting demand is small enough, the colony works all the time; if the resting demand is moderate, the colony rests in equilibrium patterns; if the resting demand is large enough, the colony rests all the time. Case (iv) differs from cases (i)-(ii) in that if the resting command is large enough, the colony may rest all the time, indicating that the colony may rest all the time if the working demand has a limited carrying capacity.

  3. 3.

    The dynamics of the case (iii) is more complicated than the other three cases (Fig. 4). When the resting demand is small enough, the colony works all the time. When the resting demand is large enough, the colony may rest in varied patterns, i.e., the ratio of resting workers either remains at a certain level or changes at a fixed cycle. When the enhanced response threshold constant is 0, case (iii) is exactly the same as the case (i), indicating that an enhanced response threshold can lead to the cycle dynamics. Specifically, the solution of the case (iii) can go through two supercritical Hopf bifurcations successively with varying the level of the enhanced response threshold (Fig. 6): when the solution crosses through the first Hopf bifurcation from the left, a stable periodic solution appears, and the amplitude of the periodic solution increases first and then decreases with the enhanced response threshold increases; when the solution crosses through the second Hopf bifurcation from the left, the periodic solution disappears. Since the change of the amplitude of the periodic solution looks like a bubble, it is called the bubble phenomenon, which was once found in the SIS disease models with time delay and media/awareness effects (Liu et al. 2015), but this is the first time we found bubble phenomenon in task allocation of social insect colonies. It reveals the dynamic process of the generation and disappearance of periodic orbits in social insect colonies with varying the level of enhanced response threshold. Similarly, the results show that the colony size can also cause bubble phenomenon (Fig. 6).

Like other biological systems, interactions between social insect colonies and the environment are noisy (Costello and Symes 2014; Barton et al. 2018; Lee et al. 2012). In social insect colonies, the task allocation of workers comes from responses to task stimuli/needs, and the process of workers receiving stimuli may be affected by environmental noise (i.e., Couzin and Franks 2003). This can be explained by, for example, random fluctuations affecting the accuracy of information exchange among workers (by affecting the pheromones or the antennae sounds), thereby affecting the task stimulus/task demands. To peek into the effects of random fluctuations on the dynamics of task allocation, we assumed that the intensity of environmental noise is proportional to the size of the task demand, and derived two white noise-driven stochastic models based on cases (iii) and (iv). For each case, we focused on the effects of random fluctuations on task allocation under three different dynamic situations (Sects. 5.1 and 5.2). Numerical simulation results of the stochastic models indicate that: (1) Noise can regulate task demand and work activity in the following ways: when the colony rests at a certain level, the intervention of random fluctuations makes the average of the task demand (over 500 replicates) higher, and the average of the resting level becomes lower; when the colony spends all the time on resting, random fluctuations can not change the colony being rest all the time but have delay effects; when the task demand and the resting level change periodically, the intervention of random fluctuations can make the periodicity irregular. (2) Increased noise intensity may lead to more possibilities for the system. (3) Noise may explain the volatility of experimental data (see Fig. 11).

Our paper provides a new modeling and theoretical framework for studying task allocation of social insect colonies. Our theoretical results provide important biological insights into how the scaling effects of colony size affects task allocation and resting probability. Besides, four application scenarios based on the actual situation are presented on the level of working activity and resting. The effects of random fluctuations on task stimuli are also included in the study of task allocation of social insect colonies. Despite these promising results above, some important factors are needed to address further. For example, (l) our framework only considers the dynamics of the colony without space. However, the task groups and demands are unevenly distributed in space. It would be interesting to take into account the effects of spatial scale on the task allocation of social insect colonies; and (2) To fully understand the task allocation of social insect colonies, experimental data should be introduced and combined with theoretical results to obtain a better understanding of the task allocation of social insect colonies. Those two points are our ongoing work.

7 Proofs

7.1 Proof of Theorem 1

Proof

Since \(\sum _{i=0}^m x_i(0)=1\) and \(\sum _{i=0}^m x_i'=0\), we can conclude that

$$\begin{aligned} \sum _{i=0}^m x_i(t)=1 \text{ and } 0\le x_i(t)\le 1 \text{ for } \text{ all } t\ge 0. \end{aligned}$$

For any initial condition taken in \(\varOmega \), we have follows:

$$\begin{aligned} \frac{dx_i}{dt} \Big \vert _{x_i=0}=0, \,\, \frac{dD_i}{dt} \Big \vert _{D_i=0}=\gamma _iN^{\delta _i}>0, i=1,\ldots ,m, \end{aligned}$$

which implies that the Model (1) is positively invariant in \(\varOmega \) according to Theorem A.4 (p.423) in Thieme (2003).

Notice that N is strictly positive, and

$$\begin{aligned} \begin{array}{lcl} D_i'= & {} \gamma _iN^{\delta _i}\left[ 1-\frac{ x_i D_i}{\theta _i{\hat{D}}_i}\right] \ge \gamma _iN^{\delta _i}\left[ 1-\frac{D_i}{\theta _i{\hat{D}}_i}\right] \end{array}, \end{aligned}$$

we have

$$\begin{aligned} \liminf _{t\rightarrow \infty }D_i(t)\ge \theta _i{\hat{D}}_i=\frac{\gamma _iN^{\delta _i-1}}{\alpha _i}. \end{aligned}$$

Assume that \(X^*=[x_0^*,x_1^*,...,x_m^*]\) and \(D^*=[D_1^*, D_2^*, ..., D_m^*]\) is an equilibrium of Model (1). If \(\frac{D_0}{\theta _0}=\varPhi N^{\delta _0}\), we have the following equations hold for \(i\ge 1\):

$$\begin{aligned} 1-\frac{ x^*_i D^*_i}{\theta _i{\hat{D}}_i}= & {} 0\Rightarrow \frac{ x^*_i D^*_i}{\theta _i}={\hat{D}}_i,\\ \frac{\frac{D_i^*}{\theta _i}}{\sum _{k=0}^m \frac{D_k^* x_k^*}{\theta _k}}-1= & {} 0\Rightarrow \frac{D_i^*}{\theta _i}=\sum _{k=0}^m \frac{D_k^* x_k^*}{\theta _k}=\sum _{k=1}^m{\hat{D}}_k\\&+\varPhi N^{\delta _0}x_0^*={\hat{D}}+\varPhi N^{\delta _0}x_0^*, \end{aligned}$$

and for \(i=0\), we have

$$\begin{aligned}&\frac{\frac{D_0}{\theta _0}}{\sum _{k=1}^m \frac{D_k^* x_k^*}{\theta _k}+\frac{D_0x_0^*}{\theta _0}}=1\Rightarrow \varPhi N^{\delta _0}= {\hat{D}}+\varPhi N^{\delta _0}x_0^*\\&\quad \Rightarrow x_0^*=1-\frac{{\hat{D}}}{\varPhi N^{\delta _0}} \text{ if } \varPhi N^{\delta _0}>{\hat{D}} \end{aligned}$$

and

$$\begin{aligned} x_0^*=0 \text{ if } \varPhi N^{\delta _0}<{\hat{D}}. \end{aligned}$$

Therefore, if \(\varPhi N^{\delta _0}>{\hat{D}}\), we have

$$\begin{aligned} x_0^*=1-\frac{{\hat{D}}}{\varPhi N^{\delta _0}},\,\,D_i^*=\theta _i\left( {\hat{D}}+\varPhi N^{\delta _0}x_0^*\right) = \theta _i\varPhi N^{\delta _0} \end{aligned}$$

and

$$\begin{aligned} x^*_i =\frac{{\hat{D}}_i \theta _i}{D^*_i}=\frac{{\hat{D}}_i }{\varPhi N^{\delta _0}} \text{ for } \text{ all } 1\le i\le m. \end{aligned}$$

If \(\varPhi N^{\delta _0}<{\hat{D}}\), we have

$$\begin{aligned}&x_0^*=0,\,\,D_i^*=\theta _i\left( {\hat{D}}+\varPhi N^{\delta _0} x_0^*\right) = \theta _i{\hat{D}} \text{ and } \\&x^*_i =\frac{{\hat{D}}_i \theta _i}{D^*_i}=\frac{{\hat{D}}_i }{{\hat{D}}} \text{ for } \text{ all } 1\le i\le m. \end{aligned}$$

If \(\frac{D_0}{\theta _0}=w N^{\delta _0} (1-x_0)\), we have the following equations hold for \(i\ge 1\):

$$\begin{aligned} 1-\frac{ x^*_i D^*_i}{\theta _i{\hat{D}}_i}= & {} 0\Rightarrow \frac{ x^*_i D^*_i}{\theta _i}={\hat{D}}_i,\\ \frac{\frac{D_i^*}{\theta _i}}{\sum _{k=0}^m \frac{D_k^* x_k^*}{\theta _k}}-1= & {} 0\Rightarrow \frac{D_i^*}{\theta _i}=\sum _{k=0}^m \frac{D_k^* x_k^*}{\theta _k}=\sum _{k=1}^m{\hat{D}}_k+w N^{\delta _0} x_0^* (1-x^*_0)\\= & {} {\hat{D}}+w N^{\delta _0} (1-x_0^*) x_0^*, \end{aligned}$$

and for \(i=0\), we have

$$\begin{aligned} \begin{array}{lcl}\frac{\frac{D_0}{\theta _0}}{\sum _{k=1}^m \frac{D_k^* x_k^*}{\theta _k}+\frac{D_0x_0^*}{\theta _0}}=1&{}\Rightarrow &{} w N^{\delta _0}(1-x_0^*)= {\hat{D}}+w N^{\delta _0}(1-x_0^*) x_0^*\\ &{}\Rightarrow &{} x_0^*=1-\sqrt{\frac{{\hat{D}}}{w N^{\delta _0}}} \text{ if } w N^{\delta _0}>{\hat{D}}\end{array} \end{aligned}$$

and

$$\begin{aligned} x_0^*=0 \text{ if } w N^{\delta _0}<{\hat{D}}. \end{aligned}$$

Therefore, if \(w N^{\delta _0}>{\hat{D}}\), we have

$$\begin{aligned} x_0^*=1-\sqrt{\frac{{\hat{D}}}{w N^{\delta _0}}},\,\,D_i^*=\theta _i\left( {\hat{D}}+wN^{\delta _0}(1-x_0^*) x_0^*\right) = \theta _i\sqrt{{\hat{D}}wN^{\delta _0}} \end{aligned}$$

and

$$\begin{aligned} x^*_i =\frac{{\hat{D}}_i \theta _i}{D^*_i}=\frac{{\hat{D}}_i }{\sqrt{{\hat{D}}wN^{\delta _0}}} \text{ for } \text{ all } 1\le i\le m. \end{aligned}$$

If \(wN^{\delta _0}<{\hat{D}}\), we have

$$\begin{aligned} x_0^*=0,\,\,D_i^*=\theta _i\left( {\hat{D}}+wN^{\delta _0}(1-x_0^*) x_0^*\right) = \theta _i{\hat{D}}\end{aligned}$$

and

$$\begin{aligned} x^*_i =\frac{{\hat{D}}_i \theta _i}{D^*_i}=\frac{{\hat{D}}_i }{{\hat{D}}} \text{ for } \text{ all } 1\le i\le m. \end{aligned}$$

Let \(v_{0i}=\frac{x_0}{x_i}\) and \(v_{i0}=\frac{x_i}{x_0}\), then we have

$$\begin{aligned} \begin{aligned} v_{0i}'&=\frac{x_0'}{x_i}-\frac{x_0x_i'}{x_i^2}=v_{0i}\frac{\frac{D_0 }{\theta _0}-\frac{D_i}{\theta _i}}{\sum _{k=0}^m \frac{D_k x_k}{\theta _k}},\\ v_{i0}'&=\frac{x_i'}{x_0}-\frac{x_ix_0'}{x_0^2}=v_{i0}\frac{\frac{D_i}{\theta _i}-\frac{D_0 }{\theta _0}}{\sum _{k=0}^m \frac{D_k x_k}{\theta _k}}. \end{aligned} \end{aligned}$$

Since \(\liminf _{t\rightarrow \infty }D_i(t)\ge \theta _i{\hat{D}}_i\), we have follows:

  1. 1.

    If \(\frac{D_0}{\theta _0}=\varPhi N^{\delta _0}<{\hat{D}}_i\), the following inequalities hold

    $$\begin{aligned} \begin{array}{lcl} v_{0i}'&{}=&{}v_{0i}\frac{\frac{D_0 }{\theta _0}-\frac{D_i}{\theta _i}}{\sum _{k=0}^m \frac{D_k x_k}{\theta _k}}\le v_{0i}\frac{\varPhi N^{\delta _0}-{\hat{D}}_i}{\sum _{k=0}^m \frac{D_k x_k}{\theta _k}}<0,\\ \\ v_{i0}'&{}=&{}v_{i0}\frac{\frac{D_i}{\theta _i}-\frac{D_0 }{\theta _0}}{\sum _{k=0}^m \frac{D_k x_k}{\theta _k}}\ge v_{i0}\frac{{\hat{D}}_i-\varPhi N^{\delta _0}}{\sum _{k=0}^m \frac{D_k x_k}{\theta _k}}>0, \end{array} \end{aligned}$$

    which imply that

    $$\begin{aligned} \limsup _{t\rightarrow \infty } v_{0i}(t)=\limsup _{t\rightarrow \infty } \frac{x_0(t)}{x_i(t)}=0 \text{ and } \limsup _{t\rightarrow \infty } v_{i0}(t)=\limsup _{t\rightarrow \infty } \frac{x_i(t)}{x_0(t)}=\infty . \end{aligned}$$
  2. 2.

    If \(\frac{D_0}{\theta _0}=wN^{\delta _0}(1-x_0)\) and \(wN^{\delta _0}<{\hat{D}}_i\), the following inequalities hold

    $$\begin{aligned} \begin{array}{lcl} v_{0i}'&{}=&{}v_{0i}\frac{\frac{D_0 }{\theta _0}-\frac{D_i}{\theta _i}}{\sum _{k=0}^m \frac{D_k x_k}{\theta _k}}\le v_{0i}\frac{wN^{\delta _0}(1-x_0)-{\hat{D}}_i}{\sum _{k=0}^m \frac{D_k x_k}{\theta _k}}\le v_{0i}\frac{wN^{\delta _0}-{\hat{D}}_i}{\sum _{k=0}^m \frac{D_k x_k}{\theta _k}}<0,\\ v_{i0}'&{}=&{}v_{i0}\frac{\frac{D_i}{\theta _i}-\frac{D_0 }{\theta _0}}{\sum _{k=0}^m \frac{D_k x_k}{\theta _k}}\ge v_{i0}\frac{{\hat{D}}_i-wN^{\delta _0}(1-x_0)}{\sum _{k=0}^m \frac{D_k x_k}{\theta _k}}>0, \end{array} \end{aligned}$$

    which imply that

    $$\begin{aligned} \limsup _{t\rightarrow \infty } v_{0i}(t)=\limsup _{t\rightarrow \infty } \frac{x_0(t)}{x_i(t)}=0 \text{ and } \limsup _{t\rightarrow \infty } v_{i0}(t)=\limsup _{t\rightarrow \infty } \frac{x_i(t)}{x_0(t)}=\infty . \end{aligned}$$

Therefore, if there exists an i such that \(wN^{\delta _0}<{\hat{D}}_i\) for \(\frac{D_0}{\theta _0}=wN^{\delta _0}(1-x_0)\) or \(\frac{D_0}{\theta _0}=\varPhi N^{\delta _0}<{\hat{D}}_i\) holds, we have

$$\begin{aligned} \lim _{t\rightarrow \infty } x_0(t)=0. \end{aligned}$$

\(\square \)

7.2 Proof of Theorem 2

Proof

The proof of the existence of equilibria is straightforward, so it is omitted here. To prove the stability of equilibria, let \(E^*\) be the corresponding equilibrium of the above four systems,\(J|_{(E^*)}\) the corresponding Jacobian matrix evaluated at \(E^*\) and \(\lambda _i(E^*)(i=1,2)\) the eigenvalues of \(J|_{(E^*)}\).

Model I The system (7) always has an equilibrium \(E^*\). The Jacobian matrix of System (7) evaluated at \(E^*\) is

$$\begin{aligned} J|_{(E^*)}=\left( \begin{array}{cc} \frac{\varPhi \theta \alpha N^{\delta _0+1-\delta }}{\gamma }-1&{}0\\ -\gamma N^\delta &{}-\alpha N\\ \end{array}\right) . \end{aligned}$$

Direct computation yields

$$\begin{aligned} \lambda _1(E^*)=-\alpha N<0~\text {and}~\lambda _2(E^*)=\frac{\alpha \theta N^{\delta _0+1-\delta }}{\gamma }\left( \varPhi -\frac{\gamma N^{\delta -\delta _0-1}}{\alpha \theta }\right) . \end{aligned}$$

It follows that \(E^*\) is locally asymptotically stable if \(\varPhi <\frac{\gamma N^{\delta -\delta _0-1}}{\alpha \theta }\), and it is unstable if \(\varPhi >\frac{\gamma N^{\delta -\delta _0-1}}{\alpha \theta }\).

Case (1) \(\varPhi <\frac{\gamma N^{\delta -\delta _0-1}}{\alpha \theta }\). In this case, \(E^*\) is the unique equilibrium of System (7). The Pioncare-Bendixson theorem (Hale 1980) implies that all solutions of System (7) converge to the equilibrium \(E^*\), i.e., \(E^*\) is globally asymptotically stable.

Case (2) \(\varPhi >\frac{\gamma N^{\delta -\delta _0-1}}{\alpha \theta }\). In this case, \(E^*\) is unstable and System (7) has a unique interior equilibrium \({\hat{E}}^*({\hat{x}}^*,{\hat{D}}^*)\). The Jacobian matrix of System (7) evaluated at \({\hat{E}}^*\) is

$$\begin{aligned} J|_{({\hat{E}}^*)}=\left( \begin{array}{cc} 0&{}\frac{\varPhi \theta N^{\delta _0}{\hat{x}}^*(1-{\hat{x}}^*)}{\left[ {\hat{D}}^*{\hat{x}}^*+\varPhi \theta N^{\delta _0}(1-{\hat{x}}^*)\right] ^2}\\ -\alpha N{\hat{D}}^*&{}-\alpha N{\hat{x}}^*\\ \end{array}\right) . \end{aligned}$$

Then we have

$$\begin{aligned} \lambda _1({\hat{E}}^*)+\lambda _2({\hat{E}}^*)=-\alpha N{\hat{x}}^*<0 \end{aligned}$$

and

$$\begin{aligned} \lambda _1({\hat{E}}^*)\lambda _2({\hat{E}}^*)=\frac{\alpha {\hat{D}}^*\varPhi \theta N^{\delta _0+1}{\hat{x}}^*}{\left[ {\hat{D}}^*{\hat{x}}^*+\varPhi \theta N^{\delta _0}(1-{\hat{x}}^*)\right] ^2}(1-{\hat{x}}^*)>0, \end{aligned}$$

which indicates that \(\lambda _1({\hat{E}}^*)<0,\lambda _2({\hat{E}}^*)<0\). Thus the equilibrium \({\hat{E}}^*\) is locally asymptotically stable. To show the global stability of \({\hat{E}}^*\), we only need to rule out the existence of periodic orbit for the System (7). Suppose that \(\varGamma (t)=(x(t),D(t))\) is an arbitrary nontrivial periodic orbit of the System (7) with the least period \(T>0\), and J(x(t), D(t)) is the Jacobian matrix of System (7) around the periodic solution (x(t), D(t)). Let

$$\begin{aligned} \begin{aligned} \varDelta (\varGamma (t))&:=\int _0^T\text {Trac}(J(x(t),D(t)))dt\\&=\int _0^T\left( \frac{\frac{D(t)}{\theta }\varPhi N^{\delta _0}}{\left[ \frac{D(t)x(t)}{\theta }+\varPhi N^{\delta _0}(1-x(t))\right] ^2}-1-\alpha Nx(t)\right) dt. \end{aligned} \end{aligned}$$

Since

$$\begin{aligned} x'=x\left[ \frac{\frac{D}{\theta }}{ \frac{D x}{\theta }+\varPhi N^{\delta _0}(1-x)}-1\right] , \end{aligned}$$

we have

$$\begin{aligned}&\frac{\frac{D}{\theta }\varPhi N^{\delta _0}}{\left[ \frac{Dx}{\theta }+\varPhi N^{\delta _0}(1-x)\right] ^2}\\&\quad =\left( \frac{x'}{x}+1\right) ^2\frac{\theta \varPhi N^{\delta _0}}{D}=\frac{x'}{x}+1-\frac{{x'}^2}{x(1-x)}-\frac{x'}{1-x}. \end{aligned}$$

It follows that

$$\begin{aligned} \varDelta (\varGamma (t))&=\int _0^T\left( \frac{x'(t)}{x(t)}-\frac{{x'(t)}^2}{x(t)(1-x(t))}-\frac{x'(t)}{1-x(t)}-\alpha Nx(t)\right) dt\\&=\int _0^T\left( \frac{x'(t)}{x(t)}-\frac{x'(t)}{1-x(t)}\right) dt\\&\quad +\int _0^T\left( -\frac{{x'(t)}^2}{x(t)(1-x(t))}-\alpha Nx(t)\right) dt\\&<0.\\ \end{aligned}$$

By the divergency criterion (Hale 1980), all the periodic solutions should be orbitally stable. This contradicts the local stability of the equilibrium \({\hat{E}}^*\), i.e., \({\hat{E}}^*\) is globally asymptotically stable.

Model II The System (8) always has an equilibrium \(E^*\). The Jacobian matrix of the System (8) evaluated at \(E^*\) is

$$\begin{aligned} J|_{(E^*)}=\left( \begin{array}{cc} \frac{\theta w \alpha N^{\delta _0+1-\delta }}{\gamma }-1&{}0\\ -\gamma N^\delta &{}-\alpha N\\ \end{array}\right) .\\ \end{aligned}$$

By calculating the eigenvalues, we have

$$\begin{aligned} \lambda _1(E^*)=-\alpha N<0,~~\lambda _2(E^*)=\frac{\alpha \theta N^{\delta _0+1-\delta }}{\gamma }\left( w -\frac{\gamma N^{\delta -\delta _0-1}}{\alpha \theta }\right) . \end{aligned}$$

It follows that \(E^*\) is locally asymptotically stable if \(w <\frac{\gamma N^{\delta -\delta _0-1}}{\alpha \theta }\), while it is unstable if \(w>\frac{\gamma N^{\delta -\delta _0-1}}{\alpha \theta }\).

Case (1) \(w <\frac{\gamma N^{\delta -\delta _0-1}}{\alpha \theta }\). In this case, \(E^*\) is the unique equilibrium of System (8). It then follows from the Pioncare-Bendixson theorem (Hale 1980) that all solutions of System (8) converge to the equilibrium \(E^*\), i.e., \(E^*\) is globally asymptotically stable.

Case (2) \(w>\frac{\gamma N^{\delta -\delta _0-1}}{\alpha \theta }\). In this case, \(E^*\) is unstable and System (8) has a unique interior equilibrium \({\hat{E}}^*({\hat{x}}^*,{\hat{D}}^*)\). The Jacobian matrix of System (8) evaluated at \({\hat{E}}^*\) is

$$\begin{aligned} J|_{({\hat{E}}^*)}=\left( \begin{array}{cc} \frac{\theta \omega N^{\delta _0}{{\hat{x}}^{*2}}}{{\hat{D}}^*}-1&{}\frac{\theta \omega N^{\delta _0}{{\hat{x}}^{*2}}(1-{\hat{x}}^*)}{{\hat{D}}^{*2}}\\ -\alpha N{\hat{D}}^*&{}-\alpha N{\hat{x}}^*\\ \end{array}\right) .\\ \end{aligned}$$

Since

$$\begin{aligned} \frac{\theta \omega N^{\delta _0}{{\hat{x}}^{*2}}}{{\hat{D}}^*}=\sqrt{\frac{\gamma N^{\delta -\delta _0-1}}{\alpha \theta w }}={\hat{x}}^*<1, \end{aligned}$$

we obtain that the eigenvalues \(\lambda _1({\hat{E}}^*), \lambda _2({\hat{E}}^*)\) satisfy

$$\begin{aligned} \lambda _1({\hat{E}}^*)+\lambda _2({\hat{E}}^*)=-\left( 1-\frac{\theta \omega N^{\delta _0}{{\hat{x}}^{*2}}}{{\hat{x}}^*}+\alpha N{\hat{x}}^*\right) <0 \end{aligned}$$

and

$$\begin{aligned} \lambda _1({\hat{E}}^*)\lambda _2({\hat{E}}^*)=\alpha N{\hat{x}}^*\left( 1-\frac{\theta \omega N^{\delta _0}{{\hat{E}}^{*2}}}{{\hat{D}}^*}\right) +\frac{\alpha \theta \omega N^{1+\delta _0}{{\hat{x}}^{*2}}(1-{\hat{x}}^*)}{{\hat{D}}^*}>0, \end{aligned}$$

which indicates that \(\lambda _1({\hat{E}}^*)<0,\lambda _2({\hat{E}}^*)<0\). Thus the equilibrium \({\hat{E}}^*\) is locally asymptotically stable. To further verify the global asymptotically stable of the equilibrium \({\hat{E}}^*\), we only need to rule out the existence of periodic orbit for the System (8). We assume that \(\varGamma (t)=(x(t),D(t))\) is an arbitrary nontrivial periodic orbit of the System (8) with the least period \(T>0\), and J(x(t), D(t)) is the Jacobian matrix of System (8) around the periodic solution (x(t), D(t)). Let

$$\begin{aligned} \begin{aligned} \varDelta (\varGamma (t))&:=\int _0^T\text {Trac}(J(x(t),D(t)))dt\\&=\int _0^T\left( \frac{\frac{D(t)}{\theta }w N^{\delta _0}x^2(t)}{\left[ \frac{D(t)x(t)}{\theta }+w N^{\delta _0}x(t)(1-x(t))\right] ^2}-1-\alpha Nx(t)\right) dt. \end{aligned} \end{aligned}$$

Since

$$\begin{aligned} x'=x\left[ \frac{\frac{D}{\theta }}{ \frac{D x}{\theta }+w N^{\delta _0}x(1-x)}-1\right] , \end{aligned}$$

we have

$$\begin{aligned}&\frac{\frac{D}{\theta }w N^{\delta _0}x^2}{\left[ \frac{Dx}{\theta }+w N^{\delta _0}x(1-x)\right] ^2}=\left( \frac{x'}{x}+1\right) ^2\frac{\theta w N^{\delta _0}x^2}{D}\\&\quad =\left( 2-\frac{1}{1-x}\right) x'+x-\frac{{x'}^2}{1-x}. \end{aligned}$$

It follows that

$$\begin{aligned} \begin{aligned} \varDelta (\varGamma (t))&=\int _0^T\left[ \left( 2-\frac{1}{1-x(t)}\right) x'(t)+x(t)-\frac{{x'(t)}^2}{1-x(t)}-1-\alpha Nx(t)\right] dt\\&=\int _0^T\left( 2-\frac{1}{1-x(t)}\right) x'(t)dt\\&\quad +\int _0^T\left( -(1-x(t))-\frac{{x'(t)}^2}{1-x(t)}-\alpha Nx(t)\right) dt\\&<0.\\ \end{aligned} \end{aligned}$$

By the divergency criterion (Hale 1980), all the periodic solutions must be orbitally stable. This contradicts the local stability of the equilibrium \({\hat{E}}^*\), i.e., the equilibrium \({\hat{E}}^*\) is globally asymptotically stable.

Model III The System (9) always has an equilibrium \(E^*\). The Jacobian matrix of System (9) evaluated at \(E^*\) is

$$\begin{aligned} J|_{(E^*)}=\left( \begin{array}{cc} \frac{\alpha \theta \varPhi N^{\delta _0+1-\delta }}{\gamma (1+b)}-1&{}0\\ -\gamma N^{\delta }&{}-\alpha N\\ \end{array}\right) .\\ \end{aligned}$$

By calculating the eigenvalues, we have

$$\begin{aligned} \lambda _1(E^*)=-\alpha N<0,~~\lambda _2(E^*)=\frac{\alpha \theta N^{\delta _0+1-\delta }}{\gamma (1+b)}\left( \varPhi -\frac{\gamma (1+b)N^{\delta -\delta _0-1}}{\alpha \theta }\right) . \end{aligned}$$

Then \(E^*\) is locally asymptotically stable if \(\varPhi <\frac{\gamma (1+b)N^{\delta -\delta _0-1}}{\alpha \theta }\), and \(E^*\) is unstable if \(\varPhi >\frac{\gamma (1+b)N^{\delta -\delta _0-1}}{\alpha \theta }\).

Case (1) \(\varPhi <\frac{\gamma (1+b)N^{\delta -\delta _0-1}}{\alpha \theta }\). In this case, \(E^*\) is the unique equilibrium of System (9). It then follows from the Pioncare-Bendixson theorem (Hale 1980) that all solutions of System (9) converge to the equilibrium \(E^*\), i.e., \(E^*\) is globally asymptotically stable.

Case (2) \(\varPhi >\frac{\gamma (1+b)N^{\delta -\delta _0-1}}{\alpha \theta }\). In this case, \(E^*\) is unstable and System (9) has an equilibrium \({\hat{E}}^*({\hat{x}}^*,{\hat{D}}^*)\). The Jacobian matrix of System (9) evaluated at \({\hat{E}}^*\) is

$$\begin{aligned} J|_{({\hat{E}}^*)}=\left( \begin{array}{cc} \frac{b{\hat{x}}^*(1-{{\hat{x}}^*})}{1+b{\hat{x}}^*}&{}\frac{{\hat{x}}^*(1-{\hat{x}}^*)}{{\hat{D}}^*}\\ -\alpha N{\hat{D}}^*&{}-\alpha N{\hat{x}}^*\\ \end{array}\right) . \end{aligned}$$

By computing the eigenvalues, we obtain that

$$\begin{aligned} \lambda _1({\hat{E}}^*)\lambda _2({\hat{E}}^*)=\alpha N{{\hat{x}}^*}(1-{\hat{x}}^*)\left( 1-\frac{b{\hat{x}}^*}{1+b{\hat{x}}^*}\right) >0 \end{aligned}$$

and

$$\begin{aligned} \lambda _1({\hat{E}}^*)+\lambda _2({\hat{E}}^*)=-{\hat{x}}^*\left( \alpha N-b+\frac{b(1+b)\gamma N^{\delta -\delta _0-1}}{\varPhi \alpha \theta }\right) . \end{aligned}$$

Therefore, we can conclude that:

  • When \(b-\alpha N\le 0\) and \(\varPhi >\frac{\gamma (1+b)N^{\delta -\delta _0-1}}{\alpha \theta }\), we have \(\lambda _1({\hat{E}}^*)+\lambda _2({\hat{E}}^*)<0\), i.e., \({\hat{E}}^*\) is locally asymptotically stable.

  • When \(b-\alpha N>0\) and \(\frac{\gamma (1+b)N^{\delta -\delta _0-1}}{\alpha \theta }<\varPhi <\frac{\gamma b(1+b)N^{\delta -\delta _0-1}}{\alpha \theta (b-\alpha N)}:=\varPhi ^*\), we have \(\lambda _1({\hat{E}}^*)+\lambda _2({\hat{E}}^*)<0\), i.e., \({\hat{E}}^*\) is locally asymptotically stable.

  • When \(b-\alpha N>0\) and \(\varPhi >\varPhi ^*\), we have \(\lambda _1({\hat{E}}^*)+\lambda _2({\hat{E}}^*)>0\), i.e., \({\hat{E}}^*\) is unstable.

Notice that when \(b>\alpha N,\) the stability of \({\hat{E}}^*\) is closely related to the parameter values. In the following, we apply local bifurcation theory to study the complex dynamics of \({\hat{E}}^*\) when \(b>\alpha N\).

We first choose \(\varPhi \) to be the bifurcation parameter. Let

$$\begin{aligned} \begin{aligned} f(\varPhi )=(\alpha N-b)\varPhi \alpha \theta +b(1+b)\gamma N^{\delta -\delta _0-1}. \end{aligned} \end{aligned}$$
(13)

Since \(f(\varPhi ^*)=0\) and \(f'(\varPhi ^*)<0\), the equilibrium \({\hat{E}}^*\) is locally asymptotically stable if \(\varPhi _0<\varPhi <\varPhi ^*\), while it is unstable if \(\varPhi >\varPhi ^*\). Then, by a similar argument (Qiu and Zhu 2016), we obtain that the system undergoes a Hopf bifurcation at \(\varPhi =\varPhi ^*\).

Since \(\varPhi >\frac{\gamma (1+b)N^{\delta -\delta _0-1}}{\alpha \theta }\Leftrightarrow b<\frac{\varPhi \alpha \theta N^{\delta _0+1-\delta }}{\gamma }-1:=b_0,\) the system has an equilibrium \({\hat{E}}^*\) if \(b<b_0\). Next, we choose b to be the bifurcation parameter. By (13) we have

$$\begin{aligned} f(b)=\gamma N^{\delta -\delta _0-1}b^2+\left( \gamma N^{\delta -\delta _0-1}-\varPhi \alpha \theta \right) b+\alpha ^2N\varPhi \theta . \end{aligned}$$

Let

$$\begin{aligned} \begin{aligned} \bigtriangleup =\left( \gamma N^{\delta -\delta _0-1}-\varPhi \alpha \theta \right) ^2-4\gamma \alpha ^2\varPhi \theta N^{\delta -\delta _0}. \end{aligned} \end{aligned}$$
(14)

It follows that the number of roots of function \(f(b)=0\) is completely determined by the discriminant \(\bigtriangleup \) (see Fig. 15):

  • If \(\bigtriangleup <0\), the function \(f(b)=0\) has no root.

  • If \(\bigtriangleup >0\), the function \(f(b)=0\) has two positive roots

    $$\begin{aligned} \begin{aligned} b_1^*=\frac{\varPhi \alpha \theta -\gamma N^{\delta -\delta _0-1}-\sqrt{\bigtriangleup }}{2\gamma N^{\delta -\delta _0-1}},~b_2^*=\frac{\varPhi \alpha \theta -\gamma N^{\delta -\delta _0-1}+\sqrt{\bigtriangleup }}{2\gamma N^{\delta -\delta _0-1}}<b_0, \end{aligned} \end{aligned}$$
    (15)

    since \(b_1^*b_2^*=\frac{\alpha ^2N^{\delta _0+2-\delta }\varPhi \theta }{\gamma }>0\) and \(b_1^*+b_2^*=\frac{\varPhi \alpha \theta N^{\delta _0+1-\delta }}{\gamma }-1>0.\)

Fig. 15
figure 15

A schematic diagram of the number of roots of function f(b) as \(\varDelta \) changes

Therefore, we can conclude that:

  • Assume that \(\bigtriangleup <0\), then we have \(\lambda _1({\hat{E}}^*)+\lambda _2({\hat{E}}^*)<0\), i.e., \({\hat{E}}^*\) is locally asymptotically stable.

  • Assume that \(\bigtriangleup >0\). If \(b<b_1^*\) or \(b_0>b>b_2^*\), we have \(\lambda _1({\hat{E}}^*)+\lambda _2({\hat{E}}^*)<0\), i.e., \({\hat{E}}^*\) is locally asymptotically stable, while if \(b_1^*<b<b_2^*,\) we have \(\lambda _1({\hat{E}}^*)+\lambda _2({\hat{E}}^*)>0\), i.e., \({\hat{E}}^*\) is unstable. It follows that two Hopf bifurcations occur at \(b=b_1^*\) and \(b=b_2^*\), respectively.

Since \(\varPhi >\frac{\gamma (1+b)N^{\delta -\delta _0-1}}{\alpha \theta }\Leftrightarrow N^{\delta _0+1-\delta }<\frac{\varPhi \alpha \theta }{\gamma (1+b)},\) the system has an equilibrium \({\hat{E}}^*\) if \(N^{\delta _0+1-\delta }<\frac{\varPhi \alpha \theta }{\gamma (1+b)}\). In the following, we choose N to be the bifurcation parameter. By (13) we have

$$\begin{aligned} \begin{aligned} f(N)=b(1+b)\gamma N^{\delta -\delta _0-1}+\alpha ^2\varPhi \theta N-\alpha b\varPhi \theta \end{aligned} \end{aligned}$$

and

$$\begin{aligned} \begin{aligned} f'(N)=(\delta -\delta _0-1)b(1+b)\gamma N^{\delta -\delta _0-2}+\alpha ^2\varPhi \theta . \end{aligned} \end{aligned}$$

It follows that

  • When \(\delta >\delta _0+1\), the system has an equilibrium \({\hat{E}}^*\) if

    $$\begin{aligned} N<\frac{\varPhi \alpha \theta }{\gamma (1+b)}^{\frac{1}{\delta -\delta _0-1}}:=N_0. \end{aligned}$$

    In this case, we have \(f(0)<0, f(N_0)>0\) and \(f'(N)>0\), which indicates that \(f(N)=0\) has a unique positive root \(N^*\in (0,N_0)\). Therefore, \({\hat{E}}^*\) is unstable if \(N\in (0,N^*)\); while it is locally asymptotically stable if \(N\in (N^*,N_0)\). By a standard argument (Qiu and Zhu 2016), a Hopf bifurcation occurs at \(N=N^*\).

  • When \(\delta <\delta _0+1\), \({\hat{E}}^*\) exists if \( N>N_0\). In this case, if

    $$\begin{aligned} N<\frac{\alpha ^2\varPhi \theta }{(1+\delta _0-\delta )b(1+b)\gamma }^{\frac{1}{\delta -\delta _0-2}}:=N_1, \end{aligned}$$

    we have \(f'(N)<0\), while if \(N>N_1\) we have \(f'(N)>0\). Since \(f(0)>0\) and \(f(N_0)>0\), we have the following results: (a) if \(N_0>N_1\), we have \(f(N)>0\) for any \(N\in (N_0,\infty )\), which indicates that \({\hat{E}}^*\) is locally asymptotically stable; (b) if \(N_0<N_1\) and \(f(N_1)>0\), we have \(f(N)>f(N_1)>0\) for any \(N\in (N_0,\infty )\), which indicates that \({\hat{E}}^*\) is locally asymptotically stable; (c) if \(N_0<N_1\) and \(f(N_1)<0\), we know that \(f(N)=0\) has two roots \(N_1^*,N_2^*\), where \(N_0<N_1^*<N_1<N_2^*\). It follows that \(f(N)>0\) if \(N\in (N_0,N_1^*)\bigcup (N_2^*,\infty )\), and \(f(N)<0\) if \(N\in (N_1^*,N_2^*)\), which indicates that \({\hat{E}}^*\) is locally asymptotically stable if \(N\in (N_0,N_1^*)\bigcup (N_2^*,\infty )\), while it is unstable if \(N\in (N_1^*,N_2^*)\). By a standard argument (Qiu and Zhu 2016), two Hopf bifurcations occur at \(N=N_1^*\) and \(N=N_2^*\), respectively.

Model IV The System (10) always has two equilibria \(E_0^*,E_1^*\). The Jacobian matrix of the System (10) evaluated at \(E_0^*\) is

$$\begin{aligned} J|_{(E_{0}^*)}=\left( \begin{array}{cc} \frac{KN^{\delta -\delta _0}}{\varPhi \theta }-1&{}0\\ -\alpha KN^{\delta +1}&{}-\frac{\gamma }{K}\\ \end{array}\right) .\\ \end{aligned}$$

Direct computation yields

$$\begin{aligned} \lambda _1(E_{0}^*)=-\frac{\gamma }{K}<0,~\text {and}~\lambda _2(E_{0}^*)=\frac{KN^{\delta -\delta _0}}{\varPhi \theta }-1, \end{aligned}$$

which indicates that the equilibrium \(E_{0}^*\) is locally asymptotically stable if \(\lambda _2(E_{0}^*)<0\Leftrightarrow \varPhi >\frac{KN^{\delta -\delta _0}}{\theta }\), and it is unstable if \(\varPhi <\frac{KN^{\delta -\delta _0}}{\theta }\). Similarly, we can obtain that \(E_{1}^*\) is locally asymptotically stable if \(\varPhi <\frac{KN^{\delta -\delta _0}}{\theta }\frac{\gamma }{\gamma +\alpha KN}\), and it is unstable if \(\varPhi >\frac{KN^{\delta -\delta _0}}{\theta }\frac{\gamma }{\gamma +\alpha KN}\).

Case (1) \(\varPhi >\frac{KN^{\delta -\delta _0}}{\theta }\). In this case, the System (10) has no interior equilibrium with two equilibria on the boundary \(\varOmega \): \(E_{0}^*\) being locally asymptotically stable and \(E_{1}^*\) being unstable. It follows from the Pioncare-Bendixson theorem (Hale 1980) that all solutions of System (10) expect \(E_{1}^*\) converge to the equilibrium \(E_{0}^*\), which indicates that \(E_{0}^*\) is globally asymptotically stable.

Case (2) \(\varPhi <\frac{KN^{\delta -\delta _0}}{\theta }\frac{\gamma }{\gamma +\alpha KN}\). In this case, the System (10) has no interior equilibrium with two equilibria on the boundary \(\varOmega \): \(E_{0}^*\) being unstable and \(E_{1}^*\) being locally asymptotically stable. It follows from the Pioncare-Bendixson theorem (Hale 1980) that all solutions of System (10) expect \(E_{0}^*\) converge to the equilibrium \(E_{1}^*\), which indicates that \(E_{1}^*\) is globally asymptotically stable.

Case (3) \(\frac{KN^{\delta -\delta _0}}{\theta }\frac{\gamma }{\gamma +\alpha KN}<\varPhi <\frac{KN^{\delta -\delta _0}}{\theta }\). In this case, the System (10) admits a unique interior equilibrium \({\hat{E}}^*\). The Jacobian matrix of the System (10) evaluated at \({\hat{E}}^*\) is

$$\begin{aligned} J|_{({\hat{E}}^*)}=\left( \begin{array}{cc} 0&{}\frac{{\hat{x}}^*(1-{\hat{x}}^*)}{{\hat{D}}^*}\\ -\alpha N{\hat{D}}^*&{}-\frac{\gamma }{K}-\alpha N{\hat{x}}^*\\ \end{array}\right) .\\ \end{aligned}$$

Direct computation yields

$$\begin{aligned} \lambda _1({\hat{E}}^*)+\lambda _2({\hat{E}}^*)=-\left( \frac{\gamma }{K}+\alpha N{\hat{x}}^*\right) <0 \end{aligned}$$

and

$$\begin{aligned} \lambda _1({\hat{E}}^*)\lambda _2({\hat{E}}^*)=\alpha N{\hat{x}}^*(1-{\hat{x}}^*)>0. \end{aligned}$$

It follows that \(\lambda _1({\hat{E}}^*)<0, \lambda _2({\hat{E}}^*)<0\), i.e., \({\hat{E}}^*\) is locally asymptotically stable. To show the globally asymptotically stable of \({\hat{E}}^*\), we only need to rule out the existence of periodic orbit for the System (10). Assume that \(\varGamma (t)=(x(t),D(t))\) is an arbitrary nontrivial periodic orbit of the System (10) with the least period \(T>0\), and J(x(t), D(t)) is the Jacobian matrix of System (10) around the periodic solution (x(t), D(t)). Let

$$\begin{aligned} \begin{aligned} \varDelta (\varGamma (t))&:=\int _0^T\text {Trac}(J(x(t),D(t)))dt\\&=\int _0^T\left( \frac{D(t)\theta \varPhi N^{\delta _0}}{\left[ D(t)x(t)+\varPhi \theta N^{\delta _0}(1-x(t))\right] ^2}-1-\frac{\gamma }{K}-\alpha Nx(t)\right) dt. \end{aligned} \end{aligned}$$

Since

$$\begin{aligned} x'=x\left[ \frac{D}{Dx+\varPhi \theta N^{\delta _0}(1-x)}-1\right] , \end{aligned}$$

we have

$$\begin{aligned}&\frac{D\varPhi N^{\delta _0}}{\left[ Dx+\varPhi \theta N^{\delta _0}(1-x)\right] ^2}=\left( \frac{x'}{x}+1\right) ^2\frac{\theta \varPhi N^{\delta _0}}{D}\\&\quad =\frac{x'}{x}+1-\frac{{x'}^2}{x(1-x)}-\frac{x'}{1-x}. \end{aligned}$$

It follows that

$$\begin{aligned} \begin{aligned} \varDelta (\varGamma (t))&=\int _0^T\left( \frac{x'(t)}{x(t)}-\frac{{x'(t)}^2}{x(t)(1-x(t))} -\frac{x'(t)}{1-x(t)}-\frac{\gamma }{K}-\alpha Nx(t)\right) dt\\&=\int _0^T\left( \frac{x'(t)}{x(t)}-\frac{x'(t)}{1-x(t)}\right) dt\\&\quad +\int _0^T \left( -\frac{{x'(t)}^2}{x(t)(1-x(t))}-\frac{\gamma }{K}-\alpha Nx(t)\right) dt\\&<0.\\ \end{aligned} \end{aligned}$$

By the divergency criterion (Hale 1980), all the periodic solutions must be orbitally stable. This contradicts the local stability of the equilibrium \({\hat{E}}^*\). Therefore, the equilibrium \({\hat{E}}^*\) is globally asymptotically stable.