lyapunov: Estimate greatest Lyapunov exponent over time span

lyapunovR Documentation

Estimate greatest Lyapunov exponent over time span

Usage

lyapunov(model, par, init, t_0 = -500, t_1 = -400, t_2 = 0, ncores = 1, ...)

Arguments

model
par
init
t_0
t_1
t_2
ncores
...

Examples

##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (model, par, init, t_0 = -500, t_1 = -400, t_2 = 0, 
    ncores = 1, ...) 
{
    N <- nrow(par)
    if (is.vector(init)) {
        state <- matrix(init, N, length(init), byrow = TRUE)
    }
    else if (is.matrix(init)) {
        state <- init
    }
    else stop("state must be a vector or a matrix")
    ds <- state * 0 + sqrt(2)
    lyap <- 0
    icalclyap <- as.integer(1)
    OUT <- propagate_1step_D_multicore(model, NULL, state, par, 
        t_0, t_1, icalclyap, ds, lyap, ncores = ncores, ...)
    state <- OUT$state
    ds <- OUT$ds
    lyap <- propagate_1step_D_multicore(model, NULL, state, par, 
        t_1, t_2, icalclyap, ds, lyap, ncores = ncores, ...)$lyap
    lyap <- lyap/(t_2 - t_1)
    return(lyap)
  }

mcrucifix/iceages documentation built on Jan. 11, 2023, 9:17 p.m.