Match the model's total consumption to observed estimates
Source:R/matchConsumption.R
matchConsumption.RdThis function sets the metabolic respiration rate so that the total
consumption matches the parameter consumption_observed for each species.
The function preserves the energy available for growth and reproduction by
adjusting external encounter rates to compensate for changes in metabolic
loss.
Details
To adjust both the encounter rate and the metabolic respiration rate the
function assumes that they are given by power laws with the same exponent
n, so it sets the species parameter p to the same value as n. A
warning is issued if the exponent p had to be changed for any species.
Any of the selected species for which consumption_observed is NA will be
quietly ignored.
If the resulting total metabolic respiration would be less than 10% of
total production, the function clamps it to 10% of total production and
issues a warning. In that case the consumption will not perfectly match
consumption_observed for those species.
The energy available for growth and reproduction is always preserved, so the steady state spectra are unchanged.
See also
Other match functions:
matchCatch(),
matchDiet(),
matchExtMortOnce(),
matchGonadicProportionOnce(),
matchProduction(),
matchRespirationOnce()
Examples
params <- suppressWarnings(matchConsumption(celtic_params))
# The energy available for growth and reproduction is not changed
all.equal(getEReproAndGrowth(params),
getEReproAndGrowth(celtic_params))
#> [1] "Attributes: < Component “params”: Attributes: < Component “ext_encounter”: Mean relative difference: 1.037582 > >"
#> [2] "Attributes: < Component “params”: Attributes: < Component “given_species_params”: Component “ks”: Mean relative difference: 0.7767267 > >"
#> [3] "Attributes: < Component “params”: Attributes: < Component “metab”: Mean relative difference: 0.7767267 > >"
#> [4] "Attributes: < Component “params”: Attributes: < Component “species_params”: Component “ks”: Mean relative difference: 0.7767267 > >"
#> [5] "Attributes: < Component “params”: Attributes: < Component “time_modified”: Mean absolute difference: 869682.8 > >"