Baker¶
Systems / Maps / Geometric maps
The baker's map — stretch, cut, and stack; the cleanest model of mixing and the horseshoe.
Definition¶
@staticmethod
def _step(X, alpha):
"""
Right-hand side of the Baker map.
x, y: Current state variables
alpha: Contraction ratio of the fold (0 < alpha <= 0.5)
The canonical ``x`` fold is ``(2 * x) % 1``, but the pure doubling map
drains a float mantissa one bit per step (``2 * x`` is an exact binary
shift), so every orbit collapses onto the ``x = 0`` fixed point in ~52
iterations and the chaos dies. Wrapping just below 1 injects a ~5e-8
offset at each fold that keeps the orbit non-degenerate; the dynamics
(and the exponents ``ln 2`` / ``ln alpha``) are unchanged to that
tolerance. This is the same guard :class:`KaplanYorke` carries.
The ``y`` branch is written with ``np.where`` (rather than a Python
``if`` on the state) so the step traces to a straight-line tape and runs
on the Rust engine.
"""
x, y = X
xp = (2 * x) % 0.99999995 # stretch in x (wrapped just below 1)
yp = np.where(x < 0.5, alpha * y, alpha * y + (1 - alpha)) # contract + stack
return xp, yp
Parameters¶
| Symbol | Default | Role |
|---|---|---|
alpha |
0.5 |
fold fraction splitting the height (0.5 = area-preserving) |
State variables: x, y
Properties¶
Lyapunov spectrum
TODO — lyapunov_spectrum failed: AttributeError
Kaplan–Yorke dimension
TODO — requires a numeric Lyapunov spectrum
Divergence ∇·f
n/a — discrete map — flow divergence undefined (per-step contraction is |det J|)
Equilibria
1 fixed points
0 stable · 1 unstable
0 stable · 1 unstable
Use it in TSDynamics¶
import tsdynamics as ts
system = ts.systems.Baker()
traj = system.run(steps=10_000)
ts.plot(traj)
spectrum = ts.analysis.lyapunov_spectrum(system)
ts.analysis.kaplan_yorke_dimension(spectrum)
Reference¶
Hopf (1937), Ergodentheorie (Springer, Berlin)
doi:10.1007/978-3-642-86630-2
