Paper The following article is Open access

Coexistence of Competing Microbial Strains under Twofold Environmental Variability and Demographic Fluctuations

, , and

Published 6 December 2023 © 2023 The Author(s). Published by IOP Publishing Ltd on behalf of the Institute of Physics and Deutsche Physikalische Gesellschaft
, , Citation Matthew Asker et al 2023 New J. Phys. 25 123010 DOI 10.1088/1367-2630/ad0d36

1367-2630/25/12/123010

Abstract

Microbial populations generally evolve in volatile environments, under conditions fluctuating between harsh and mild, e.g. as the result of sudden changes in toxin concentration or nutrient abundance. Environmental variability (EV) thus shapes the long-time population dynamics, notably by influencing the ability of different strains of microorganisms to coexist. Inspired by the evolution of antimicrobial resistance, we study the dynamics of a community consisting of two competing strains subject to twofold EV. The level of toxin varies in time, favouring the growth of one strain under low drug concentration and the other strain when the toxin level is high. We also model time-changing resource abundance by a randomly switching carrying capacity that drives the fluctuating size of the community. While one strain dominates in a static environment, we show that species coexistence is possible in the presence of EV. By computational and analytical means, we determine the environmental conditions under which long-lived coexistence is possible and when it is almost certain. Notably, we study the circumstances under which environmental and demographic fluctuations promote, or hinder, the strains coexistence. We also determine how the make-up of the coexistence phase and the average abundance of each strain depend on the EV.

Export citation and abstract BibTeX RIS

Original content from this work may be used under the terms of the Creative Commons Attribution 4.0 license. Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.

1. Introduction

Microbial communities evolve in volatile environments that often fluctuate between mild and harsh conditions. For instance, the concentration of toxin and the abundance of nutrients in a community can suddenly and radically change [14]. This results in environmental variability (EV) that shapes the population evolution [513]. In particular, EV greatly influences the ability of species to coexist [1419], which is a characteristic of key importance in biology and ecology, with direct applications in subjects of great societal concern [2025] like the maintenance of biodiversity in ecosystems [2634] and the evolution of antimicrobial resistance (AMR) [3540].

In the absence of detailed knowledge about the time-variation of external factors, EV is generally modelled by means of noise terms affecting the species growth and/or death rates [26, 4166]. Demographic noise (DN) is another important source of fluctuations: it can lead to fixation, which is the phenomenon arising when one strain takes over the entire community. The effect of DN is significant in communities of small size, and becomes negligible in large populations [41, 42, 6769]. Significantly, the time development of the size and composition of populations are often interdependent [7078], with fluctuations of the population size modulating the strength of DN [57, 6163, 65, 66, 79]. The interplay between EV and DN is crucial in shaping microbial communities, but the quantitative effects of their coupling are as yet still mostly unknown.

Environmental and demographic fluctuations play a crucial role in the evolution of AMR [13, 38, 40, 60, 64]. When treatments reduce a microbial community to a very small size, but fail to eradicate the microorganisms resistant to the drugs, resistant cells may replicate and restore infection, hence possibly leading to the spread of antibiotic resistance. Moreover, within a small population, demographic fluctuations may also lead to the extinction of resistant cells. Understanding how the coexistence of cells resistant and sensitive to antibiotics is affected by the joint effect of EV and demographic fluctuations, and how the fraction of resistant cells varies with environmental conditions with the possibility of eradication, are thus central questions in the effort to understand the evolution of AMR [13, 36, 38, 40, 79].

It is worth noting that considerable efforts have recently been dedicated to study the mechanisms underpinning the coexistence of competing species under various scenarios, see e.g. [31, 32, 34, 65]. The influence of different kinds of variability (e.g. quenched disorder, heterogeneous rates, 'spillover protection') on species coexistence in ecosystems exhibiting cyclic dominance [59, 80] has notably been investigated in [47, 8185]. Here, inspired by the AMR evolution in a chemostat setup [19, 65], we study the eco-evolutionary dynamics of an idealised microbial community consisting of two competing strains subject to a time-varying level of toxin, with the growth of one strain favoured under low toxin level and a selective advantage to the other strain under high toxin level. We also assume that the resource abundance varies according to a time-switching carrying capacity that drives the fluctuating size of the community. In most of previous works, EV is either encoded in fluctuating growth rates, with the size or carrying capacity of the population kept constant [26, 4145, 4751, 5356, 58, 60, 64, 86], or EV is modelled by a time-varying carrying capacity that affects the species death rates and drives the population size [57, 6163, 66] (see also [65]). The distinctive feature of this study is therefore the twofold EV accounting for fluctuations stemming from the variation of the toxin level and the switches of the carrying capacity resulting in the coupling of DN and EV; see figure 1.

Figure 1.

Figure 1. Cartoon of the model characterised by twofold EV. A microbial community consisting of two strains, denoted by $R$ (resistant, blue (charcoal), fitness $f_R$) and $S$ (sensitive, red (grey), fitness $f_S$), evolves in a time-varying environment, as illustrated by the arrows: the level of toxin, $\xi_T$, stochastically switches with rates $\nu_T^{\pm}$ (vertical arrows) between low ($\xi_T = +1$) and high ($\xi_T = -1$), and the amount of available resources, modelled by the carrying capacity $K(t)$, stochastically switches with rates $\nu_K^{\pm}$ (horizontal arrows) between scarce and abundant. The strain $R$ fares better than $S$ under high toxin level ($f_R\gt f_S$), while $S$ grows faster under low toxin level ($f_R\lt f_S$). The carrying capacity $K(t) = K_+$ when there are abundant resources, while $K(t) = K_-\lt K_+$ when available nutrients are scarce. The four environmental states characterising the twofold EV are indicated by the coloured background: striped / solid green (light grey) refers to low toxin level and scarce / abundant resources, while striped / solid red (grey) indicates high toxin level with scarce / abundant resources. See the text for the greyscale coding, and the table in section SM1 of [87] for detailed notations and definitions..

Standard image High-resolution image

As main results, we obtain the fixation-coexistence diagrams of the system, and these allow us to determine the environmental conditions under which long-lived coexistence of the strains is possible or certain, and when one strain dominates the other. We also analyse the make-up of the population when the strains coexist, and their average abundance.

The organisation of the paper is as follows: the model is introduced in section 2. Section 3 is dedicated to the study of the case with a constant carrying capacity (subject to a static or varying toxin level) by means of a mean-field (MF) analysis and a mapping onto a suitable Moran process. The twofold influence of time-varying fitness and carrying capacity on the coexistence and fixation of the species is analysed in section 4. Section 5 is dedicated to the influence of the EV on the make-up of the coexistence phase and strains abundance. We present our conclusions in section 6. Additional technical details are given in the supplementary material (SM) [87].

2. Model

We consider a well-mixed population of fluctuating size $N(t) = N_R(t)+N_S(t)$ which, at time $t$ , consists of $N_R$ bacteria of strain $R$ and $N_S$ of type $S$ , which compete for the same resources. The former refers to a strain that pays a metabolic cost to be resistant to a certain toxin, and the latter to microorganisms sensitive to that toxin. Based on mounting evidence showing that microbial communities generally evolve in volatile environments [5, 6, 9, 12, 25], we study the eco-evolutionary dynamics of this population under twofold EV: external conditions fluctuate between harsh and mild, and affect the level of toxin and resources that are available in the population; see figure 1.

For concreteness, we assume that the toxin is biostatic and reduces the growth rate of the sensitive strain, but does not affect the resistant bacteria [8890]. 2 In this setting, resistant $R$ bacteria have a constant fitness $f_R$ , whereas the sensitive $S$ bacteria have an environment-dependent fitness $f_S(\xi_T)$, where $\xi_T(t)$ is a time-varying environmental random variable encoding the toxin level: $\xi_T\gt0$ for the low toxin level and $\xi_T \lt 0$ for the high toxin level. As in previous studies [29, 30, 9294], we here consider

where $s>0$ denotes the selection bias favouring the strain $S$ when $\xi_T\gt0$, and strain $R$ when $\xi_T\lt0$. The parameter $s$ therefore encodes both the selection and strength of the environmental variability associated with the changes in toxin level (T-EV). As in many recent theoretical studies [56, 57, 6163, 65, 92, 95], T-EV is here modelled by coloured dichotomous Markov noise (DMN) [9698], so that $\xi_T\in\{-1,1\}$; see below. DMN is an important example of bounded noise [56, 6163, 65, 9598], with finite correlation time, which allows us to efficiently model suddenly changing conditions occurring in bacterial life [8, 19, 71, 72, 86], like the environmental stress resulting from exposure to antibiotics [10, 11, 75]. In this context, DMN, that is easy to simulate accurately and whose relationships with more complex forms of noise have been studied (see section SM4 in [87] and [66, 96, 97]), provides us with mathematically-amenable models that can be regarded as the theoretical counterparts of commonly-used laboratory experimental chemostat set-ups [8, 11, 13, 19].

The environmental effect on the level of nutrients (K-EV), fluctuating between scarcity and abundance, is modelled by a binary switching carrying capacity $K(t)\in\{K_-,K_+\}$ that is driven by the binary random variable (also following a DMN process) $\xi_K(t)\in\{-1,1\}$. The state $\xi_K = -1$ thus corresponds to a harsh state with scare resources, where the carrying capacity is $K_-$, whereas nutrients are abundant in the mild state $\xi_K = +1$ where the carrying capacity is $K_+\gt K_-\gg 1$. As in [57, 6163, 65, 66], this is encoded in the time-switching carrying capacity

Equation (1)

which, with $K_0 \equiv \frac{K_+ + K_-}{2}$ and $\gamma \equiv \frac{K_+ - K_-}{2K_0}$, can conveniently be written as

This randomly switching carrying capacity drives the population size $N(t)$ and is hence responsible for its fluctuations, with $K(t)\gg 1$ ensuring that the population dynamics is never solely dominated by demographic fluctuations. It is worth noting the choice of $\xi_K$ as a DMN ensures that the carrying capacity is always bounded and physical, i.e. $K(t)\in \{K_-, K_+\}$ and $K(t)\gt0$, which is not the case if EV is modelled by unbounded (e.g. Gaussian) noise, see section SM4 in [87].

The population thus evolves under twofold EV encoded in the environmental states ${\xi_{T}(t),\xi_K(t)}$, see figure 1, subject to time switching according to the reactions

where $\nu_{\alpha}^{\pm}$ are the switching rates of the $\alpha$ -DMN, with $\alpha\in \{T,K\}$ indicating the relevant environmental noise. It is also useful to define the average switching rate $\nu_\alpha$ and switching bias $\delta_\alpha$ for each $\alpha$ -DMN as

such that $\nu_\alpha^\pm\equiv\nu_\alpha(1\mp\delta_\alpha)$. This means that $\delta_T\gt0$ corresponds to a bias towards low toxin level (mild T state, $\xi_T = +1$) favouring the $S$ strain, whereas $\delta_T\lt0$ indicates a bias towards high toxin level (harsh T state, $\xi_T = -1$) where the growth of $S$ is hampered and the spread of $R$ is favoured, see figure 1. Similarly, $\delta_K\gt0$ corresponds to bias towards the environmental state rich in nutrients (where $K = K_+$), while $\delta_K\lt0$ is associated with a bias towards an environment where nutrients are scarce ($K = K_-$). In all cases, we consider $\alpha$ -DMN at stationarity, where $\xi_{\alpha} = \pm 1$ with probability $(1\pm \delta_{\alpha})/2$, yielding the average $\left\langle \xi_{\alpha} \right\rangle = \delta_{\alpha}$ and autocovariance (autocorrelation up to a constant) $\left\langle \xi_{\alpha}(t)\xi_{\alpha}(t^{^{\prime}}) \right\rangle = (1-\delta_{\alpha}^2)\exp(-2\nu_{\alpha}|t-t^{^{\prime}}|)$, where $\left\langle \cdot \right\rangle $ denotes the $\alpha$ -DMN ensemble average. We notice that the correlation time of the $\alpha$ -DMN, $1/(2\nu_{\alpha})$, is half of the inverse of the average switching rate of $\xi_\alpha$ [9698]. From equation (1), we find that the average carrying capacity is $\left\langle K \right\rangle = K_0(1+\gamma\delta_K)$ and the variance of $K(t)$ is $(K_0\gamma)^2(1-\delta_K^2)$, with the amplitude of K-EV thus scaling as $K_0\gamma$, while the variance and amplitude of the T-EV increase with $s$ ; see section SM2 in [87].

For concreteness, we here assume that $\xi_T$ and $\xi_K$ are totally uncorrelated. In our motivating example, this corresponds to the reasonable assumption that nutrient and antibiotic uptake are independent processes. The case where $\xi_T$ and $\xi_K$ are fully correlated or fully anti-correlated, with $\xi_T = \xi_K = \xi$ or $\xi_T = -\xi_K = \xi$, where $\xi$ is a single DMN process, is briefly discussed in section SM8 of [87].

The system considered here best translates to a chemostat setup whereby toxin and nutrient levels can be maintained at a constant level through time and switched via changing concentrations of medium coming into the system [19, 65]. The switch $\xi_T\to -\xi_T$ with $\xi_T = -1$ can thus be envisioned as corresponding to switching the concentration of an antibiotic drug from above the minimum inhibitory concentration (MIC), where the growth of the sensitive strain is hampered, to a concentration below the MIC where the $S$ strain can spread at the expense of $R$ [36, 38, 64].

At time $t$ the fraction of $R$ -types in the system is $x(t)\equiv \frac{N_R(t)}{N(t)}$ and the average population fitness is $\overline{f}(x,\xi_T)\equiv x+(1-x)\exp(s\xi_T)$, which depends on the population composition $x$ and the toxin state $\xi_T$ ,. We assume that mutation rates between strains are negligible, and seek to characterise the population dynamics by the evolution of its size and composition according to the multivariate birth–death process [99101]

Equation (2)

where the time-dependent birth and death transition rates are respectively

Equation (3)

The per-capita birth rates $f_{R/S}/\overline{f}$ (where we normalise with $\overline{f}$ in line with the standard Moran process [41, 6769, 102]) thus vary with the toxin level and population composition, while the logistic-like per-capita death rate $N/K$ varies with nutrient level and population size. With $\mathbf{N}\equiv(N_R,N_S)$, the master equation giving the probability $P(\mathbf{N},\xi_T,\xi_K,t)$ for the population to consist of $N_R$ and $N_S$ bacteria of type $R$ and $S$ , respectively, in the environmental state $(\xi_T,\xi_K)$ at time $t$ is

Equation (4)

where $\mathbb{E}^{\pm}_{R/S}$ are shift operators such that $\mathbb{E}^{\pm}_R f(N_R,N_S,\xi_T,\xi_K,t) = f(N_R\pm 1,N_S,\xi_T,\xi_K,t)$, and $\nu_\alpha^{\xi_\alpha}\equiv \nu_\alpha^{\pm}$ when $\xi_\alpha = \pm 1$. We note that $P(\mathbf{N},\xi_T,\xi_K,t) = 0$ whenever $N_R\lt0$ or $N_S\lt0$, and the last two lines on the right-hand-side of equation (4) account for the random environmental switching of toxin ($\xi_T\to -\xi_T$) and carrying capacity ($\xi_K\to -\xi_K$). The dynamics encoded by the multivariate master equation (4) can be simulated exactly by a stochastic algorithm as explained in [103, 104], see Sec. SM4 in [87]. Since $T^{\pm}_{R/S} = 0$ whenever $N_{R/S} = 0$, there is extinction of $R$ and fixation of $S$ ($N_R = 0, N = N_S$), or fixation of $R$ and extinction of $S$ ($N_S = 0, N = N_R$). When one strain fixates and replaces the other, the population composition no longer changes while its size continues to fluctuate 3 . Fixation of one strain and extinction of the other is expected when strains compete for the same resources (competitive exclusion principle), and always occur in a finite population even when its size fluctuates [57, 61, 63]. In stark contrast, here we show that environmental fluctuations can lead to the long-lived coexistence of competing species and nontrivially shape the abundance distribution of both strains.

The notation and definitions of the model parameters and physical quantities of interest are conveniently summarised in the table of section SM1 in [87].

3. Constant carrying capacity: mean-field analysis and Moran process

Since $\xi_T$ and $\xi_K$ are independent, it is useful to first consider the case of a constant carrying capacity, with EV stemming only from the fluctuations of the toxin level in the birth rates of equation (3).

In this section, we thus assume that the carrying capacity is constant and large: $K(t) = K_0\gg 1$. After a short transient the population size fluctuates about $K_0$ , with $N\approx K_0$. When $K_0\gg 1$, we can approximate the population size by $N = K_0$ and make analytical progress by using the well-known results of the Moran process [41, 6769, 102]. In this approximation, the population is kept constant, which requires the simultaneous birth and death of individuals of either species, and the population evolves according to a fitness-dependent Moran process [57, 6163], defined in terms of equations (2) and (3) by the reactions

Equation (5)

corresponding, respectively, to the simultaneous birth of an $R$ and death of an $S$ with rate $\widetilde{T}_{R}^+$, and death of an $R$ and birth of an $S$ with rate $\widetilde{T}_{R}^-$, where

Equation (6)

3.1. Mean-field analysis

We now consider the case where $N = K_0\to \infty$, and thus ignore demographic fluctuations. In this case, the population composition evolves according to the MF equation [99]:

Equation (7)

where the dot denotes the time derivative. It is important to notice that, owing to environmental noise $\xi_T$ , equation (7) is a MF stochastic differential equation that defines a so-called 'piecewise deterministic Markov process' (PDMP) [56, 57, 61, 63, 106]. According to this PDMP, after a switch to an environmental state $\xi_T$ , $x$ evolves deterministically with equation (7) and a fixed value of $\xi_T$, until a switch $\xi_T\to-\xi_T$ occurs, see section 5.1.

We consider equation (7) in the regimes of (i) low, (ii) high, and (iii) intermediate switching rate $\nu_T$ :

(i) Under low switching rate, $\nu_T\to 0$, the population settles in its final state without experiencing any T-switches. In this regime, the population reaches its final state in its initial toxin level $\xi_T(0)$, i.e. $\xi_T(0) = \xi_T(\infty) = \pm 1$ with probability $(1\pm \delta_T)/2$. In this regime, equation (7) thus boils down to

Since $s>0$, with a probability $(1+ \delta_T)/2$ we have $\xi_T(0) = \xi_T(\infty) = +1$ and $x \rightarrow 0$ ( $R$ vanishes), while with a probability $(1- \delta_T)/2$ we have $\xi_T(0) = \xi_T(\infty) = -1$ and $x\rightarrow 1$ ( $S$ vanishes). In either case, the MF dynamics are characterised by the dominance of one of the strains. Therefore, in the absence of demographic fluctuations, there is never long-lived coexistence of the strains $R$ and $S$ under low switching rate of the toxin level.

(ii) Under high switching rate, $\nu_T\gg 1$, the population experiences a large number of T-switches before relaxing into its final state; see below. In this case the T-DN self-averages [29, 53, 57, 61, 63, 66] and we are left with a Moran process defined by the effective rates $\widetilde{T}_{R}^{\pm} \to \left\langle \widetilde{T}_{R}^{\pm} \right\rangle$ obtained by averaging $\xi_T$ over its stationary distribution, yielding

Equation (8)

When $N\to \infty$, the MF rate equation associated with this effective Moran process thus reads [68, 99, 100]:

Equation (9)

where the right-hand-side (RHS) can be interpreted as the RHS of equation (7) averaged over $\xi_T$ . In addition to the trivial fixed points $x = 0, 1$, equation (9) admits a coexistence equilibrium

Equation (10)

when $-\tanh{\frac{s}{2}}\lt\delta_T\lt\tanh{\frac{s}{2}}$. This equilibrium stems from the T-DMN and thus is a fluctuation-induced coexistence point. In the case of large $s$ we have that $\coth{\frac{s}{2}}\rightarrow1$, and $x^*$ exists ($0\lt x^*\lt1$) for all values of $\delta_T$. Since $\left.\frac{\text{d}\dot{x}}{\text{d}x}\right|_{x^*} = -\frac{4}{1-\delta_T^2}\tanh^2\left(\frac{s}{2}\right)\left(1-x^*\right)$ is always negative, linear stability analysis reveals that $x^*$ is the sole asymptotically stable equilibrium of equation (9) when it exists ($x = 0,1$ are thus unstable). When $s\ll 1$, $\coth{\frac{s}{2}}\rightarrow \frac{2}{s}$, and $x^*$ exists only for $-\frac{s}{2}\lt\delta_T\lt\frac{s}{2}$. This means that for $s\ll 1$, coexistence is essentially possible only under symmetric switching ($\delta_T = 0$), see section SM2 in [87]. In what follows, we focus on the less restrictive case $s = {\cal O}(1)$, for which coexistence is possible for a broad range of parameters $(\nu_T,\delta_T)$.

(iii) In the regime of intermediate switching rate, where $\nu_T\sim 1$, the population experiences a finite number of T-switches prior to settling in its final state. Depending on this number, as well as the selection strength $s$ and the population size, the dynamics may be closer to either the low or high $\nu_T$ regime, with dominance or coexistence possible but, in general, not certain; see figure 3 below.

3.2. Finite populations—fixation and long-lived coexistence

From the MF analysis, we have found that when $N\to \infty$ species coexistence is feasible under fast T-EV switching, whereas only $R$ or $S$ dominance occurs under slow switching. We now study how these results nontrivially morph when the population is fixed and finite.

Since the model is defined as a finite Markov chain with absorbing boundaries, see equations (5) and (6), its final state unavoidably corresponds to the fixation of one strain and the extinction of the other, i.e. the population eventually ends up in either the state $(N_R,N_S) = (N,0)$ or $(N_R,N_S) = (0,N)$ [41, 68, 101, 102]. This means that, strictly, the finite population does not admit stable coexistence: when it exists, $x^*$ is metastable [107109]. In fact, while it is guaranteed that eventually only one of the strains will finally survive, fixation can occur after a very long time and can follow a long-term coexistence of the strains, as suggested by the MF analysis of the regime with $\nu_T\gg 1$. It is thus relevant to study under which circumstances there is long-lived coexistence of the strains.

The evolutionary dynamics is characterised by the fixation probability of the strain $R$, here denoted by $\phi$ . This is the probability that a population, consisting initially of a fraction $x_0$ of $R$ bacteria, is eventually taken over by the strain $R$ .

A related quantity is the unconditional mean fixation time (MFT), here denoted by $\tau$ , which is the average time for the fixation of either species to occur.

In what follows, we study how the $R$ fixation probability $\phi(\nu_T)$ and the MFT $\tau(\nu_T)$ vary with the average switching rate of the T-EV for different values of $K_0$ , $\delta_T$ , and $s$ (treated as parameters), and determine when there is long-lived coexistence of the strains.

In the limits $\nu_T\to0, \infty$, we can use the well-known properties of the Moran model [41, 69, 102] to obtain $\phi(\nu_T)$ and $\tau(\nu_T)$ from their Moran approximation (MA) counterparts, denoted by $\phi_\textrm{MA}(N)$ and $\tau_\textrm{MA}(N)$, which are respectively the $R$ fixation probability and MFT in the associated Moran process for a population of constant size $N$ ; see section SM3 in [87].

For a given initial resistant fraction 4 , the fixation probability in the slow-switching regime, $\phi(\nu_T\to0)$ is obtained by averaging $\phi_{\textrm{MA}}(N){\big|}_{\xi_T}$, denoting the $R$ fixation probability in the realm of the MA in static environment $\xi_T$, over the stationary distribution of $\xi_T$ [57, 61, 63, 66]:

Equation (11)

When $N\gg1$ and $\xi_T = +1$ the strain $S$ is always favoured and $\phi_{\textrm{MA}}(N){\big|}_{\xi_T = +1}\approx 0$, whereas $R$ is favoured when $\xi_T = -1$ and in this case $\phi_{\textrm{MA}}(N){\big|}_{\xi_T = -1}\approx 1$. Since $\xi_T(0) = - 1$ with probability $(1- \delta_T)/2$, this coincides with the $R$ fixation probability: $\phi(\nu_T\to0)\approx (1- \delta_T)/2$. The probability that $S$ fixates when $\nu_T\to0$ is thus $1-\phi(\nu_T\to0)\approx (1+ \delta_T)/2$

In the fast-switching regime the fixation probability is that of the Moran process defined by the effective rates in equation (8). Using equation (8) with $x = n/N$, we thus find [41, 102]:

Equation (12)

see section SM3.A in [87]. A similar analysis can also be carried out for $\tau$ , see section SM3.B in [87]. Results reported in figure 2 show that equations (11) and (12) accurately capture the behaviour of $\phi$ in the limiting regimes $\nu_T\to0,\infty$, see figure 2(a). Figure 2(b) shows that the predictions for $\tau$ when $\nu_T\to0,\infty$, are also in good agreement with simulation results, with a much larger MFT under high $\nu_T$ than under low switching rate (at fixed $\delta_T$ ). In figure 2(b), the MFT when $\nu_T\gg 1$ for $\delta_T = 0$ is significantly larger than under $\delta_T\neq 0$. This stems from $x^* = x_0 = 1/2$ being the attractor of equation (9) when $\delta_T = 0$, but not being an equilibrium when $\delta_T = 0.3$ or $\delta_T = 0.5$. Figures 2(a) and (b) also illustrate the excellent agreement between the predictions of the MA with $N = K_0$ and those obtained from stochastic simulations with $K = K_0$ constant. Note that typical error bars are shown for $\delta_T = 0$ in figure 2(b). These are found to be small and almost coincide with the markers. For the sake of readability, we have thus omitted similar error bars from the other panels and figures.

Figure 2.

Figure 2.  R fixation probability φ and MFT τ under constant carrying capacity and T-EV. Symbols are from stochastic simulations (103 realisations) with carrying capacity $K_0$ (and non-constant $N$ ), and full black lines are for the Moran approximation with $N = K_0$, based on equation (13) (a) and equation (14) (b), (c). (a) $\phi$ against $\nu_T$ , for $\delta_T = -0.9$ (×), $-0.5$($\bigcirc$), $0$ ($\bigtriangledown$), $0.5$($\bigtriangleup$), $0.9$ ($\lozenge$), from top to bottom, with $s=0.3$ and $K_0 = 50$. Red dashed lines are predictions of equations (11) and (12). (b) $\tau$ against $\nu_T$, for $\delta_T = 0$ ($\bigtriangledown$), $0.3$($\square$), $0.5$ ($\bigtriangleup$) from top to bottom, with $s=0.1$ and $K_0 = 500$. Any bias $\delta_T\neq0$, reduces $\tau$ . Error bars (dark grey) are overlaid for the case $\delta_T = 0$ and almost indistinguishable from the symbols; see text and SM4 in [87]. Red dashed lines are analytical predictions in the limiting regimes $\nu_T\to 0,\infty$ (equation (S4) in [87] with same time-averaging process of rates as in section 3.1). (c) $\tau$ against $K_0$ under fast T-EV in the coexistence regime for $\delta_T = 0$, $s=0.1$ ($\bigtriangleup$) and $s=0.3$ ($\bigtriangleup$). Here, there is long-lived coexistence of the strains at the (meta-)stable equilibrium $x^* = x_0 = 0.5$ prior to fixation. The MFT grows exponentially when $K_0 s^2\gg 1$, see section SM2 in [87]. Red dashed lines show the analytical predictions for the MFT when $\nu_T\to\infty$ (equation (S4) in [87] with equation (8)), compared with the predictions of equation (14) (black lines) and simulation results (markers) for $\nu_T = 100$.

Standard image High-resolution image

The MF analysis and results of figure 2 suggest that under sufficiently high switching rate $\nu_T$ there is long-lived coexistence of the strains. We can rationalise this picture by noting that in the regime of dominance of one strain the MFT scales sublinearly with the population size $N$ , while the MFT grows superlinearly (exponentially when $N = K_0\gg1$, see figure 2(c)) in the regime of long-lived coexistence [82, 102, 110, 111]. The dominance and long-lived coexistence scenarios are separated by a regime where the MFT scales with the population size, i.e. $\tau\sim N$, where the dynamics is governed by random fluctuations. This leads us to consider that long-lived coexistence of the $R$ and $S$ strains arises whenever the MFT exceeds $2\langle N \rangle$, i.e. when $\tau\gt2\langle N \rangle$, where $\langle N \rangle$ is the mean population size at (quasi-)stationarity; see below 5 . This is illustrated in the provided videos of [112] commented in section SM7 of [87]. When, as in this section, $N = K_0$ or $N$ fluctuates about the constant carrying capacity $K_0$ ($N\approx K_0$), we simply have $\langle N \rangle = K_0$. The criterion $\tau\gt2\langle N \rangle = 2K_0$ thus prescribes that long-lived coexistence occurs when the MFT scales superlinearly with $K_0$ and hence exceeds the double of the average population size, $2K_0\gg 1$.

The conditions under which the long-lived coexistence criterion, $\tau\gt2\langle N \rangle$, is satisfied can be estimated by noting that, from the MF analysis, we expect coexistence to occur when $\xi_T$ self-averages under sufficiently high switching rate $\nu_T$. Since the average number of T-switches by $t = 2\langle N \rangle$ scales as $\nu_T \langle N \rangle$, self-averaging occurs when $\nu_T \langle N \rangle\gg 1$. We thus consider that there is fast T-EV switching when $\nu_T \gg 1/\langle N \rangle$, while $\nu_T \ll 1/\langle N \rangle$ corresponds to the slow T-EV regime. To ensure long-lived coexistence, the necessary condition $\nu_T \gg 1/\langle N \rangle$ is supplemented by the requirement that $s\sim 1$. This ensures enough EV and a regime of coexistence where the MFT is generally $\tau \sim e^{c\langle N \rangle}$ (where $c$ is some positive constant) when $s = {\cal O}(1)$ [41, 42, 102, 108110, 113] guaranteeing $\tau\gt2\langle N \rangle$.

Hence, the expected conditions for long-lived coexistence are $\nu_T \gg 1/\langle N \rangle$ (fast T-switching) and $s = {\cal O}(1)$ (enough EV), which are satisfied in the examples considered here when $\nu_T \sim 1, s\sim 1$ or greater, and $\left\langle N \right\rangle\gg 1$.

We have studied the influence of T-EV on the fixation and coexistence properties of the model with constant carrying capacity $K = K_0$ and selection strength $s$ by running a large number of computer simulations up to a time $t = 2K_0$ across the $\nu_T-\delta_T$ parameter space. When just after $t = 2K_0$ both species are present, the run for $(\nu_T,\delta_T,s)$ is characterised by long-lived coexistence which is RGB coded $(0, 1, 0)$. There is no long-lived coexistence for the run $(\nu_T,\delta_T)$ if one of the species fixates by $t\unicode{x2A7D} 2K_0$: either the strain $R$ , which is RGB coded $(1,0,0)$, or the strain $S$ , which is coded by $(0,0,1)$. This procedure is repeated for 103 realisations for different $(\nu_T,\delta_T)$ and, after sample averaging, yields the RGB-diagram of figures 3(a)–(c); see section SM4 in [87]. In greyscale, the RGB coding translates into red $\rightarrow$ grey, blue $\rightarrow$ charcoal, and green $\rightarrow$ light grey. In what follows, the crossover regimes are coded in magenta and faint green with dark grey and faint light grey as their respective greyscale counterparts, see below.

It is also useful to study the effect of the T-EV in the realm of the MA by means of numerically exact results. For this, with the transition rates equation (6), we notice that when $N = K_0$ is constant and there are initially $n$ cells of type $R$ , the $R$ -strain fixation probability, $\phi_n^{\xi_T}$, in the environmental state $\xi_T$ satisfies the first-step analysis equation [53, 99, 101]

Equation (13)

subject to the boundary conditions $\phi_0^{\xi_T} = 0$ and $\phi_N^{\xi_T} = 1$. The MFT in the environmental state $\xi_T$ , $\tau_n^{\xi_T}$, satisfies a similar equation:

Equation (14)

with boundary conditions $\tau_0^{\xi_T} = \tau_N^{\xi_T} = 0$. Equations (13) and (14) are thus solved numerically, and the fixation probability and MFT are obtained after averaging over the stationary distribution of $\xi_T$, yielding

Equation (15)

In our examples, we always consider $x_0 = 1/2$, and henceforth write $\phi_{\textrm{MA}}(N)\equiv\phi_{N/2}$ for the $R$ -fixation probability and $\tau_{\textrm{MA}}(N)\equiv\tau_{N/2}$ for the MFT in the realm of the MA. For each triple $(\nu_T,\delta_T,s)$, we numerically solved equation (14) and, in the region of the the parameter space where $\tau_{\textrm{MA}}(N)\gt 2K_0$, there is long-lived coexistence, which is coded by $(0,1,0)$ in the RGB-diagram of figures 3(d)–(f). When $\tau_{\textrm{MA}}(N)\unicode{x2A7D} 2K_0$, there is dominance of one of the species, characterised by the fixation probabilities $\phi_{\textrm{MA}}(N)$ and $1-\phi_{\textrm{MA}}(N)$ of $R$ and $S$ , respectively, obtained from equation (13) and coded by $(\phi_{\textrm{MA}}(N),0,1-\phi_{\textrm{MA}}(N))$ in figures 3(d)–(f).

Figure 3.

Figure 3. Fixation/coexistence diagrams under T-EV in the $(\nu_T,\delta_T)$ parameter space for a small system of constant carrying capacity $K_0 = 50$, with selection bias $s=0.1$ (a) and (d), $s=1$ (b) and (e), and $s=10$ (c) and (f), after a time $t = 2K_0$. (a)–(c): phase diagrams obtained from stochastic simulations of the model with a constant $K_0$ ( $N$ fluctuates about $K_0$ ) over 103 realisations and coded according to the RGB colourmap of panel (g): red / blue (grey / charcoal) corresponds to the likely fixation of $S/R$ (red (grey): $S$ dominance; blue (charcoal): $R$ dominance), regions indicated as '$S/R$ fixation' in panel (a); magenta (dark grey) indicates where fixation of $R$ or $S$ is likely, area between '$S/R$ fixation' regions in panel (a); green (light grey) indicates where long-lived coexistence is most likely, area highlighted as ' $S+R$ coex.' in panel (c). (d)–(f): same as in (a)–(c) but from numerically exact solutions of equation (15) for the corresponding Moran process with a constant population size $N = K_0$, see text.

Standard image High-resolution image

Exact numerical results for the MA with $N = K_0$ in figures 3(d)–(f) are in excellent agreement with those of simulations obtained for $K = K_0$ in figures 3(a)–(c). In line with the MF analysis, we find that long-lived coexistence, occurs for T-EV of sufficiently large magnitude, i.e. $s\sim 1$ or higher, and under high enough switching rate, i.e. $\nu_T\sim 1$ or higher, shown as green (light grey) areas in figure 3. The region of coexistence separates regimes dominated by either species, especially at high $\nu_T$ when $\phi \approx 0$ where ${\delta_T}>{0}$ while $\phi \approx 1$ when $\delta_T\lt0$. In figure 3, the boundaries between the regimes of $R/S$ dominance, coded in blue (charcoal) / red (grey), and coexistence, areas in green (light grey)), are interspersed by crossover regimes where both species are likely to fixate (magenta (dark grey) in figure 3), or coexist with probability between 0 and 1 (faint green (faint light grey) in figure 3), as coded in figure 3(g).

4. Twofold environmental variability: coexistence and fixation under time-varying fitness and switching carrying capacity

We have seen that under a constant carrying capacity, long-lived coexistence of the strains is feasible when $s$ and $\nu_T$ are of order 1 or higher (enough T-EV and fast T-switching). We now study how this picture morphs when, in addition to the time-variation of $f_S$ and $\overline{f}$, the carrying capacity $K(t)$ switches according to equation (1) and drives the fluctuating population size $N$ . EV is thus twofold, and the population evolves under the joint effect of T-EV and K-EV.

We consider $K(t)\in\{K_-,K_+\}$ with $1\ll K_-\lt K_+$, and in the first instance assume that $N$ is always sufficiently large to allow us to neglect the DN, yielding [57, 6163, 66, 99, 106]

Equation (16a)

Equation (16b)

where $N$ is independent of $s$ and affected only by K-EV via $\xi_K$ in equation (1), while the evolution of $x$ in equation (16b) is impacted by $\xi_K$ , $\xi_T$, and $s$ via $x = N_R/N$ and $\overline{f}(t) = x+(1-x)\exp(s\xi_T$). The population composition is hence coupled to the evolution of the population size (eco-evolutionary dynamics), while the statistics of $N$ , like its average, denoted by $\langle N\rangle$, are obtained by ensemble averaging over $\xi_K$ . The stochastic logistic differential equation equation (16a) defines an $N$ -PDMP whose properties allow us to characterise the distribution of $N$ [56, 57, 61, 106].

As discussed in [57, 6163], the (marginal) stationary probability density function (PDF) $p(N)$ of the $N$ -PDMP equation (16a), while ignoring DN, provides a useful approximation of the actual quasi-stationary population size distribution (QPSD). Here, the stationary PDF is [57, 6163, 9698]

Equation (17)

of support $[K_-,K_+]$, with the normalisation constant $\mathcal{Z}$ ensuring that $\int_{K_-}^{K_+} p(N)~\mathrm{d}N = 1$.

4.1.  N-PDMP approximation

The PDF $p(N)$ captures well the main effects of the K-EV on the QPSD, which is bimodal under low $\nu_K$ and becomes unimodal when $\nu_K\gg 1$, see figure 4. In the realm of the $N$ -PDMP approximation, $p(N)$ aptly reproduces the location of the QPSD peaks and the transition from a bimodal to unimodal distribution as $\nu_K$ increases: The distribution is sharply peaked around $N\approx K_{\pm}$ when $\nu_K \to 0$ (with probability $(1\mp \delta_K)/2$), flattens when $\nu_K\sim 1$, and then sharpens about $N\approx \mathcal{K}\equiv K_0(1-\gamma^2)/(1-\gamma\delta_K)$ when $\nu_K \to \infty$. Since $p(N)$ ignores DN, it cannot capture the width of the QPSD about the peaks, but it provides an accurate description of the mean population size, see figure 4, that is well approximated by

Equation (18)

with $\langle N\rangle\approx K_0(1+\gamma\delta_K)$ when $\nu_K\ll 1$ and $\langle N\rangle\approx \mathcal{K}$ when $\nu_K\gg 1$ [57, 6163], as shown in figure 4.

Figure 4.

Figure 4. Long-time average population size $\langle N\rangle$ versus the K-EV average switching rate $\nu_K$ . Symbols are from simulations (averaged over 103 realisations at time $t = 2\langle K\rangle$), the solid black line shows the PDMP prediction equation (18). For fixed $\delta_K$, $\langle N\rangle$ decreases with $\nu_K$ , and $\langle N\rangle\approx \langle K\rangle = K_0(1+\gamma\delta_K)$ when $\nu_K\ll 1$ while $\langle N\rangle\approx \mathcal{K}$ when $\nu_K\gg 1$ (red horizontal dashed lines). Insets show the PDMP PDF equation (17) under low switching rate $\nu_K$ (left) and for $\nu_K\gg 1$ (right); dashed vertical lines are eye-guides indicating the corresponding values of $\nu_K$ , where for low $\nu_K$ the PDMP PDF is indistinguishable in either case. Parameters are: $K_0 = 1000$, $\gamma=0.5$ , and $\delta_K = 0.0$. See text for details.

Standard image High-resolution image

The PDF $p(N)$ is particularly useful to obtain the fixation/coexistence diagrams under the effects of both T-EV and K-EV. Theoretical/numerical predictions of the fixation and coexistence probabilities can indeed be derived in the vein of [57, 6163, 66] by focusing on situations where coexistence occurs when $x$ and $N$ relax on similar timescales. Long-lived coexistence of the strains thus arises when $s\sim 1$, with fixation typically occurring after $N$ has settled in the QPSD, see section SM7 in [87] and videos in [112]. Hence, for the analytical description of the fixation/coexistence diagrams, the $R$ fixation probability (with $x_0 = 1/2$) can be suitably approximated by averaging $\phi_{\textrm{MA}}(N)$ over $p(N)$ as follows:

Equation (19)

where $\phi_{\textrm{MA}}(N)$ is obtained from solving the corresponding equation (13) for the $R$ fixation probability of the associated Moran process, as seen in section 3.2.

We can use the PDF $p(N)$ and the results for the MFT $\tau_{\textrm{MA}}(N)$, obtained from solving equation (14), to determine the probability of coexistence in the realm of the $N$ -PDMP approximation. For this, we first solve equation (14) for $\tau_{\textrm{MA}}(N^*) = 2\langle N\rangle$, where $\langle N\rangle$ is given by equation (18). Since $\tau_{\text{MA}}$ is an increasing function of $N$ , see figure 2(c), we have $\tau_{\textrm{MA}}(N)\gt2\langle N\rangle$ for all $N\gt N^*$, which is the long-lived coexistence condition. Within the $N$ -PDMP approximation, the lowest possible value of $N^*$ is $K_-$ (since $N\in [K_-,K_+]$). We then determine the probability $\eta$ that this condition is satisfied by integrating $p(N)$ over $[\textrm{max}(N^*,K_-),K_+]$:

Equation (20)

where $N^*$ depends on both T-EV and K-EV (via $\left\langle N \right\rangle$), while the integrand depends only on K-EV. Clearly, $\eta \rightarrow 1$ when $N^*\to K_-$. Hence, long-lived coexistence is almost certain when $N^*\approx K_-$, i.e. whenever the mean-fixation time of the population of fixed size $N = K_-$ exceeds $2\left\langle N \right\rangle$. Based on the results of section 3.2, $\eta$ increases with $\nu_T$ and $s$ , and thus for sufficiently large $\nu_T$ and $s$ (but not too large $|\delta_T|$ ), we expect $N^*\to K_-$ and $\eta \rightarrow 1$ .

4.2. Fixation/coexistence diagrams under T-EV and K-EV

The fixation/coexistence diagrams under joint effect of T-EV and K-EV are obtained as in section 3.2, with the difference that long-lived coexistence arises when $t\gt2\left\langle N \right\rangle$, a condition that depends on $(\nu_K,\delta_K)$, see figure 2(c). In our simulations, we considered different values of $\nu_K$ (letting $\delta_K = 0$ for simplicity), and ran simulations until $t = 2\left\langle N \right\rangle$. Each run in which both species still coexist just after $t = 2\left\langle N \right\rangle$ are RGB (greyscale) coded $(0,1,0)$, whereas those in which $R$ or $S$ fixates by $t\unicode{x2A7D} 2\left\langle N \right\rangle$ are respectively RGB (greyscale) coded $(1,0,0)$ or $(0,0,1)$. The RGB (greyscale) fixation/coexistence diagrams of figures 5(a)–(c) are obtained after sample-averaging the outcome of this procedure, repeated 103 times for each pair $(\nu_T,\delta_T)$ and different values of $\nu_K$ .

Figure 5.

Figure 5. Fixation/coexistence diagrams under T-EV and K-EV in the $(\nu_T,\delta_T)$ parameter space showing the influence of K-switching rate $\nu_K$ on the fixation and coexistence probabilities, for $\nu_K = 5\times 10^{-6}$ (a) and (d), $\nu_K = 5\times 10^{-3}$ (b) and (e), and $\nu_K = 5$ (c) and (f). Other parameters are $K_0 = 1200$, $s=0.5$ , $\gamma = 2/3$, $\delta_K = 0$. (a)–(c): phase diagrams obtained from stochastic simulations data collected at $t = 2\langle N\rangle$ over 103 realisations. (d)–(f): same as in (a)–(c) but from the theoretical predictions based on equations (19) and (20), see text for details. All diagrams are colour-coded (greyscale-coded) as in figure 3.

Standard image High-resolution image

Theoretical RGB (greyscale) diagrams are obtained from the $N$ -PDMP based approximation built on equations (19) and (20): for a given $\nu_K$ , we allocate the RGB (greyscale) value $((1-\eta)(1-\phi), \eta, (1-\eta)\phi)$ obtained for each pair $(\nu_T,\delta_T)$ of the diagram, see figures 5(d)–(f). This triple corresponds to the probability of having, by $t = 2\left\langle N \right\rangle$, either no long-lived coexistence (with probability $1-\eta$) and fixation of $R$ or $S$ (with respective probabilities $\phi$ and $1-\phi$), or long-lived coexistence (with probability $\eta$ ). In practice, equations (19) and (20) have been used for relatively small systems whereas an equivalent, but more efficient, method was used for large systems, see section SM4 in [87].

The comparison of the top and bottom rows of figure 5 shows that the theoretical RGB (greyscale) diagrams quantitatively reproduce the features of those obtained from simulations. In general, we find that coexistence regions are brighter in diagrams obtained from $N$ -PDMP based approximation than in those stemming from simulations. This difference stems from former ignoring demographic fluctuations which slightly broaden the crossover (magenta (dark grey) and faint green (faint light grey)) regimes in the latter.

The regions of figure 5 where $|\delta_T|\to 1$ are characterised by dominance of one of the strains, and essentially reduces to the model studied in [57, 61, 63], and we can therefore focus on characterising the coexistence phase.

When $K_0$ is large, under sufficient EV ( $s=0.5$ , $\gamma = 2/3$ in figure 5), the joint effect of T-EV and K-EV on the phase of long-lived coexistence in the RGB (greyscale) diagrams of figure 5 can be summarised as follows: (i) when $\nu_K\to 0$, a (bright green) region where $\eta\approx 1$ and coexistence is almost certain is surrounded by a faint green (faint light grey) 'outer shell' where coexistence is possible but not certain ($0\lt\eta\lt1$), see figures 5(a) and (d); (ii) at low, but non-vanishingly small, values of $\nu_K$ , the outer-shell where $0\lt\eta\lt1$ fades, and there is essentially only a bright green (bright light grey) region of coexistence where $\eta\approx 1$ , see figures 5(b) and (e); (iii) when $\nu_K\gg 1$, the coexistence region corresponds essentially to $\eta\approx 1$ (bright green / bright light grey) and is broader than under low $\nu_K$ , figures 5(c) and (f). In all scenarios (i)–(iii), $\eta$ increases with $\nu_T\gtrsim 1$ (for not too large $|\delta_T|$ ) and hence all the green (bright and faint light grey) coexistence phases in figure 5) become brighter as $\nu_T$ is raised and $\eta \rightarrow 1$ .

These different scenarios can be explained by the dependence of the QPSD on $\nu_K$ , well captured by the PDF equation (17). In regime (i) where $\nu_K \ll 1/K_0$, the QPSD and $p(N)$ are bimodal, $N\approx K_{\pm}$ with probability $(1\pm \delta_K)/2$, and any K-switches by $t = 2\left\langle N \right\rangle \sim K_0$ are unlikely, yielding the faint green (faint light grey) outer shell of figures 5(a) and (d) corresponding to long-lived coexistence arising only when $N\approx K_+$, with a probability $\eta\approx (1+\delta_K)/2$. In regime (ii), where $1/K_0\ll \nu_K \ll 1$, the QPSD and $p(N)$ are still bimodal but some K-switches occur by $t\sim K_0$, resulting in long-lived coexistence arising almost only when $\nu_T$ is high enough to ensure $\eta \approx 1$ when $N\approx K_-$. In regime (iii), where $\nu_K\gg 1$ the QPSD and $p(N)$ are unimodal with average $\left\langle N \right\rangle\approx {\cal K}\unicode{x2A7E} K_-$, which results in a long-lived coexistence region where $\eta \approx 1$ that is broader than in (i) and (ii), figures 5(c) and (f). The size of the coexistence region in regime (iii) actually depends nontrivially on $\nu_K$ , as revealed by the modal value of the PDF equation (17) when $\nu_K(1-|\delta_K|)\gt1$, which reads

Equation (21)

with $\lim_{\nu_K\to \infty} \hat{N} = \left\langle N \right\rangle = \mathcal{K}$. We notice that $\hat{N}$ is an increasing function of $\nu_K$ when $\gamma\gt\delta_K$, and it decreases if $\gamma\lt\delta_K$ (remaining constant when $\gamma = \delta_K$). As a consequence, the long-lived coexistence region under high K switching rate grows with $\nu_K$ when $\gamma\gt\delta_K$, as in figures 5(c) and (f), and, when $\gamma\lt\delta_K$, shrinks as $\nu_K$ is increased, see section SM6 figure (S3) in [87].

4.3. Influence of the K-EV amplitude on coexistence

We have seen that increasing the selection bias $s$ , raises the amplitude of the T-EV and facilitates the emergence of long-lived coexistence. Here, by keeping $K_0$ constant, we investigate the influence of the parameter $\gamma$ , which controls the amplitude of K-EV, on the fixation/coexistence diagrams. When $\gamma \rightarrow 1$ and $K_0\gg 1$, there is K-EV of large amplitude, with the population subject to a harsh population bottleneck ($K_-\to 0$) accompanied by strong demographic fluctuations. The latter facilitate fixation of either strain and counter the effect of T-EV that drives the community to coexistence. Results of figure 6 illustrate the influence of $\gamma$ under low and high K-switching rate ($\delta_K = 0$):

  • Under low $\nu_K$ , the probability of long-lived coexistence $\eta$ decreases together with the value of $K_- = K_0(1-\gamma)$ when $\gamma$ is increased (all other parameters being kept fixed). As a consequence, the bright green (bright light grey) region in figure 6(a) where long-lived coexistence is almost certain ( $\eta \approx 1$ ) shrinks with $\gamma$ and is gradually replaced by a faint green (faint light grey) area where coexistence occurs with a lower probability ($\eta = (1+\delta_K)/2\lt 1$), see figures 6(b) and (c).
  • Under high $\nu_K$ , we have $N\approx \mathcal{K}$ and the effect of $\gamma$ is encoded in the expression of $\mathcal{K} = K_0 (1-\gamma^2)/(1-\gamma\delta_K)$. When $\delta_K\unicode{x2A7D} 0$, $\mathcal{K}$ and $\eta$ decrease with $\gamma$ , and as a result the bright green (bright light grey) region in figure 6(d) shrinks and is eventually replaced by a smaller faint green (faint light grey) region where coexistence is possible but not certain ($0\lt\eta\lt 1$), see figures 6(e) and (f). When $\delta_K\gt 0$, there is a bias towards $K = K_+$ and $\mathcal{K}$ increases with $\gamma$ until $\gamma = \bar{\gamma}\equiv(1-\sqrt{1-\delta_K^2})/\delta_K$ and then decreases, with $\mathcal{K}\lt K_0$, when $\gamma\gt\delta_K$. This results in a non-monotonic dependence of the coexistence region where $\eta \approx 1$ : under $\nu_K\gg 1$ and $\delta_K\gt0$, the long-lived (bright-green) coexistence region grows with $\gamma$ up to $\bar{\gamma}$ and shrinks when $\gamma\gt \bar{\gamma}$.

Figure 6.

Figure 6. Fixation/coexistence diagrams under T-EV and K-EV in the $(\nu_T,\delta_T)$ parameter space showing the effect of the amplitude of K-EV $\gamma$, on the fixation and coexistence probabilities when $K_0 = 500$ is kept fixed, for $\gamma = 0.65$ ($K_- = 175$, $K_+ = 825)$ (a) and (d), $\gamma = 0.8$ ($K_- = 100, K_+ = 900$) (b) and (e), and $\gamma = 0.95$ ($K_- = 25, K_+ = 975$) (c) and (f). Other parameters are $s=1$ , $\delta_K = 0$, $\nu_K = 10^{-3}$ in (a)–(c) and $\nu_K = 10$ in (d)–(f). Phase diagrams obtained from stochastic simulations data collected at $t = 2\langle N\rangle$ over 103 realisations. All diagrams are colour-coded (greyscale-coded) as in figure 3.

Standard image High-resolution image

We have thus found that the environmental fluctuations have opposite effects on the species coexistence: increasing the amplitude of T-EV (by raising $s$ ) prolongs the coexistence of the strains and expands the coexistence region, but raising the amplitude of K-EV (by raising $\gamma$ ) can significantly reduce the probability of long-lived coexistence for all values of $\nu_K$ .

5. Make-up of the coexistence phase and strains average abundance

Having characterised in detail the conditions under which long-lived coexistence and fixation occur, we now study the make-up of the coexistence phase and then use this result to determine the stationary average abundance of each strain.

5.1. Coexistence phase make-up

We are interested in the characteristic fraction of the resistant strain $R$ in the coexistence phase, here defined as $x^*$. This is the fraction of $R$ expected, given that we have coexistence at $t = 2\left\langle N \right\rangle$. According to the MF theory, the fraction of the strain $R$ in the coexistence phase is given by the expression equation (10) of $x^*$. It turns out that deep into the coexistence region whereby $\eta \approx 1$ and $\nu_T$ is sufficiently high, there is good agreement between theory and simulations, see figures 7(a) and (b). In addition, even when $\eta < 1$ , the MF prediction $x^*$ remains remarkably close to the value of fraction of $R$ measured in the coexistence state obtained in simulations, with small deviations arising as $\eta$ approaches 0. We notice that the characteristic fraction of $R$ , for given $\delta_T$ , is almost independent of $\nu_T$ .

Figure 7.

Figure 7. Make-up of the coexistence state: fraction of the resistant strain $R$ in the coexistence phase as function of $\nu_T$ and $\delta_T$ ; from simulation results (a) and predictions of equations (10) and (20) in (b), respectively for $x^*$ and $\eta$ . The colourbar (brightness bar) gives the characteristic fraction of the $R$ strain in the region of the $\nu_T - \delta_T$ parameter space where $\eta > 0.01$ . Simulation results have been obtained just after $t = 2\langle N\rangle$ and averaged over 104 realisations. Parameters are $K_0 = 500$, $\gamma = 0.5$ , $\nu_K = 100$, and $s=1$ .

Standard image High-resolution image

We can also predict the fraction of $R$ regardless of coexistence or fixation, here denoted by $\left\langle x \right\rangle$. The quantity $\left\langle x \right\rangle$ thus characterises the fraction of $R$ in the coexistence, fixation, and crossover regime where both coexistence and fixation are possible, with respective probabilities $\eta$ and $\phi$ , but neither is certain. Making use of equations (10), (19) and (20) we thus define $\left\langle x \right\rangle$ as

Equation (22)

This captures well the dependence of $\left\langle x \right\rangle$ on $\nu_T$ and reduces to the fraction of $R$ in the coexistence phase, $\left\langle x \right\rangle = x^*$, when $\eta \approx 1$ and long-lived coexistence is almost certain (see SM5, figure S2). As shown in section SM5 of [87], a closed-form alternative to $\left\langle x \right\rangle$ is provided by the modal value of the stationary PDF of the PDMP defined by equation (7), which, while less accurate than $\left\langle x \right\rangle$, matches qualitatively well to simulations.

5.2. Strain average abundance

In this section, we study the (quasi-)stationary average abundance of the strains $R$ and $S$ , respectively denoted by $\left\langle N_R \right\rangle$ and $\left\langle N_S \right\rangle$. Since $\left\langle N_S \right\rangle = \left\langle N \right\rangle-\left\langle N_R \right\rangle$, and $\left\langle N \right\rangle$ is well described by equation (18), see figure 4, we only need to focus on studying $\left\langle N_R \right\rangle$.

In fact, while the evolution of N is governed by K-EV and is well-captured by the stochastic logistic equation (16a) and the corresponding $N$ -PDMP, the dynamics of the abundance of the $R$ strain depends on both T-EV and K-EV. In the MF limit, where demographic fluctuations are neglected, we indeed have [99]

which is a stochastic differential equation depending on both $\xi_K$ and $\xi_T$ , and coupled to the $N$ - and $x$ -PDMPs defined respectively by equations (16a) and (16b). In the dominance regimes, $\left\langle N_R \right\rangle \approx 0$ ( $S$ dominance) or $\left\langle N_R \right\rangle \approx\left\langle N \right\rangle$ ( $R$ dominance), which can be obtained from equation (18). However, finding $\left\langle N_R \right\rangle$ in the coexistence phase is a nontrivial task. Progress can be made by noticing that, $\xi_K$ and $\xi_T$ being independent, we can write

Equation (23)

where $\left\langle N \right\rangle\eta x^*$ is the contribution to $\left\langle N_R \right\rangle$ when there is coexistence (with probability $\eta$ ), and $\left\langle N \right\rangle(1-\eta)\phi$ is the contribution arising when there is fixation of the strain $R$ (with probability $(1-\eta)\phi$). In our theoretical analysis, $x^*, \left\langle N \right\rangle, \phi$ and $\eta$ are obtained from equations (10) and (18)–(20). Equation (23) thus captures the behaviour of $\left\langle N_R \right\rangle$ in each regime: the dominance regime where $\eta \approx 0$ and we have $\left\langle N_R \right\rangle\approx\left\langle N \right\rangle\phi$, deep in the coexistence phase where we have $\eta \approx 1$ and $\left\langle N_R \right\rangle\approx \left\langle N \right\rangle x^*$, and where $0\lt\eta\lt 1$ and coexistence is possible but not certain where we have $\left\langle N_R \right\rangle \approx \left\langle N \right\rangle\left\langle x \right\rangle$.

In figure 8, we find that the theoretical predictions based on equation (23) agree well with simulation results over a broad range of $\nu_K$ and $\nu_T$ , and for different values of $\delta_K$ and $\delta_T$ . The dependence of $\left\langle N_R \right\rangle$ on $\nu_K$ reflects that of $\left\langle N \right\rangle$ shown in figure 4: $\left\langle N_R \right\rangle$ decreases with $\nu_K$ at fixed $\delta_K$ , see figure 8(a), and we have $\left\langle N \right\rangle\approx {\cal K}$ when $\nu_K\to \infty$ yielding $\left\langle N_R \right\rangle\approx {\cal K}x^*$ deep in the coexistence phase where $\nu_T\gg 1$, and similarly $\left\langle N \right\rangle\approx K_0 (1+\gamma\delta_K)$ when $\nu_K\to 0$ yields $\left\langle N_R \right\rangle\approx K_0 (1+\gamma\delta_K) x^*$. Not shown in figure 8(a) is the case of $\nu_T\ll1$, whereby we have only dominance such that $\left\langle N_R \right\rangle\approx\left\langle N \right\rangle(1-\delta_T)/2$. Figure 8(b) shows that the dependence of $\left\langle N_R \right\rangle$ on $\nu_T$ can be non-monotonic and exhibit an extreme dip ($\delta_T\gt0$) or peak ($\delta_T\lt0$) at intermediate T-switching rate, $\nu_T\sim 1$. This behaviour can be understood by referring to the diagrams of figure 6: as $\nu_T$ is raised from $\nu_T = 0$ with $\delta_T\lt0$ kept fixed, the $R$ fixation probability first slowly increases across the slightly $R$ -dominant phase where coexistence is unlikely ( $\eta \approx 0$ ) and $\left\langle N_R \right\rangle\approx \left\langle N \right\rangle\phi$. When $\nu_T$ is increased further and $R$ is the strongly dominant species (blue (charcoal) phases in figure 6), with $\phi \approx 1$ and $\left\langle N_R \right\rangle\approx \left\langle N \right\rangle$ is maximal; coexistence then becomes first possible ($0\lt\eta\lt1$, faint green (faint light gray) in figure 6) and then almost certain ( $\eta \approx 1$ , bright green (bright light gray) in figure 6) when $\nu_T$ is increased further, which results in a reduction of the $R$ abundance to $\left\langle N_R \right\rangle\approx \left\langle N \right\rangle x^*\lt\left\langle N \right\rangle$. A similar reasoning holds for the $S$ strain when $\delta_T\gt0$ and results in a maximal value $\left\langle N_S \right\rangle\approx \left\langle N \right\rangle$ and therefore a dip of the $R$ abundance, with a minimal value $\left\langle N_R \right\rangle\approx 0$, when $\nu_T\sim 1$.

Figure 8.

Figure 8. Long-time average $R$ abundance $\langle N_R \rangle$ as function of the average switching rate of the $T/K$-EV. Solid lines are theoretical predictions of equation (23) with $x^*$, $\langle N\rangle$, $\phi$ and $\eta$ given by equations (10) and (18)–(20); symbols are from simulation data. (a) $\langle N_R \rangle$ versus $\nu_K$ for $\delta_K = 0.5$ ($\mathbf{\times}$), $\delta_K = 0$ ($\mathbf{\bigcirc}$) and $\delta_K = -0.5$ ($\mathbf{\bigtriangledown}$). Limiting value are plotted for $\nu_K\rightarrow0,\infty$ as dotted lines. Other parameters are: $K_0 = 500$, $\gamma = 0.5$ , $s=1$ , $\nu_T = 10$, and $\delta_T = 0.0$. (b) $\langle N_R \rangle$ versus $\nu_T$ for $(\delta_T,\nu_K) = (-0.2,0.01)$ ($\bigtriangleup$), $(\delta_T,\nu_K) = (-0.2,10)$ ($\bigtriangleup$),$(\delta_T,\nu_K) = (0.2,0.01)$ ($\bigtriangleup$), $(\delta_T,\nu_K) = (0.2,10)$ ($\lozenge$). Limiting value are plotted for $\nu_T\rightarrow0,\infty$ as dotted lines. Other parameters are: $K_0 = 500$, $\gamma =0.5$ , $s=1$f, and $\delta_K = 0.0$. Simulations data have been collected and sample-averaged after $t = 2\langle K\rangle$ over 102 realisations. See text for details.

Standard image High-resolution image

The results of this section hence show that the twofold EV has nontrivial effects on the make-up of the coexistence phase, and on the average number of cells of each strain, as shown by figure 7 and the nonmonotonic dependence of $\left\langle N_R \right\rangle$ on $\nu_T$ in figure 8.

6. Conclusion

Microorganisms live in environments that unavoidably fluctuate between mild and harsh conditions. EV can cause endless changes in the concentration of toxins and amount of available nutrients, and thus shapes the eco-evolutionary properties of microbial communities including the ability of species to coexist. Understanding under which circumstances various microbial species can coexist, and how their coexistence and abundance vary with environmental factors, is crucial to shed further light on the mechanisms promoting biodiversity in ecosystems and to elucidate the evolution of AMR.

Motivated by these considerations, and inspired by the AMR evolution in a chemostat setup, we have studied the eco-evolutionary dynamics of an idealised microbial community of fluctuating size consisting of two strains competing for the same resources under twofold EV (T-EV and K-EV): the level of toxin and the abundance of nutrients in the community both vary in time. One of the strains is resistant while the other is sensitive to the drug present in the community, and both compete for the same resources.

EV is thus assumed to affect the strains growth and death rates, and is modelled by means of binary randomly time-switching fitness (T-EV) and carrying capacity (K-EV). Under harsh conditions, the level of toxin is high and resources are scarce, while environmental conditions are mild when the level of toxin is low and resources are abundant. In this setting, the strain resistant to the drug has a selective advantage under high toxin-level, whereas it is outgrown by the sensitive strain when the level of toxin is low. Moreover, the time-switching carrying capacity drives the fluctuating size of the microbial community, which in turn modulates the amplitude of the demographic fluctuations, resulting in their coupling with the variation of the available resources. When the environment is static, there is no lasting coexistence since one species dominates and rapidly fixates the entire population.

Here, we have shown that this picture changes radically in fluctuating environments: we have indeed found that long-lived species coexistence is possible in the presence of environmental fluctuations. Using stochastic simulations and the properties of suitable piecewise-deterministic and Moran processes, we have computationally and analytically obtained the fixation-coexistence phase diagrams of the system. These have allowed us to identify the detailed environmental conditions under which species coexist almost certainly for extended period of times, and the phases where one species dominates, as well as the crossover regimes where both coexistence and fixation are possible but not guaranteed. We have found that long-lived coexistence requires sufficient variation of the toxin level, while resource variability can oppose coexistence when strong K-EV leads to population bottlenecks responsible for large demographic fluctuations facilitating fixation. More generally, our analysis has allowed us to assess the influence of the population size distribution, whose shape changes greatly with the rate of K-EV, on the fixation-coexistence phase diagram. We have also determined how the make-up of the coexistence phase and average abundance of each strain depend on the rates of environmental change.

EV generally comes about in many forms in a variety of settings throughout biology and ecology, and the conundrum of coexistence within a system is impacted by it, alongside demographic fluctuations. This leads to complex eco-evolutionary dynamics. In particular, how microbial communities evolve subject to EV is vital when considering the issue of AMR, so that the effectiveness of treatments can be maximised, while minimising the harmful effects. In considering twofold environmental variations, we have shown that these can have qualitative effects on the population evolution as they can either promote or jeopardise lasting species coexistence.

In summary, our analysis allows us to understand under which circumstances environmental variability, together with demographic fluctuations, favours or hinders the long-lived coexistence of competing species, and how it affects the fraction and abundance of each strain in the community. This work hence contributes to further elucidate the role of fluctuations on the maintenance of biodiversity in complex ecosystems.

In particular, our findings demonstrate the influence of environmental fluctuations on biodiversity in microbial communities, and may thus have potential impacts on numerous applications. For instance, the model studied here is well suited to describe the in vitro evolution of antimicrobial resistance in a chemostat setup where the level of antibiotics would fluctuate below and above the MIC. In this context, the model is able to predict, under a broad range of external constraints, the best conditions to avoid the fixation of the strain resistant to the drug and when both strains coexist. A more realistic model of AMR evolution would take into account that the drug resistance is often mediated by a form of public goods [36, 79], and that there may exist more than two competing species and various toxins. The eco-evolutionary dynamics of communities consisting of multiple species, resources and toxins can generally not be simply inferred from those of two-species eco-systems, even though in some cases simple models can be illuminating [65]. Another potential application of the model considered here, with varying drug levels, concerns the so-called adaptive therapy used in cancer treatment to prevent or delay the cancer from becoming completely drug resistant [114].

Acknowledgment

We would like to thank K Distefano, J Jiménez, S Muñoz-Montero, M Pleimling, M Swailem, and U C Täuber for helpful discussions. L H N, A M R and M M gratefully acknowledge funding from the U.K. Engineering and Physical Sciences Research Council (EPSRC) under the Grant No. EP/V014439/1 for the project 'DMS-EPSRC Eco-Evolutionary Dynamics of Fluctuating Populations'. The support of a Ph.D. scholarship to M A by the EPSRC Grant No. EP/T517860/1 is also thankfully acknowledged. This work was undertaken on ARC4, part of the High Performance Computing facilities at the University of Leeds, UK.

Data availability statement

The data that support the findings of this study are openly available at the following URL/DOI: 10.5518/1371 [115].

Author contributions

Matthew Asker: Conceptualisation (supporting), Methodology, Formal Analysis (lead), Software, Writing—Original Draft, Writing—Review & Editing, Visualisation, Investigation, Validation.

Lluís Hernández-Navarro: Formal Analysis (supporting), Writing—Review & Editing (supporting), Supervision (supporting).

Alastair M. Rucklidge: Writing—Review & Editing (supporting), Supervision (supporting), Funding acquisition (supporting).

Mauro Mobilia: Conceptualisation (lead), Methodology (lead), Formal Analysis (supporting), Writing—Original Draft, Writing—Review & Editing, Visualisation, Supervision (lead), Project administration, Funding acquisition (lead).

Footnotes

  • The case where the toxin increases the death rate of the strain $S$ corresponds to a biocidal toxin, and is not directly considered here. This is not particularly limiting since the same drug can often act as a biostatic or biocidal toxin at low/high concentration [91].

  • Finally, the population will settle in the absorbing state $N_R = N_S = 0$ corresponding to the eventual extinction of the entire population. This occurs after a time that grows exponentially with the system size [57, 61, 63, 105]. This phenomenon, irrelevant for our purposes (since we always have $K(t)\gg 1$), is not considered here.

  • In all our examples we set $x_0 = 0.5$.

  • The factor 2 has been chosen arbitrarily to prevent $\tau\sim \left\langle N \right\rangle$ from appearing as coexistence. Other choices are of course possible, and would have only modest effects on the crossover regime between the phases of dominance and coexistence.

Please wait… references are loading.
10.1088/1367-2630/ad0d36