Skip to contents

Calculates the flux divergence \((J_{j+1} - J_j)/\Delta w_j\) that appears as the second term in the discretised size-spectrum transport equation $$\frac{\partial N_j}{\partial t} + \frac{J_{j+1} - J_j}{\Delta w_j} = -\mu_j N_j.$$ The bin-boundary fluxes \(J_j\) are obtained from getFlux(), which uses the advective-flux scheme stored in the flux entry of the second_order_w slot of params. The flux leaving the largest size class through the upper boundary (\(J_{K+1}\)) is evaluated with the same scheme using the boundary condition \(N_{K+1} = 0\).

Usage

getFluxGradient(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) giving the flux divergence in each size bin, in units of \(g^{-1} \, \text{year}^{-1}\).

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

Examples

# \donttest{
params <- NS_params
fg <- getFluxGradient(params)
sim <- project(params, t_max = 5)
fg_sim <- getFluxGradient(sim)
# }