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\).
Arguments
- object
A MizerParams or MizerSim object.
- ...
Additional arguments that depend on the class of
object.For a MizerParams object:
nA matrix of species abundances (species x size). Defaults to the initial abundances stored in
object.n_ppA vector of the resource abundance by size. Defaults to the initial resource abundance stored in
object.n_otherA named list of the abundances of other dynamical components. Defaults to the initial values stored in
object.tThe time for which to do the calculation. Defaults to 0.
For a MizerSim object:
time_rangeThe 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.
dropIf
TRUEthen any dimension of length 1 is removed from the returned array.
Value
MizerParams: AnArraySpeciesBySizeobject (species x size) giving the flux divergence in each size bin, in units of \(g^{-1} \, \text{year}^{-1}\).MizerSim: AnArrayTimeBySpeciesBySizeobject (time step x species x size) with the flux divergence at every saved time step. Ifdrop = TRUEthen 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)
# }
