localLotkaVolterra: Lotka-Volterra with local predation interactions

Description Usage Arguments Value Author(s) References Examples

View source: R/model-localLotkaVolterra.R

Description

This function simulates several trajectories for a Lotka-Volterra model with local predation interactions as decribed in Brigatti et al. (2009).

Usage

1
2
localLotkaVolterra(par, T, replicates = 1, dim = 1, periodic = TRUE,
  spatial = FALSE, verbose = FALSE, maxpop = 1e+06)

Arguments

par

A list containing the parameters to run the model, currently the growth rate of prey (r), the mortality rate of predator (l), predation interaction parameters (alpha and beta), diffusion rates (D), diameters of local interaction (L) and initial population size (initial). For D, L and initial population, a list with two values (named N and P) is required.

T

Time horizon, number of time steps to be simulated.

replicates

Number of replicates (trajectories) to be simulated.

dim

Spatial dimension for the space. Can be 1, 2 or 3.

periodic

Spatial boundary conditions. If periodic is set to TRUE, the space is a torus. If set to FALSE, the boundaries are reflective.

spatial

Boolean, should spatial outputs (position of individuals) to be saved?

verbose

Boolean, to print population sizes by step?

maxpop

Maximum population size. If predator or prey population size get bigger, the simulation ends.

Value

A list with the following elements:

N

A matrix with prey population sizes by time (rows) and replicates (columns)

P

A matrix with predator population sizes by time (rows) and replicates (columns)

pop

Prey and predator positions by time, if spatial is TRUE

Author(s)

Ricardo Oliveros–Ramos

References

Brigatti et al. 2009.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
set.seed(880820)
par = list(alpha=5e-4, beta=5e-4, r=0.1, m=0.05, D=list(N=8e-5, P=8e-5), 
L=list(N=0.2, P=0.2))
N0 = with(par, m/(2*beta*L$P))
P0 = with(par, r/(2*alpha*L$N))
par$initial = list(N=round(N0), P=round(P0))
sim = localLotkaVolterra(par, T=240, replicates=100, maxpop = 1e4)
plot(sim)

## End(Not run) 

ibm documentation built on May 2, 2019, 5:53 a.m.