Skip to contents

Calculates the predation mortality rate \(\mu_p(w)\) on the resource spectrum by resource size (in units 1/year).

Usage

getResourceMort(
  params,
  n = initialN(params),
  n_pp = initialNResource(params),
  n_other = initialNOther(params),
  t = 0,
  ...
)

Arguments

params

A MizerParams object

n

A matrix of species abundances (species x size).

n_pp

A vector of the resource abundance by size

n_other

A list of abundances for other dynamical components of the ecosystem

t

The time for which to do the calculation (Not used by standard mizer rate functions but useful for extensions with time-dependent parameters.)

...

Unused

Value

A vector of mortality rate by resource size.

Your own resource mortality function

By default getResourceMort() calls mizerResourceMort(). However you can replace this with your own alternative resource mortality function. If your function is called "myResourceMort" then you register it in a MizerParams object params with

params <- setRateFunction(params, "ResourceMort", "myResourceMort")

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

Examples

# \donttest{
params <- NS_params
# With constant fishing effort for all gears for 20 time steps
sim <- project(params, t_max = 20, effort = 0.5)
# Get resource mortality at one time step
getResourceMort(params, n = N(sim)[15, , ], n_pp = NResource(sim)[15, ])
#>     2.12e-13     2.53e-13     3.02e-13     3.61e-13      4.3e-13     5.14e-13 
#> 1.191600e-05 1.465460e-05 1.798292e-05 2.201903e-05 2.690274e-05 3.279930e-05 
#>     6.13e-13     7.31e-13     8.73e-13     1.04e-12     1.24e-12     1.48e-12 
#> 3.990356e-05 4.844483e-05 5.869238e-05 7.096180e-05 8.562223e-05 1.031046e-04 
#>     1.77e-12     2.11e-12     2.52e-12     3.01e-12     3.59e-12     4.28e-12 
#> 1.239110e-04 1.486254e-04 1.779260e-04 2.125986e-04 2.535523e-04 3.018375e-04 
#>     5.11e-12      6.1e-12     7.28e-12     8.69e-12     1.04e-11     1.24e-11 
#> 3.586655e-04 4.254310e-04 5.037376e-04 5.954260e-04 7.026065e-04 8.276945e-04 
#>     1.48e-11     1.76e-11      2.1e-11     2.51e-11     2.99e-11     3.57e-11 
#> 9.734509e-04 1.143027e-03 1.340016e-03 1.568506e-03 1.833146e-03 2.139215e-03 
#>     4.26e-11     5.09e-11     6.07e-11     7.25e-11     8.65e-11     1.03e-10 
#> 2.492696e-03 2.900367e-03 3.369892e-03 3.909929e-03 4.530249e-03 5.241863e-03 
#>     1.23e-10     1.47e-10     1.75e-10     2.09e-10      2.5e-10     2.98e-10 
#> 6.057169e-03 6.990113e-03 8.056368e-03 9.273534e-03 1.066136e-02 1.224199e-02 
#>     3.56e-10     4.25e-10     5.07e-10     6.05e-10     7.21e-10     8.61e-10 
#> 1.404025e-02 1.608396e-02 1.840426e-02 2.103607e-02 2.401848e-02 2.739529e-02 
#>     1.03e-09     1.23e-09     1.46e-09     1.75e-09     2.08e-09     2.49e-09 
#> 3.121561e-02 3.553457e-02 4.041409e-02 4.592387e-02 5.214254e-02 5.915897e-02 
#>     2.97e-09     3.54e-09     4.23e-09     5.04e-09     6.02e-09     7.18e-09 
#> 6.707381e-02 7.600133e-02 8.607129e-02 9.743112e-02 1.102481e-01 1.247118e-01 
#>     8.57e-09     1.02e-08     1.22e-08     1.46e-08     1.74e-08     2.07e-08 
#> 1.410363e-01 1.594636e-01 1.802665e-01 2.037529e-01 2.302707e-01 2.602140e-01 
#>     2.48e-08     2.95e-08     3.53e-08     4.21e-08     5.02e-08     5.99e-08 
#> 2.940298e-01 3.322254e-01 3.753760e-01 4.241321e-01 4.792265e-01 5.414796e-01 
#>     7.15e-08     8.53e-08     1.02e-07     1.22e-07     1.45e-07     1.73e-07 
#> 6.118044e-01 6.912085e-01 7.807945e-01 8.817570e-01 9.953761e-01 1.123005e+00 
#>     2.07e-07     2.46e-07     2.94e-07     3.51e-07     4.19e-07        5e-07 
#> 1.266056e+00 1.425971e+00 1.604200e+00 1.802155e+00 2.021173e+00 2.262461e+00 
#>     5.96e-07     7.12e-07     8.49e-07     1.01e-06     1.21e-06     1.44e-06 
#> 2.527036e+00 2.815672e+00 3.128828e+00 3.466589e+00 3.828609e+00 4.214051e+00 
#>     1.72e-06     2.06e-06     2.45e-06     2.93e-06     3.49e-06     4.17e-06 
#> 4.621551e+00 5.049193e+00 5.494492e+00 5.954415e+00 6.425412e+00 6.903482e+00 
#>     4.98e-06     5.94e-06     7.09e-06     8.46e-06     1.01e-05      1.2e-05 
#> 7.384253e+00 7.863102e+00 8.335280e+00 8.796067e+00 9.240932e+00 9.665706e+00 
#>     1.44e-05     1.71e-05     2.05e-05     2.44e-05     2.91e-05     3.48e-05 
#> 1.006675e+01 1.044112e+01 1.078672e+01 1.110244e+01 1.138819e+01 1.164500e+01 
#>     4.15e-05     4.95e-05     5.91e-05     7.05e-05     8.42e-05        1e-04 
#> 1.187490e+01 1.208070e+01 1.226570e+01 1.243314e+01 1.258558e+01 1.272433e+01 
#>      0.00012     0.000143     0.000171     0.000204     0.000243      0.00029 
#> 1.284898e+01 1.295739e+01 1.304607e+01 1.311126e+01 1.315020e+01 1.316268e+01 
#>     0.000346     0.000413     0.000493     0.000588     0.000702     0.000838 
#> 1.315211e+01 1.312594e+01 1.309514e+01 1.307283e+01 1.307241e+01 1.310551e+01 
#>        0.001      0.00119      0.00142       0.0017      0.00203      0.00242 
#> 1.317995e+01 1.330042e+01 1.346681e+01 1.367535e+01 1.391969e+01 1.419202e+01 
#>      0.00289      0.00345      0.00411      0.00491      0.00586      0.00699 
#> 1.448407e+01 1.478786e+01 1.509615e+01 1.540257e+01 1.570168e+01 1.598885e+01 
#>      0.00834      0.00995       0.0119       0.0142       0.0169       0.0202 
#> 1.626016e+01 1.651232e+01 1.674253e+01 1.694847e+01 1.712823e+01 1.728027e+01 
#>       0.0241       0.0288       0.0343       0.0409       0.0489       0.0583 
#> 1.740341e+01 1.749673e+01 1.755959e+01 1.759152e+01 1.759215e+01 1.756122e+01 
#>       0.0696        0.083       0.0991        0.118        0.141        0.168 
#> 1.749844e+01 1.740347e+01 1.727591e+01 1.711521e+01 1.692075e+01 1.669182e+01 
#>        0.201         0.24        0.286        0.342        0.408        0.486 
#> 1.642767e+01 1.612762e+01 1.579110e+01 1.541784e+01 1.500795e+01 1.456207e+01 
#>         0.58        0.693        0.827        0.987         1.18          1.4 
#> 1.408146e+01 1.356818e+01 1.302509e+01 1.245594e+01 1.186536e+01 1.125883e+01 
#>         1.68            2         2.39         2.85          3.4         4.06 
#> 1.064257e+01 1.002339e+01 9.408524e+00 8.805382e+00 8.221287e+00 7.663203e+00 
#>         4.84         5.78          6.9         8.23         9.82         11.7 
#> 7.137449e+00 6.649430e+00 6.203383e+00 5.802174e+00 5.447164e+00 5.138144e+00 
#>           14         16.7         19.9         23.8         28.4         33.8 
#> 4.873209e+00 4.648827e+00 4.458701e+00 4.293528e+00 4.147438e+00 4.025062e+00 
#>         40.4         48.2         57.5         68.7         81.9         97.8 
#> 3.923228e+00 3.833172e+00 3.745724e+00 3.652449e+00 3.546606e+00 3.423801e+00 
#>          117          139          166          198          237          282 
#> 3.281837e+00 3.119213e+00 2.937145e+00 2.737836e+00 2.524583e+00 2.301380e+00 
#>          337          402          480          573          683          816 
#> 2.072726e+00 1.843382e+00 1.618080e+00 1.401232e+00 1.196692e+00 1.007558e+00 
#>          973         1160         1390         1650         1970         2360 
#> 8.360481e-01 6.835105e-01 5.504124e-01 4.364156e-01 3.406147e-01 2.616301e-01 
#>         2810         3350         4000         4780         5700         6800 
#> 1.977202e-01 1.469509e-01 1.073462e-01 7.700117e-02 5.416234e-02 3.728088e-02 
#>         8120         9690        11600        13800        16500        19600 
#> 2.503301e-02 1.632133e-02 1.026069e-02 6.153628e-03 3.461409e-03 1.775429e-03 
#>        23400        28000        33400        39900 
#> 7.899871e-04 2.759636e-04 5.803739e-05 3.902282e-16 
# }