upgraded package description
[RiDMC.git] / RiDMC / man / LexpMap.Rd
blob6478b222f84d8da44db05ee1e58614fd838639b5
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}
6 \title{
7 Lyapunov exponents map in parameter space for continuous and discrete-time dynamical systems
9 \usage{
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, ...)
19 \arguments{
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}
35 \description{
36 Lyapunov exponents for continuous and discrete-time dynamical systems in parameters space
38 \details{
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
44 manipulation.
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.
52 \author{
53 Antonio, Fabio Di Narzo
55 \keyword{ misc }
56 \seealso{
57 \code{\link{Model}}, \code{\link{Bifurcation}}
59 \examples{
60 ##Consider the SHED discrete time model:
61 text <- readLines(txt <- textConnection('
62 name = "SCED"
63 description = "none"
64 type = "D"
65 parameters = {"phi0", "phi1"}
66 variables = {"d"}
68 function f(phi0, phi1, d)
69        a=(1-phi0)
70        b=(1-phi1)
71        if (d <= phi0) then
72                d1 = (2/phi0) * d * (1-(1/(2*phi0))*d)
73        end
74        if (d > phi0) then
75                d1 = (1/(phi0*a))*d*(1-phi0^2*b-(1-phi0*b)*d)
76        end
77        return d1
78 end
79 '))
80 close(txt)
81 m <- Model(text=text)
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)
87 plot(ly)
88 ##change colors:
89 grid.newpage()
90 plot(ly, colors=c('blue', 'red', 'green'))
92 \dontshow{
93 stopifnot(inherits(as.matrix(ly), 'matrix'))