Skip to content

Baker

Systems · Discrete · Geometric maps

Dimension: 2

Equations

@staticjit
def _step(X, alpha):
    """
    Right-hand side of the Baker map.

    x, y: Current state variables
    alpha: Fraction determining the fold (0 < alpha < 1)

    Written branchlessly 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.  On the attractor ``y in [0, 1)`` the single test
    ``y < alpha`` is equivalent to ``0 <= y < alpha``.
    """
    x, y = X
    lower = y < alpha
    xp = np.where(lower, (2 * x) % 1, (2 * x - 1) % 1)  # stretch / shift in x
    yp = np.where(lower, y / alpha, (y - alpha) / (1 - alpha))  # fold in y
    return xp, yp

Parameters

parameter default
alpha 0.5

Baker attractor

Usage

import tsdynamics as ts

sys = ts.Baker()
traj = sys.iterate(steps=10_000)

Back to Geometric maps