A General Lotka-Volterra Competition Model

Share:

Description

A general Lotka-Volterra competition model, for any number of species. For use with ode in the deSolve package. This function uses a vector and matrix within the list of parameters.

Usage

1
lvcompg(t, n, parms)

Arguments

t

the time point for a realization of the integration.

n

the vector of populations, at each time t.

parms

a LIST containing a vector of growth rates (r), and a matrix of interaction coefficients (a).

Value

Returns a list of length one which is the vector of the rates of increase (required by ode).

Author(s)

Hank Stevens <HStevens@muohio.edu>

References

Lotka, A.J. (1956) Elements of Mathematical Biology. Dover Publications, Inc.

Stevens, M.H.H. (2009) A Primer of Ecology with R. Use R! Series. Springer.

See Also

lvcomp3, clogistic, igp, scheffer

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Specify the number of species
S <- 10
alpha <- .01
r <- runif(S)*2
a <- matrix(rnorm(S^2, m=alpha, sd=alpha/10), nrow=S, ncol=S)
parms <- list(r,a)
t=seq(0,40, by=.1)
N0 <- runif(S)/(S*alpha)
library(deSolve)
lvout <- ode(N0, t, lvcompg, parms)
matplot(t, lvout[,-1], type="l", ylab="N", log='y')

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.