Introduction

Traditional physical systems involve interactions between objects characterized by universal coupling constants, such as the Newtonian constant of gravitation and the Coulomb constant for electrostatic forces. This is true whether the objects are subatomic particles, electric charges, or celestial bodies. The objects can differ in the amount of charge or mass they have, but otherwise interact in the same way with each other. This is in contrast to biological systems, where individual organisms are described by a large number of traits, be it morphological, metabolic, or behavioral, which are not all identical even between individuals of the same species1,2,3. Any of these traits can affect the way an individual interacts with other organisms and the environment. Thus, for biological interactions, the coupling constants (or “interaction strengths”) themselves can be heterogeneous among individuals. Such interaction strengths can also vary in time due to behavioral changes, seasonal variations, or different life stages of an organism.

However, when trying to apply dynamical models to biological systems, the heterogeneity among individuals is often left out, so that a whole population is treated as having the same interaction strength. A classic example is the Lotka-Volterra model of trophic interaction between two species, a predator and a prey. The predation rate is assumed to be proportional to the population densities of both species (in a quadratic form that loosely resembles some of the physical interactions mentioned above). This may be true if each population is homogeneous, so that only the population size or density is relevant. However, if we take into account the individual variation in various external or internal traits, the interaction strength between the predator and prey need not be the same for every individual. Thus, using an “average” interaction strength and ignoring the heterogeneity among individuals may cause models to miss important features. Here we address these problems by analyzing simple ecological models that demonstrate nontrivial consequences of dynamic heterogeneity in interaction strengths.

In this study, we analyze an ecosystem with “exploitative competition” between two predators feeding on the same prey species. Traditional models of such ecosystems treat each species as being homogeneous, so that the interaction strength between each pair is constant. We incorporate heterogeneity in how the prey species interacts with the predators, which can happen if there is trait variation among the prey population. Our model allows us to study several kinds of heterogeneity, including what we call “inherent”, “reversible”, and “adaptive” heterogeneities, depending on whether the prey phenotype is determined at birth, can change reversibly, or adapts plastically to the density of predators. In all cases, we show that heterogeneous interactions lead to new phenomena in the population dynamics of species. Without heterogeneity, the expected outcome of the ecosystem is that one of the predators drives the other to extinction, a phenomenon known as “competitive exclusion”4,5,6. However, if the interaction strength with predators varies within the prey species, it turns out that the system can stabilize in a state where both predators coexist. For some range of parameters, we observe emergent facilitation between the predators7, such that the presence of one predator allows the other predator to persist. Moreover, the prey species can reach a higher abundance than when it interacts with only one predator, suggesting that heterogeneity in interactions may be an evolutionarily favorable feature for the population.

Coexistence between competing species has been studied in terms of niche separation, where different species fill different roles in an ecosystem, such that they can both consume enough resources to survive4,5. Our results suggest a different cause of coexistence resulting from a convergence of fitness rather than a separation of niches8. The idea that intraspecific trait variation can have significant ecological effects has been studied in recent works1,9. In addition, the trait of a species can be influenced by the environment or another species, leading to further effects on the population, known as trait-mediated indirect effects10. The heterogeneous interactions in our model give rise to similar effects due to dynamic changes of trait composition in the population. The relation between our results and those previous studies are discussed in section “Discussion”.

System with homogeneous interactions

As a null model, we first consider an ecosystem with homogeneous interactions. The two predators and one prey species are modeled by a Lotka-Volterra dynamical system11,

$$\begin{aligned} \dot{A}&= A \, (\varepsilon _A \, \alpha _{AC} \, C - \beta _A) \end{aligned}$$
(1a)
$$\begin{aligned} \dot{B}&= B \, (\varepsilon _B \, \alpha _{BC} \, C - \beta _B) \end{aligned}$$
(1b)
$$\begin{aligned} \dot{C}&= C \, (\beta _C - \alpha _{CC} \, C - \alpha _{AC} \, A - \alpha _{BC} \, B) \end{aligned}$$
(1c)

Here A, B, and C represent the density of each species in a spatially well-mixed system, where A and B are the predators and C is the prey (Fig. 1a). Parameters \(\beta _A\) and \(\beta _B\) are the death rates of A and B, respectively; \(\alpha _{AC}\) and \(\alpha _{BC}\) are the predation rates of A and B on C. Species C has a birth rate \(\beta _C\) and an intraspecific competition strength \(\alpha _{CC}\). The \(\varepsilon\)’s are the efficiency by which an amount of C consumed is converted to the increase of the predator population. We can rescale the variables by \(t \leftarrow \beta _C \, t\), \(A \leftarrow \frac{ \alpha _{CC}}{\beta _C} A\), \(B \leftarrow \frac{ \alpha _{CC}}{\beta _C} B\), and \(C \leftarrow \frac{\alpha _{CC}}{\beta _C} C\), so that the equations above simplify to

$$\begin{aligned} \dot{A}&= A \, (a \, C - a_0) \end{aligned}$$
(2a)
$$\begin{aligned} \dot{B}&= B \, (b \, C - b_0) \end{aligned}$$
(2b)
$$\begin{aligned} \dot{C}&= C \, (1-\, C - a \, A - b \, B) \end{aligned}$$
(2c)

where the rescaled parameters are \(a = \frac{\varepsilon _A \alpha _{AC}}{\alpha _{CC}}\), \(a_0 = \frac{\beta _{A}}{\beta _{C}}\), \(b = \frac{\varepsilon _B \alpha _{AC}}{\alpha _{CC}}\), \(b_0 = \frac{\beta _{B}}{\beta _{C}}\).

Figure 1
figure 1

An ecosystem with two predators (A, B) and one prey (C). (a) A homogeneous system where all individuals of a species have the same interaction strength with another species. Arrows represent trophic interaction pointing from prey to predator. (b) Heterogeneity is added by splitting the prey into two types (\(C_1\), \(C_2\)), each with their own interaction strengths with the predators. Double-sided arrow represents the exchange of individuals between the prey subpopulations. (c) An equivalent description using the total prey population C and the prey type composition \(\lambda\). Arrows represent “effective” interaction strengths that depend on \(\lambda\).

There are 4 equilibrium states of this system, which are labeled \(P_O\), \(P_C\), \(P_A\), and \(P_B\), as shown in Fig. 2. They all belong to the surface \(a_0 A + b_0 B = C (1-C)\) restricted to the non-negative octant of the A-B-C space. \(P_O\) is the point where all three species have zero population sizes, which is an unstable equilibrium. \(P_C\) is where only C persists; \(P_A\) and \(P_B\) are where A or B coexists with C, respectively. In general, only one of \(P_A\), \(P_B\), and \(P_C\) can be stable for a given set of parameters. This demonstrates the competitive exclusion principle, by which two consumers (predators) of the same resource (prey) cannot coexist. The persistent predator is the one that has a lower \(R^*\) value (i.e., the minimal prey density required to sustain a predator, \(R^*_A = a_0 / a\) and \(R^*_B = b_0 / b\)). Only if the parameters are fine-tuned, such that the two predators have equal \(R^*\), will all three species coexist. In such a fine-tuned system, there is a continuum of possible equilibria that form a line attractor \(\mathscr {L}\) shown in Fig. 2.

Figure 2
figure 2

A-B-C space showing the locations of the equilibrium points. \(P_O\) (black) is an unstable equilibrium at the origin where all species go extinct. \(P_C\) (yellow) is where only C survives. \(P_A\) (red) and \(P_B\) (blue) represent the persistence of one predator (A and B, respectively) and the prey. These points each lie on a parabola in the \(B=0\) and \(A=0\) planes, respectively. \(P_N\) (green) is a point where all three species coexist, which lies on a line \(\mathscr {L}\) (purple) that is a line attractor for \(\lambda = \lambda ^*\). All five possible equilibria are on the surface \(a_0 A + b_0 B = C (1-C)\), shown in gray.

Heterogeneous interactions

Now consider a generalized model in which the species interactions are heterogeneous. A natural way of introducing heterogeneity in the system is by having a species diversify into subpopulations with different interaction strengths12,13,14,15. This way of modeling heterogeneity is useful as it can describe different kinds of heterogeneity. For example, the subpopulations could represent polymorphic traits that are genetically determined or result from plastic response to heterogeneous environments. A population could also be divided into local subpopulations in different spatial patches, which can migrate between patches and may face different local predators. We can also model different behavioral modes as subpopulations that, for instance, spend more time foraging for food or hiding from predators. We study several kinds of heterogeneity after we introduce a common mathematical framework. By studying these different scenarios using variants of the model, we show that our main results are not sensitive to the details of the model.

We focus on the simple case where only the prey species splits into two types, \(C_1\) and \(C_2\), as illustrated in Fig. 1b. The situation is interesting when predator A consumes \(C_1\) more readily than predator B and B consumes \(C_2\) more readily than A (i.e., \(a_1 / a_0 > b_1 / b_0\) and \(b_2 / b_0 > a_2 / a_0\), which is equivalent to the condition that the nullclines of A and B cross, see section “Resources competition and nullcline analysis”). The arrows between \(C_1\) and \(C_2\) in Fig. 1b represent the exchange of individuals between the two subpopulations, which can happen by various mechanisms considered below. Such exchange as well as intraspecific competition between \(C_1\) and \(C_2\) result from the fact that the two prey types remain a single species.

The system is now described by an enlarged Lotka-Volterra system with four variables, A, B, \(C_1\), and \(C_2\):

$$\begin{aligned} \dot{A}&= \varepsilon _A \,\alpha _{A1} \, A \, C_1 + \alpha _{A2} \, A \, C_2 - \beta _A \, A \end{aligned}$$
(3a)
$$\begin{aligned} \dot{B}&= \varepsilon _B \, \alpha _{B1} \, B \, C_1 + \alpha _{B2} \, B \, C_2 - \beta _B \, B \end{aligned}$$
(3b)
$$\begin{aligned} \dot{C_1}&= C_1 \, (\beta _C - \alpha _{CC} \, C)-\alpha _{A1} \, C_1 A-\alpha _{B1} \, C_1 B - \sigma _1 \, C_1 + \sigma _2 \, C_2 \end{aligned}$$
(3c)
$$\begin{aligned} \dot{C_2}&= C_2 \, (\beta _C - \alpha _{CC} \, C) -\alpha _{A2} \, C_2 A -\alpha _{B2} \, C_2 B + \sigma _1 \, C_1 - \sigma _2 \, C_2 \end{aligned}$$
(3d)

The parameters in these equations and their meanings are listed in Table 1. Here we assume that the prey types \(C_1\) and \(C_2\) have the same birth rate and intraspecific competition strength, but different interaction strengths with A and B. Note that \(C_1\) and \(C_2\) are connected by the \(\sigma _i\) terms, which represent the exchange of individuals between these subpopulations through mechanisms studied below; these terms indicate a major difference between our model of a prey with intraspecific heterogeneity and other models of two prey species. For the convenience of analysis, we transform the variables \(C_1\) and \(C_2\) to another pair of variables C and \(\lambda\), where \(C \equiv C_1 + C_2\) is the total population of C as before, and \(\lambda \equiv C_2 / (C_1 + C_2)\) represents the composition of the population (Fig. 1c). After this transformation and rescaling of variables (described in “Methods”), the new dynamical system can be written as:

$$\begin{aligned} \dot{A}&= A \, \big ( C \, (a_1 (1-\lambda ) + a_2 \lambda ) - a_0 \big ) \end{aligned}$$
(4a)
$$\begin{aligned} \dot{B}&= B \, \big ( C \, (b_1 (1-\lambda ) + b_2 \lambda ) - b_0 \big ) \end{aligned}$$
(4b)
$$\begin{aligned} \dot{C}&= C \, \big ( 1 - C - A (a_1 (1-\lambda ) + a_2 \lambda ) - B (b_1 (1-\lambda ) + b_2 \lambda ) \big ) \end{aligned}$$
(4c)
$$\begin{aligned} \dot{\lambda }&= \lambda (1-\lambda ) \, \big ( A (a_1 - a_2) + B (b_1 - b_2) \big ) + \eta _1 (1-\lambda ) - \eta _2 \lambda \end{aligned}$$
(4d)

Here, \(a_i\) and \(b_i\) are the (rescaled) feeding rates of the predators on the prey type \(C_i\); \(a_0\) and \(b_0\) are the death rates of the predators as before; \(\eta _1\) and \(\eta _2\) are the exchange rates of the prey types (Table 1). The latter can be functions of other variables, representing different kinds of heterogeneous interactions that we study below. Notice that Eqs. (4a4c) are equivalent to the homogeneous Eqs. (2a2c) but with effective interaction strengths \(a_\text {eff} = (1-\lambda ) \, a_1 + \lambda \, a_2\) and \(b_\text {eff} = (1-\lambda ) \, b_1 + \lambda \, b_2\) that both depend on the prey composition \(\lambda\) (Fig. 1c).

Table 1 Model parameters (before/after rescaling) and their meanings.

The variable \(\lambda\) can be considered an internal degree of freedom within the C population. In all of the models we study below, \(\lambda\) dynamically stabilizes to a special value \(\lambda ^*\) (a bifurcation point), as shown in Fig. 3a. Accordingly, a new equilibrium point \(P_N\) appears (on the line \(\mathscr {L}\) in Fig. 2), at which all three species coexist. For comparison, Fig. 3b shows the equilibrium points if \(\lambda\) is held fixed at any other values, which all result in the exclusion of one of the predators. Thus, heterogeneous interactions give rise to a new coexistence phase (see Fig. 4 below) by bringing the prey composition \(\lambda\) to the value \(\lambda ^*\), instead of having to fine-tune the interaction strengths. The exact conditions for this new equilibrium to be stable are detailed in “Methods”.

Figure 3
figure 3

(a) Time series of \(\lambda\) for systems with each kind of heterogeneity. All three systems stabilize at the same \(\lambda ^*\) value, which is the bifurcation point in panel (b). (b) Equilibrium population of each species \(X = A\), B, or C, with \(\lambda\) held fixed at different values. Solid curves represent stable equilibria and dashed curves represent unstable equilibria (see Eq. (9) in “Methods”). The vertical dashed line is where \(\lambda = \lambda ^*\), which is also the bifurcation point. Notice that the equilibrium population of C is maximized at this point (for \(a_1 > a_2\) and \(b_2 > b_1\)). Parameters used here are \((a_0, a_1, a_2, b_0, b_1, b_2, \rho , \eta _1, \eta _2, \kappa ) = (0.25, 0.5, 0.2, 0.4, 0.2, 0.6, 0.5, 0.05, 0.05, 50)\).

Inherent heterogeneity

We first consider a scenario where individuals of the prey species are born as one of two types with a fixed ratio, such that a fraction \(\rho\) of the newborns are \(C_2\) and \((1-\rho )\) are \(C_1\). This could describe dimorphic traits, such as the winged and wingless morphs in aphids12 or the horned and hornless morphs in beetles13. We call this “inherent” heterogeneity, because individuals are born with a certain type and cannot change in later stages of life. The prey type given at birth determines the individual’s interaction strength with the predators. This kind of heterogeneity can be described by Eq. (4d) with \(\eta _1 = \rho (1-C)\) and \(\eta _2 = (1-\rho ) (1-C)\) (see “Methods”).

Figure 4
figure 4

Phase diagrams showing regions of parameter space identified by the stable equilibrium points. Yellow region represents \(P_C\) (predators AB both extinct), red represents \(P_A\) (A excludes B), blue represents \(P_B\) (B excludes A), and green represents \(P_N\) (AB coexist). The middle point (black dot) is where the preferences of the two predators are identical, \(a_2/a_0=b_2/b_0\) and \(b_1/b_0=a_1/a_0\). The coexistence phase appears in all three kinds of heterogeneity modeled here. (ad) Inherent heterogeneity: Individuals of the prey population are born in two types with a fixed composition \(\rho\). In the extreme cases of \(\rho = 0\) and 1, the prey is homogeneous and there is no coexistence of the predators. (eh) Reversible heterogeneity: Individual prey can switch types with fixed switching rates \(\eta _1\) and \(\eta _2\). As the switching rates increase, the coexistence region shrinks because the prey population becomes effectively homogeneous (the occasional green spots are numerical artifacts because the time to reach the equilibrium becomes long in this limit). (il) Adaptive heterogeneity: The switching rates \(\eta _i\) dynamically adapt to the predator densities, so as to maximize the growth rate of the prey. As the sharpness \(\kappa\) of the sigmoidal decision function is increased, the prey adapts more optimally and the region of coexistence expands. Parameters used here are \((a_0, a_1, b_0, b_2) = (0.3, 0.5, 0.4, 0.6)\).

The stable equilibrium of the system can be represented by phase diagrams that show the identities of the species at equilibrium. We plot these phase diagrams by varying the parameters \(a_2\) and \(b_1\) while keeping \(a_1\) and \(b_2\) constant. As shown in Fig. 4a–d, the equilibrium state depends on the parameter \(\rho\). In the limit \(\rho = 0\) or 1, we recover the homogeneous case because only one type of C is produced. The corresponding phase diagrams (Fig. 4a, d) contain only two phases where either of the predators is excluded, illustrating the competitive exclusion principle. For intermediate values of \(\rho\), however, there is a new phase of coexistence that separates the two exclusion phases (Fig. 4b, c). There are two such regions of coexistence, which touch at a middle point and open toward the bottom left and upper right, respectively. The middle point is at \((a_2/a_0 = b_2/b_0, b_1/b_0 = a_1/a_0)\), where the feeding preferences of the two predators are identical (hence their niches fully overlap). Towards the origin and the far upper right, the predators consume one type of C each (hence their niches separate). The coexistence region in the bottom left is where the feeding rates of the predators are the lowest overall. There can be a region (yellow) where both predators go extinct, if their primary prey type alone is not enough to sustain each predator. Increasing the productivity of the system by increasing the birth rate (\(\beta _C\)) of the prey eliminates this extinction region, whereas lowering productivity causes the extinction region to take over the lower coexistence region. Because the existence and identity of the phases is determined by the configuration of the equilibrium points (Fig. 2, see also section “Mathematical methods”), the qualitative shape of the phase diagram is not sensitive to changes of parameter values.

The new equilibrium is not only where the predators A and B can coexist, but also where the prey species C grows to a larger density than what is possible for a homogeneous population. This is illustrated in Fig. 3b, which shows the equilibrium population of C if we hold \(\lambda\) fixed at different values. The point \(\lambda = \lambda ^*\) is where the system with a dynamic \(\lambda\) is stable, and also where the population of C is maximized (when A and B prefer different prey types). That means the population automatically stabilizes at the optimal composition of prey types. Moreover, the value of \(C^*\) at this coexistence point can even be larger than the equilibrium population of C when there is only one predator A or B. This is discussed further in section “Multiple-predator effects and emergent promotion of prey”. These results suggest that heterogeneity in interaction strengths can potentially be a strategy for the prey population to leverage the effects of multiple predators against each other to improve survival.

Reversible heterogeneity

We next consider a scenario where individual prey can switch their types. This kind of heterogeneity can model reversible changes of phenotypes, i.e., trait changes that affect the prey’s interaction with predators but are not permanent. For example, changes in coat color or camouflage14,16,17, physiological changes such as defense15, and biomass allocation among tissues18,19. One could also think of the prey types as subpopulations within different spatial patches, if each predator hunts at a preferred patch and the prey migrate between the patches20,21. With some generalization, one could even consider heterogeneity in resources, such as nutrients located in different places, that can be reached by primary consumers, such as swimming phytoplankton22. We can model this “reversible” kind of heterogeneity by introducing switching rates from one prey type to the other. In Eq. (4d), \(\eta _1\) and \(\eta _2\) now represent the switching rates per capita from \(C_1\) to \(C_2\) and from \(C_2\) to \(C_1\), respectively. Here we study the simplest case where both rates are fixed.

In the absence of the predators, the natural composition of the prey species given by the switching rates would be \(\rho \equiv \eta _1 / (\eta _1 + \eta _2)\), and the rate at which \(\lambda\) relaxes to this natural composition is \(\gamma \equiv \eta _1 + \eta _2\). Compared to the previous scenario where we had only one parameter \(\rho\), here we have an additional parameter \(\gamma\) that modifies the behavior of the system. Fig. 4e–h shows phase diagrams for the system as \(\rho\) is fixed and \(\gamma\) varies. We again find the new equilibrium \(P_N\) where all three species coexist. When \(\gamma\) is small, the system has a large region of coexistence. As \(\gamma\) is increased, this region is squeezed into a border between the two regions of exclusion, where the slope of the border is given by \(\eta _1/\eta _2\) as determined by the parameter \(\rho\). However, this is different from the exclusion we see in the case of inherent heterogeneity, which happens only for \(\rho \rightarrow 0\) or 1, where the borders are horizontal or vertical (Fig. 4a,d). Here the predators exclude each other despite having a mixture of prey types in the population.

This special limit can be understood as follows. For a large \(\gamma\), \(\lambda\) is effectively set to a constant value equal to \(\rho\), because it has a very fast relaxation rate. In other words, the prey types exchange so often that the population always maintains a constant composition. In this limit, the system behaves as if it were a homogeneous system with effective interaction strengths \(a_\text {eff} = (1-\rho ) \, a_1 + \rho \, a_2\) and \(b_\text {eff} = (1-\rho ) \, b_1 + \rho \, b_2\). As in a homogeneous system, there is competitive exclusion between the predators instead of coexistence. This demonstrates that having a constant level of heterogeneity is not sufficient to cause coexistence. The overall composition of the population must be able to change dynamically as a result of population growth and consumption by predators.

An interesting behavior is seen when we examine a point inside the shrinking coexistence region as \(\gamma\) is increased. Typical trajectories of the system for such parameter values are shown in Fig. 5. As \(\gamma\) increases, the system relaxes to the line \(\mathscr {L}\) quickly, then slowly crawls along it towards the final equilibrium point \(P_N\). This is because increasing \(\gamma\) increases the speed that \(\lambda\) relaxes to \(\lambda ^*\), and when \(\lambda \rightarrow \lambda ^*\), \(\mathscr {L}\) becomes marginally stable. Therefore, the attraction to \(\mathscr {L}\) in the perpendicular direction is strong, but the attraction towards the equilibrium point along \(\mathscr {L}\) is weak. This leads to a long transient behavior that makes the system appear to reach no equilibrium in a limited time23,24. It is especially true when there is noise in the dynamics, which causes the system to diffuse along \(\mathscr {L}\) with only a weak drift towards the final equilibrium (Fig. 5). Thus, the introduction of a fast timescale (quick relaxation of \(\lambda\) due to a large \(\gamma\)) actually results in a long transient.

Figure 5
figure 5

Trajectories of the system projected in the A-B plane, with parameters inside the coexistence region (by holding the position of \(P_N\) fixed). As \(\gamma\) increases, the system tends to approach the line \(\mathscr {L}\) quickly and then crawl along it. The grey trajectory is with independent Gaussian white noise (\(\sim \mathscr {N}(0,0.5)\)) added to each variable’s dynamics. Noise causes the system to diffuse along \(\mathscr {L}\) for a long transient period before coming to the equilibrium point \(P_N\). Parameters used here are \((a_0, a_1, a_2, b_0, b_1, b_2) = (0.2, 0.8, 0.5, 0.2, 0.6, 0.9)\), chosen to place \(P_N\) away from the middle of \(\mathscr {L}\) to show the trajectory drifting toward the equilibrium.

Adaptive heterogeneity

A third kind of heterogeneity we consider is the change of interactions in time. By this we mean an individual can actively change its interaction strength with others in response to certain conditions. This kind of response is often invoked in models of adaptive foraging behavior, where individuals choose appropriate actions to maximize some form of fitness25,26. For example, we may consider two behaviors, resting and foraging, as our prey types. Different predators may prefer to strike when the prey is doing different things. In response, the prey may choose to do one thing or the other depending on the current abundances of different predators. Such behavioral modulation is seen, for example, in systems of predatory spiders and grasshoppers27. Phenotypic plasticity is also seen in plant tissues in response to consumers28,29,30.

This kind of “adaptive” heterogeneity can be modeled by having switching rates \(\eta _1\) and \(\eta _2\) that are time-dependent. Let us assume that the prey species tries to maximize its population growth rate by switching to the more favorable type. From Eq. (4c), we see that the growth rate of C depends linearly on the composition \(\lambda\) with a coefficient \(u(A,B) \equiv (a_1 - a_2) A + (b_1 - b_2) B\). Therefore, when this coefficient is positive, it is favorable for C to increase \(\lambda\) by switching to type \(C_2\). This can be achieved by having a positive switching rate \(\eta _2\) whenever \(u(A,B) > 0\). Similarly, whenever \(u(A,B) < 0\), it is favorable for C to switch to type \(C_1\) by having a positive \(\eta _1\). In this way, the heterogeneity of the prey population constantly adapts to the predator densities. We model such adaptive switching by making \(\eta _1\) and \(\eta _2\) functions of the coefficient u(AB), e.g., \(\eta _1(u) = 1/(1+\mathrm {e}^{\kappa u})\) and \(\eta _2(u) = 1/(1+\mathrm {e}^{-\kappa u})\). The sigmoidal form of the functions means that the switching rate in the favorable direction for C is turned on quickly, while the other direction is turned off. The parameter \(\kappa\) controls the sharpness of this transition.

Phase diagrams for the system with different values of \(\kappa\) are shown in Fig. 4i–l. A larger \(\kappa\) means the prey adapts its composition faster and more optimally, which causes the coexistence region to expand. In the extreme limit, the system changes its dynamics instantaneously whenever it crosses the boundary where \(u(A,B) = 0\), like in a hybrid system31. Such a system can still reach a stable equilibrium that lies on the boundary, if the flow on each side of the boundary points towards the other side32. This is what happens in our system and, interestingly, the equilibrium is the same three-species coexistence point \(P_N\) as in the previous scenarios. The region of coexistence turns out to be largest in this limit (Fig. 4l).

Our results suggest that the coexistence of the predators can be viewed as a by-product of the prey’s strategy to maximize its own benefit. The time-dependent case studied here represents a strategy that involves the prey evaluating the risk posed by different predators. This is in contrast to the scenarios studied above, where the prey population passively creates phenotypic heterogeneity regardless of the presence of the predators. These two types of behavior are analogous to the two strategies studied for adaptation in varying environments, i.e., sensing and bet-hedging33,34. The former requires accessing information about the current environment to make optimal decisions, whereas the latter relies on maintaining a diverse population to reduce detrimental effects caused by environmental changes. Here the varying abundances of the predators play a similar role as the varying environment. From this point of view, the heterogeneous interactions studied here can be a strategy of the prey species that is evolutionarily favorable.

Discussion

Exploitative competition is a basic motif in the modeling of trophic interactions. However, the exclusion of all but one competing species as implied by such models is at odds with the high diversity of species seen in natural ecosystems35. Many explanations for this apparent paradox have been considered36,37,38,39,40. Our results suggest a new mechanism for species coexistence in these ecosystems through heterogeneous interactions between the predators and prey. Our model is general enough to describe many types of trait differentiation within a species, including phenotypic polymorphism and switching, spatial localization and migration, as well as behavioral changes and foraging strategies. Our results are related to the following ecological concepts that have been studied previously.

Resources competition and nullcline analysis

If we think of the two subpopulations of the prey as two resources, then the competition between the two predators can be analyzed using nullclines. A nullcline is a contour line in the space of both prey densities (\(C_1\) and \(C_2\)), along which the net growth rate of a predator (\(\dot{A}\) or \(\dot{B}\)) is zero. As illustrated in Fig. 6, there is one nullcline for each predator (A and B). The nullcline is a generalization of the \(R^*\) value for a single (homogeneous) prey, and represents the minimal combination of prey levels required for a predator to sustain its population. For two preys that vary independently, the persistence of the predators can be determined from this picture. For example, if the prey levels are above the A nullcline and below the B nullcline, then the A population can grow but the B population will decline, leading to the exclusion of B by A. By such analysis, the two predators can coexist only if the prey levels are precisely at the intersection of the nullclines41.

Figure 6
figure 6

A schematic for nullcline analysis showing the prey subpopulations as two resources. Nullclines for A and B are shown in black; the intercepts are the amount of a single resource that a consumer needs to survive, \(R^*_{Ai} = a_0 / a_i\) and \(R^*_{Bi} = b_0 / b_i\). The total population of C is represented by a line with slope \(-1\). Prey composition \(\lambda\) is represented by the angle of a line going through the origin. The equilibrium values of \(C^*\) and \(\lambda ^*\) at three-species coexistence is determined by the intersection of the nullclines. However, for our models of heterogeneous interactions, the dynamics of \(\lambda\) and its stability at \(\lambda ^*\) are undetermined by this picture.

The nullcline analysis helps determine the location of the coexistent equilibrium in the parameter space. However, the stability of this equilibrium point cannot be derived from the picture, because in our model the two resource types interact with each other dynamically. Indeed, they are subpopulations of the same prey species, exchanging fluxes of individuals and sharing a common carrying capacity. The ratio of the prey types (\(\lambda\)) is determined by the angle of lines going through the origin (Fig. 6). The dynamics of \(\lambda\) and of the total prey population C both depend on the densities of A and B (Eqs. (4c,4d)) and are not captured in the picture here. Nevertheless, the nullcline analysis does show that the equilibrium values of \(C^*\) and \(\lambda ^*\) in the coexistence phase do not depend on the parameters such as \(\rho\) and \(\gamma\), and in fact do not depend on the form of heterogeneity at all (see “Methods”). Beyond that, the main point of our model is to demonstrate that the coexistent equilibrium is in fact stable, and is robust to the different kinds of heterogeneity that we studied.

Emergent fitness equalization vs. niche separation

It is important to note that the coexistence of the predators shown here does not result from the separation of niches, but rather from the convergence of the predators to a common fitness, similar to the situation studied in (van Velzen 2020)8. The separation of niches would mean that each predator consumes only one prey type. Here the niches of the predators overlap because all of the interaction strengths \((a_1, a_2, b_1, b_2)\) are non-zero, meaning that both predators consume a mixture of prey types, although with different preferences. In (van Velzen 2020)8 and in the models that we study here, an internal variable of the prey population (the phenotype composition in our case, and the defense level in (van Velzen 2020)8) is adjusted to ensure equal fitness of the predators. Here fitness is used to mean the \(R^*\) values of the predators for a given internal trait value. The convergence of fitness is emergent in that it is not the result of fine-tuning the predators’ consumption preferences (i.e., interaction strengths), but rather a result of the dynamics of the prey composition that automatically stabilizes at the critical value where \(R^*\)’s are equal. Thus, the coexistence of predators observed in our model is an emergent consequence of the prey having heterogeneous interaction strengths with the predators.

Emergent facilitation and trait-mediated indirect effects

Our model also demonstrates an interesting effect that one predator can have on the other, called facilitation7,42. It happens when one predator is better off in the presence of another even though they compete for the same resources. We can distinguish between two levels of facilitation: Strong facilitation is such that one predator would go extinct if the other predator is absent but can survive when both are present. Weak facilitation is such that the abundance of one predator is increased when the other predator is present rather than absent. Strong facilitation was studied in (de Roos et al. 2008)7 in the case of adult and juvenile prey with body size differentiation. In that system, facilitation emerges as a result of two predators specializing in different prey stages and the prey stages competing with each other. Our system shares the feature that two predators prefer different subpopulations of the same prey. We found that our models exhibit both strong and weak facilitation, as show in Fig. 7a, b for the case of inherent heterogeneity. Intuitively, the consumption of one prey type by one predator allows the other prey type to flourish, thus helping the other predator.

Figure 7
figure 7

Phase diagrams showing facilitation of predators by their competitor, and promotion of prey by predators. (a, b) Parameter regions of strong and weak facilitation, with (a) B facilitating A and (b) A facilitating B. Color represents the difference between equilibrium populations of each predator in the presence and absence of the other, with \(X^*(P_i)\) being the population of species X at equilibrium point \(P_i\). (c, d) Parameter regions showing promotion of the prey by the addition of a second predator, with (c) B promoting C and (d) A promoting C. Color represents the difference in population levels of the prey C in the presence of both or only one predator. Parameter values used here are \((a_0, a_1, b_0, b_2, \rho ) = (0.25, 0.6, 0.5, 0.6, 0.55)\), chosen to show significant areas of both types of facilitation and promotion.

We can interpret such emergent facilitation as a trait-mediated indirect effect10,43. The interaction between the predator A and the prey C causes a shift in the composition of C, which can be considered a trait of C on the population level. This trait change then affects the overall interaction between C and the other predator B. Therefore, in a coarse-grained picture where the subpopulations of C are lumped together (Fig. 1c), it is as if one species A modifies the effective interaction strength \(b_\text {eff}(\lambda )\) between the other two species B and C, and similarly for B that modifies the interaction between A and C. Here the interaction modification by one predator can be either detrimental to the other predator, or beneficial as in the cases of facilitation.

Multiple-predator effects and emergent promotion of prey

In addition to the facilitation between predators shown above, our model also exhibits a surprising “promotion” of the prey population by a predator. By this we mean that the equilibrium population of the prey is higher in the presence of both predators than in the presence of just one. This will be an extreme case of subadditive effects on the prey from multiple predators44,45, to the extent that the total effect from two predators is lower than that from one predator alone. Fig. 7c, d show the regions in parameter space where there is promotion of the prey C by predator A and B respectively. This surprising effect arises when both predators prefer to consume the same prey type, and the promoting predator has a stronger preference than the other. Heuristically, if we start with only the latter predator in equilibrium with the prey, then adding the promoting predator would push the composition of the prey further away from the preferred type. This compositional shift then inhibits both predators and allows the prey to reach a larger population at the new equilibrium. Mathematical conditions for such emergent promotion, as well as facilitation, are given in “Methods”.

Conclusion

Heterogeneity is natural in biological systems, as each individual organism possesses a large number of traits that are influenced one way or the other by developmental noise or environmental variation. Every individual interacts with other individuals and the environment somewhat differently due to its unique combination of traits. The heterogeneity in such interactions are generally treated in one of two ways. It is ignored in some cases where the system is treated as being well-mixed or homogeneous, such as in the classic Lotka-Volterra model11,46. In other cases the system is treated as “disordered” such that the interaction strengths are randomly drawn from some probability distribution47,48,49,50. Here, we have addressed the heterogeneity of biological interactions in a more structured framework that considers subpopulations of a species with a dynamic composition. We have demonstrated nontrivial consequences of having heterogeneous interactions. We expect such ecosystems to exhibit stronger persistence and richer diversity. We find that one predator can facilitate another both qualitatively and quantitatively through trait-mediated indirect effects. And we show that a prey species can change its population composition to benefit its own growth under multiple predators. These effects are apparent in our model with only one species of a small ecosystem exhibiting a single differentiating trait. In real natural ecosystems, there is a massively higher dimensionality in both the number of traits within a species that can vary among individuals and the number of species that can exhibit such trait differentiation. We expect such high dimensionality to lead to more manifestations of the effects illustrated here. Future research can address this point by either modeling a larger network of interacting species or including more subpopulations within a species. We have explored only one interaction pattern known as exploitative competition. Similar analyses can be done in the context of other interaction patterns, including both trophic interactions and competitive interactions.

We have focused here on biological and ecological systems, but heterogeneous interactions can have nontrivial effects on dynamical systems in general. Here we have seen new attractors appear where they could not in a homogeneous system. We have seen new timescales introduced to the system that can result in slow convergence to the equilibrium. We have even seen the transformation of the dynamical system from a simple differential system to one which exhibits flow switching depending on the state of the system51. It is less common for traditional systems in physics to have heterogeneous interaction constants. However, non-uniform parameters can be important in systems involving a large number of mesoscopic components. In such systems, the parameters of the components are often non-identical, and the shape or width of the parameter distribution can have strong effects on the behavior of the system. This can be seen in systems of coupled oscillators52,53,54 where the spread of the natural frequencies of the oscillators can lead to different degrees of synchronization. The effect of inhomogeneous parameters can also be seen in systems of colloids55, where differences in size and mass among large numbers of colloids can lead to intermittent behavior with periods of ordered lattice configuration and more random motion. These are examples of systems where differences among interacting units of a system can have qualitative effects on the overall system behavior. As we have shown, incorporating such differences between the units can be important for predicting the outcome of these complex dynamics.