Run model of mutualism with saturating functional response
run_mutualism.Rd
Given a vector of time, initial values, and parameters, this function runs a phenomenological model of direct mutualism between two species as described by Holland (2012). This model features a saturating functional response for interspecific density dependence, which produces a stable equilibrium where both mutualist species can coexist above their respective population carrying capacities.
Arguments
- time
Vector of time units over which to run the model, starting at 0.
time
can also be supplied as the total length of the simulation.- init
Named vector of initial population sizes.
N1
: Initial population size of species 1N2
: Initial population size of species 2
- params
Named vector of model parameters.
r1
: Per capita growth rate of species 1r2
: Per capita growth rate of species 1a12
: Effect of species 2 on species 1a21
: Effect of species 1 on species 2b1
: Half-saturation constant for species 1b2
: Half-saturation constant for species 2d1
: Rate of self-limitation for species 1d2
: Rate of self-limitation for species 2
Value
A data frame of population sizes (N1
, N2
) simulated through time,
produced by solving mutualism()
with deSolve::ode()
given time
, init
,
and params
. This data frame has additional attributes recording the model
run (model
), input parameter values (params
) and population carrying
capacities calculated from the parameter values (K
).
Note
See the following for further context and details regarding this model: Holland, N.J. (2012). Population dynamics of mutualism. Nature Education Knowledge, 3, 2.
Examples
# Define full time series and run model with default parameter values
run_mutualism(time = 0:10)
#> time N1 N2
#> 1 0 20.00000 40.00000
#> 2 1 36.39801 54.98436
#> 3 2 49.85543 67.71351
#> 4 3 56.65409 75.96815
#> 5 4 59.29797 80.41556
#> 6 5 60.23751 82.57074
#> 7 6 60.56841 83.55962
#> 8 7 60.68756 84.00130
#> 9 8 60.73187 84.19599
#> 10 9 60.74890 84.28124
#> 11 10 60.75564 84.31844
# Define length of simulation and run model with default parameter values
run_mutualism(time = 10)
#> time N1 N2
#> 1 0.0 20.00000 40.00000
#> 2 0.1 21.50882 41.47669
#> 3 0.2 23.07089 42.97066
#> 4 0.3 24.67861 44.47747
#> 5 0.4 26.32334 45.99249
#> 6 0.5 27.99550 47.51093
#> 7 0.6 29.68482 49.02790
#> 8 0.7 31.38056 50.53851
#> 9 0.8 33.07181 52.03790
#> 10 0.9 34.74775 53.52136
#> 11 1.0 36.39797 54.98435
#> 12 1.1 38.01267 56.42255
#> 13 1.2 39.58294 57.83199
#> 14 1.3 41.10089 59.20898
#> 15 1.4 42.55982 60.55023
#> 16 1.5 43.95428 61.85284
#> 17 1.6 45.28008 63.11432
#> 18 1.7 46.53430 64.33258
#> 19 1.8 47.71520 65.50598
#> 20 1.9 48.82214 66.63325
#> 21 2.0 49.85547 67.71353
#> 22 2.1 50.81637 68.74631
#> 23 2.2 51.70674 69.73144
#> 24 2.3 52.52907 70.66909
#> 25 2.4 53.28626 71.55969
#> 26 2.5 53.98157 72.40394
#> 27 2.6 54.61847 73.20276
#> 28 2.7 55.20055 73.95727
#> 29 2.8 55.73145 74.66872
#> 30 2.9 56.21478 75.33851
#> 31 3.0 56.65409 75.96815
#> 32 3.1 57.05280 76.55921
#> 33 3.2 57.41421 77.11331
#> 34 3.3 57.74142 77.63214
#> 35 3.4 58.03739 78.11736
#> 36 3.5 58.30486 78.57066
#> 37 3.6 58.54639 78.99370
#> 38 3.7 58.76436 79.38812
#> 39 3.8 58.96097 79.75554
#> 40 3.9 59.13823 80.09752
#> 41 4.0 59.29797 80.41556
#> 42 4.1 59.44190 80.71112
#> 43 4.2 59.57154 80.98562
#> 44 4.3 59.68829 81.24038
#> 45 4.4 59.79343 81.47669
#> 46 4.5 59.88810 81.69576
#> 47 4.6 59.97334 81.89875
#> 48 4.7 60.05009 82.08674
#> 49 4.8 60.11921 82.26076
#> 50 4.9 60.18146 82.42180
#> 51 5.0 60.23752 82.57075
#> 52 5.1 60.28802 82.70848
#> 53 5.2 60.33352 82.83578
#> 54 5.3 60.37453 82.95342
#> 55 5.4 60.41149 83.06209
#> 56 5.5 60.44481 83.16245
#> 57 5.6 60.47486 83.25512
#> 58 5.7 60.50196 83.34065
#> 59 5.8 60.52642 83.41959
#> 60 5.9 60.54849 83.49243
#> 61 6.0 60.56841 83.55962
#> 62 6.1 60.58641 83.62160
#> 63 6.2 60.60266 83.67876
#> 64 6.3 60.61735 83.73146
#> 65 6.4 60.63063 83.78005
#> 66 6.5 60.64263 83.82484
#> 67 6.6 60.65349 83.86612
#> 68 6.7 60.66332 83.90417
#> 69 6.8 60.67222 83.93923
#> 70 6.9 60.68027 83.97154
#> 71 7.0 60.68756 84.00130
#> 72 7.1 60.69417 84.02872
#> 73 7.2 60.70016 84.05398
#> 74 7.3 60.70559 84.07724
#> 75 7.4 60.71052 84.09867
#> 76 7.5 60.71499 84.11841
#> 77 7.6 60.71904 84.13658
#> 78 7.7 60.72273 84.15332
#> 79 7.8 60.72607 84.16873
#> 80 7.9 60.72911 84.18292
#> 81 8.0 60.73187 84.19599
#> 82 8.1 60.73438 84.20801
#> 83 8.2 60.73666 84.21909
#> 84 8.3 60.73874 84.22928
#> 85 8.4 60.74063 84.23867
#> 86 8.5 60.74235 84.24731
#> 87 8.6 60.74391 84.25526
#> 88 8.7 60.74534 84.26258
#> 89 8.8 60.74664 84.26932
#> 90 8.9 60.74782 84.27553
#> 91 9.0 60.74890 84.28123
#> 92 9.1 60.74988 84.28649
#> 93 9.2 60.75078 84.29133
#> 94 9.3 60.75160 84.29578
#> 95 9.4 60.75235 84.29987
#> 96 9.5 60.75303 84.30364
#> 97 9.6 60.75365 84.30711
#> 98 9.7 60.75422 84.31031
#> 99 9.8 60.75474 84.31324
#> 100 9.9 60.75521 84.31595
#> 101 10.0 60.75564 84.31844
# Run model with custom input values
tmax <- 10
start <- c(N1 = 100, N2 = 50)
pars <- c(r1 = 1, r2 = 1, a12 = 1.2, a21 = 0.8, b1 = 20, b2 = 20, d1 = 0.04, d2 = 0.02)
run_mutualism(time = tmax, init = start, params = pars)
#> time N1 N2
#> 1 0.0 100.00000 50.00000
#> 2 0.1 83.70023 53.21507
#> 3 0.2 73.81523 56.18362
#> 4 0.3 67.30379 58.89673
#> 5 0.4 62.77894 61.35311
#> 6 0.5 59.51722 63.55802
#> 7 0.6 57.10395 65.52199
#> 8 0.7 55.28422 67.25939
#> 9 0.8 53.89267 68.78710
#> 10 0.9 52.81738 70.12340
#> 11 1.0 51.97998 71.28697
#> 12 1.1 51.32411 72.29621
#> 13 1.2 50.80825 73.16871
#> 14 1.3 50.40135 73.92090
#> 15 1.4 50.07978 74.56786
#> 16 1.5 49.82538 75.12324
#> 17 1.6 49.62405 75.59926
#> 18 1.7 49.46475 76.00674
#> 19 1.8 49.33883 76.35519
#> 20 1.9 49.23941 76.65292
#> 21 2.0 49.16106 76.90717
#> 22 2.1 49.09947 77.12418
#> 23 2.2 49.05119 77.30936
#> 24 2.3 49.01347 77.46733
#> 25 2.4 48.98413 77.60209
#> 26 2.5 48.96141 77.71703
#> 27 2.6 48.94392 77.81508
#> 28 2.7 48.93056 77.89873
#> 29 2.8 48.92043 77.97010
#> 30 2.9 48.91284 78.03100
#> 31 3.0 48.90722 78.08298
#> 32 3.1 48.90313 78.12735
#> 33 3.2 48.90022 78.16524
#> 34 3.3 48.89821 78.19761
#> 35 3.4 48.89689 78.22526
#> 36 3.5 48.89609 78.24888
#> 37 3.6 48.89567 78.26908
#> 38 3.7 48.89553 78.28634
#> 39 3.8 48.89559 78.30111
#> 40 3.9 48.89579 78.31374
#> 41 4.0 48.89608 78.32455
#> 42 4.1 48.89644 78.33380
#> 43 4.2 48.89682 78.34172
#> 44 4.3 48.89721 78.34850
#> 45 4.4 48.89761 78.35431
#> 46 4.5 48.89799 78.35928
#> 47 4.6 48.89836 78.36354
#> 48 4.7 48.89870 78.36720
#> 49 4.8 48.89902 78.37033
#> 50 4.9 48.89932 78.37301
#> 51 5.0 48.89959 78.37531
#> 52 5.1 48.89984 78.37729
#> 53 5.2 48.90006 78.37898
#> 54 5.3 48.90026 78.38043
#> 55 5.4 48.90044 78.38168
#> 56 5.5 48.90060 78.38275
#> 57 5.6 48.90074 78.38367
#> 58 5.7 48.90087 78.38446
#> 59 5.8 48.90098 78.38514
#> 60 5.9 48.90108 78.38572
#> 61 6.0 48.90117 78.38622
#> 62 6.1 48.90124 78.38665
#> 63 6.2 48.90131 78.38701
#> 64 6.3 48.90137 78.38733
#> 65 6.4 48.90142 78.38760
#> 66 6.5 48.90147 78.38784
#> 67 6.6 48.90151 78.38804
#> 68 6.7 48.90154 78.38821
#> 69 6.8 48.90157 78.38836
#> 70 6.9 48.90160 78.38849
#> 71 7.0 48.90162 78.38860
#> 72 7.1 48.90164 78.38869
#> 73 7.2 48.90166 78.38877
#> 74 7.3 48.90168 78.38884
#> 75 7.4 48.90169 78.38890
#> 76 7.5 48.90170 78.38895
#> 77 7.6 48.90171 78.38900
#> 78 7.7 48.90172 78.38903
#> 79 7.8 48.90173 78.38907
#> 80 7.9 48.90173 78.38910
#> 81 8.0 48.90174 78.38912
#> 82 8.1 48.90174 78.38914
#> 83 8.2 48.90175 78.38916
#> 84 8.3 48.90175 78.38917
#> 85 8.4 48.90175 78.38919
#> 86 8.5 48.90176 78.38920
#> 87 8.6 48.90176 78.38921
#> 88 8.7 48.90176 78.38922
#> 89 8.8 48.90176 78.38922
#> 90 8.9 48.90176 78.38923
#> 91 9.0 48.90177 78.38924
#> 92 9.1 48.90177 78.38924
#> 93 9.2 48.90177 78.38924
#> 94 9.3 48.90177 78.38925
#> 95 9.4 48.90177 78.38925
#> 96 9.5 48.90177 78.38925
#> 97 9.6 48.90177 78.38926
#> 98 9.7 48.90177 78.38926
#> 99 9.8 48.90177 78.38926
#> 100 9.9 48.90177 78.38926
#> 101 10.0 48.90177 78.38926