This function calculates the resource abundance at time `t + dt`

from all
abundances and rates at time `t`

.

resource_semichemostat( params, n, n_pp, n_other, rates, t, dt, resource_rate, resource_capacity, ... )

params | A MizerParams object |
---|---|

n | A matrix of species abundances (species x size) |

n_pp | A vector of the resource abundance by size |

n_other | A list with the abundances of other components |

rates | A list of rates as returned by |

t | The current time |

dt | Time step |

resource_rate | Resource replenishment rate |

resource_capacity | Resource carrying capacity |

... | Unused |

Vector containing resource spectrum at next timestep

The time evolution of the resource spectrum is described by a semi-chemostat equation $$\frac{\partial N_R(w,t)}{\partial t} = r_R(w) \Big[ c_R (w) - N_R(w,t) \Big] - \mu_R(w, t) N_R(w,t)$$

Here \(r_R(w)\) is the resource regeneration rate and \(c_R(w)\) is the
carrying capacity in the absence of predation. These parameters are changed
with `setResource()`

. The mortality \(\mu_R(w, t)\) is
due to predation by consumers and is calculate with `getResourceMort()`

.

This function uses the analytic solution of the above equation, keeping the mortality fixed during the timestep.

It is also possible to implement other resource dynamics, as
described in the help page for `setResource()`

.

if (FALSE) { params <- newMultispeciesParams(NS_species_params_gears, NS_interaction, resource_dynamics = "resource_semichemostat") }