lotkapreyK | R Documentation |
Function implements Lotka-Volterra predator-prey model.
lotkapreyK(a, b, c, d, K) ## S3 method for class 'lotkapreyK' plot(x, xlim, ylim, arrows = 5, ...) ## S3 method for class 'lotkapreyK' lines(x, N, P, time = 100, step = 0.2, ...) ## S3 method for class 'lotkapreyK' traj(x, N, P, time = 100, step = 1, ...)
a, b, c, d, K |
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 model is identical to lotkaprey
except that
the prey N is density-dependent following the logistic
population growth model with carrying capacity K, prey growth
rate a, attack rate b and predator density P:
dN/dt = a*N*(1-N/K) - b*N*P
Other parameters and the predator model are identical to the basic
Lotka-Volterra model (lotkaprey
). The
Rosenzweig-MacArtur model uses the same prey model as this function,
but applies type II functional response for the predator. The
density-dependent Lotka-Volterra model is not commonly represented in
ecology textbooks, but it is an educating step between basic
Lotka-Volterra and Rosenzweig-MacArthur models. The predator isocline
is identical to the basic model, but the prey isocline is a line
reaching P = 0 at carrying capacity K, and the intercept
at N is equal to the prey isocline of the basic Lotka-Volterra
model. The density dependent Lotka-Volterra model always has a stable
equilibrium point.
Function lotkapreyK
set ups the model, plot
displays the
phase diagram and isoclines, and lines
adds trajectories. The
trajectories can be generated with traj
.
The function returns a "lotkapreyK"
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 for the basic Lotka-Volterra model.
Jari Oksanen
lotkacomp
, lotkaprey
, rmprey
.
mod <- lotkapreyK(0.5, 0.01, 0.2, 0.1, K = 1000) mod op <- par(no.readonly = TRUE) layout(matrix(c(1,1, 1, 1, 2, 2), ncol=2, byrow = TRUE)) plot(mod) lines(mod, 200, 20) plot(traj(mod, 200, 20)) par(op)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.