The default simulates a system of Ndim = 4
coupled competitive Lotka-Volterra equations studied by Vano et al. (2006) using RK4 numerical integration. Vano et al. describe the dynamics of the resulting attractor as chaotic (bounded, quasi-periodic, sensitive dependence on initial conditions), also see this Wiki page.
Arguments
- Nsim
How many data points to simulate (default =
1000
)- Ndim
How many dimensions (coupled L-V equations) to use (default =
4
)- Y0
A vector with
Ndim
elements representing the initial value (default =rep(.1, Ndim)
)- r
A vector with
Ndim
elements representing the growth rates for each dimension. The default settings are taken from Vano et al. (2006) (default =c(1, 0.72, 1.53, 1.27)
)- A
The interaction matrix of
Ndim X Ndim
representing the nature of the coupling between each dimension.A[1,2]
will appear as a parameter in the equation forY1
setting the magnitude of the interaction withY2
. ConverselyA[2,1]
will appear in the equation forY2
setting the magnitude of the interaction withY1
. The diagonal elements have to be1
. The default settings are taken from Vano et al. (2006)- K
A vector with
Ndim
elements representing the carrying capacity for each dimension. (default =rep(1, Ndim)
)- h
The Euler parameter for RK4 integration.
- returnLongData
Return the data in long format for easy plotting (default =
FALSE
)
References
Vano, J. A., Wildenberg, J. C., Anderson, M. B., Noel, J. K., & Sprott, J. C. (2006). Chaos in low-dimensional Lotka–Volterra models of competition. Nonlinearity, 19(10), 2391.
Examples
library(plot3D)
Y <- lv_Ndim()
#> Error in laply(1:Ndim, function(i) { matrix(c(Y0[i], rep(NA, Nsim - 1)), nrow = 1)}): could not find function "laply"
df <- as.data.frame(apply(t(Y), 2, ts_standardise))
#> Error in h(simpleError(msg, call)): error in evaluating the argument 'x' in selecting a method for function 't': object 'Y' not found
lines3D(df$Y1, df$Y2, df$Y3, colvar = df$Y4, clab = "Y4", xlab= "Y1", ylab = "Y2", zlab ="Y3", ticktype = "detailed")
#> Error in df$Y4: object of type 'closure' is not subsettable