lvcomp2: Two Species Lotka-Volterra Competition

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

System of ordinary differential equations for two species Lotka-Volterra competition. For use with ode in the deSolve package.

Usage

1
lvcomp2(t, n, parms)

Arguments

t

Times points that will return N.

n

a vector of length two for the population sizes at time = t.

parms

vector or list of model parameters (see details below).

Details

The parameters include r1, r2, a11, a12, a21, a22 with the usual meanings. Here the a's are the per capita effects which determine K (a11 = 1/K).

Value

Returns a list of length one which is the rate 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 Theoretical Population Ecology with R. Use R! Series. Springer.

See Also

lvcomp3, lvcompg, clogistic

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## The function is currently defined as
function (t, n, parms)
{
    with(as.list(parms), {
        dn1dt <- r1 * n[1] * (1 - a11 * n[1] - a12 * n[2])
        dn2dt <- r2 * n[2] * (1 - a22 * n[2] - a21 * n[1])
        list(c(dn1dt, dn2dt))
    })
  }
library(deSolve)
parms <- c(r1 = 1, r2 = 0.1, a11 = 0.2, a21 = 0.1, a22 = 0.02, a12 = 0.01)
initialN <- c(1, 1)
out <- ode(y = initialN, times = 1:100, func = lvcomp2, parms = parms)
matplot(out[, 1], out[, -1], type = "l")

primer documentation built on Jan. 7, 2021, 1:07 a.m.