# Consumer-resource model

In theoretical ecology and nonlinear dynamics, consumer-resource models (CRMs) are a class of ecological models in which a community of consumer species compete for a common pool of resources. Instead of species interacting directly, all species-species interactions are mediated through resource dynamics. Consumer-resource models have served as fundamental tools in the quantitative development of theories of niche construction, coexistence, and biological diversity. These models can be interpreted as a quantitative description of a single trophic level.
A general consumer-resource model consists of M resources whose abundances are $R_{1},\dots ,R_{M}$ and S consumer species whose populations are $N_{1},\dots ,N_{S}$. A general consumer-resource model is described by the system of coupled ordinary differential equations,${\begin{aligned}{\frac {\mathrm {d} N_{i}}{\mathrm {d} t}}&=N_{i}g_{i}(R_{1},\dots ,R_{M}),&&\qquad i=1,\dots ,S,\\{\frac {\mathrm {d} R_{\alpha }}{\mathrm {d} t}}&=f_{\alpha }(R_{1},\dots ,R_{M},N_{1},\dots ,N_{S}),&&\qquad \alpha =1,\dots ,M\end{aligned}}$ where $g_{i}$, depending only on resource abundances, is the per-capita growth rate of species $i$, and $f_{\alpha }$ is the growth rate of resource $\alpha$. An essential feature of CRMs is that species growth rates and populations are mediated through resources and there are no explicit species-species interactions. Through resource interactions, there are emergent inter-species interactions.
Originally introduced by Robert H. MacArthur and Richard Levins, consumer-resource models have found success in formalizing ecological principles and modeling experiments involving microbial ecosystems.

## Models
### Niche models

Niche models are a notable class of CRMs which are described by the system of coupled ordinary differential equations,
    ${\begin{aligned}{\frac {\mathrm {d} N_{i}}{\mathrm {d} t}}&=N_{i}g_{i}(\mathbf {R} ),&&\qquad i=1,\dots ,S,\\{\frac {\mathrm {d} R_{\alpha }}{\mathrm {d} t}}&=h_{\alpha }(\mathbf {R} )+\sum _{i=1}^{S}N_{i}q_{i\alpha }(\mathbf {R} ),&&\qquad \alpha =1,\dots ,M,\end{aligned}}$
where $\mathbf {R} \equiv (R_{1},\dots ,R_{M})$ is a vector abbreviation for resource abundances, $g_{i}$ is the per-capita growth rate of species $i$, $h_{\alpha }$ is the growth rate of species $\alpha$ in the absence of consumption, and $-q_{i\alpha }$ is the rate per unit species population that species $i$ depletes the abundance of resource $\alpha$ through consumption. In this class of CRMs, consumer species' impacts on resources are not explicitly coordinated; however, there are implicit interactions.

#### MacArthur consumer-resource model (MCRM)

The MacArthur consumer-resource model (MCRM), named after Robert H. MacArthur, is a foundational CRM for the development of niche and coexistence theories. The MCRM is given by the following set of coupled ordinary differential equations:${\begin{aligned}{\frac {\mathrm {d} N_{i}}{\mathrm {d} t}}&=\tau _{i}^{-1}N_{i}\left(\sum _{\alpha =1}^{M}w_{\alpha }c_{i\alpha }R_{\alpha }-m_{i}\right),&&\qquad i=1,\dots ,S,\\{\frac {\mathrm {d} R_{\alpha }}{\mathrm {d} t}}&={\frac {r_{\alpha }}{K_{\alpha }}}\left(K_{\alpha }-R_{\alpha }\right)R_{\alpha }-\sum _{i=1}^{S}N_{i}c_{i\alpha }R_{\alpha },&&\qquad \alpha =1,\dots ,M,\end{aligned}}$where $c_{i\alpha }$ is the relative preference of species $i$ for resource $\alpha$ and also the relative amount by which resource $\alpha$ is depleted by the consumption of consumer species $i$; $K_{\alpha }$ is the steady-state carrying capacity of resource $\alpha$ in absence of consumption (i.e., when $c_{i\alpha }$ is zero); $\tau _{i}$ and $r_{\alpha }^{-1}$ are time-scales for species and resource dynamics, respectively; $w_{\alpha }$ is the quality of resource $\alpha$; and $m_{i}$ is the natural mortality rate of species $i$. This model is said to have self-replenishing resource dynamics because when $c_{i\alpha }=0$, each resource exhibits independent logistic growth. Given positive parameters and initial conditions, this model approaches a unique uninvadable steady state (i.e., a steady state in which the re-introduction of a species which has been driven to extinction or a resource which has been depleted leads to the re-introduced species or resource dying out again). Steady states of the MCRM satisfy the competitive exclusion principle: the number of coexisting species is less than or equal to the number of non-depleted resources. In other words, the number of simultaneously occupiable ecological niches is equal to the number of non-depleted resources.

#### Externally supplied resources model

The externally supplied resource model is similar to the MCRM except the resources are provided at a constant rate from an external source instead of being self-replenished. This model is also sometimes called the linear resource dynamics model. It is described by the following set of coupled ordinary differential equations:${\begin{aligned}{\frac {\mathrm {d} N_{i}}{\mathrm {d} t}}&=\tau _{i}^{-1}N_{i}\left(\sum _{\alpha =1}^{M}w_{\alpha }c_{i\alpha }R_{\alpha }-m_{i}\right),&&\qquad i=1,\dots ,S,\\{\frac {\mathrm {d} R_{\alpha }}{\mathrm {d} t}}&=r_{\alpha }(\kappa _{\alpha }-R_{\alpha })-\sum _{i=1}^{S}N_{i}c_{i\alpha }R_{\alpha },&&\qquad \alpha =1,\dots ,M,\end{aligned}}$where all the parameters shared with the MCRM are the same, and $\kappa _{\alpha }$ is the rate at which resource $\alpha$ is supplied to the ecosystem. In the eCRM, in the absence of consumption, $R_{\alpha }$ decays to $\kappa _{\alpha }$ exponentially with timescale $r_{\alpha }^{-1}$. This model is also known as a chemostat model.

#### Tilman consumer-resource model (TCRM)

The Tilman consumer-resource model (TCRM), named after G. David Tilman, is similar to the externally supplied resources model except the rate at which a species depletes a resource is no longer proportional to the present abundance of the resource. The TCRM is the foundational model for Tilman's R* rule. It is described by the following set of coupled ordinary differential equations:${\begin{aligned}{\frac {\mathrm {d} N_{i}}{\mathrm {d} t}}&=\tau _{i}^{-1}N_{i}\left(\sum _{\alpha =1}^{M}w_{\alpha }c_{i\alpha }R_{\alpha }-m_{i}\right),&&\qquad i=1,\dots ,S,\\{\frac {\mathrm {d} R_{\alpha }}{\mathrm {d} t}}&=r_{\alpha }(K_{\alpha }-R_{\alpha })-\sum _{i=1}^{S}N_{i}c_{i\alpha },&&\qquad \alpha =1,\dots ,M,\end{aligned}}$where all parameters are shared with the MCRM. In the TCRM, resource abundances can become nonphysically negative.

#### Microbial consumer-resource model (MiCRM)

The microbial consumer resource model describes a microbial ecosystem with externally supplied resources where consumption can produce metabolic byproducts, leading to potential cross-feeding. It is described by the following set of coupled ODEs:${\begin{aligned}{\frac {\mathrm {d} N_{i}}{\mathrm {d} t}}&=\tau _{i}^{-1}N_{i}\left(\sum _{\alpha =1}^{M}(1-l_{\alpha })w_{\alpha }c_{i\alpha }R_{\alpha }-m_{i}\right),&&\qquad i=1,\dots ,S,\\{\frac {\mathrm {d} R_{\alpha }}{\mathrm {d} t}}&=\kappa _{\alpha }-rR_{\alpha }-\sum _{i=1}^{S}N_{i}c_{i\alpha }R_{\alpha }+\sum _{i=1}^{S}\sum _{\beta =1}^{M}N_{i}D_{\alpha \beta }l_{\beta }{\frac {w_{\beta }}{w_{\alpha }}}c_{i\beta }R_{\beta },&&\qquad \alpha =1,\dots ,M,\end{aligned}}$where all parameters shared with the MCRM have similar interpretations; $D_{\alpha \beta }$ is the fraction of the byproducts due to consumption of resource $\beta$ which are converted to resource $\alpha$ and $l_{\alpha }$ is the "leakage fraction" of resource $\alpha$ governing how much of the resource is released into the environment as metabolic byproducts.

## Symmetric interactions and optimization
### MacArthur's Minimization Principle

For the MacArthur consumer resource model (MCRM), MacArthur introduced an optimization principle to identify the uninvadable steady state of the model (i.e., the steady state so that if any species with zero population is re-introduced, it will fail to invade, meaning the ecosystem will return to said steady state). To derive the optimization principle, one assumes resource dynamics become sufficiently fast (i.e., $r_{\alpha }\gg 1$) that they become entrained to species dynamics and are constantly at steady state (i.e., ${\mathrm {d} }R_{\alpha }/{\mathrm {d} }t=0$) so that $R_{\alpha }$ is expressed as a function of $N_{i}$. With this assumption, one can express species dynamics as, ${\frac {\mathrm {d} N_{i}}{\mathrm {d} t}}=\tau _{i}^{-1}N_{i}\left[\sum _{\alpha \in M^{\ast }}r_{\alpha }^{-1}K_{\alpha }w_{\alpha }c_{i\alpha }\left(r_{\alpha }-\sum _{j=1}^{S}N_{j}c_{j\alpha }\right)-m_{i}\right],$ where $\sum _{\alpha \in M^{\ast }}$ denotes a sum over resource abundances which satisfy $R_{\alpha }=r_{\alpha }-\sum _{j=1}^{S}N_{j}c_{j\alpha }\geq 0$. The above expression can be written as $\mathrm {d} N_{i}/\mathrm {d} t=-\tau _{i}^{-1}N_{i}\,\partial Q/\partial N_{i}$, where,$Q(\{N_{i}\})={\frac {1}{2}}\sum _{\alpha \in M^{\ast }}r_{\alpha }^{-1}K_{\alpha }w_{\alpha }\left(r_{\alpha }-\sum _{j=1}^{S}c_{j\alpha }N_{j}\right)^{2}+\sum _{i=1}^{S}m_{i}N_{i}.$
At un-invadable steady state $\partial Q/\partial N_{i}=0$ for all surviving species $i$ and $\partial Q/\partial N_{i}>0$ for all extinct species $i$.

### Minimum Environmental Perturbation Principle (MEPP)

MacArthur's Minimization Principle has been extended to the more general Minimum Environmental Perturbation Principle (MEPP) which maps certain niche CRM models to constrained optimization problems. When the population growth conferred upon a species by consuming a resource is related to the impact the species' consumption has on the resource's abundance through the equation,$q_{i\alpha }(\mathbf {R} )=-a_{i}(\mathbf {R} )b_{\alpha }(\mathbf {R} ){\frac {\partial g_{i}}{\partial R_{\alpha }}},$ species-resource interactions are said to be symmetric. In the above equation $a_{i}$ and $b_{\alpha }$ are arbitrary functions of resource abundances. When this symmetry condition is satisfied, it can be shown that there exists a function $d(\mathbf {R} )$ such that:${\frac {\partial d}{\partial R_{\alpha }}}=-{\frac {h_{\alpha }(\mathbf {R} )}{b_{\alpha }(\mathbf {R} )}}.$After determining this function $d$, the steady-state uninvadable resource abundances and species populations are the solution to the constrained optimization problem:${\begin{aligned}\min _{\mathbf {R} }&\;d(\mathbf {R} )&&\\{\text{s.t.,}}&\;g_{i}(\mathbf {R} )\leq 0,&&\qquad i=1,\dots ,S,\\&\;R_{\alpha }\geq 0,&&\qquad \alpha =1,\dots ,M.\end{aligned}}$The species populations are the Lagrange multipliers for the constraints on the second line. This can be seen by looking at the KKT conditions, taking $N_{i}$ to be the Lagrange multipliers:${\begin{aligned}0&=N_{i}g_{i}(\mathbf {R} ),&&\qquad i=1,\dots ,S,\\0&={\frac {\partial d}{\partial R_{\alpha }}}-\sum _{i=1}^{S}N_{i}{\frac {\partial g_{i}}{\partial R_{\alpha }}},&&\qquad \alpha =1,\dots ,M,\\0&\geq g_{i}(\mathbf {R} ),&&\qquad i=1,\dots ,S,\\0&\leq N_{i},&&\qquad i=1,\dots ,S.\end{aligned}}$Lines 1, 3, and 4 are the statements of feasibility and uninvadability: if ${\overline {N}}_{i}>0$, then $g_{i}(\mathbf {R} )$ must be zero otherwise the system would not be at steady state, and if ${\overline {N}}_{i}=0$, then $g_{i}(\mathbf {R} )$ must be non-positive otherwise species $i$ would be able to invade. Line 2 is the stationarity condition and the steady-state condition for the resources in nice CRMs. The function $d(\mathbf {R} )$ can be interpreted as a distance by defining the point in the state space of resource abundances at which it is zero, $\mathbf {R} _{0}$, to be its minimum. The Lagrangian for the dual problem which leads to the above KKT conditions is,$L(\mathbf {R} ,\{N_{i}\})=d(\mathbf {R} )-\sum _{i=1}^{S}N_{i}g_{i}(\mathbf {R} ).$ In this picture, the unconstrained value of $\mathbf {R}$ that minimizes $d(\mathbf {R} )$ (i.e., the steady-state resource abundances in the absence of any consumers) is known as the resource supply vector.

## Geometric perspectives

The steady states of consumer resource models can be analyzed using geometric means in the space of resource abundances.

### Zero net-growth isoclines (ZNGIs)

For a community to satisfy the uninvisibility and steady-state conditions, the steady-state resource abundances (denoted $\mathbf {R} ^{\star }$) must satisfy, $g_{i}(\mathbf {R} ^{\star })\leq 0,$ for all species $i$. The inequality is saturated if and only if species $i$ survives. Each of these conditions specifies a region in the space of possible steady-state resource abundances, and the realized steady-state resource abundance is restricted to the intersection of these regions. The boundaries of these regions, specified by $g_{i}(\mathbf {R} ^{\star })=0$, are known as the zero net-growth isoclines (ZNGIs). If species $i=1,\dots ,S^{\star }$survive, then the steady-state resource abundances must satisfy, $g_{1}(\mathbf {R} ^{\star }),\ldots ,g_{S^{\star }}(\mathbf {R} ^{\star })=0$. The structure and locations of the intersections of the ZNGIs thus determine what species and feasibly coexist; the realized steady-state community is dependent on the supply of resources and can be analyzed by examining coexistence cones.

### Coexistence cones

The structure of ZNGI intersections determines what species can feasibly coexist but does not determine what set of coexisting species will be realized. Coexistence cones determine what species determine what species will survive in an ecosystem given a resource supply vector. A coexistence cone generated by a set of species $i=1,\ldots ,S^{\star }$ is defined to be the set of possible resource supply vectors which will lead to a community containing precisely the species $i=1,\ldots ,S^{\star }$.
To see the cone structure, consider that in the MacArthur or Tilman models, the steady-state non-depleted resource abundances must satisfy,$\mathbf {K} =\mathbf {R} ^{\star }+\sum _{i=1}^{S}N_{i}\mathbf {C} _{i},$ where $\mathbf {K}$ is a vector containing the carrying capacities/supply rates, and $\mathbf {C} _{i}=(c_{i1},\ldots ,c_{iM^{\star }})$ is the $i$th row of the consumption matrix $c_{i\alpha }$, considered as a vector. As the surviving species are exactly those with positive abundances, the sum term becomes a sum only over surviving species, and the right-hand side resembles the expression for a convex cone with apex $\mathbf {R} ^{\star }$ and whose generating vectors are the $\mathbf {C} _{i}$ for the surviving species $i$.

## Complex ecosystems

In an ecosystem with many species and resources, the behavior of consumer-resource models can be analyzed using tools from statistical physics, particularly mean-field theory and the cavity method. In the large ecosystem limit, there is an explosion of the number of parameters. For example, in the MacArthur model, $O(SM)$ parameters are needed. In this limit, parameters may be considered to be drawn from some distribution which leads to a distribution of steady-state abundances. These distributions of steady-state abundances can then be determined by deriving mean-field equations for random variables representing the steady-state abundances of a randomly selected species and resource.

### MacArthur consumer resource model cavity solution

In the MCRM, the model parameters can be taken to be random variables with means and variances:$\langle c_{i\alpha }\rangle =\mu /M,\quad \operatorname {var} (c_{i\alpha })=\sigma ^{2}/M,\quad \langle m_{i}\rangle =m,\quad \operatorname {var} (m_{i})=\sigma _{m}^{2},\quad \langle K_{\alpha }\rangle =K,\quad \operatorname {var} (K_{\alpha })=\sigma _{K}^{2}.$
With this parameterization, in the thermodynamic limit (i.e., $M,S\to \infty$ with $S/M=\Theta (1)$), the steady-state resource and species abundances are modeled as a random variable, $N,R$, which satisfy the self-consistent mean-field equations,${\begin{aligned}0&=R(K-\mu {\tfrac {S}{M}}\langle N\rangle -R+{\sqrt {\sigma _{K}^{2}+{\tfrac {S}{M}}\sigma ^{2}\langle N^{2}\rangle }}Z_{R}+\sigma ^{2}{\tfrac {S}{M}}\nu R),\\0&=N(\mu \langle R\rangle -m-\sigma ^{2}\chi N+{\sqrt {\sigma ^{2}\langle R^{2}\rangle +\sigma _{m}^{2}}}Z_{N}),\end{aligned}}$ where $\langle N\rangle ,\langle N^{2}\rangle ,\langle R\rangle ,\rangle R^{2}\rangle$ are all moments which are determined self-consistently, $Z_{R},Z_{N}$ are independent standard normal random variables, and $\nu =\langle \partial N/\partial m\rangle$ and $\chi =\langle \partial R/\partial K\rangle$ are average susceptibilities which are also determined self-consistently.
This mean-field framework can determine the moments and exact form of the abundance distribution, the average susceptibilities, and the fraction of species and resources that survive at a steady state.
Similar mean-field analyses have been performed for the externally supplied resources model, the Tilman model, and the microbial consumer-resource model. These techniques were first developed to analyze the random generalized Lotka–Volterra model.