Skip to contents

Calculates the energy rate \(g_i(w)\) (grams/year) available by species and size for growth after metabolism, movement and reproduction have been accounted for.

Usage

getEGrowth(object, ...)

Arguments

object

A MizerParams or MizerSim object.

...

Additional arguments that depend on the class of object.

For a MizerParams object:

n

A matrix of species abundances (species x size). Defaults to the initial abundances stored in object.

n_pp

A vector of the resource abundance by size. Defaults to the initial resource abundance stored in object.

n_other

A named list of the abundances of other dynamical components. Defaults to the initial values stored in object.

t

The time for which to do the calculation. Defaults to 0.

For a MizerSim object:

time_range

The time range over which to return the rates. Either a vector of values, a vector of min and max time, or a single value. Defaults to the whole time range of the simulation.

drop

If TRUE then any dimension of length 1 is removed from the returned array.

Value

  • MizerParams: An ArraySpeciesBySize object (species x size) with the somatic growth rates (grams/year).

  • MizerSim: An ArrayTimeBySpeciesBySize object (time step x species x size) with the growth rates at every time step. If drop = TRUE then dimensions of length 1 will be removed.

Details

The growth rate is calculated as the difference between the energy available for reproduction and growth (obtainable with getEReproAndGrowth()) and the energy used for reproduction (obtainable with getERepro()), but is set to 0 if the result would be negative.

Your own growth rate function

By default getEGrowth() calls mizerEGrowth(). However you can replace this with your own alternative growth rate function. If your function is called "myEGrowth" then you register it in a MizerParams object params with

params <- setRateFunction(params, "EGrowth", "myEGrowth")

Your function will then be called instead of mizerEGrowth(), with the same arguments.

Examples

# \donttest{
params <- NS_params
# Project with constant fishing effort for all gears for 20 time steps
sim <- project(params, t_max = 20, effort = 0.5)
# Get the energy at a particular time step
growth <- getEGrowth(params, n = N(sim)[15, , ], n_pp = NResource(sim)[15, ], t = 15)
# Growth rate at this time for Sprat of size 2g
growth["Sprat", "2"]
#> [1] 4.706336
# }