Skip to main content
Nature Communications logoLink to Nature Communications
. 2025 Nov 12;16:9962. doi: 10.1038/s41467-025-64935-5

Mechanistic prediction of community composition across resource conditions and species richness

Zhijie Zhang 1,2,, Lutz Becks 2
PMCID: PMC12612213  PMID: 41224768

Abstract

Predicting species coexistence and community assembly is a central goal in ecology. Traditional methods, based on the effect of one species on another (e.g., Lotka-Volterra competition model), are sensitive to environmental context. This is because they ignore the fundamental processes that can be applied across environments. While mechanistic approaches offer promise, empirical tests remain rare. Here, we integrate a mechanistic consumer-resource model with the growth of 12 phytoplankton species in monoculture over a range of nitrate, ammonium or phosphorous concentrations. We find that the mechanistic approach accurately predicts the composition of 960 communities across species richness and resource conditions. We confirm by simulations, species competing for substitutable resources (nitrate vs. ammonium) exhibit greater diversity than those competing for essential resources (nitrate vs. phosphorus), especially when initial species richness is high. This is because, in competition for essential resources, each species is likely to consume less of the resource that is more limiting to its growth, which violates the mechanistic rule of coexistence that states that each species must consume more of the resource that more limit it. Our study highlights the power of the mechanistic approach in understanding and predicting species loss across environments and, ultimately, mitigating its pace.

Subject terms: Community ecology, Biodiversity


Predicting species coexistence across environments is challenging. This study accurately predicts community composition using a consumer-resource model and reveals higher diversity when species compete for substitutable versus essential resources.

Introduction

Understanding and predicting species coexistence often relies on the Lotka1 and Volterra2 framework. This approach, inferring competitive interactions from the effects of one species on the growth of another, has provided numerous insights. For example, it has revealed the relative strength of intra- to interspecific competition as a major determinant of species coexistence3 and has been used to predict community composition4,5. However, without explicitly identifying the causes of competition, it fails to capture the dependence of species coexistence on environments, such as resource availability68 and species richness9, limiting its applications. Consequently, mechanistic approaches are much needed. One such approach, formularized by MacArthur, describes how species consume and convert shared resources and thus compete with each other10,11. Expanding upon this groundwork, two rules for species coexistence were identified by Tilman12,13 (Fig. 1a). First, each species must be limited by different resources. Otherwise, a ‘superior’ species with the lowest resource requirements will outcompete others. Second, each species must consume more of the resource that more limits itself. Despite the enduring interest in this mechanistic approach, direct empirical studies are rare14,15. The few empirical studies focus on resource requirement16 or the effect of resource availability on species coexistence, leaving the important role of resource consumption largely unexplored (but see refs. 1719). Furthermore, most studies focus on species pairs and a single type of resource (e.g., only essential17 or substitutable18 resources). A comprehensive understanding of the proportion of species that meet Tilman’s two rules for coexistence remains elusive.

Fig. 1. A mechanistic approach to understanding and predicting species coexistence.

Fig. 1

a Tilman’s rules for species coexistence, as illustrated by two algae consuming two resources (See Supplement Note 4 for the corresponding Zero Net Growth Isoclines [ZNGI] figures). First, each species must be limited by different resources. Second, they must consume more of the resource that more limits itself. Inhibitors indicate the limitation of resources on algal growth (resource requirement). Arrows indicate the effect of algae on resources (resource consumption), with thicker arrows representing a larger effect. b In a monoculture experiment, each of the 12 algal species was grown under 12 concentrations of nitrate NO3, ammonium NH4+, or phosphorus (P). In a competition experiment, two, three, four, or six species were competed for either two substitutable resources (NO3 and NH4+) or essential resources (NO3 and P). Measured conditions refer to resource conditions used in both monoculture and competition experiments, while novel conditions are those used only in the latter. c To quantify resource requirement and consumption, we combined a consumer-resource model with the monoculture experiment. We further assessed the proportion of species that met Tilman’s mechanistic rules. d We predicted community composition and assessed predictive accuracy with the competition experiments. Fig. 1a was created in in BioRender. Becks, L. (2025) https://BioRender.com/oyxxims.

Here, we test 1) whether the mechanistic approach can well-predict community composition and 2) to what extent the two rules for coexistence described by Tilman are fulfilled. We used unicellular phytoplankton (freshwater green algae) as the study system. Their small size and fast generation time provide a controllable, rapid and scalable system to test theoretical models. Unlike bacteria — where cross-feeding, or the sharing of metabolites between species, is common20 — phytoplankton primarily compete for resources, such as light, nitrogen, and phosphorus and descriptions of interactions between phytoplankton species via metabolites are limited to toxins21.

We track the daily growth rates of 12 different phytoplankton species (Table S1) in monocultures over four days (approx. zero to eight generations, depending on the resource concentrations). This is conducted under 12 concentrations of nitrate NO3, ammonium NH4+, or phosphorus (P; Fig. 1b), while ensuring that all other nutrients remained unlimited. To quantify the resource requirement and consumption for each species, we use Bayesian modeling to parameterize a consumer-resource model using the growth data and initial resource concentrations (see Materials and Methods for details; Fig. 1c). Next, we grow two, three, four, or six species in semi-continuous cultures where they compete for different ratios of two essential resources (NO3 and P) or of two substitutable resources (NO3 and NH4+; Figs. 1b, S1, 2). We track the community composition over 12 days with an automated pipeline that integrates high-content microscopy, imaging analysis, and machine learning; and compare the observed composition of these 960 communities with predictions from the consumer-resource model and parameters derived from the monocultures (Fig. 1d). Finally, we assess the proportion of communities meeting Tilman’s two rules for coexistence using our experiments and simulation.

Results and Discussion

The mechanistic approach predicts community composition

The per capita growth rate and consumption rate increased asymptotically with resource concentration for all 12 algal species (Fig. 2), indicating that all species can grow in monocultures, although with a large variation among species (Fig. 2). Using this information on resource requirement and consumption, we asked whether the mechanistic, resource-consumer approach can predict the composition (as species relative abundance) of 960 communities where species competed for essential or substitutable resources. For comparison, we predicted relative abundance using a null model in which species relative abundances were randomly shuffled within each community to be predicted. This model predicted the community composition with a mean accuracy of 53.5% (Fig. 3a; assessed by the Bray-Curtis similarity between the predicted and observed species relative abundance). Then, we predicted relative abundance with the consumer-resource model. In this model, for essential resources (NO3 and P), we assumed that the growth of a species was determined by the resource that supports the lower growth rate, according to the Liebig’s law of minimum22. For substitutable resources (NO3 and NH4+), we assumed that the growth rate is the sum of the growth rates provided by both resources. Although the relative abundance strongly depended on resource condition and changed over time (Figs. S4, 5; Supplement Note 1), it was well-predicted by the mechanistic model, with a mean accuracy of 83.4% (Figs. 3a, S6; Table S2; Linear mixed-effects model (LMM): F1, 14251 = 2656, P < 0.001).

Fig. 2. The 12 algal species vary in resource requirement and consumption.

Fig. 2

a Using time series data, the consumer-resource model captured both resource requirement and consumption of Chlamydomonas reinhardtii on nitrate (NO3; see Fig. S3 for all species and all three resources). On day 1, the fitted resource requirement curve explained the relationship between growth rate and initial NO3 concentration (gray dots). On days 2 and 3, using the initial concentration always overestimated the growth rate because it ignored resource consumption. The modeled NO3 concentration (black dots), which accounted for resource consumption, better explained the growth rate. b, c The resource requirement and consumption for nitrate NO3, ammonium NH4+, or phosphorus (P). Colors indicate different species (see Table S1 for the full names of the species).

Fig. 3. The consumer-resource model predicts community composition.

Fig. 3

a We predicted the composition of 960 communities with a null model that randomly shuffled species relative abundance within each community and a resource-consumer model that integrated resource requirement and consumption. The observed versus predicted relative abundances (logit transformed) are shown for each model, with warmer colors indicating a higher density of data points. Diagonal lines are included for reference and indicate perfect agreement between observations and predictions. The predictive accuracies (acc) are shown for each model. b The predictive accuracy did not differ between the measured (used in the monoculture experiment) and novel (not used in the monoculture experiment) conditions. c The predictive accuracy was higher for two-species communities than six-species communities.

Our mechanistic approach had also robust predictive abilities across resource conditions. It accurately predicted community composition of the 960 communities, not only in measured conditions, in which resource requirement and consumption were quantified from monocultures, but also in novel conditions (i.e., combinations N ad P concentrations), which were not assessed in the monocultures (Fig. 3b; LMM: F1, 10 = 3.999, P = 0.073). In comparison, previous work has found that the classical Lotka-Volterra approach, which infers competition from the negative effects of one species on the growth of another, was sensitive to abiotic environments, such as water and nutrient levels68. Such context-dependency makes it challenging to predict from one condition to another (but see ref. 23 for a probabilistic approach). Furthermore, applying the Lotka-Volterra approach requires conducting experiments with 2S -1 communities, where S is the species richness (but see refs. 5,24. for approaches to reduce the experiment size). In contrast, the mechanistic approach sees the experiment size growing linearly with the species richness, as it requires measuring only monocultures. Since we found that the mechanistic approach also well-predicted community composition across species richness (Fig. 3c; mean accuracy > 74% for all species richness; Supplement Note 2) and time (Fig. S6), it is now poised to be applied to biodiverse communities under various conditions.

Although the predictive accuracy was high and did not differ between two-species, three-species, and four-species communities, we found that the accuracy was higher for two- communities than for six-species communities (Fig. 3c; F1, 36 = 4.580, P = 0.039). Alternative stable states25 were present in communities and may explain this difference, particularly in more diverse communities (Supplement Note 6). Perturbations, such as those induced by refreshing the cultures every two days, could drive the community to transition between these states. Given the prevalence of disturbance and stochastic processes in natural communities, achieving accurate long-term predictions for species-rich communities likely requires continuous monitoring.

The mechanistic rules are more likely to be met when competing for substitutable resources

We next used parameters that were quantified from the monoculture experiment and predicted whether the species pairs can stably coexist by assessing Tilman’s two rules on species coexistence. We found that when competing for two essential resources (NO3 and P), only 30.3% of the species pairs (20 out of 66 all possible pairs) met Tilman’s first rule for coexistence: each species must be limited by different resources (Fig. 4a). Among the species pairs that meet the first rule, only 40.0% of the pairs (8 out of 20) met the second: each species must consume more of the resource that more limits itself (Fig. 4b). Together, only 12.1% of the species pairs (8 out of 66) can stably coexist, which further depends on the resource supply12. When competing for substitutable resources (NO3 and NH4+), the probability of stable coexistence was higher (22.7%, 15 out of 66), with 37.9% and 60.0% of the pairs meeting the first and the second rules, respectively (Fig. 4). Both findings indicate the low probability of stable coexistence when species compete for two limiting resources, regardless of the resource type. Previous studies26,27 using the Lotka-Volterra approach revealed a comparable probability across taxonomic groups, ranging from 14.6% to 33.9%. However, because theory suggests multiple resources promote multispecies coexistence28,29, future study should explore its effect.

Fig. 4. The mechanistic rules are more likely to be met when two species compete for substitutable resources.

Fig. 4

Vertical lines indicate the proportion calculated from the experiment (abbreviated as Exp) while density plots indicate the theoretical expectations calculated from 999 sets of simulation. a The simulation showed that the median proportion of two species meeting the first rule was 50%, irrespective of the resource type (essential or substitutable). The proportion found in the experiment was 30.3% and 37.9% (out of 66 species pairs) for essential and substitutable resources, respectively. b The proportion of two species meeting the second rule was low when competing for essential resources (40.0% in the experiment and 20.5% in the simulation) but was high for substitutable resources (60.0% in the experiment and 79.5% in the simulation).

To test whether these experimental results align with theoretical expectations for matching Tillman’s rules, and whether there is a difference between competition for essential resources and competition for substitutable resources, we simulated 12 species over 999 times. For each species, we drew parameters for the consumer-resource model from unique distributions (Materials and Methods and Supplement Note 3.1). On average, 50% of the species pairs (66 pairs × 999 simulations) met Tilman’s first rule (Fig. 3a; lower and upper 2.5% quantiles: 28.7% and 71.2%). Although the resource type did not affect the percentage of species that met the first rule, it did affect the second rule (Fig. 4b). Specifically, we found that species competing for essential resources were less likely to meet the second rule than those competing for substitutable resources (average percentage 20.5% vs. 79.5%). Both findings confirmed the results of our experiments.

But why species that compete for essential resources are less likely to meet Tilman’s second rule? Given the intrinsic link between consumption and growth rates (Fig. S8; Supplement Note 3.2), the resource that a species consumes more is often the same resource that supports higher growth rates, consequently more limiting the species (Supplement Note 4). However, this is only true for substitutable resource. For essential resources, Liebig’s law of minimum reverses the results. Specifically, the only limiting resource is often consumed less and thus supports the lower growth (Supplement Note 4). This contrasts with Tilman’s second rule: a species must consume more of the resource that more limits its growth. As a result, our finding, along with other theoretical work30,31, explains the inherent challenges of species coexistence when competing for essential resources. However, substitutable resources for phytoplankton, such as different forms of nitrogen and different light spectra32, is prevalent under natural conditions. Furthermore, phytoplankton serve as substitutable resources to their predators, offering an alternative pathway for the coexistence of phytoplankton33 and for solving the paradox of plankton34.

Last, we compared Shannon diversity of experiments and model simulations in multispecies communities. We used Shannon diversity rather than species richness to indicate the probability of coexistence in the experiment, because the duration of the experiment was not long enough to assess the endpoint of all communities (i.e., potential competitive exclusion). Shannon diversity at the end of the experiment increased with initial species richness (Fig. 5a; LMM: F3, 36 = 7.64, P = 4.48 × 10−4). This is especially the case when the species competed for substitutable resources, as indicated by the significant interaction between initial species richness and resource type (Fig. 5a; LMM: F3, 575 = 22.88, P = 5.27 × 10−14). Our simulation confirmed it: although no more than two species can coexist when competing for two resources35, the probability of coexistence of two species increased with initial species richness (Fig. 5b; Linear model (LM): F3 = 413.7, P < 2.2 × 10−16), especially when competing for substitutable resources (LM: F3 = 21.54, P = 3.76 × 10−16). This is because meeting the first rule is almost guaranteed in multispecies communities (P=S1S, where S is the initial species richness; Supplement Note 4). Consequently, the probability of coexistence is predominately determined by the second rule, which is much more likely to be met for substitutable resources.

Fig. 5. Diversity is promoted in multispecies communities when species compete for substitutable resources.

Fig. 5

a At the end of the experiment, Shannon diversity increased with initial species richness, especially when the species competed for substitutable resources. The sample sizes per resource type are 128 for two-species communities and 64 for other communities. b The 999 sets of simulation showed that the probability of coexistence of two species increased with initial species richness, especially when competing for substitutable resources. Density plots indicate the distribution of Shannon diversity of all communities in the experiment and that of probability of coexistence of two species (i.e., meeting both mechanistic rules) calculated from the simulation. Error bars indicate the means and 95% confidence intervals.

The effect of resource type on diversity was weaker in the experiment than the simulation, especially at low species richness. First, while the Shannon diversity did not significantly differ between species competing for essential resources and species competing for substitutable resources, coexistence under essential resources was potentially less stable (e.g., neutral36). Differentiating neutral from stable coexistence would require increased replicates to assess if communities consistently reach the same endpoints. Second, while our model assumes random parameters, introducing correlation between parameters (e.g., size-dependent consumption and growth rate; supplement Note 7) can reduce the effect of resource type. Third, while our model assumes that growth is directly linked to external nutrient concentration, real-world organisms can store nutrients, such as phosphorus. This storage capacity can influence species coexistence when competing for essential resources37. Last, because using NO3 as nitrogen source is more energy-demanding than using NH4+, algae may preferentially use NH4+ when it is abundant. This makes the two resources not perfectly substitutable, thereby reducing the probability of coexistence. Exploring the full spectrum of resource complexity—from perfectly essential to perfectly substitutable—and its implications for coexistence could allow more nuanced predictions.

Our finding of the fundamental difference between essential and substitutable resources can advance our understanding of mechanisms governing species coexistence and evolution. For example, theoretical studies38,39 revealed that competition for substitutable resources led to character divergence40, while competition for essential resources led to character convergence. As suggested by our study, this occurs because stable coexistence through essential resources is unlikely, making convergence toward ecologically identical species one pathway to achieving ‘neutral’ coexistence. Although we focused on resource competition in our phytoplankton system, our mechanistic model can be readily extended to other types of competition, such as cross-feeding in bacteria. Furthermore, our study suggests that the mechanistic model, which captures the processes underlying species interactions, can accurately predict community composition across a broad spectrum of abiotic and biotic conditions. This makes it a highly valuable tool for anticipating species loss and, ultimately, mitigating its pace.

Methods

All the cultures were grown in 96-well plates (TPP®, Techno Plastic Products AG), at 20 °C, constant light (65 µmol/m2/s), and static conditions.

Study species

We selected 12 green algal species (Table S1): Acutodesmus obliquus (abbreviation in Fig. 2: AO), Chlamydomonas klinobasis (CK), Chlamydomonas oblonga (CO), Chlamydomonas reinhardtii (CR), Chlorella vulgaris (CV), Chlorella minutissima (ChlM), Choricystis minor (ChoM), Monoraphidium griffithii (MG), Monoraphidium minutum (MM), Scenedesmus intermedius (SI), Scenedesmus quadricauda (SQ), and Scenedesmus sp (SS). All species are from the algae collection at the Limnological Institute of the University of Konstanz. Before the experiments, stocks of each species were spread on agar plates and grown for seven days. Then, we picked a single colony for each species and grew it in modified WC medium (512 μM of nitrate and 25.6 μM of phosphorus) for nine days. The use of single colonies aims to minimize the effect of evolution on coexistence.

Two days before the experiments, we collected 2 mL culture for each species and washed the remaining nitrate and phosphorus by performing two rounds of centrifuging at 3000 G for 5 min, discarding approx. 1.9 mL supernatant and replacing it with modified WC medium that did not contain nitrate and phosphorus. After that, we counted each culture and diluted it to approx. 500 cells/μL with a modified WC medium that did not contain nitrate and phosphorus. We let the culture rest for two days to reduce the remaining nutrients in the medium or potential intracellular storage of nutrients.

Quantifying resource use from monoculture experiments

On the day of the experiment, for each species, we added 10 μL of diluted culture (~5,000 cells) into 260 μL of modified WC medium. This medium was modified to contain varying concentrations of either nitrate resources NO3, ammonium NH4+, or phosphorus. For NO3, we reduced the nitrate concentration of the WC medium to one of the 12 levels: 0, 0.25, 0.5, 1, 2, 4, 8, 16, 32, 64, 128, and 512 μM. This ensured that nitrate was the major limiting factor, especially when low. For NH4+, we replaced sodium nitrate with ammonium chloride and employed the same 12 concentrations. For P, we reduced the P concentration to one of the 12 levels: 0, 0.0125, 0.025, 0.05, 0.1, 0.2, 0.4, 0.8, 1.6, 3.2, 6.4 and 25.6 μM. With two technical replicates, we had a total of 864 cultures (3 resources × 12 concentrations × 12 species × 2 replicates; a fully crossed design). All species and resource concentrations were randomized in the 96-well plates. We sampled each culture 20 μL after mixing for four consecutive days. Because our pilot experiment showed that most species experienced a lag phase of approx. 12 h, we started our first sampling 12 h after the inoculation. All culture preparation and sampling were done by a pipetting robot (OT-2, Opentrons). All samples were imaged and counted with a high-content microscopy (ImageXpress® Micro 4 High-Content Imaging System).

For a given species (i) and resource (j, NO3, NH4+, or P), we fit the growth data with a consumer-resource model that contains one species and one resource:

1NidNidt=umax,ijRjkij+Rjmij 1
1NidRjdt=cijRjsij+Rj 2

Equation (1) describes the per capita growth rate of species i, 1NidNidt, as a function of the concentration of resource j (Rj), and thus indicates resource requirement. It follows the Monod equation41, where umax,ij is the maximum birth rate of species i on resource j, kij is the half-saturation constant for birth rate (the concentration of resource j when species i reaches to half of its maximum birth rate), and mij is the mortality rate of species i in the presence of resource j. Equation (2) describes the per capita consumption rate of species i on resource j, 1NidRjdt, as a function of Rj. It follows the type II functional response sensu Holling42, where cij is the maximum consumption rate, and sij is the half-saturation constant for consumption rate (the concentration of resource j when species i reaches to half of its maximum consumption rate). We did not use type III functional response because it typically applies to biotic resources (prey), which can hide at low densities43.

While the theoretical model is continuous, abundance can only be measured at discrete times. Consequently, we calculated 1NidNidt at time t as lnNj,t+1Nj,t,, and 1RjdRjdt at time t as lnRj,t+1Rj,t, where t + 1 is one day after t. Theoretically, the relationship between resources and per capita growth rate (or consumption rate) can be linear. We tested this and found that the nonlinear relationship fitted the experimental data better, with a median R squared of 0.7 (Supplement Note 8).

We applied a Bayesian approach to parameterize the model with the brms (version 2.19.0) package44 in R (version 4.2.3) language45. The resource consumption was quantified based on the combined information of per capita growth rate and initial resource concentrations (i.e., without the need for measuring resources over time). As a hypothetical example, consider a species growing in two media in which initial nitrate concentrations are 0 and 10 μM, respectively. While the initial per capita growth rate at the 10 μM concentration is high, it will decrease due to resource consumption and at a later time point reach the same rate as the initial per capita growth rate at the 0 μM concentration. Then, we can conclude that the amount of consumed nitrate is 10 μM. An additional assay in which we measured nitrate and phosphorus concentrations over time confirmed that our approach did well quantify the resource consumption (Supplement Note 9). To account for the non-independence of data from the same culture, we assumed that each culture had different maximum birth rates in the Bayesian model.

Assessing community composition in competition experiments

In parallel with the monoculture experiment, we conducted competition experiments, where two, three, four, or six species were randomly chosen, mixed in the same ratio, and competed in modified WC media (20 μL culture added into 260 μL medium) for 12 days. We designed six resource conditions where the species competed for different ratios of essential resources (NO3 and P) and another six where the species competed for different ratios of substitutable resources (NO3 and NH4+; Fig. S2). Note that we maintained high concentrations of other resources (e.g., potassium) while keeping the manipulated resources relatively low. This ensured that the manipulated resources were the major limiting resources. Four of the twelve resource conditions were used in the monoculture experiments (i.e., measured conditions), and the other eight were not (i.e., novel conditions; Fig. S2). For the species richness of two, we randomly selected 16 out of the 66 combinations of species. From these 16 combinations, we randomly selected eight combinations and then randomly added one, two, and four species, resulting in eight combinations each for species richness of three, four, and six, respectively. With two technical replicates, we had a total of 960 cultures (2 resource types × 6 resource conditions × 40 combinations × 2 replicates; a fully crossed design). We sampled 20 μL of culture after mixing on day one, and then every two days starting from day four. The algal abundance for each sample was counted with the high-content microscopy (ImageXpress®), and species were identified with a machine-learning approach (Supplement Note 10). To maintain semi-continuous cultures, starting from day four, we mixed 160 μL of the old culture and 80 μL of fresh medium every two days.

Predicting community composition with the mechanistic model

To assess whether the mechanistic model predicted the community composition, we started with a null model as a reference. In this null model, we randomly shuffled the species abundance in each community 999 times. Then, we used the mechanistic model to predict the community composition from day four to day twelve in the competition experiments. Specifically, we used the resource requirement and consumption that were quantified from the monoculture experiments (i.e., the mechanistic model). The initial abundance of each species is based on the abundance on day one of the competition experiments. We modeled the abundance of each algal species and resource with a consumer-resource model that contains multispecies and two resources:

1NidNidt=minj=1,2umax,ijRjkij+RjmijDforessentialresroucesj=12umax,ijRjkij+RjmijDforsubstitutableresrouces 3
dRjdt=D(Rj,inRj)i=1ncijNiRjsij+Rj 4

Equation (3) describes the per capita consumption rate of species i when grown on two resources. D is the dilution rate. It equals to ln32 day−1 (160 μL old culture mixed with 80 μL fresh medium) at day 4, 6, 8, 10 and 12 and equals to 0 for the other days. All the other parameters follow the Eq. (1). For essential resources (here, NO3 and P), the growth rate of the species is determined by the resource that supported a lower growth rate (i.e., Liebig’s law). For a substitutable resource (NO3 and NH4+), the growth rate is the sum of both growth rates. Our additional assay on growth rate under varying resource concentrations did support that NO3 and P were essential resources and that NO3 and NH4+ were substitutable resource (SI text 10). The Eq. (4) describes the change of resource j, as a function of Rj and Ni. D(Rj,inRj) describes the resources supply, with Rj,in representing input nutrient concentration (same as the initial nutrient concentration). i=1ncijNiRjsij+Rj describes the resource consumption by all the species, with n representing the species richness in the community (i.e., n = 2, 3, 4, or 6). All the other parameters follow Eq. (2). Note that, for simplification, we transposed Rj from the left to the right side in Eq. (4). This resulted in the difference in the left-hand sides of Eqs. (2) and (4) but did not affect the prediction.

To assess the performance of our models in predicting community composition of competition experiments, we calculated predictive accuracy using the Bray–Curtis similarity index46 for each community at each time point (Eq. 5):

acc=2i=1nmin(ai,obs,ai,pred)i=1n(ai,obs+ai,pred)=i=1nmin(ai,obs,ai,pred) 5

where n, ai,obs, ai,pred are the number of species in the community, observed and predicted relative abundance of species i, respectively. The value of accuracy ranges from 0 to 1. A higher value indicates higher predictive accuracy, with a value of 1 indicating that the predicted relative abundance is exactly the same as the observed relative abundance. To minimize the effect of randomness on cell sampling and counting, we excluded data points where fewer than 10 cells were counted. We also calculated the predictive accuracy according to the absolute abundance, the results were overall similar (Supplement Note 2).

We first tested whether the mechanistic model better predicted the community composition than the null model. To do so, we conducted a linear mixed model with the lme4 (version 1.1-33) package47. The model included the predictive accuracy as the response variable and type of prediction (the null vs. the mechanistic model) as the fixed effect. We then tested whether the predictive accuracy was consistent across time point, across species richness, and across measured and novel environments (e.g., if a species fails to grow in a given medium in monoculture, the model will naturally and accurately predict it to be outcompeted in this measured medium when competing with other species). To do so, we conducted another linear mixed model. The model included the predictive accuracy of the mechanistic model as the response variable and the time point (day four to day twelve), the type of medium (novel vs. measured), and species richness as the fixed effect. We did not include the interactions between the main effects because this is not the main interest of our study and because this will lead to many categories (e.g., 5 time points × 4 species richness × 2 types of medium). Both models included the identity of medium and species combination as the random effects. The predictive accuracy was logit-transformed to improve the normality of the residuals. For species richness and time points, which contain more than two levels, we created dummy variables48 to compare each levels to the reference levels (i.e., two species, and day 4, respectively). The significance of the fixed effects was assessed with ANOVA.

Assessing the proportion of species that meet Tilman’s rules for coexistence

Community of two consumers

To assess the proportion of species pairs that can stably coexist, we assessed Tilman’s two rules on species coexistence, using parameters that were quantified from the monoculture experiment. To assess the proportion of species pairs that met Tilman’s first rule, each species must be limited by different resources, we tested whether the zero net growth isoclines (ZNGIs) of two species have a positive intersection (i.e., resource equilibrium) for each species pair (Supplement Note 4). This was done with the sympy (version 1.11.1) library49 in python (version 3.10.9)50.

For species pairs that met the first rule, we further assessed the proportion of species pairs that met Tilman’s second rule, each species must consume more of the resource that more limits itself. To do so, we determined for each species the resource that more limited itself. Mathematically, this is done by comparing the partial derivatives of the per capita growth rate of each species to each resource at the equilibrium, using the math library51. Then, we determined for each species the resource that it consumed more by comparing the per capita consumption rate of each species on each resource at the equilibrium.

To test whether our experimental results align with the theoretical expectation, we simulated 12 species. For each species, we randomly drew the parameters (e.g., cij and sij) in the consumer-resource model from zero to one following a uniform distribution. Note that changing the range of the distribution (e.g., using from zero to two) will not affect the results (Supplement Note 4). Changing the type of the distribution (e.g., using Gaussian distribution) will affect the results quantitatively but not qualitatively (Supplement Note 4). We set the mortality rate to 0.1 for all the species. This is because our experiments showed that the species-specific mortality rate (mean: 0.01 day−1) is much lower than the mortality caused by dilution, which is constant.

Instead of modeling the per capita growth rate as a function of resource concentration, as we did earlier to quantify resource requirement, we modeled it as a function of per capita consumption rate. While the former approach is more practical for parameter estimation, the latter is theoretically justified, as an individual converts its consumed resources into growth38 (but see Supplement Note 3 for how the two methods match with each other). Specifically, we modeled the per capita growth rate of species i as:

1NidNidt=minj=1,2wijgij(Rj)qij+gij(Rj)mforessentialresroucesj=12wijgij(Rj)qij+gij(Rj)mforsubstitutableresrouces 6

where wi,j is a weighing factor, the value of one unit of the consumed resource j to species i. gij(Rj) is the per capita consumption rate of species i on resource j, i.e., cijNiRjsij+Rj. qij is the half-saturation constant for birth rate (the level of consumed resource j when species i reaches half of its maximum birth rate). m is the mortality rate. For the changes of resource, we modeled it as Eq. (4).

We only kept species that can grow when alone (i.e., had positive abundance when reaching equilibrium), which meets the condition of our experiment. As above, we assessed the proportion of species pairs that met Tilman’s rules. We repeated the simulation over 999 times and calculated the average and 95% quantile for both proportions. Besides the simulation, we also derived the analytic solution in the linear system (Supplement Note 4), which confirmed the results of our simulation.

Note that as long as the two rules are met, the coexistence is further determined by the resource supply: the resource supply must fall within the region bounded by the consumption vectors of the two species (the third rule). This is explored in the Supplement Note 4.4).

Community of multiple consumers

While Tilman’s mechanistic rules are based on two consumers, we scaled it up to multiple consumers (Supplement Note 5). The first rule should be adapted to: at least two of the species must be limited by different resources. Additionally, the equilibrium of these two species must not be invadable by other species (i.e., all the other species have a negative growth rate at this equilibrium). Otherwise, at least one of the two species will be replaced by a third species. The second rule stays the same: for these two species, each species must consume more of the resource that more limits itself.

We calculated the mean probability of coexistence for each of the 999 sets of simulations above. For each simulation, we used all the combinations of two species (66), and randomly selected 99 combinations of three, four, or six species. Then, we tested whether the mean probability of coexistence of two species depended on the resource type and initial species richness with a linear model. The model included the mean probability of coexistence of each simulation as the response variable and the resource type, initial species richness, and their interaction as the explanatory variables.

In comparison, we tested with our competition experiment whether the coexistence depended on the resource type and initial species richness with a linear-mixed effects model. We excluded data from conditions where one of the two manipulated resources was abundant (e.g., 0.1 μM P and 512 μM NO3), as these scenarios were limited by a single resource and could not be categorized as either essential or substitutable. The model included the Shannon diversity at the end of the experiment as the response variable; the resource type, initial species richness, and their interaction as the fixed effects; and the species combination (as we have two technical replicates) and resource condition as the random effects. Unlike the simulation, we used Shannon diversity. This is due to the duration of the competition experiment being too short to assess the endpoint of co-existence. However, by investigating Shannon diversity, we can still glean insights into whether the initial species richness and/or resource type promote coexistence.

Reporting summary

Further information on research design is available in the Nature Portfolio Reporting Summary linked to this article.

Supplementary information

Reporting Summary (74.8KB, pdf)

Acknowledgements

We thank Chuliang Song for help with deriving the analytic solution, Natascha Handke for helping with the experiment, and Faruk Tök for conducting a pilot experiment. We also thank Toni Klauschies, Ville Mustonen, and Dietmar Straile for comments on the manuscript. Z.Z. was supported by Deutsche Forschungsgemeinschaft (DFG: ZH 113/2-1) and YSF co-funding at the University of Konstanz.

Author contributions

Z.Z. and L.B. conceived the idea and designed the study. Z.Z. performed the experiment, analyzed the data, and conducted the simulation. Z.Z. drafted the manuscript and L.B. revised it.

Peer review

Peer review information

Nature Communications thanks Chang-Yu Chang, Wenping Cui, and Robert Marsland III for their contribution to the peer review of this work. A peer review file is available.

Funding

Open Access funding enabled and organized by Projekt DEAL.

Data availability

The data generated in the study have been deposited in the Figshare database (10.6084/m9.figshare.29093678).

Code availability

The code of the study has been deposited in the Figshare database (10.6084/m9.figshare.29093678).

Competing interests

The authors declare no competing interests.

Footnotes

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Supplementary information

The online version contains supplementary material available at 10.1038/s41467-025-64935-5.

References

  • 1.Lotka, A. J. The growth of mixed populations: Two species competing for a common food supply. J. Wash. Acad. Sci.22, 461–469 (1932). [Google Scholar]
  • 2.Volterra, V. Fluctuations in the abundance of a species considered mathematically1. Nature118, 558–560 (1926). [Google Scholar]
  • 3.Adler, P. B. et al. Competition and coexistence in plant communities: intraspecific competition is stronger than interspecific competition. Ecol. Lett.21, 1319–1329 (2018). [DOI] [PubMed] [Google Scholar]
  • 4.Friedman, J., Higgins, L. M. & Gore, J. Community structure follows simple assembly rules in microbial microcosms. Nat. Ecol. Evolution1, 0109 (2017). [DOI] [PubMed] [Google Scholar]
  • 5.Maynard, D. S., Miller, Z. R. & Allesina, S. Predicting coexistence in experimental ecological communities. Nat. Ecol. Evolution4, 91–100 (2020). [DOI] [PubMed] [Google Scholar]
  • 6.Zhang, Z., Liu, Y., Hardrath, A., Jin, H. & van Kleunen, M. Increases in multiple resources promote competitive ability of naturalized non-native plants. Commun. Biol.5, 1150 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 7.Dostál, P. Fitness and niche differences are both important in explaining responses of plant diversity to nutrient addition. Ecology104, e4125 (2023). [DOI] [PubMed] [Google Scholar]
  • 8.Van Dyke, M. N., Levine, J. M. & Kraft, N. J. B. Small rainfall changes drive substantial changes in plant coexistence. Nature611, 507–511 (2022). [DOI] [PubMed] [Google Scholar]
  • 9.Kleinhesselink, A. R., Kraft, N. J. B., Pacala, S. W. & Levine, J. M. Detecting and interpreting higher-order interactions in ecological communities. Ecol. Lett.25, 1604–1617 (2022). [DOI] [PubMed] [Google Scholar]
  • 10.MacArthur, R. H. Species packing, and what competition minimizes. Proc. Natl Acad. Sci.64, 1369–1371 (1969). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 11.MacArthur, R. Species packing and competitive equilibrium for many species. Theor. Popul. Biol.1, 1–11 (1970). [DOI] [PubMed] [Google Scholar]
  • 12.Tilman, D. Resources: A graphical-mechanistic approach to competition and predation. Am. Naturalist116, 362–393 (1980). [Google Scholar]
  • 13.Tilman, D. Resource competition and community structure. (Princeton University Press, 1982). [PubMed]
  • 14.Miller, T. E. et al. A critical review of twenty years’ use of the resource-ratio theory. Am. Nat.165, 439–448 (2005). [DOI] [PubMed] [Google Scholar]
  • 15.Letten, A. D., Ke, P. J. & Fukami, T. Linking modern coexistence theory and contemporary niche theory. Ecol. Monogr.87, 161–177 (2017). [Google Scholar]
  • 16.Gallego, I. & Narwani, A. Ecology and evolution of competitive trait variation in natural phytoplankton communities under selection. Ecol. Lett.25, 2397–2409 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 17.Tilman, D. Tests of resource competition theory using four species of Lake Michigan algae. Ecology62, 802–815 (1981). [Google Scholar]
  • 18.Rothhaupt, K. O. Mechanistic resource competition theory applied to laboratory experiments with zooplankton. Nature333, 660–662 (1988). [Google Scholar]
  • 19.Grover, J. P. Resource competition. Vol. 19 (Springer US, 1997).
  • 20.McKinlay, J. B. Are Bacteria Leaky? Mechanisms of Metabolite Externalization in Bacterial Cross-Feeding. Annu. Rev. Microbiol.77, 277–297 (2023). [DOI] [PubMed] [Google Scholar]
  • 21.Holland, A. & Kinnear, S. Interpreting the possible ecological role(s) of cyanotoxins: Compounds for competitive advantage and/or physiological aide?. Mar. Drugs11, 2239–2258 (2013). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 22.Sprengel, C. Die lehre vom dünger: oder Beschreibung aller bei der landwirthschaft gebräuchlicher vegetabilischer, animalischer und mineralischer düngermaterialien nebst erklärung ihrer wirkungsart. (I. Müller, 1839).
  • 23.Song, C., Von Ahn, S., Rohr, R. P. & Saavedra, S. Towards a probabilistic understanding about the context-dependency of species interactions. Trends Ecol. Evolution35, 384–396 (2020). [DOI] [PubMed] [Google Scholar]
  • 24.Ansari, A. F., Reddy, Y. B. S., Raut, J. & Dixit, N. M. An efficient and scalable top-down method for predicting structures of microbial communities. Nat. Computational Sci.1, 619–628 (2021). [DOI] [PubMed] [Google Scholar]
  • 25.Lewontin, R. C. The meaning of stability. Brookhaven Symp. Biol.22, 13–24 (1969). [PubMed] [Google Scholar]
  • 26.Buche, L., Spaak, J. W., Jarillo, J. & De Laender, F. Niche differences, not fitness differences, explain predicted coexistence across ecological groups. J. Ecol.110, 2785–2796 (2022). [Google Scholar]
  • 27.Chang, C.-Y., Bajić, D., Vila, J. C. C., Estrela, S. & Sanchez, A. Emergent coexistence in multispecies microbial communities. Science381, 343–348 (2023). [DOI] [PubMed] [Google Scholar]
  • 28.Huisman, J. & Weissing, F. J. Biodiversity of plankton by species oscillations and chaos. Nature402, 407 (1999). [Google Scholar]
  • 29.Dal Bello, M., Lee, H., Goyal, A. & Gore, J. Resource–diversity relationships in bacterial communities reflect the network structure of microbial metabolism. Nat. Ecol. Evolution5, 1424–1434 (2021). [DOI] [PubMed] [Google Scholar]
  • 30.Wickman, J., Diehl, S. & Brannstrom, A. Evolution of resource specialisation in competitive metacommunities. Ecol. Lett.22, 1746–1756 (2019). [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 31.Vincent, T. L. S., Scheel, D., Brown, J. S. & Vincent, T. L. Trade-offs and coexistence in consumer-resource models: It all depends on what and where you eat. Am. Naturalist148, 1038–1058 (1996). [Google Scholar]
  • 32.Stomp, M. et al. Adaptive divergence in pigment composition promotes phytoplankton biodiversity. Nature432, 104–107 (2004). [DOI] [PubMed] [Google Scholar]
  • 33.Allesina, S. & Tang, S. Stability criteria for complex ecosystems. Nature483, 205–208 (2012). [DOI] [PubMed] [Google Scholar]
  • 34.Hutchinson, G. E. The paradox of the plankton. Am. Naturalist95, 137–145 (1961). [Google Scholar]
  • 35.Hardin, G. The competitive exclusion principle. Science131, 1292–1297 (1960). [DOI] [PubMed] [Google Scholar]
  • 36.Adler, P. B., Hillerislambers, J. & Levine, J. M. A niche for neutrality. Ecol. Lett.10, 95–104 (2007). [DOI] [PubMed] [Google Scholar]
  • 37.Grover, J. P. Resource storage and competition with spatial and temporal variation in resource availability. Am. Naturalist178, E124–E148 (2011). [DOI] [PubMed] [Google Scholar]
  • 38.Abrams, P. A. Alternative models of character displacement and niche shift. I. Adaptive shifts in resource use when there is competition for nutritionally nonsubstitutable resources. Evolution41, 651–661 (1987). [DOI] [PubMed] [Google Scholar]
  • 39.Fox, J. W. & Vasseur, D. A. Character convergence under competition for nutritionally essential resources. Am. Naturalist172, 667–680 (2008). [DOI] [PubMed] [Google Scholar]
  • 40.Brown, W. L. & Wilson, E. O. Character Displacement. Syst. Zool.5, 49–64 (1956). [Google Scholar]
  • 41.Monod, J. The growth of bacterial cultures. Annu. Rev. Microbiol.3, 371–394 (1949). [Google Scholar]
  • 42.Holling, C. S. Some characteristics of simple types of predation and parasitism. Can. Entomologist91, 385–398 (1959). [Google Scholar]
  • 43.Hossie, T. J. & Murray, D. L. You can’t run but you can hide: refuge use in frog tadpoles elicits density-dependent predation by dragonfly larvae. Oecologia163, 395–404 (2010). [DOI] [PubMed] [Google Scholar]
  • 44.Bürkner, P.-C. brms: An r package for bayesian multilevel models using Stan. J. Stat. Softw.80, 1–28 (2017). [Google Scholar]
  • 45.R Core Team, R. R: A language and environment for statistical computing. (2023).
  • 46.Bray, J. R. & Curtis, J. T. An ordination of the upland forest communities of southern Wisconsin. Ecol. Monogr.27, 325–349 (1957). [Google Scholar]
  • 47.Bates, D., Mächler, M., Bolker, B. & Walker, S. Fitting linear mixed-effects models using lme4. J. Stat. Softw.67, 1–48 (2015). [Google Scholar]
  • 48.Schielzeth, H. Simple means to improve the interpretability of regression coefficients. Methods Ecol. Evol.1, 103–113 (2010). [Google Scholar]
  • 49.Meurer, A. et al. SymPy: symbolic computing in Python. PeerJ Computer Sci.3, e103 (2017). [Google Scholar]
  • 50.Van Rossum, G. & Drake, F. L. Python 3 Reference Manual. (CreateSpace, 2009).
  • 51.Van Rossum, G. The Python Library Reference, release 3.8.2. (Python Software Foundation, 2020).

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Supplementary Materials

Reporting Summary (74.8KB, pdf)

Data Availability Statement

The data generated in the study have been deposited in the Figshare database (10.6084/m9.figshare.29093678).

The code of the study has been deposited in the Figshare database (10.6084/m9.figshare.29093678).


Articles from Nature Communications are provided here courtesy of Nature Publishing Group

RESOURCES