Topic

Lyapunov exponents and sensitivity

Two orbits that start a distance δ apart are, after n steps, about δ eλn\delta\,e^{\lambda n} apart. The number λ is the Lyapunov exponent, and a positive one is what "chaotic" means in practice.

lyapunov(logistic(4), "1/10", { steps: 300 });           // { value, float, bits, kind }
lyapunov(logistic("3.2"), "1/10", { steps: 200, transient: 100 });
sensitivity(logistic(4), "1/10", "1/1000000000000");     // { rows, reaches, rate, factor }

The definition

The distance between nearby orbits is multiplied at each step by about ∣f′(xi)∣|f'(x_i)|, so

λ=lim⁡n→∞1n∑i=0n−1log⁡∣f′(xi)∣. \lambda = \lim_{n\to\infty} \frac1n \sum_{i=0}^{n-1} \log\bigl|f'(x_i)\bigr| .

lyapunov computes the average over steps terms (after discarding transient). What makes it different from the usual program is that the xix_i are the true orbit, enclosed with enough digits, and the logarithms are enclosed too, so the result is an interval that contains the finite-time average of the orbit you asked about. Its kind says so: certified for n steps. The limit itself is not something a finite computation proves, and for a chaotic orbit the average settles slowly as n grows.

The field float is the same average computed the ordinary way. For a chaotic orbit it differs from the certified one in the second or third decimal, because after fifty steps the program is averaging along a different orbit. Both are near the right answer for the same reason: almost every orbit gives the same limit.

Where the value is known

  • For an attracting cycle, λ is 1nlog⁡∣multiplier∣\tfrac1n\log|\text{multiplier}|, negative, and cycles gives it directly. An orbit attracted to the cycle has the same exponent.
  • For the tent map with slope 2, ∣f′∣=2|f'| = 2 everywhere, so λ = ln 2 on every orbit.
  • For the logistic map with r = 4, the change of variable x=sin⁡2(πθ/2)x = \sin^2(\pi\theta/2) turns it into the tent map, so λ = ln 2 for almost every starting point. Every periodic orbit except the fixed point 0 also has exactly ln 2 per step, as the 3-cycles on the previous page show.

The limit itself: integrating against the invariant density

An orbit average over nn steps is not the exponent, however large nn is. But when the map has an ergodic invariant measure μ\mu, almost every orbit spends its time according to μ\mu, so the time average equals the space average:

λ=∫log⁡∣f′(x)∣ dμ(x). \lambda = \int \log|f'(x)|\,d\mu(x).

For the logistic map at r=4r = 4 the measure is known. The change of variable x=sin⁡2(πθ/2)x = \sin^2(\pi\theta/2) turns 4x(1−x)4x(1 - x) into the tent map, which keeps length, so μ\mu is the image of length: its distribution function is F(x)=2πarcsin⁡xF(x) = \tfrac{2}{\pi}\arcsin\sqrt{x} and its density 1/(πx(1−x))1/(\pi\sqrt{x(1 - x)}). lyapunovExponent encloses the integral, and the enclosure is a statement about the limit:

const e = lyapunovExponent(logistic(4), { digits: 4 });
e.value;        // [0.69309…, 0.69317…], which contains log 2 = 0.693147…
e.invariance;   // { proven: true, reason: "x = sin(pi*θ/2)^2 turns the map into the tent map …", checks: […] }

The integrand is awkward twice over: the density is unbounded at 0 and 1, and log⁡∣f′∣\log|f'| is −∞-\infty at the critical point 12\tfrac12. The calculation is arranged so that neither needs a special rule.

  • It works with FF, which is continuous. The measure of a cell [l,r][l, r] is F(r)−F(l)F(r) - F(l), and on a cell with midpoint mm and g=log⁡∣f′∣g = \log|f'|, ∫g dF=g(m) ΔF+g′(m) M1+12g′′(ξ)∫(x−m)2 dF,M1=h2(F(l)+F(r))−∫lrF dx, \int g\,dF = g(m)\,\Delta F + g'(m)\,M_1 + \tfrac12 g''(\xi)\int (x - m)^2\,dF, \qquad M_1 = \tfrac{h}{2}\bigl(F(l) + F(r)\bigr) - \int_l^r F\,dx, where ∫(x−m)2dF\int (x - m)^2 dF lies in [0,h2/4] ΔF[0, h^2/4]\,\Delta F and ∫F\int F lies between the midpoint and trapezoid rules wherever FF is convex or concave.
  • On a cell with the critical point cc at one end, f′(x)=f′′(ξ)(x−c)f'(x) = f''(\xi)(x - c), so g=log⁡∣f′′(ξ)∣+log⁡∣x−c∣g = \log|f''(\xi)| + \log|x - c|, and ∫0δlog⁡u du=δlog⁡δ−δ\int_0^\delta \log u\,du = \delta\log\delta - \delta is known exactly. The density is bounded there, and its range on the cell turns that into an interval.

Cells are halved where they contribute most to the width until the total is below the tolerance.

What is proven. The integral is enclosed for the measure given. That the measure is invariant is proven for the built-in maps by the change of variable named in invariance.reason. For a distribution you supply, it is tested: at several levels yy the measure of {x:f(x)≤y}\{x : f(x) \le y\} is computed from certified preimages and compared with F(y)F(y), and a mismatch is refused. The Chebyshev map 4x3−3x4x^3 - 3x on [−1,1][-1, 1] with F=1−arccos⁡(x)/πF = 1 - \arccos(x)/\pi gives log⁡3\log 3 this way. Ergodicity is taken from the theory of these maps and is stated in note.

Sensitive dependence, measured

sensitivity(f, x0, δ) follows the true orbits of x0x_0 and x0+δx_0 + \delta together and returns their separation at each step as an enclosure, the first step at which it passes a threshold (1/10 by default), and the average growth factor per step up to then. For r = 4 the factor is about 2: a starting error of 10−1210^{-12} is a visible error after about 36 steps, and no instrument or data type changes that count by much, since each extra decimal digit of accuracy buys only log⁡210≈3.3\log_2 10 \approx 3.3 more steps.

callreturns
lyapunov(f, x0, { steps = 200, transient = 0, digits = 10 }){ value: RationalInterval, steps, transient, bits, kind, float }
lyapunovExponent(f, { distribution, interval, digits = 5 }){ value: RationalInterval, distribution, density, criticalPoints, cells, invariance: { proven, reason, checks, holds }, exponent, note }
invariantDensity(f){ density, distribution, interval, exponent, reason } for the logistic map at 4, the tent map at 2 and x² − 2
sensitivity(f, x0, delta, { steps = 60, threshold = "1/10" }){ rows: [{ n, separation }], reaches, rate, factor }
Try itEdit the code and run it with @ratmath/chaos and Core's Rational in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math.
Ctrl/⌘ + Enter runs