Skip to contents

Set external diffusion rate

Usage

setExtDiffusion(params, ext_diffusion = NULL, reset = FALSE, ...)

# S3 method for class 'MizerParams'
setExtDiffusion(params, ext_diffusion = NULL, reset = FALSE, ...)

ext_diffusion(params)

ext_diffusion(params) <- value

Arguments

params

MizerParams

ext_diffusion

Optional. An array (species x size) holding the external diffusion rate. If not supplied, a default is calculated from the D_ext and n species parameters as described in the section "Setting external diffusion rate".

reset

[Experimental] If set to TRUE, then the external diffusion rate will be reset to the value calculated from the species parameters, even if it was previously overwritten with a custom value. If set to FALSE (default) then a recalculation from the species parameters will take place only if no custom value has been set.

...

Unused

value

ext_diffusion

Value

setExtDiffusion(): A MizerParams object with updated external diffusion rate.

ext_diffusion(): An ArraySpeciesBySize object (species x size) with the external diffusion rate.

Setting external diffusion rate

The external diffusion rate allows you to impose additional diffusion of abundance density over body size beyond the predation-driven diffusion computed by mizerDiffusion().

The ext_diffusion argument allows you to specify a diffusion rate that depends on species and body size.

If the ext_diffusion argument is not supplied, then the external diffusion rate is calculated as a power law: $$D_{ext.i}(w) = D_{ext.i}\, w^{n_i+1}.$$ The coefficient \(D_{ext.i}\) is taken from the D_ext column of the species parameter data frame, which defaults to 0. The exponent \(n_i + 1\) uses the n column of the species parameter data frame.

If the ext_diffusion slot has a comment and reset = FALSE, then a recalculation from the species parameters is suppressed and a message is issued if the recalculated values would differ from the stored ones.