| lotkaprey | R Documentation |
Function implements Lotka-Volterra predator-prey model.
lotkaprey(a, b, c, d) ## S3 method for class 'lotkaprey' plot(x, xlim, ylim, arrows = 8, ...) ## S3 method for class 'lotkaprey' lines(x, N, P, time = 100, step = 0.2, ...) ## S3 method for class 'lotkaprey' traj(x, N, P, time = 100, step = 1, ...)
a, b, c, d |
Lotka-Volterra model parameters: see Details. |
x |
|
xlim, ylim |
Axis ranges. |
arrows |
Number of trend arrows displayed in the graph. |
N, P |
Initial prey and predator densities |
time, step |
Total time span and time step for which trajectories are found. |
... |
Other arguments passed to functions. |
The function uses the following parametrization for the prey N
dN/dt = a*N - b*N*P,
and for predator P
dP/dt = -c*P + d*b*N*P .
Function lotkaprey set ups the model, plot displays the
phase diagram and isoclines, and lines adds trajectories. The
trajectories can be generated with traj.
Krebs (2009, p. 191) hardly mentions these models, although they are the basis of more advanced models. The implementation is based on Stevens (2009).
The function returns a "lotkaprey" result object which contains
the input parameters and isocline values. Function traj returns
trajectories with given starting values.
The parametrization vary: the one in this function is the same as used in my lectures.
Jari Oksanen
Krebs, C. J. (2009) Ecology. Benjamin Cummings. 6 ed., 655 p.
Stevens, M.H.H. (2009) A Primer of Ecology with R. Springer.
lotkacomp, lotkapreyK,
rmprey.
mod <- lotkaprey(0.5, 0.01, 0.2, 0.1) mod op <- par(no.readonly = TRUE) layout(matrix(c(1,1,2, 1,1,3), nrow=2, byrow = TRUE)) plot(mod) lines(mod, 200, 20) lines(mod, 200, 30) plot(traj(mod, 200, 20)) plot(traj(mod, 200, 30)) par(op)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.