Maps of the plane
A map of the plane takes a point to another. Two formulas are enough for folding, stretching and a strange attractor. Orbits come exact, enclosed or in doubles as on the line, and periodic points are proven to exist, each alone in a small box.
const H = henon(); // (x, y) → (1 − 1.4x² + y, 0.3x)
H.orbit([0, 0], 3); // (0, 0), (1, 0), (−2/5, 3/10), (269/250, −3/25): the true orbit
H.compare([0, 0], 150).parted; // 93: the step where doubles have no digit right
H.fixedPoints({ x: [-2, 2], y: [-1, 1] }); // two, each proven, and proven to be all
H.exactPeriodicPoints(1).map((p) => p.text); // [["(−7 − √609)/28", …], ["(−7 + √609)/28", "(−21 + 3√609)/280"]]
planeMap(["x/2 + y/4 + 1", "x/4 - y/3"]); // any two formulas
The Hénon map
Hénon's map is the simplest map of the plane with a strange attractor:
It bends the plane (the term), squeezes it (the Jacobian determinant is everywhere, so areas shrink by the factor 0.3 at every step) and flips it. H.determinant is that constant, found by expanding the determinant of the Jacobian symbolically, and H.areaPreserving is true when it is 1 or −1.
A rational starting point has a rational orbit, and orbit gives it. The number of digits doubles at each step, so long orbits are enclosed instead: enclosedOrbit(p, n) adds working digits until the last point is known to the accuracy asked for. compare sets the double orbit beside the true one. From the doubles lose their last correct digit at step 93: the error doubles about every 1.6 steps, which is the Lyapunov exponent at work.
Periodic points, proven
A point of period is a solution of , two equations in two unknowns. periodicPoints(n, region) searches a rectangle by subdivision. A box is thrown away when interval arithmetic shows that cannot vanish in it. A box is kept as a solution when Krawczyk's test succeeds: with , the centre of the box and an approximate inverse of , if
lies in the interior of , then has exactly one zero in , and it lies in . So every point in the list exists and is the only one in its enclosure, and when the list's complete is true, the rest of the rectangle was proven empty. For the classical parameters the search finds 2 fixed points, one orbit of period 2, one of period 4, two of period 6 and four of period 7, and none of period 3 or 5.
Each point comes with the eigenvalues of there (its multipliers), as enclosures, and a verdict: attracting (both inside the unit circle), repelling, saddle, or elliptic for a complex pair of an area-preserving map. At a saddle, unstable and stable are the eigenvectors: the directions along which nearby points leave and arrive. The unstable direction at the fixed point on the attractor is the direction of the attractor's leaves there.
Periodic points, exact
For a polynomial map the equations are polynomial. When one of them is of first degree in one unknown, that unknown can be eliminated and the other is a root of a polynomial in one variable: an algebraic number. For the Hénon family this works for periods 1 and 2, and exactPeriodicPoints(n) returns the points in closed form:
For higher periods neither equation is linear, and the method says so; the proven enclosures above remain.
Lyapunov exponents
A map of the plane has two exponents: the growth rate of a tangent vector, and of an area. lyapunov(p, n) estimates both in doubles, re-orthogonalising two tangent vectors at each step, and labels the result kind: "estimated". One thing about them is exact: their sum is the average of , and when the determinant is constant that is . The result's sum is an enclosure of it, and the two estimates can be checked against it.
The standard map
Chirikov's standard map models a kicked rotor,
and keeps areas for every : its determinant comes out as exactly 1, with the sines and cosines treated as symbols. standardMap(k) is the map lifted to the plane (take and modulo 1 to draw it on the torus). It has no rational orbits, so orbits are enclosed. Its fixed point at the origin is a saddle and the one at is elliptic for : the centre of the island that the pictures show.
| call | returns |
|---|---|
| planeMap([f, g], { variables, params }) | PlaneMap |
| henon(a = "1.4", b = "0.3"), standardMap(k = 1) | PlaneMap |
| F.at(p), F.float(p), F.enclose(p) | the image: exact, in doubles, enclosed |
| F.orbit(p, n), F.floatOrbit(p, n), F.enclosedOrbit(p, n, { digits }) | orbits of the three kinds |
| F.compare(p, n) | { rows: [{ n, float, exact, error, digits }], parted } |
| F.jacobian(), F.determinant, F.areaPreserving | formulas; a Rational or null; a boolean |
| F.periodicPoints(n, region, { all }) | [{ point, period, leastPeriod, multipliers, stability, stable, unstable }] with .complete |
| F.fixedPoints(region), F.cycles(n, region) | the same for n = 1; points grouped into orbits |
| F.exactPeriodicPoints(n) | [{ x, y, text, period, multipliers, stability }] |
| F.lyapunov(p, n) | { exponents, kind: "estimated", sum } |
@ratmath/chaos and Core's Rational in scope. The last line's value is shown; PRINT(…) adds lines, TEX(…) typesets math.