Skip to contents

Calculates the total mortality rate \(\mu_i(w)\) (in units 1/year) on each species by size from predation mortality, background mortality and fishing mortality for a single time step.

Usage

getMort(
  params,
  n = initialN(params),
  n_pp = initialNResource(params),
  n_other = initialNOther(params),
  effort = getInitialEffort(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

effort

A numeric vector of the effort by gear or a single numeric effort value which is used for all gears.

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 two dimensional array (prey species x prey size).

Details

If your model contains additional components that you added with setComponent() and for which you specified a mort_fun function then the mortality inflicted by these components will be included in the returned value.

Your own mortality function

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

params <- setRateFunction(params, "Mort", "myMort")

Your function will then be called instead of mizerMort(), 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 total mortality at a particular time step
getMort(params, n = N(sim)[15, , ], n_pp = NResource(sim)[15, ], 
        t = 15, effort = 0.5)
#>          w_prey
#> prey         0.001  0.00119  0.00142   0.0017  0.00203  0.00242  0.00289
#>   Sprat   3.307104 3.271129 3.250718 3.244916 3.251191 3.266205 3.286479
#>   Sandeel 1.836437 1.733373 1.645019 1.570597 1.509052 1.459148 1.419550
#>   N.pout  4.179237 4.387690 4.605647 4.831782 5.064399 5.301517 5.540949
#>   Herring 4.655757 4.709200 4.768840 4.833936 4.903091 4.974545 5.046437
#>   Dab     4.151500 4.194752 4.243469 4.296635 4.352479 4.408868 4.463653
#>   Whiting 4.090114 4.177942 4.273617 4.376170 4.483979 4.595057 4.707308
#>   Sole    2.733905 2.749057 2.769123 2.793483 2.820903 2.849851 2.878779
#>   Gurnard 3.279084 3.367805 3.462923 3.563607 3.668558 3.776203 3.884867
#>   Plaice  4.618068 4.681587 4.748376 4.817270 4.886373 4.953460 5.016329
#>   Haddock 4.374014 4.544334 4.722850 4.908437 5.099617 5.294650 5.491638
#>   Cod     4.470632 4.554045 4.647212 4.749057 4.857697 4.970805 5.085939
#>   Saithe  1.713814 1.805644 1.902181 2.003115 2.108027 2.216410 2.327689
#>          w_prey
#> prey       0.00345  0.00411  0.00491  0.00586  0.00699  0.00834  0.00995
#>   Sprat   3.308872 3.330824 3.350436 3.366416 3.377966 3.384657 3.386320
#>   Sandeel 1.388889 1.365820 1.349052 1.337379 1.329692 1.324988 1.322375
#>   N.pout  5.780377 6.017411 6.249636 6.474664 6.690173 6.893952 7.083944
#>   Herring 5.116991 5.184624 5.247985 5.305953 5.357608 5.402196 5.439109
#>   Dab     4.514912 4.561080 4.600991 4.633851 4.659182 4.676754 4.686525
#>   Whiting 4.818715 4.927440 5.031876 5.130641 5.222554 5.306613 5.381968
#>   Sole    2.906311 2.931353 2.953114 2.971086 2.984988 2.994711 3.000262
#>   Gurnard 3.992898 4.098746 4.200996 4.298375 4.389748 4.474102 4.550545
#>   Plaice  5.073050 5.122101 5.162402 5.193288 5.214445 5.225838 5.227642
#>   Haddock 5.688592 5.883497 6.074347 6.259177 6.436090 6.603278 6.759053
#>   Cod     5.200769 5.313218 5.421507 5.524149 5.619917 5.707799 5.786964
#>   Saithe  2.441241 2.556411 2.672524 2.788896 2.904841 3.019686 3.132775
#>          w_prey
#> prey        0.0119   0.0142   0.0169   0.0202   0.0241   0.0288   0.0343
#>   Sprat   3.382953 3.374659 3.361601 3.343975 3.321988 3.295845 3.265735
#>   Sandeel 1.321072 1.320404 1.319800 1.318783 1.316967 1.314042 1.309767
#>   N.pout  7.258294 7.415384 7.553868 7.672701 7.771149 7.848789 7.905503
#>   Herring 5.467857 5.488062 5.499446 5.501830 5.495126 5.479332 5.454521
#>   Dab     4.688586 4.683121 4.670374 4.650625 4.624168 4.591292 4.552268
#>   Whiting 5.447904 5.503836 5.549303 5.583963 5.607596 5.620093 5.621451
#>   Sole    3.001719 2.999195 2.992816 2.982697 2.968932 2.951580 2.930662
#>   Gurnard 4.618302 4.676714 4.725245 4.763483 4.791143 4.808068 4.814216
#>   Plaice  5.220178 5.203869 5.179195 5.146667 5.106792 5.060055 5.006895
#>   Haddock 6.901869 7.030349 7.143307 7.239770 7.318982 7.380411 7.423745
#>   Cod     5.856735 5.916567 5.966038 6.004841 6.032768 6.049710 6.055636
#>   Saithe  3.243477 3.351193 3.455354 3.555424 3.650895 3.741276 3.826083
#>          w_prey
#> prey        0.0409   0.0489   0.0583   0.0696    0.083   0.0991    0.118
#>   Sprat   3.231826 3.194258 3.153138 3.108537 3.060494 3.009014 2.954072
#>   Sandeel 1.303963 1.296499 1.287283 1.276258 1.263389 1.248658 1.232062
#>   N.pout  7.941445 7.957007 7.952767 7.929434 7.887787 7.828610 7.752638
#>   Herring 5.420833 5.378456 5.327611 5.268534 5.201458 5.126599 5.044138
#>   Dab     4.507336 4.456694 4.400493 4.338829 4.271749 4.199249 4.121281
#>   Whiting 5.611761 5.591195 5.559984 5.518402 5.466748 5.405320 5.334404
#>   Sole    2.906158 2.878004 2.846098 2.810304 2.770461 2.726397 2.677937
#>   Gurnard 4.809657 4.794559 4.769163 4.733772 4.688726 4.634376 4.571075
#>   Plaice  4.947692 4.882751 4.812294 4.736458 4.655295 4.568779 4.476815
#>   Haddock 7.448873 7.455863 7.444935 7.416427 7.370753 7.308368 7.229735
#>   Cod     6.050582 6.034634 6.007907 5.970527 5.922614 5.864265 5.795547
#>   Saithe  3.904825 3.976986 4.042015 4.099309 4.148209 4.187993 4.217888
#>          w_prey
#> prey         0.141    0.168    0.201     0.24    0.286    0.342    0.408
#>   Sprat   2.895627 2.833620 2.767998 2.698715 2.625755 2.549143 2.468960
#>   Sandeel 1.213605 1.193297 1.171152 1.147192 1.121444 1.093950 1.064763
#>   N.pout  7.660506 7.552717 7.429618 7.291407 7.138148 6.969819 6.786367
#>   Herring 4.954216 4.856930 4.752336 4.640458 4.521308 4.394907 4.261316
#>   Dab     4.037769 3.948618 3.853734 3.753046 3.646525 3.534207 3.416218
#>   Whiting 5.254261 5.165112 5.067144 4.960510 4.845344 4.721777 4.589963
#>   Sole    2.624920 2.567214 2.504731 2.437445 2.365398 2.288723 2.207644
#>   Gurnard 4.499150 4.418900 4.330585 4.234432 4.130640 4.019399 3.900913
#>   Plaice  4.379258 4.275930 4.166650 4.051256 3.929638 3.801766 3.667716
#>   Haddock 7.135295 7.025446 6.900538 6.760871 6.606717 6.438346 6.256066
#>   Cod     5.716487 5.627080 5.527295 5.417094 5.296460 5.165426 5.024116
#>   Saithe  4.237080 4.244741 4.240064 4.222306 4.190834 4.145183 4.085103
#>          w_prey
#> prey         0.486     0.58     0.693     0.827     0.987     1.18       1.4
#>   Sprat   2.385354 2.298558 2.2088925 2.1167747 2.0227185 1.927332 1.8313088
#>   Sandeel 1.033958 1.001636 0.9679262 0.9329911 0.8970299 0.860279 0.8230103
#>   N.pout  6.587786 6.374197 6.1459420 5.9036598 5.6483619 5.381483 5.1049081
#>   Herring 4.120671 3.973210 3.8193156 3.6595364 3.4946137 3.325493 3.1533252
#>   Dab     3.292791 3.164287 3.0312054 2.8941915 2.7540393 2.611684 2.4681878
#>   Whiting 4.450110 4.302506 4.1475596 3.9858215 3.8180133 3.645042 3.4680095
#>   Sole    2.122484 2.033674 1.9417402 1.8473087 1.7510896 1.653865 1.5564723
#>   Gurnard 3.775426 3.643253 3.5048098 3.3606454 3.2114625 3.058135 2.9017159
#>   Plaice  3.527698 3.382076 3.2313815 3.0763215 2.9177771 2.756794 2.5945633
#>   Haddock 6.060272 5.851503 5.6304881 5.3982031 5.1559071 4.905170 4.6478783
#>   Cod     4.872780 4.711839 4.5419211 4.3638889 4.1788639 3.988234 3.7936488
#>   Saithe  4.010615 3.922049 3.8200815 3.7057501 3.5804606 3.445973 3.3043677
#>          w_prey
#> prey           1.68         2      2.39     2.85       3.4     4.06      4.84
#>   Sprat   1.7354159 1.6404752 1.5473424 1.456881 1.3699368 1.287305 1.2097075
#>   Sandeel 0.7855286 0.7481652 0.7112707 0.675204 0.6403219 1.106966 1.0754492
#>   N.pout  4.8209700 4.5324120 4.2423191 3.954018 3.6709532 3.396545 3.1340425
#>   Herring 2.9794573 2.8054052 2.6328163 2.463418 2.2989592 2.141140 1.9915467
#>   Dab     2.3247210 2.1825321 2.0429147 1.907169 1.7765595 1.652274 1.5353805
#>   Whiting 3.2882025 3.1070794 2.9262366 2.747366 2.5722020 2.402460 2.2397714
#>   Sole    1.4597836 1.3646839 1.2720476 1.182714 1.0974653 1.017002 0.9419233
#>   Gurnard 2.7434280 2.5846492 2.4268795 2.271698 2.1207077 1.975479 1.8374845
#>   Plaice  2.4323958 2.2716863 2.1138740 1.960397 1.8126454 1.671915 1.5393624
#>   Haddock 4.3862266 4.1226771 3.8599036 3.600712 3.3479419 3.104364 2.8725644
#>   Cod     3.5969982 3.4003739 3.2060157 3.016242 2.8333698 2.659624 2.4970465
#>   Saithe  3.1580009 3.0094343 2.8613555 2.716484 2.5774679 2.446773 2.3265773
#>          w_prey
#> prey           5.78       6.9      8.23      9.82      11.7        14      16.7
#>   Sprat   1.1377598 1.0719493 1.0126131 0.9599230 0.9138762 1.3742816 1.3407679
#>   Sandeel 1.0460456 1.0189758 0.9943994 0.9724071 0.9530169 0.9361668 0.9217159
#>   N.pout  2.8863770 2.6560167 2.4448563 2.2541370 2.0843973 1.9353725 1.8059859
#>   Herring 1.8515802 1.7223905 1.6048233 1.4993813 1.4061992 1.3249995 1.2550974
#>   Dab     1.4267883 1.3272125 1.2371453 1.1568370 1.0862849 1.0252172 0.9731057
#>   Whiting 2.0856221 1.9412804 1.8077454 1.6857045 1.5755027 1.4770868 1.3900111
#>   Sole    0.8727122 0.8097169 0.7531424 0.7030445 0.6593285 0.6217480 0.5899175
#>   Gurnard 1.7080334 1.5882116 1.4788297 1.3803862 1.2930427 1.2165780 1.1503902
#>   Plaice  1.4159637 1.3024799 1.1994298 1.1070740 1.0254068 0.9541471 0.8927555
#>   Haddock 2.6548353 2.4530673 2.2686644 2.1024839 1.9547996 1.8252298 1.7127404
#>   Cod     2.3474052 2.2121028 2.0921050 1.9878860 1.8993934 1.8259953 1.7664894
#>   Saithe  2.2186624 2.1243188 2.0442697 1.9786202 1.9268347 1.8877152 1.8594339
#>          w_prey
#> prey           19.9      23.8      28.4      33.8      40.4      48.2      57.5
#>   Sprat   1.3127062 1.2892008 1.2695089 1.2534934 1.2404707 1.2293654 1.2190508
#>   Sandeel 0.9093858 0.8987464 0.8895285 0.8819654 0.8758957 0.8708692 0.8663998
#>   N.pout  1.6933969 2.0927114 2.0019903 1.9277721 1.8703694 1.8254997 1.7883258
#>   Herring 1.1950426 1.1425225 1.0962515 1.0580475 1.0273611 1.0019076 0.9791921
#>   Dab     0.9290572 1.3918070 1.3603238 1.3344509 1.3132538 1.2952445 1.2788674
#>   Whiting 1.3130594 1.2441356 1.1821613 1.1291603 1.0847368 1.0467039 1.0126015
#>   Sole    0.5632982 0.5412111 0.5229668 0.5079967 0.4955641 0.4848252 0.4749312
#>   Gurnard 1.0931249 1.0425696 0.9975900 0.9602603 1.4302332 1.4053752 1.3833297
#>   Plaice  0.8403470 0.7956910 0.7577394 0.7261922 0.7000757 0.6779411 0.6582880
#>   Haddock 1.6149925 1.5281533 1.4503672 1.3855817 1.3334326 1.2903894 1.2525556
#>   Cod     1.7187201 1.6794892 1.6466434 1.6213690 1.6022480 1.5859848 1.5691085
#>   Saithe  1.8392390 1.8234237 1.8092721 1.7972049 1.7854371 1.7706800 1.7497260
#>          w_prey
#> prey           68.7      81.9      97.8       117       139       166       198
#>   Sprat   1.2083873 1.1964264 1.1825687 1.1665606 1.1480860 1.1270044 1.1032988
#>   Sandeel 0.8620155 0.8573214 0.8520483 0.8460415 0.8391535 0.8313634 0.8226993
#>   N.pout  1.7543909 1.7199811 1.6823489 1.6395955 1.5902786 1.5347712 1.4738089
#>   Herring 0.9568186 0.9328043 0.9058197 1.3751013 1.3399666 1.3004476 1.2568016
#>   Dab     1.2625638 1.2450297 1.2254119 1.2033389 1.1783639 1.1502835 1.1190494
#>   Whiting 0.9799272 1.4466374 1.4115906 1.3742257 1.3337615 1.2900407 1.2431279
#>   Sole    0.4650185 0.9543805 0.9425641 0.9294210 0.9147140 0.8982672 0.8799954
#>   Gurnard 1.3618224 1.3389750 1.3135542 1.2848228 1.2521015 1.2154378 1.1751020
#>   Plaice  0.6396198 0.6206735 0.6005790 1.0789716 1.0554060 1.0296300 1.0015073
#>   Haddock 1.2162896 1.1785792 1.1373177 1.0911347 1.0389318 1.4809526 1.4177869
#>   Cod     1.5483389 1.5209860 1.4852612 1.4401893 1.3850360 1.3200452 1.2459104
#>   Saithe  1.7198693 1.6790903 1.6261672 1.5606526 1.4827230 1.3936495 1.2951984
#>          w_prey
#> prey            237       282       337       402       480       573       683
#>   Sprat   1.0771453 1.0488862 1.0190029 0.9880775 0.9567497 0.9256710 0.8954629
#>   Sandeel 0.8132570 0.8031748 0.7926282 0.7818214 0.7709732 0.7603019 0.7500121
#>   N.pout  1.4084753 1.3400240 1.2698416 1.1993902 1.1301214 1.0633919 1.0003879
#>   Herring 1.2095829 1.1595399 1.1075843 1.0547417 1.0020833 0.9506558 0.9014169
#>   Dab     1.0848672 1.0481571 1.0095180 0.9696802 0.9294476 0.8896398 0.8510371
#>   Whiting 1.1934042 1.1414582 1.0880588 1.0341092 0.9805797 0.9284370 0.8785788
#>   Sole    0.8599715 0.8384134 0.8156581 0.7921291 0.7683005 0.7446608 0.7216792
#>   Gurnard 1.1316331 1.0857298 1.0382269 0.9900535 0.9421738 0.8955246 0.8509590
#>   Plaice  0.9711352 0.9388135 0.9050116 0.8703229 0.8354126 0.8009647 0.7676335
#>   Haddock 1.3504290 1.2800349 1.2079083 1.1354566 1.0641060 0.9952116 0.9299776
#>   Cod     1.1638341 1.0753800 0.9824013 0.8869414 0.7911106 0.6969602 0.6063687
#>   Saithe  1.1895586 1.0791717 0.9666185 0.8544912 0.7452548 0.6411190 0.5439323
#>          w_prey
#> prey            816       973      1160      1390      1650      1970      2360
#>   Sprat   0.8666811 0.8397867 0.8151285 0.7929305 0.7732919 0.7562371 0.7417070
#>   Sandeel 0.7402825 0.7312574 0.7230418 0.7156987 0.7092490 0.7036877 0.6989820
#>   N.pout  0.9420683 0.8891227 0.8419765 0.8007846 0.7654548 0.7357200 0.7111662
#>   Herring 0.8551843 0.8125958 0.7740955 0.7399220 0.7101155 0.6845931 0.6631471
#>   Dab     0.8143348 0.7801068 0.7487830 0.7206354 0.6957771 0.6742263 0.6558960
#>   Whiting 0.8317800 0.7886496 0.7496110 0.7148868 0.6844966 0.6583827 0.6363630
#>   Sole    0.6997770 0.6793056 0.6605312 0.6436262 0.6286679 0.6156756 0.6046049
#>   Gurnard 0.8092007 0.7708089 0.7361673 0.7054737 0.6787466 0.6558990 0.6367323
#>   Plaice  0.7360023 0.7065514 0.6796390 0.6554883 0.6341863 0.6157409 0.6000698
#>   Haddock 0.8693940 0.8141909 0.7648345 0.7215179 0.6841794 0.6525878 0.6263587
#>   Cod     0.5209469 0.4419671 0.3703363 0.3065750 0.7508348 0.7030006 0.6627193
#>   Saithe  0.4551054 0.3755638 0.8057888 0.7458241 0.6953374 0.6536801 0.6199927
#>          w_prey
#> prey           2810      3350      4000      4780      5700      6800      8120
#>   Sprat   0.7295559 0.7195769 0.7115269 0.7051473 0.7001798 0.6963795 0.6935237
#>   Sandeel 0.6950731 0.6918840 0.6893277 0.6873144 0.6857559 0.6845706 0.6836851
#>   N.pout  0.6912661 0.6754303 0.6630542 0.6535529 0.6463866 0.6410775 0.6372164
#>   Herring 0.6454549 0.6311191 0.6197068 0.6107795 0.6039165 0.5987321 0.5948850
#>   Dab     0.6405914 0.6280422 0.6179343 0.6099354 0.6037159 0.5989645 0.5953989
#>   Whiting 0.6181341 0.6033118 0.5914711 0.5821765 0.5750060 0.5695704 0.5655227
#>   Sole    0.5953453 0.5877399 0.5816039 0.5767404 0.5729531 0.5700555 0.5678779
#>   Gurnard 0.6209463 0.6081763 0.5980273 0.5901012 0.5840177 0.5794296 0.5760307
#>   Plaice  0.5869999 0.5762947 0.5676811 0.5608718 0.5555826 0.5515458 0.5485195
#>   Haddock 0.6049808 0.5878694 0.5744148 0.5640200 0.5561275 0.5502399 0.5459272
#>   Cod     0.6294172 0.6023758 0.5808037 0.5638941 0.5508685 0.5410092 0.5336785
#>   Saithe  0.5932880 0.5725329 0.5567157 0.5448955 0.5362344 0.5300147 0.5256419
#>          w_prey
#> prey           9690     11600     13800     16500     19600     23400     28000
#>   Sprat   0.6914172 0.6898943 0.6888191 0.6880829 0.6876011 0.6873073 0.6871482
#>   Sandeel 0.6830356 0.6825689 0.6822414 0.6820185 0.6818736 0.6817857 0.6817383
#>   N.pout  0.6344630 0.6325421 0.6312364 0.6303775 0.6298377 0.6295211 0.6293553
#>   Herring 0.5920833 0.5900844 0.5886922 0.5877524 0.5871458 0.5867807 0.5865851
#>   Dab     0.5927724 0.5908762 0.5895393 0.5886254 0.5880280 0.5876643 0.5874675
#>   Whiting 0.5625643 0.5604457 0.5589643 0.5579602 0.5573095 0.5569163 0.5567050
#>   Sole    0.5662714 0.5651100 0.5642898 0.5637283 0.5633607 0.5631365 0.5630151
#>   Gurnard 0.5735595 0.5717994 0.5705759 0.5697517 0.5692206 0.5689016 0.5687310
#>   Plaice  0.5462925 0.5446863 0.5435551 0.5427826 0.5422781 0.5419713 0.5418054
#>   Haddock 0.5428282 0.5406482 0.5391528 0.5381595 0.5375288 0.5371550 0.5369576
#>   Cod     0.5283288 0.5245037 0.5218337 0.5200271 0.5188582 0.5181531 0.5177747
#>   Saithe  0.5226384 0.5206303 0.5193308 0.5185234 0.5180473 0.5177863 0.5176585
#>          w_prey
#> prey          33400     39900
#>   Sprat   0.6870786 0.6870596
#>   Sandeel 0.6817177 0.6817121
#>   N.pout  0.6292849 0.6292661
#>   Herring 0.5865003 0.5864774
#>   Dab     0.5873815 0.5873580
#>   Whiting 0.5566131 0.5565882
#>   Sole    0.5629620 0.5629475
#>   Gurnard 0.5686571 0.5686371
#>   Plaice  0.5417329 0.5417132
#>   Haddock 0.5368730 0.5368503
#>   Cod     0.5176105 0.5175659
#>   Saithe  0.5176073 0.5175943
# }