Attempts to determine the attractors of a model. The space is discretized into initial points, and repeated iteration of the model's function is used to approximate the attractors. It is possible that non-attractor fixpoints will be found by accident. The function is iterated until the points move less than tolerance (default sqrt(.Machine$double.eps)) between iterations. The color of each point is drawn from the col parameter. If the number of points exceeds the size of $col$, or $col$ is not defined, then reasonable defaults are used instead. The attractors are dspoints that are added to the model.

simattractors(discretize = NULL, xlim = NULL, ylim = NULL, stride = 8,
  iters = 1e+18, epsilon = NULL, tolerance = sqrt(.Machine$double.eps),
  cols = NULL)

Arguments

discretize

The space between initial points. If not set, the discretization of the range is used. May be set separately from the discretization of the range without overwriting.

xlim

The range of x values to search for attractors. Defaults to the limits of the range.

ylim

The range of y values to search for attractors. Defaults to the limits of the range.

stride

The number of times the function is applied before movement is checked: in essence finding the attractors for f^stride. For non-periodic dynamical systems, this is merely an efficiency concern. For systems with periodic attractors with a period that is a factor of that is a factor of stride, this may identify each of the points in the orbit. A warning will be issued if a point is only stable in f^stride, and not in f. Default 8.

iters

The maximum number of iterations to use. Points that still move greater than tolerance will result in a warning and will be discarded. Can be disabled by setting to Inf or 0. Default 1e+18.

epsilon

The distance at which two points are considered to be the same attractor. Defaults to discretize^2.

tolerance

A, usually smaller, distance at which a point is considered to have stopped moving. Defaults to sqrt(.Machine$double.eps).

cols

The colors of the attractors. If insufficient not provided, reasonable defaults are used. Generally (but not always) proceeds left to right, then bottom to top.

See also

dspoint dsregion dspolygon simbasins

Examples

model <- dsmodel(function(X0,Y0) { list(X0*exp(2.6-X0-6.45/(1+4.5*X0)), Y0*exp(2.6-Y0-0.15*X0-6.25/(1+4.5*Y0))) }) model + dsrange(5,5,0.09) + simattractors(discretize=0.02)