If you set your resource dynamics to use this function then 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)$$
resource_semichemostat(
params,
n,
n_pp,
n_other,
rates,
t,
dt,
resource_rate,
resource_capacity,
...
)balance_resource_semichemostat(params, resource_rate, resource_capacity)
Vector containing resource spectrum at next timestep
A MizerParams object
A matrix of species abundances (species x size)
A vector of the resource abundance by size
A list with the abundances of other components
A list of rates as returned by mizerRates()
The current time
Time step
Resource replenishment rate
Resource carrying capacity
Unused
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 to calculate
the resource abundance at time t + dt
from all abundances and rates at time
t
, keeping the mortality fixed during the timestep.
To set your model to use semichemostat dynamics for the resource you do
params <- setResource(params,
resource_dynamics = "resource_semichemostat",
resource_level = 0.5)
where you should replace params
with the name of the variable holding your
MizerParams object. You can of course choose any value between 0 and 1 for
the resource level.
The balance_resource_semichemostat()
function is called by setResource()
to determine the values of the resource parameters that are needed to make
the replenishment rate at each size equal the consumption rate at that size,
as calculated by getResourceMort()
. It should be called with only one of
resource_rate
or resource_capacity
should and will return a named list
with the values for both.
Other resource dynamics:
resource_constant()
,
resource_logistic()