1 \name{Lyapunov exponents map}
2 \alias{LyapunovExponentsMap}
3 \alias{as.matrix.idmc_lexp_map}
4 \alias{plot.idmc_lexp_map}
5 \alias{print.idmc_lexp_map}
7 Lyapunov exponents map in parameter space for continuous and discrete-time dynamical systems
10 LyapunovExponentsMap(idmc_model, par, var, time, eps,
11 par.x = 1, par.x.range, par.x.howMany=100, par.y = 2, par.y.range, par.y.howMany=100,
12 eps.zero=sqrt(.Machine$double.eps))
13 \method{print}{idmc_lexp_map}(x, ...)
14 \method{as.matrix}{idmc_lexp_map}(x, ...)
15 \method{plot}{idmc_lexp_map}(x, y, colors, labels,
16 main = getModelName(x$model),
17 xlab, ylab, axes=TRUE, mar=NULL, legend=TRUE, ...)
20 \item{idmc_model}{idmc\_model object as returned by \code{\link{Model}}}
21 \item{par, var, time, eps}{see \code{\link{LyapunovExponents}}}
22 \item{par.x}{which parameter for x-axis variation?}
23 \item{par.x.range, par.x.howMany}{x-axis values}
24 \item{par.y}{which parameter for y-axis variation?}
25 \item{par.y.range, par.y.howMany}{y-axis values}
26 \item{eps.zero}{threshold for discriminating 0-value exponents}
27 \item{x}{a \code{idmc_lexp_map} object}
28 \item{y}{currently unused}
29 \item{colors}{(optional) vector of colors (for each combination of lyap.exp. signs!)}
30 \item{labels}{(optional) legend labels for each color}
31 \item{main, xlab, ylab, mar, axes}{see \code{\link{plotGrob}}}
32 \item{legend}{should a legend be plotted?}
33 \item{...}{arguments to/from other methods}
36 Lyapunov exponents for continuous and discrete-time dynamical systems in parameters space
39 Computes numerically Lyapunov exponents for continuous and discrete-time dynamical systems
40 in a bi-dimensional parameters space.
42 The output of \code{LyapunovExponentsMap} can be directly plotted
43 with \code{plot} or converted to a regular R matrix with \code{as.matrix} for subsequent
46 With continuous time models, you should supply the integration step \code{eps} for numerical
47 ODE solving. If not supplied, \code{getOption('ts.eps')} is used by default.
49 With discrete time models (maps), if not supplied, map jacobian is numerically approximated
50 by finite differencing.
53 Antonio, Fabio Di Narzo
57 \code{\link{Model}}, \code{\link{Bifurcation}}
60 ##Consider the SHED discrete time model:
61 text <- readLines(txt <- textConnection('
65 parameters = {"phi0", "phi1"}
68 function f(phi0, phi1, d)
72 d1 = (2/phi0) * d * (1-(1/(2*phi0))*d)
75 d1 = (1/(phi0*a))*d*(1-phi0^2*b-(1-phi0*b)*d)
83 ##This may take a little while:
84 ly <- LyapunovExponentsMap(m, par=c(phi0=0, phi1=0), var=0.8, time=100,
85 par.x = 1, par.x.range=c(0.01, 0.99), par.x.howMany=100, par.y = 2, par.y.range=c(0.01, 0.99), par.y.howMany=100)
90 plot(ly, colors=c('blue', 'red', 'green'))
93 stopifnot(inherits(as.matrix(ly), 'matrix'))