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.
How many data points to simulate (default = 1000
)
How many dimensions (coupled L-V equations) to use (default = 4
)
A vector with Ndim
elements representing the initial value (default = rep(.1, Ndim)
)
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)
)
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 for Y1
setting the magnitude of the interaction with Y2
. Conversely A[2,1]
will appear in the equation for Y2
setting the magnitude of the interaction with Y1
. The diagonal elements have to be 1
. The default settings are taken from Vano et al. (2006)
A vector with Ndim
elements representing the carrying capacity for each dimension. (default = rep(1, Ndim)
)
The Euler parameter for RK4 integration.
Return the data in long format for easy plotting (default = FALSE
)
A matrix of Ndim X Nsim
with simulated values.
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.
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