Skip to content

Dynamical systems

Dynamical systems: chaotic and driven flows, maps, Koopman embeddings, and normal forms of bifurcations.

BakerMapElement(label, visual=None, *, x=0.2, y=0.3, alpha=1 / 3, lambda_a=1 / 3, lambda_b=2 / 3)

Bases: Element

Coordinates and parameters of the generalized baker map, which stretches the unit square and stacks it.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial stretched coordinate.

0.2
y Annotated[object, StateSpec()]

The initial squeezed coordinate.

0.3
alpha Annotated[object, ParameterSpec()]

The position of the cut.

1 / 3
lambda_a Annotated[object, ParameterSpec()]

The height of the bottom band.

1 / 3
lambda_b Annotated[object, ParameterSpec()]

The height of the top band.

2 / 3

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import BakerMapElement
>>> BakerMapElement('map', alpha=0.4).alpha
0.4
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 0.2,
    y: Annotated[object, StateSpec()] = 0.3,
    alpha: Annotated[object, ParameterSpec()] = 1 / 3,
    lambda_a: Annotated[object, ParameterSpec()] = 1 / 3,
    lambda_b: Annotated[object, ParameterSpec()] = 2 / 3,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.y = y
    self.alpha = alpha
    self.lambda_a = lambda_a
    self.lambda_b = lambda_b

BlowUpElement(label, visual=None, *, x=1.0, a=1.0, p=2.0)

Bases: Element

Hyperbolic growth x' = a x^p, which diverges in finite time for p > 1.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial value.

1.0
a Annotated[object, ParameterSpec()]

The growth coefficient.

1.0
p Annotated[object, ParameterSpec()]

The growth exponent.

2.0

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import BlowUpElement
>>> BlowUpElement('growth', p=3.0).p
3.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_flows.py
47
48
49
50
51
52
53
54
55
56
57
58
59
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 1.0,
    a: Annotated[object, ParameterSpec()] = 1.0,
    p: Annotated[object, ParameterSpec()] = 2.0,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.a = a
    self.p = p

CatMapElement(label, visual=None, *, x=0.1, y=0.3)

Bases: Element

Coordinates of Arnold's cat map (x, y) -> (2 x + y, x + y) (mod 1) of the unit torus, which maps iterate.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial first coordinate, between 0 and 1.

0.1
y Annotated[object, StateSpec()]

The initial second coordinate, between 0 and 1.

0.3

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import CatMapElement
>>> CatMapElement('map', x=0.5).x
0.5
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 0.1,
    y: Annotated[object, StateSpec()] = 0.3,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.y = y

CircleMapElement(label, visual=None, *, theta=0.0, Omega=0.25, K=0.9)

Bases: Element

Angle and parameters of the sine circle map theta' = theta + Omega - K / (2 pi) sin(2 pi theta) (mod 1).

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
theta Annotated[object, StateSpec()]

The initial angle, as a fraction of a turn.

0.0
Omega Annotated[object, ParameterSpec()]

The bare rotation per step.

0.25
K Annotated[object, ParameterSpec()]

The nonlinearity.

0.9

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import CircleMapElement
>>> CircleMapElement('map', K=1.0).K
1.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
129
130
131
132
133
134
135
136
137
138
139
140
141
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    theta: Annotated[object, StateSpec()] = 0.0,
    Omega: Annotated[object, ParameterSpec()] = 0.25,
    K: Annotated[object, ParameterSpec()] = 0.9,
) -> None:
    super().__init__(label, visual=visual)
    self.theta = theta
    self.Omega = Omega
    self.K = K

ConservativeHenonMapElement(label, visual=None, *, x=0.1, y=0.0, nu=0.2114)

Bases: Element

Coordinates and rotation of Hénon's area-preserving map, a rotation by 2π nu followed by a quadratic kick.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial first coordinate.

0.1
y Annotated[object, StateSpec()]

The initial second coordinate.

0.0
nu Annotated[object, ParameterSpec()]

The rotation number of the linear part, in turns.

0.2114

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import ConservativeHenonMapElement
>>> ConservativeHenonMapElement('map', nu=0.25).nu
0.25
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
169
170
171
172
173
174
175
176
177
178
179
180
181
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 0.1,
    y: Annotated[object, StateSpec()] = 0.0,
    nu: Annotated[object, ParameterSpec()] = 0.2114,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.y = y
    self.nu = nu

CubicWalkElement(label, visual=None, *, x=0.3, y=0.0, lam=15.0)

Bases: Element

Walker driven by Bertin's cubic chaotic map x' = lam x (x - 1/2)(x - 1) + x, which steps by 2 x - 1.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial value of the map, between 0 and 1.

0.3
y Annotated[object, StateSpec(role=position)]

The initial position of the walker.

0.0
lam Annotated[object, ParameterSpec(domain=open(0, oo))]

The nonlinearity of the map.

15.0

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import CubicWalkElement
>>> CubicWalkElement('walker', lam=8.0).lam
8.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_chaotic_ensembles.py
48
49
50
51
52
53
54
55
56
57
58
59
60
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 0.3,
    y: Annotated[object, StateSpec(role='position')] = 0.0,
    lam: Annotated[object, ParameterSpec(domain=RealSet.open(0, oo))] = 15.0,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.y = y
    self.lam = lam

CuspElement(label, visual=None, *, x=0.5, beta1=0.0, beta2=1.0)

Bases: Element

Normal form x' = beta1 + beta2 x - x^3 of the cusp bifurcation.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial value.

0.5
beta1 Annotated[object, ParameterSpec()]

The first unfolding parameter, the asymmetry.

0.0
beta2 Annotated[object, ParameterSpec()]

The second unfolding parameter, the splitting.

1.0

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import CuspElement
>>> CuspElement('form', beta2=2.0).beta2
2.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_normal_forms.py
41
42
43
44
45
46
47
48
49
50
51
52
53
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 0.5,
    beta1: Annotated[object, ParameterSpec()] = 0.0,
    beta2: Annotated[object, ParameterSpec()] = 1.0,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.beta1 = beta1
    self.beta2 = beta2

DoublingMapElement(label, visual=None, *, x=0.4, q=DOUBLING_DENOMINATOR)

Bases: Element

Doubling map x' = 2 x (mod 1) on the grid of the fractions of denominator q.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial value, between 0 and 1.

0.4
q Annotated[object, ParameterSpec(domain=open(0, oo))]

The denominator of the grid.

DOUBLING_DENOMINATOR

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import DoublingMapElement
>>> DoublingMapElement('point', q=1024.0).q
1024.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_chaotic_ensembles.py
104
105
106
107
108
109
110
111
112
113
114
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 0.4,
    q: Annotated[object, ParameterSpec(domain=RealSet.open(0, oo))] = DOUBLING_DENOMINATOR,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.q = q

DrivenRosslerElement(label, visual=None, *, x=1.0, y=1.0, z=1.0, eta=0.0, a=0.2, b=0.4, c=5.743, tau=50.0, rho=0.5)

Bases: RosslerElement

Rössler flow with a control eta, the state that the drive adds to the rate of y and that relaxes to 0.

The element holds the flow and the states and parameters of its control. The interactions of the system add the control to the rate of y and make it an Ornstein-Uhlenbeck process of correlation time tau and noise rho.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x float

The initial first coordinate.

1.0
y float

The initial second coordinate.

1.0
z float

The initial third coordinate.

1.0
eta Annotated[float, StateSpec()]

The initial control.

0.0
a float

The feedback of the second coordinate on itself.

0.2
b float

The constant drive of the third coordinate.

0.4
c float

The threshold of the third coordinate's growth.

5.743
tau Annotated[float, ParameterSpec(domain=open(0, oo))]

The correlation time of the control.

50.0
rho Annotated[float, ParameterSpec(domain=closed_open(0, oo))]

The amplitude of the noise of the control.

0.5

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import DrivenRosslerElement
>>> DrivenRosslerElement('rossler', tau=10.0).tau
10.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_driven_flows.py
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: float = 1.0,
    y: float = 1.0,
    z: float = 1.0,
    eta: Annotated[float, StateSpec()] = 0.0,
    a: float = 0.2,
    b: float = 0.4,
    c: float = 5.743,
    tau: Annotated[float, ParameterSpec(domain=RealSet.open(0, oo))] = 50.0,
    rho: Annotated[float, ParameterSpec(domain=RealSet.closed_open(0, oo))] = 0.5,
) -> None:
    super().__init__(label, visual=visual, x=x, y=y, z=z, a=a, b=b, c=c)
    self.eta = eta
    self.tau = tau
    self.rho = rho

FermiUlamMapElement(label, visual=None, *, u=0.5, theta=1.0, epsilon=0.1)

Bases: Element

Speed and wall phase of the Fermi-Ulam map of a ball bouncing between a fixed and an oscillating wall.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
u Annotated[object, StateSpec()]

The initial speed of the ball.

0.5
theta Annotated[object, StateSpec()]

The initial phase of the oscillating wall.

1.0
epsilon Annotated[object, ParameterSpec()]

The amplitude of the speed the oscillating wall gives the ball.

0.1

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import FermiUlamMapElement
>>> FermiUlamMapElement('map', epsilon=0.2).epsilon
0.2
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
209
210
211
212
213
214
215
216
217
218
219
220
221
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    u: Annotated[object, StateSpec()] = 0.5,
    theta: Annotated[object, StateSpec()] = 1.0,
    epsilon: Annotated[object, ParameterSpec()] = 0.1,
) -> None:
    super().__init__(label, visual=visual)
    self.u = u
    self.theta = theta
    self.epsilon = epsilon

GaussianMapElement(label, visual=None, *, x=0.1, alpha=2.8, beta=-0.5)

Bases: Element

Value and parameters of the CDN Gaussian map x' = exp(-alpha² x²) + β of an interval.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial value.

0.1
alpha Annotated[object, ParameterSpec()]

The steepness of the Gaussian.

2.8
beta Annotated[object, ParameterSpec()]

The shift of the Gaussian.

-0.5

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import GaussianMapElement
>>> GaussianMapElement('map', beta=-0.3).beta
-0.3
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
249
250
251
252
253
254
255
256
257
258
259
260
261
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 0.1,
    alpha: Annotated[object, ParameterSpec()] = 2.8,
    beta: Annotated[object, ParameterSpec()] = -0.5,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.alpha = alpha
    self.beta = beta

HenonMapElement(label, visual=None, *, x=0.0, y=0.0, a=1.4, b=0.3)

Bases: Element

Coordinates and parameters of the Hénon map x' = 1 - a x^2 + y, y' = b x, which maps iterate.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial first coordinate.

0.0
y Annotated[object, StateSpec()]

The initial second coordinate.

0.0
a Annotated[object, ParameterSpec()]

The nonlinearity.

1.4
b Annotated[object, ParameterSpec()]

The contraction.

0.3

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import HenonMapElement
>>> HenonMapElement('map', a=1.2).a
1.2
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 0.0,
    y: Annotated[object, StateSpec()] = 0.0,
    a: Annotated[object, ParameterSpec()] = 1.4,
    b: Annotated[object, ParameterSpec()] = 0.3,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.y = y
    self.a = a
    self.b = b

HopfElement(label, visual=None, *, x=0.1, y=0.0, mu=0.25, omega=1.0, a=-1.0)

Bases: Element

Normal form of the Hopf bifurcation in Cartesian coordinates, with the radial law r' = mu r + a r^3.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial real part.

0.1
y Annotated[object, StateSpec()]

The initial imaginary part.

0.0
mu Annotated[object, ParameterSpec()]

The bifurcation parameter.

0.25
omega Annotated[object, ParameterSpec()]

The angular frequency.

1.0
a Annotated[object, ParameterSpec()]

The cubic coefficient, negative for the supercritical bifurcation.

-1.0

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import HopfElement
>>> HopfElement('form', mu=0.5).mu
0.5
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_normal_forms.py
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 0.1,
    y: Annotated[object, StateSpec()] = 0.0,
    mu: Annotated[object, ParameterSpec()] = 0.25,
    omega: Annotated[object, ParameterSpec()] = 1.0,
    a: Annotated[object, ParameterSpec()] = -1.0,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.y = y
    self.mu = mu
    self.omega = omega
    self.a = a

HyperchaoticRosslerElement(label, visual=None, *, x=-10.0, y=-6.0, z=0.0, w=10.0, a=0.25, b=3.0, c=0.05, d=0.5)

Bases: Element

Rössler's four-dimensional flow x' = -(y + z), y' = x + a y + w, z' = b + x z, w' = c w - d z.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial first coordinate.

-10.0
y Annotated[object, StateSpec()]

The initial second coordinate.

-6.0
z Annotated[object, StateSpec()]

The initial third coordinate.

0.0
w Annotated[object, StateSpec()]

The initial fourth coordinate.

10.0
a Annotated[object, ParameterSpec()]

The feedback of the second coordinate on itself.

0.25
b Annotated[object, ParameterSpec()]

The constant drive of the third coordinate.

3.0
c Annotated[object, ParameterSpec()]

The growth of the fourth coordinate.

0.05
d Annotated[object, ParameterSpec()]

The damping of the fourth coordinate by the third.

0.5

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import HyperchaoticRosslerElement
>>> HyperchaoticRosslerElement('rossler', b=2.0).b
2.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_flows.py
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = -10.0,
    y: Annotated[object, StateSpec()] = -6.0,
    z: Annotated[object, StateSpec()] = 0.0,
    w: Annotated[object, StateSpec()] = 10.0,
    a: Annotated[object, ParameterSpec()] = 0.25,
    b: Annotated[object, ParameterSpec()] = 3.0,
    c: Annotated[object, ParameterSpec()] = 0.05,
    d: Annotated[object, ParameterSpec()] = 0.5,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.y = y
    self.z = z
    self.w = w
    self.a = a
    self.b = b
    self.c = c
    self.d = d

IkedaElement(label, visual=None, *, x=2.0, a=1.0, tau=2.0)

Bases: Element

Ikeda delay equation x' = a sin x(t - tau), which oscillates about its stable rest point once a tau > π / 2.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[float, StateSpec()]

The initial value, also its history.

2.0
a Annotated[float, ParameterSpec()]

The gain of the delayed feedback.

1.0
tau Annotated[float, ParameterSpec(domain=open(0, oo))]

The delay.

2.0

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import IkedaElement
>>> IkedaElement('ikeda', tau=2.0).tau
2.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_flows.py
183
184
185
186
187
188
189
190
191
192
193
194
195
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[float, StateSpec()] = 2.0,
    a: Annotated[float, ParameterSpec()] = 1.0,
    tau: Annotated[float, ParameterSpec(domain=RealSet.open(0, oo))] = 2.0,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.a = a
    self.tau = tau

IntermittencyMapElement(label, visual=None, *, x=0.01, z=2.0)

Bases: Element

Value and exponent of the Pomeau-Manneville map x' = x + x^z (mod 1), which a MapInteraction iterates.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial value, between 0 and 1.

0.01
z Annotated[object, ParameterSpec()]

The exponent of the tangency at 0, above 1.

2.0

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import IntermittencyMapElement
>>> IntermittencyMapElement('map', z=1.5).z
1.5
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
331
332
333
334
335
336
337
338
339
340
341
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 0.01,
    z: Annotated[object, ParameterSpec()] = 2.0,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.z = z

JerkElement(label, visual=None, *, x=0.0, x_d2=1.0, x_d1=0.0, A=0.6)

Bases: Element

Sprott's jerk flow x''' = -A x'' - x' + |x| - 1 of a state of order 3.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec(order=3, initial=(0.0, 1.0))]

The initial position.

0.0
x_d2 float

The initial second derivative.

1.0
x_d1 float

The initial first derivative.

0.0
A Annotated[object, ParameterSpec()]

The damping of the second derivative.

0.6

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import JerkElement
>>> JerkElement('jerk', A=0.5).A
0.5
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_flows.py
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec(order=3, initial=(0.0, 1.0))] = 0.0,
    x_d2: float = 1.0,
    x_d1: float = 0.0,
    A: Annotated[object, ParameterSpec()] = 0.6,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.x_d2 = x_d2
    self.x_d1 = x_d1
    self.A = A

LangfordElement(label, visual=None, *, x=0.1, y=0.0, z=0.0, a=0.95, b=0.7, c=0.6, d=3.5, e=0.25, f=0.1)

Bases: Element

Langford flow, a rotation in x, y whose radius and height z couple into a torus that breaks into chaos.

The flow is x' = (z - b) x - d y, y' = d x + (z - b) y, and z' = c + a z - z³ / 3 - (x² + y²)(1 + e z) + f z x³.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial first coordinate.

0.1
y Annotated[object, StateSpec()]

The initial second coordinate.

0.0
z Annotated[object, StateSpec()]

The initial height.

0.0
a Annotated[object, ParameterSpec()]

The linear growth of the height.

0.95
b Annotated[object, ParameterSpec()]

The height above which the rotation grows.

0.7
c Annotated[object, ParameterSpec()]

The constant drive of the height.

0.6
d Annotated[object, ParameterSpec()]

The angular frequency of the rotation.

3.5
e Annotated[object, ParameterSpec()]

The coupling of the radius and the height.

0.25
f Annotated[object, ParameterSpec()]

The term that breaks the rotational symmetry.

0.1

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import LangfordElement
>>> LangfordElement('langford', d=3.0).d
3.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_flows.py
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 0.1,
    y: Annotated[object, StateSpec()] = 0.0,
    z: Annotated[object, StateSpec()] = 0.0,
    a: Annotated[object, ParameterSpec()] = 0.95,
    b: Annotated[object, ParameterSpec()] = 0.7,
    c: Annotated[object, ParameterSpec()] = 0.6,
    d: Annotated[object, ParameterSpec()] = 3.5,
    e: Annotated[object, ParameterSpec()] = 0.25,
    f: Annotated[object, ParameterSpec()] = 0.1,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.y = y
    self.z = z
    self.a = a
    self.b = b
    self.c = c
    self.d = d
    self.e = e
    self.f = f

LogisticMapElement(label, visual=None, *, x=0.2, r=3.7)

Bases: Element

Value and growth rate of the logistic map x -> r x (1 - x), which a MapInteraction iterates.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial value, between 0 and 1.

0.2
r Annotated[object, ParameterSpec()]

The growth rate, between 0 and 4.

3.7

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import LogisticMapElement
>>> LogisticMapElement('map', r=3.2).r
3.2
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
366
367
368
369
370
371
372
373
374
375
376
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 0.2,
    r: Annotated[object, ParameterSpec()] = 3.7,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.r = r

LoziMapElement(label, visual=None, *, x=0.0, y=0.0, a=1.7, b=0.5)

Bases: Element

Coordinates and parameters of the Lozi map x' = 1 + y - a |x|, y' = b x, which maps iterate.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial first coordinate.

0.0
y Annotated[object, StateSpec()]

The initial second coordinate.

0.0
a Annotated[object, ParameterSpec()]

The slope of the fold.

1.7
b Annotated[object, ParameterSpec()]

The contraction.

0.5

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import LoziMapElement
>>> LoziMapElement('map', a=1.5).a
1.5
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 0.0,
    y: Annotated[object, StateSpec()] = 0.0,
    a: Annotated[object, ParameterSpec()] = 1.7,
    b: Annotated[object, ParameterSpec()] = 0.5,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.y = y
    self.a = a
    self.b = b

MixedFlowElement(label, visual=None, *, x=1.0, y=0.0, z=0.0)

Bases: Element

Sprott's flow x' = y + 2xy + xz, y' = 1 - 2x² + yz, z' = x - x² - y², conservative and dissipative at once.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial first coordinate.

1.0
y Annotated[object, StateSpec()]

The initial second coordinate.

0.0
z Annotated[object, StateSpec()]

The initial third coordinate.

0.0

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import MixedFlowElement
>>> MixedFlowElement('flow', x=2.0).x
2.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_flows.py
385
386
387
388
389
390
391
392
393
394
395
396
397
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 1.0,
    y: Annotated[object, StateSpec()] = 0.0,
    z: Annotated[object, StateSpec()] = 0.0,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.y = y
    self.z = z

NewtonMapElement(label, visual=None, *, x=0.5, y=0.5)

Bases: Element

Real and imaginary parts of Newton's method for z^3 = 1, z' = (2 z^3 + 1) / (3 z^2), which maps iterate.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial real part.

0.5
y Annotated[object, StateSpec()]

The initial imaginary part.

0.5

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import NewtonMapElement
>>> NewtonMapElement('map', x=1.5).x
1.5
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
446
447
448
449
450
451
452
453
454
455
456
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 0.5,
    y: Annotated[object, StateSpec()] = 0.5,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.y = y

NoseHooverElement(label, visual=None, *, x=0.0, y=0.1, z=0.0)

Bases: Element

Nosé-Hoover oscillator x' = y, y' = y z - x, z' = 1 - y², a conservative flow with tori and chaos.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial position.

0.0
y Annotated[object, StateSpec()]

The initial momentum.

0.1
z Annotated[object, StateSpec()]

The initial friction of the thermostat.

0.0

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import NoseHooverElement
>>> NoseHooverElement('oscillator', y=1.0).y
1.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_flows.py
442
443
444
445
446
447
448
449
450
451
452
453
454
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 0.0,
    y: Annotated[object, StateSpec()] = 0.1,
    z: Annotated[object, StateSpec()] = 0.0,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.y = y
    self.z = z

RosslerElement(label, visual=None, *, x=1.0, y=1.0, z=1.0, a=0.2, b=0.2, c=5.7)

Bases: Element

Rössler flow x' = -y - z, y' = x + a y, z' = b + z (x - c).

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial first coordinate.

1.0
y Annotated[object, StateSpec()]

The initial second coordinate.

1.0
z Annotated[object, StateSpec()]

The initial third coordinate.

1.0
a Annotated[object, ParameterSpec()]

The feedback of the second coordinate on itself.

0.2
b Annotated[object, ParameterSpec()]

The constant drive of the third coordinate.

0.2
c Annotated[object, ParameterSpec()]

The threshold of the third coordinate's growth.

5.7

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import RosslerElement
>>> RosslerElement('rossler', c=4.0).c
4.0
Source code in src/skcomplex/systems/mathematics/common/flows/_rossler.py
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 1.0,
    y: Annotated[object, StateSpec()] = 1.0,
    z: Annotated[object, StateSpec()] = 1.0,
    a: Annotated[object, ParameterSpec()] = 0.2,
    b: Annotated[object, ParameterSpec()] = 0.2,
    c: Annotated[object, ParameterSpec()] = 5.7,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.y = y
    self.z = z
    self.a = a
    self.b = b
    self.c = c

SaddleNodeElement(label, visual=None, *, x=0.0, mu=1.0)

Bases: Element

Normal form x' = mu - x^2 of the saddle-node bifurcation.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial value.

0.0
mu Annotated[object, ParameterSpec()]

The bifurcation parameter.

1.0

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import SaddleNodeElement
>>> SaddleNodeElement('form', mu=-1.0).mu
-1.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_normal_forms.py
157
158
159
160
161
162
163
164
165
166
167
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 0.0,
    mu: Annotated[object, ParameterSpec()] = 1.0,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.mu = mu

SkewTentMapElement(label, visual=None, *, x=0.4, a=0.3)

Bases: Element

Skew tent map x' = x / a below the peak a and (1 - x) / (1 - a) above it.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial value, between 0 and 1.

0.4
a Annotated[object, ParameterSpec(domain=open(0, oo))]

The position of the peak, between 0 and 1.

0.3

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import SkewTentMapElement
>>> SkewTentMapElement('point', a=0.5).a
0.5
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_chaotic_ensembles.py
152
153
154
155
156
157
158
159
160
161
162
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 0.4,
    a: Annotated[object, ParameterSpec(domain=RealSet.open(0, oo))] = 0.3,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.a = a

SlowManifoldElement(label, visual=None, *, x1=1.0, x2=1.0, mu=-0.05, lam=-1.0)

Bases: Element

Quadratic flow x1' = mu x1, x2' = lam (x2 - x1^2) with the slow manifold x2 = x1^2.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x1 Annotated[object, StateSpec()]

The initial slow coordinate.

1.0
x2 Annotated[object, StateSpec()]

The initial fast coordinate.

1.0
mu Annotated[object, ParameterSpec()]

The slow eigenvalue.

-0.05
lam Annotated[object, ParameterSpec()]

The fast eigenvalue.

-1.0

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import SlowManifoldElement
>>> SlowManifoldElement('flow', lam=-2.0).lam
-2.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_koopman.py
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x1: Annotated[object, StateSpec()] = 1.0,
    x2: Annotated[object, StateSpec()] = 1.0,
    mu: Annotated[object, ParameterSpec()] = -0.05,
    lam: Annotated[object, ParameterSpec()] = -1.0,
) -> None:
    super().__init__(label, visual=visual)
    self.x1 = x1
    self.x2 = x2
    self.mu = mu
    self.lam = lam

StandardMapElement(label, visual=None, *, theta=0.0, p=2 * math.pi * GOLDEN_MEAN, K=1.2)

Bases: Element

Angle, momentum, and kick of the standard map p' = p + K sin(theta), theta' = theta + p' (mod 2 pi).

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
theta Annotated[object, StateSpec()]

The initial angle.

0.0
p Annotated[object, StateSpec()]

The initial momentum.

2 * pi * GOLDEN_MEAN
K Annotated[object, ParameterSpec()]

The kick strength.

1.2

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import StandardMapElement
>>> StandardMapElement('map', K=0.5).K
0.5
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
487
488
489
490
491
492
493
494
495
496
497
498
499
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    theta: Annotated[object, StateSpec()] = 0.0,
    p: Annotated[object, StateSpec()] = 2 * math.pi * GOLDEN_MEAN,
    K: Annotated[object, ParameterSpec()] = 1.2,
) -> None:
    super().__init__(label, visual=visual)
    self.theta = theta
    self.p = p
    self.K = K

SubcriticalHopfElement(label, visual=None, *, x=0.1, y=0.0, alpha=-0.1, omega=1.0, q=0.0, gamma=1.0, s=0.0)

Bases: Element

Subcritical Hopf normal form z' = (alpha + i omega) z + (1 + i q) |z|^2 z - (gamma + i s) |z|^4 z.

The complex amplitude is z = x + i y.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial real part of z.

0.1
y Annotated[object, StateSpec()]

The initial imaginary part of z.

0.0
alpha Annotated[object, ParameterSpec()]

The bifurcation parameter, the linear growth rate.

-0.1
omega Annotated[object, ParameterSpec()]

The angular frequency at small amplitude.

1.0
q Annotated[object, ParameterSpec()]

The nonlinear frequency shift of the cubic term.

0.0
gamma Annotated[object, ParameterSpec(domain=open(0, oo))]

The stabilizing quintic coefficient, positive.

1.0
s Annotated[object, ParameterSpec()]

The nonlinear frequency shift of the quintic term.

0.0

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import SubcriticalHopfElement
>>> SubcriticalHopfElement('form', alpha=0.1).alpha
0.1
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_subcritical_forms.py
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 0.1,
    y: Annotated[object, StateSpec()] = 0.0,
    alpha: Annotated[object, ParameterSpec()] = -0.1,
    omega: Annotated[object, ParameterSpec()] = 1.0,
    q: Annotated[object, ParameterSpec()] = 0.0,
    gamma: Annotated[object, ParameterSpec(domain=RealSet.open(0, oo))] = 1.0,
    s: Annotated[object, ParameterSpec()] = 0.0,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.y = y
    self.alpha = alpha
    self.omega = omega
    self.q = q
    self.gamma = gamma
    self.s = s

TakensBogdanovElement(label, visual=None, *, x=0.2, y=0.0, beta1=0.1, beta2=-1.0, sign=-1.0)

Bases: Element

Normal form x' = y, y' = beta1 + beta2 x + x^2 + sign x y of the Takens-Bogdanov bifurcation.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial first coordinate.

0.2
y Annotated[object, StateSpec()]

The initial second coordinate.

0.0
beta1 Annotated[object, ParameterSpec()]

The first unfolding parameter.

0.1
beta2 Annotated[object, ParameterSpec()]

The second unfolding parameter.

-1.0
sign Annotated[object, ParameterSpec()]

The sign of the term x y, 1 or -1.

-1.0

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import TakensBogdanovElement
>>> TakensBogdanovElement('form', beta1=0.0).beta1
0.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_normal_forms.py
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 0.2,
    y: Annotated[object, StateSpec()] = 0.0,
    beta1: Annotated[object, ParameterSpec()] = 0.1,
    beta2: Annotated[object, ParameterSpec()] = -1.0,
    sign: Annotated[object, ParameterSpec()] = -1.0,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.y = y
    self.beta1 = beta1
    self.beta2 = beta2
    self.sign = sign

TentMapElement(label, visual=None, *, x=0.3, mu=1.99)

Bases: Element

Value and slope of the tent map x' = mu min(x, 1 - x), which a MapInteraction iterates.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial value, between 0 and 1.

0.3
mu Annotated[object, ParameterSpec()]

The slope, between 0 and 2.

1.99

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import TentMapElement
>>> TentMapElement('map', mu=1.5).mu
1.5
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
524
525
526
527
528
529
530
531
532
533
534
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 0.3,
    mu: Annotated[object, ParameterSpec()] = 1.99,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.mu = mu

ThomasElement(label, visual=None, *, x=0.1, y=0.0, z=0.0, a=0.18)

Bases: Element

Thomas flow x' = -a x + sin y, y' = -a y + sin z, z' = -a z + sin x, cyclically symmetric and damped.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial first coordinate.

0.1
y Annotated[object, StateSpec()]

The initial second coordinate.

0.0
z Annotated[object, StateSpec()]

The initial third coordinate.

0.0
a Annotated[object, ParameterSpec()]

The damping of every coordinate.

0.18

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import ThomasElement
>>> ThomasElement('thomas', a=0.2).a
0.2
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_flows.py
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 0.1,
    y: Annotated[object, StateSpec()] = 0.0,
    z: Annotated[object, StateSpec()] = 0.0,
    a: Annotated[object, ParameterSpec()] = 0.18,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.y = y
    self.z = z
    self.a = a

TowelMapElement(label, visual=None, *, x=0.085, y=-0.121, z=0.075, a=3.8, b=3.78)

Bases: Element

Coordinates and growth rates of Rössler's towel map, a three-dimensional map with two positive exponents.

Parameters:

Name Type Description Default
label str

The label of the element.

required
visual VisualSpec | None

How the element is drawn, or None for default_visual_.

None
x Annotated[object, StateSpec()]

The initial first coordinate.

0.085
y Annotated[object, StateSpec()]

The initial second coordinate.

-0.121
z Annotated[object, StateSpec()]

The initial third coordinate.

0.075
a Annotated[object, ParameterSpec()]

The growth rate of the first logistic coordinate.

3.8
b Annotated[object, ParameterSpec()]

The growth rate of the third logistic coordinate.

3.78

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import TowelMapElement
>>> TowelMapElement('map', a=3.7).a
3.7
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[object, StateSpec()] = 0.085,
    y: Annotated[object, StateSpec()] = -0.121,
    z: Annotated[object, StateSpec()] = 0.075,
    a: Annotated[object, ParameterSpec()] = 3.8,
    b: Annotated[object, ParameterSpec()] = 3.78,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.y = y
    self.z = z
    self.a = a
    self.b = b

baker_map(x=0.2, y=0.3, *, alpha=1 / 3, lambda_a=1 / 3, lambda_b=2 / 3)

Return the generalized baker map, which stretches the unit square along x and stacks the two pieces in y.

The strip x < alpha is stretched by 1 / alpha and squeezed into the bottom band of height lambda_a, and the rest is stretched by 1 / (1 - alpha) and squeezed into the top band of height lambda_b. The map preserves area when lambda_a = alpha and lambda_b = 1 - alpha, and it has a fractal attractor when lambda_a + lambda_b < 1.

Parameters:

Name Type Description Default
x float

The initial stretched coordinate.

0.2
y float

The initial squeezed coordinate.

0.3
alpha float

The position of the cut.

1 / 3
lambda_a float

The height of the bottom band.

1 / 3
lambda_b float

The height of the top band.

2 / 3

Returns:

Name Type Description
system System

The system, with the states map.x and map.y.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import baker_map
>>> baker_map(lambda_a=0.2).elements[0].lambda_a
0.2
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
@register_system(
    field='mathematics/dynamical_systems',
    tags=('chaos', 'discrete map', 'mixing', 'fractal'),
    references=('Farmer, Ott, and Yorke 1983', 'Datseris and Parlitz 2022', 'Lindgren 2024'),
    defaults={'until': 500, 'dt': 1},
)
def baker_map(
    x: float = 0.2,
    y: float = 0.3,
    *,
    alpha: float = 1 / 3,
    lambda_a: float = 1 / 3,
    lambda_b: float = 2 / 3,
) -> System:
    """Return the generalized baker map, which stretches the unit square along `x` and stacks the two pieces in `y`.

    The strip `x < alpha` is stretched by `1 / alpha` and squeezed into the bottom band of height `lambda_a`, and the
    rest is stretched by `1 / (1 - alpha)` and squeezed into the top band of height `lambda_b`. The map preserves area
    when `lambda_a = alpha` and `lambda_b = 1 - alpha`, and it has a fractal attractor when `lambda_a + lambda_b < 1`.

    Args:
        x:
            The initial stretched coordinate.

        y:
            The initial squeezed coordinate.

        alpha:
            The position of the cut.

        lambda_a:
            The height of the bottom band.

        lambda_b:
            The height of the top band.

    Returns:
        system:
            The system, with the states `map.x` and `map.y`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import baker_map
        >>> baker_map(lambda_a=0.2).elements[0].lambda_a
        0.2
    """
    stretch = MapInteraction(
        'x_map',
        target='map',
        state='x',
        function=lambda s: where(
            s.target.x < s.target.alpha,
            s.target.x / s.target.alpha,
            (s.target.x - s.target.alpha) / (1 - s.target.alpha),
        ),
    )
    stack = MapInteraction(
        'y_map',
        target='map',
        state='y',
        function=lambda s: where(
            s.target.x < s.target.alpha,
            s.target.lambda_a * s.target.y,
            1 - s.target.lambda_b + s.target.lambda_b * s.target.y,
        ),
    )
    baker = BakerMapElement('map', x=x, y=y, alpha=alpha, lambda_a=lambda_a, lambda_b=lambda_b)
    return System(elements=[baker], interactions=[stretch, stack])

cat_map(x=0.1, y=0.3)

Return Arnold's cat map (x, y) → (2x + y, x + y) (mod 1), an area-preserving hyperbolic map of the torus.

Parameters:

Name Type Description Default
x float

The initial first coordinate, between 0 and 1.

0.1
y float

The initial second coordinate, between 0 and 1.

0.3

Returns:

Name Type Description
system System

The system, with the states map.x and map.y.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import cat_map
>>> cat_map(x=0.5).elements[0].x
0.5
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
@register_system(
    field='mathematics/dynamical_systems',
    tags=('chaos', 'discrete map', 'mixing', 'hamiltonian'),
    references=('Arnold and Avez 1968', 'Dilão 2023'),
    defaults={'until': 200, 'dt': 1},
)
def cat_map(x: float = 0.1, y: float = 0.3) -> System:
    """Return Arnold's cat map `(x, y) → (2x + y, x + y) (mod 1)`, an area-preserving hyperbolic map of the torus.

    Args:
        x:
            The initial first coordinate, between 0 and 1.

        y:
            The initial second coordinate, between 0 and 1.

    Returns:
        system:
            The system, with the states `map.x` and `map.y`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import cat_map
        >>> cat_map(x=0.5).elements[0].x
        0.5
    """
    first = MapInteraction('x_map', target='map', state='x', function=lambda s: mod(2 * s.target.x + s.target.y, 1))
    second = MapInteraction('y_map', target='map', state='y', function=lambda s: mod(s.target.x + s.target.y, 1))
    return System(elements=[CatMapElement('map', x=x, y=y)], interactions=[first, second])

cdn_map(x=0.1, *, alpha=2.8, beta=-0.5)

Return the Cascais-Dilão-Noronha Gaussian map x' = exp(-alpha² x²) + β of an interval.

For alpha = 2.8 the map is chaotic over most of β between about -0.8 and -0.25, with periodic windows, and its complexity rises and falls again with β through period doubling and reverse period doubling, as in the bifurcation diagram and the topological entropy of Dilão (2023, Fig. 3.17). Dilão's Exercises 3.4 and 3.5 write the exponent as -alpha² x² / 2π, the same family with alpha scaled by √(2π).

Parameters:

Name Type Description Default
x float

The initial value.

0.1
alpha float

The steepness of the Gaussian.

2.8
beta float

The shift of the Gaussian.

-0.5

Returns:

Name Type Description
system System

The system, with the state map.x.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import cdn_map
>>> cdn_map(beta=-0.3).elements[0].beta
-0.3
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
@register_system(
    field='mathematics/dynamical_systems',
    tags=('chaos', 'discrete map', 'interval map', 'period doubling', 'reverse bifurcations'),
    references=('Cascais, Dilão, and Noronha da Costa 1983', 'Dilão 2023'),
    defaults={'until': 200, 'dt': 1},
)
def cdn_map(x: float = 0.1, *, alpha: float = 2.8, beta: float = -0.5) -> System:
    """Return the Cascais-Dilão-Noronha Gaussian map `x' = exp(-alpha² x²) + β` of an interval.

    For `alpha = 2.8` the map is chaotic over most of `β` between about -0.8 and -0.25, with periodic windows, and its
    complexity rises and falls again with `β` through period doubling and reverse period doubling, as in the
    bifurcation diagram and the topological entropy of Dilão (2023, Fig. 3.17). Dilão's Exercises 3.4 and 3.5 write
    the exponent as `-alpha² x² / 2π`, the same family with `alpha` scaled by `√(2π)`.

    Args:
        x:
            The initial value.

        alpha:
            The steepness of the Gaussian.

        beta:
            The shift of the Gaussian.

    Returns:
        system:
            The system, with the state `map.x`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import cdn_map
        >>> cdn_map(beta=-0.3).elements[0].beta
        -0.3
    """
    gaussian = MapInteraction(
        'x_map',
        target='map',
        state='x',
        function=lambda s: exp(-(s.target.alpha**2) * s.target.x**2) + s.target.beta,
    )
    return System(elements=[GaussianMapElement('map', x=x, alpha=alpha, beta=beta)], interactions=[gaussian])

circle_map(theta=0.0, *, Omega=0.25, K=0.9)

Return the sine circle map θ' = θ + Ω - K / (2π) sin 2πθ (mod 1), which locks into Arnold tongues.

Parameters:

Name Type Description Default
theta float

The initial angle, as a fraction of a turn.

0.0
Omega float

The bare rotation per step.

0.25
K float

The nonlinearity, invertible below 1.

0.9

Returns:

Name Type Description
system System

The system, with the state map.theta.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import circle_map
>>> circle_map(K=1.0).elements[0].K
1.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
@register_system(
    field='mathematics/dynamical_systems',
    tags=('discrete map', 'mode locking', 'arnold tongues'),
    references=('Arnold 1965', 'Datseris and Parlitz 2022', 'Dilão 2023'),
    defaults={'until': 500, 'dt': 1},
)
def circle_map(theta: float = 0.0, *, Omega: float = 0.25, K: float = 0.9) -> System:
    """Return the sine circle map `θ' = θ + Ω - K / (2π) sin 2πθ (mod 1)`, which locks into Arnold tongues.

    Args:
        theta:
            The initial angle, as a fraction of a turn.

        Omega:
            The bare rotation per step.

        K:
            The nonlinearity, invertible below 1.

    Returns:
        system:
            The system, with the state `map.theta`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import circle_map
        >>> circle_map(K=1.0).elements[0].K
        1.0
    """
    rotation = MapInteraction(
        'theta_map',
        target='map',
        state='theta',
        function=lambda s: mod(
            s.target.theta + s.target.Omega - s.target.K / (2 * pi) * sin(2 * pi * s.target.theta),
            1,
        ),
    )
    return System(elements=[CircleMapElement('map', theta=theta, Omega=Omega, K=K)], interactions=[rotation])

conservative_henon_map(x=0.1, y=0.0, *, nu=0.2114)

Return Hénon's area-preserving quadratic map, a rotation by 2π nu with a quadratic kick.

The map is x' = a x + b y + b x², y' = -b x + a y + a x² with a = cos 2π nu and b = sin 2π nu (Dilão 2023, Example 3.17 and Exercise 2.8). For nu in (0, 1/2) the origin is a centre surrounded by invariant curves, and (2 tan(π nu), -2 tan²(π nu)) is a saddle whose manifolds bound the region of bounded orbits, the dynamic aperture of accelerator physics. The default nu gives cos 2π nu = 0.24, the case of Hénon (1969).

Parameters:

Name Type Description Default
x float

The initial first coordinate.

0.1
y float

The initial second coordinate.

0.0
nu float

The rotation number of the linear part, in turns.

0.2114

Returns:

Name Type Description
system System

The system, with the states map.x and map.y.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import conservative_henon_map
>>> conservative_henon_map(nu=0.25).elements[0].nu
0.25
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
@register_system(
    field='mathematics/dynamical_systems',
    tags=('discrete map', 'area preserving', 'hamiltonian', 'kam', 'dynamic aperture'),
    references=('Hénon 1969', 'Dilão 2023'),
    defaults={'until': 1000, 'dt': 1},
)
def conservative_henon_map(x: float = 0.1, y: float = 0.0, *, nu: float = 0.2114) -> System:
    """Return Hénon's area-preserving quadratic map, a rotation by `2π nu` with a quadratic kick.

    The map is `x' = a x + b y + b x²`, `y' = -b x + a y + a x²` with `a = cos 2π nu` and `b = sin 2π nu` (Dilão
    2023, Example 3.17 and Exercise 2.8). For `nu` in `(0, 1/2)` the origin is a centre surrounded by invariant curves,
    and `(2 tan(π nu), -2 tan²(π nu))` is a saddle whose manifolds bound the region of bounded orbits, the dynamic
    aperture of accelerator physics. The default `nu` gives `cos 2π nu = 0.24`, the case of Hénon (1969).

    Args:
        x:
            The initial first coordinate.

        y:
            The initial second coordinate.

        nu:
            The rotation number of the linear part, in turns.

    Returns:
        system:
            The system, with the states `map.x` and `map.y`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import conservative_henon_map
        >>> conservative_henon_map(nu=0.25).elements[0].nu
        0.25
    """
    first = MapInteraction(
        'x_map',
        target='map',
        state='x',
        function=lambda s: cos(2 * pi * s.target.nu) * s.target.x
        + sin(2 * pi * s.target.nu) * (s.target.y + s.target.x**2),
    )
    second = MapInteraction(
        'y_map',
        target='map',
        state='y',
        function=lambda s: -sin(2 * pi * s.target.nu) * s.target.x
        + cos(2 * pi * s.target.nu) * (s.target.y + s.target.x**2),
    )
    return System(elements=[ConservativeHenonMapElement('map', x=x, y=y, nu=nu)], interactions=[first, second])

cubic_chaotic_map(n_walkers=100, *, lam=15.0)

Return Bertin's cubic chaotic map and the chaotic walk it drives, which spreads like a random walk.

Every walker follows the map x' = λ x (x - 1/2)(x - 1) + x on the unit interval and moves by the step y' = y + 2x - 1. The fixed point x = 1/2 is stable for λ < 8, a period-two cycle follows, and the map is chaotic at λ = 15. The walkers start at y = 0 with values of x spread regularly over the unit interval, so the mean position stays near 0 while the mean square position grows linearly in time, and the invariant density of x is not uniform.

Parameters:

Name Type Description Default
n_walkers int

The number of walkers of the ensemble.

100
lam float

The parameter λ of the map, between 0 and 16.

15.0

Returns:

Name Type Description
system System

The system, with the states walkers.x and walkers.y and the observables displacement, the mean position, and square_displacement, the mean square position.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import cubic_chaotic_map
>>> cubic_chaotic_map(4, lam=10.0).elements[0].prepare().size_
4
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_chaotic_ensembles.py
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
@register_system(
    field='mathematics/dynamical_systems',
    tags=('chaos', 'discrete map', 'random walk', 'diffusion'),
    references=('Bertin 2021',),
    defaults={'until': 200, 'dt': 1},
    observables=lambda system: [
        ObservableSpec('displacement', group='walkers', variable='y'),
        ObservableSpec('square_displacement', _square_displacement, group='walkers'),
    ],
)
def cubic_chaotic_map(n_walkers: int = 100, *, lam: float = 15.0) -> System:
    """Return Bertin's cubic chaotic map and the chaotic walk it drives, which spreads like a random walk.

    Every walker follows the map `x' = λ x (x - 1/2)(x - 1) + x` on the unit interval and moves by the step
    `y' = y + 2x - 1`. The fixed point `x = 1/2` is stable for `λ < 8`, a period-two cycle follows, and the map is
    chaotic at `λ = 15`. The walkers start at `y = 0` with values of `x` spread regularly over the unit interval, so
    the mean position stays near 0 while the mean square position grows linearly in time, and the invariant density of
    `x` is not uniform.

    Args:
        n_walkers:
            The number of walkers of the ensemble.

        lam:
            The parameter `λ` of the map, between 0 and 16.

    Returns:
        system:
            The system, with the states `walkers.x` and `walkers.y` and the observables `displacement`, the mean
            position, and `square_displacement`, the mean square position.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import cubic_chaotic_map
        >>> cubic_chaotic_map(4, lam=10.0).elements[0].prepare().size_
        4
    """
    start = (np.arange(n_walkers) + 1 / 4) / n_walkers
    walkers = GroupElement(
        'walkers',
        element=CubicWalkElement,
        size=n_walkers,
        values={'x': start, 'y': 0.0, 'lam': lam},
    )
    return System(
        elements=[walkers],
    )

cusp_form(x=0.5, *, beta1=0.0, beta2=1.0)

Return the cusp normal form x' = β1 + β2 x - x³, bistable inside the cusp 27 β1² < 4 β2³.

Parameters:

Name Type Description Default
x float

The initial value.

0.5
beta1 float

The asymmetry.

0.0
beta2 float

The splitting parameter.

1.0

Returns:

Name Type Description
system System

The system, with the state form.x.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import cusp_form
>>> cusp_form(beta1=0.2).elements[0].beta1
0.2
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_normal_forms.py
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
@register_system(
    field='mathematics/dynamical_systems',
    tags=('bifurcation', 'normal form', 'ode', 'bistability', 'hysteresis'),
    references=('Gros 2015', 'Dilão 2023'),
    defaults={'until': 20.0, 'dt': 0.1},
)
def cusp_form(x: float = 0.5, *, beta1: float = 0.0, beta2: float = 1.0) -> System:
    """Return the cusp normal form `x' = β1 + β2 x - x³`, bistable inside the cusp `27 β1² < 4 β2³`.

    Args:
        x:
            The initial value.

        beta1:
            The asymmetry.

        beta2:
            The splitting parameter.

    Returns:
        system:
            The system, with the state `form.x`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import cusp_form
        >>> cusp_form(beta1=0.2).elements[0].beta1
        0.2
    """
    return System(elements=[CuspElement('form', x=x, beta1=beta1, beta2=beta2)])

doubling_map(n_points=100, *, x=0.4, spread=0.01, q=DOUBLING_DENOMINATOR, random_state=0)

Return an ensemble of the doubling map x' = 2x (mod 1), iterated exactly on fractions with an odd denominator.

In floating point 2x (mod 1) shifts out one binary digit per step, and every orbit reaches 0 within 53 steps. The system keeps every point on the fractions k / q of an odd denominator q and applies the map to them exactly, k' = 2k (mod q), through the update x' = (2 round(q x) mod q) / q. The orbits are the exact orbits of these fractions. The default q is a prime below 2^50 of which 2 is a primitive root, so every orbit except that of 0 has the period q - 1, about 10^15. The points start in a narrow interval and spread until their histogram matches the uniform invariant density.

Parameters:

Name Type Description Default
n_points int

The number of points of the ensemble.

100
x float

The left end of the interval of initial points, which are rounded to the nearest fraction k / q.

0.4
spread float

The width of the interval of initial points.

0.01
q float

The odd denominator of the fractions the points stay on, an integer below 2^51.

DOUBLING_DENOMINATOR
random_state int | Generator | None

The seed or generator of the initial points.

0

Returns:

Name Type Description
system System

The system, with the states points.x.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import doubling_map
>>> float(doubling_map(10, q=101.0).elements[0].values['x'][0] * 101)
41.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_chaotic_ensembles.py
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
@register_system(
    field='mathematics/dynamical_systems',
    tags=('chaos', 'discrete map', 'bernoulli shift', 'invariant density'),
    references=('Bertin 2021',),
    defaults={'until': 50, 'dt': 1},
)
def doubling_map(
    n_points: int = 100,
    *,
    x: float = 0.4,
    spread: float = 0.01,
    q: float = DOUBLING_DENOMINATOR,
    random_state: int | np.random.Generator | None = 0,
) -> System:
    """Return an ensemble of the doubling map `x' = 2x (mod 1)`, iterated exactly on fractions with an odd denominator.

    In floating point `2x (mod 1)` shifts out one binary digit per step, and every orbit reaches 0 within 53 steps.
    The system keeps every point on the fractions `k / q` of an odd denominator `q` and applies the map to them exactly,
    `k' = 2k (mod q)`, through the update `x' = (2 round(q x) mod q) / q`. The orbits are the exact orbits of these
    fractions. The default `q` is a prime below `2^50` of which 2 is a primitive root, so every orbit except that of 0
    has the period `q - 1`, about `10^15`. The points start in a narrow interval and spread until their histogram
    matches the uniform invariant density.

    Args:
        n_points:
            The number of points of the ensemble.

        x:
            The left end of the interval of initial points, which are rounded to the nearest fraction `k / q`.

        spread:
            The width of the interval of initial points.

        q:
            The odd denominator of the fractions the points stay on, an integer below `2^51`.

        random_state:
            The seed or generator of the initial points.

    Returns:
        system:
            The system, with the states `points.x`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import doubling_map
        >>> float(doubling_map(10, q=101.0).elements[0].values['x'][0] * 101)
        41.0
    """
    start = np.floor(q * _draw_cloud(n_points, x, spread, random_state) + 1 / 2) / q
    return System(
        elements=[GroupElement('points', element=DoublingMapElement, size=n_points, values={'x': start, 'q': q})],
    )

fermi_ulam_map(u=0.5, theta=1.0, *, epsilon=0.1)

Return the Fermi-Ulam map of a ball bouncing between a fixed wall and a wall that oscillates in time.

The speed and the phase of the wall at a bounce follow u' = |u + ε sin θ|, θ' = θ + 2π / u' (mod 2π), an area-preserving map with a mixed state space like the standard map (Datseris and Parlitz 2022, Exercise 1.11). The points θ = 0 and θ = π at the speeds u = 1 / m are its fixed points.

Parameters:

Name Type Description Default
u float

The initial speed of the ball, positive.

0.5
theta float

The initial phase of the oscillating wall.

1.0
epsilon float

The amplitude of the speed the oscillating wall gives the ball.

0.1

Returns:

Name Type Description
system System

The system, with the states map.u and map.theta.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import fermi_ulam_map
>>> fermi_ulam_map(epsilon=0.2).elements[0].epsilon
0.2
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
@register_system(
    field='mathematics/dynamical_systems',
    tags=('discrete map', 'area preserving', 'billiard', 'fermi acceleration'),
    references=('Ulam 1961', 'Lichtenberg and Lieberman 1992', 'Datseris and Parlitz 2022'),
    defaults={'until': 1000, 'dt': 1},
)
def fermi_ulam_map(u: float = 0.5, theta: float = 1.0, *, epsilon: float = 0.1) -> System:
    """Return the Fermi-Ulam map of a ball bouncing between a fixed wall and a wall that oscillates in time.

    The speed and the phase of the wall at a bounce follow `u' = |u + ε sin θ|`, `θ' = θ + 2π / u' (mod 2π)`, an
    area-preserving map with a mixed state space like the standard map (Datseris and Parlitz 2022, Exercise 1.11).
    The points `θ = 0` and `θ = π` at the speeds `u = 1 / m` are its fixed points.

    Args:
        u:
            The initial speed of the ball, positive.

        theta:
            The initial phase of the oscillating wall.

        epsilon:
            The amplitude of the speed the oscillating wall gives the ball.

    Returns:
        system:
            The system, with the states `map.u` and `map.theta`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import fermi_ulam_map
        >>> fermi_ulam_map(epsilon=0.2).elements[0].epsilon
        0.2
    """
    speed = MapInteraction(
        'u_map',
        target='map',
        state='u',
        function=lambda s: abs_symbolic(s.target.u + s.target.epsilon * sin(s.target.theta)),
    )
    phase = MapInteraction(
        'theta_map',
        target='map',
        state='theta',
        function=lambda s: mod(
            s.target.theta + 2 * pi / abs_symbolic(s.target.u + s.target.epsilon * sin(s.target.theta)),
            2 * pi,
        ),
    )
    return System(elements=[FermiUlamMapElement('map', u=u, theta=theta, epsilon=epsilon)], interactions=[speed, phase])

finite_time_blow_up(x=1.0, *, a=1.0, p=2.0)

Return hyperbolic growth x' = a x^p, which diverges at the finite time x0^(1 - p) / (a (p - 1)) for p > 1.

Parameters:

Name Type Description Default
x float

The initial value, positive.

1.0
a float

The growth coefficient.

1.0
p float

The growth exponent.

2.0

Returns:

Name Type Description
system System

The system, with the state growth.x.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import finite_time_blow_up
>>> finite_time_blow_up(p=3.0).elements[0].p
3.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_flows.py
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
@register_system(
    field='mathematics/dynamical_systems',
    tags=('ode', 'singularity', 'hyperbolic growth'),
    references=('Forrest 2018',),
    defaults={'until': 0.9, 'dt': 0.01},
)
def finite_time_blow_up(x: float = 1.0, *, a: float = 1.0, p: float = 2.0) -> System:
    """Return hyperbolic growth `x' = a x^p`, which diverges at the finite time `x0^(1 - p) / (a (p - 1))` for p > 1.

    Args:
        x:
            The initial value, positive.

        a:
            The growth coefficient.

        p:
            The growth exponent.

    Returns:
        system:
            The system, with the state `growth.x`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import finite_time_blow_up
        >>> finite_time_blow_up(p=3.0).elements[0].p
        3.0
    """
    return System(elements=[BlowUpElement('growth', x=x, a=a, p=p)])

henon_map(x=0.0, y=0.0, *, a=1.4, b=0.3)

Return the Hénon map x' = 1 - a x² + y, y' = b x, with a fractal strange attractor for its defaults.

Parameters:

Name Type Description Default
x float

The initial first coordinate.

0.0
y float

The initial second coordinate.

0.0
a float

The nonlinearity.

1.4
b float

The contraction.

0.3

Returns:

Name Type Description
system System

The system, with the states map.x and map.y.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import henon_map
>>> henon_map(a=1.2).elements[0].a
1.2
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
@register_system(
    field='mathematics/dynamical_systems',
    tags=('chaos', 'discrete map', 'strange attractor'),
    references=('Hénon 1976', 'Datseris and Parlitz 2022'),
    defaults={'until': 1000, 'dt': 1},
)
def henon_map(x: float = 0.0, y: float = 0.0, *, a: float = 1.4, b: float = 0.3) -> System:
    """Return the Hénon map `x' = 1 - a x² + y`, `y' = b x`, with a fractal strange attractor for its defaults.

    Args:
        x:
            The initial first coordinate.

        y:
            The initial second coordinate.

        a:
            The nonlinearity.

        b:
            The contraction.

    Returns:
        system:
            The system, with the states `map.x` and `map.y`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import henon_map
        >>> henon_map(a=1.2).elements[0].a
        1.2
    """
    first = MapInteraction(
        'x_map',
        target='map',
        state='x',
        function=lambda s: 1 - s.target.a * s.target.x**2 + s.target.y,
    )
    second = MapInteraction('y_map', target='map', state='y', function=lambda s: s.target.b * s.target.x)
    return System(elements=[HenonMapElement('map', x=x, y=y, a=a, b=b)], interactions=[first, second])

hopf_form(x=0.1, y=0.0, *, mu=0.25, omega=1.0, a=-1.0)

Return the Hopf normal form, whose focus gives birth to a limit cycle of radius √(-μ / a) as μ crosses 0.

x' = μx - ωy + a x (x² + y²) and y' = ωx + μy + a y (x² + y²), supercritical for a < 0.

Parameters:

Name Type Description Default
x float

The initial first coordinate.

0.1
y float

The initial second coordinate.

0.0
mu float

The bifurcation parameter.

0.25
omega float

The angular frequency.

1.0
a float

The cubic coefficient, the sign of the first Lyapunov coefficient.

-1.0

Returns:

Name Type Description
system System

The system, with the states form.x and form.y.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import hopf_form
>>> hopf_form(mu=-0.1).elements[0].mu
-0.1
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_normal_forms.py
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
@register_system(
    field='mathematics/dynamical_systems',
    tags=('bifurcation', 'normal form', 'ode', 'limit cycle'),
    references=('Gros 2015', 'Dilão 2023'),
    defaults={'until': 50.0, 'dt': 0.1},
)
def hopf_form(x: float = 0.1, y: float = 0.0, *, mu: float = 0.25, omega: float = 1.0, a: float = -1.0) -> System:
    """Return the Hopf normal form, whose focus gives birth to a limit cycle of radius `√(-μ / a)` as μ crosses 0.

    `x' = μx - ωy + a x (x² + y²)` and `y' = ωx + μy + a y (x² + y²)`, supercritical for `a < 0`.

    Args:
        x:
            The initial first coordinate.

        y:
            The initial second coordinate.

        mu:
            The bifurcation parameter.

        omega:
            The angular frequency.

        a:
            The cubic coefficient, the sign of the first Lyapunov coefficient.

    Returns:
        system:
            The system, with the states `form.x` and `form.y`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import hopf_form
        >>> hopf_form(mu=-0.1).elements[0].mu
        -0.1
    """
    return System(elements=[HopfElement('form', x=x, y=y, mu=mu, omega=omega, a=a)])

hyperchaotic_rossler(x=-10.0, y=-6.0, z=0.0, w=10.0, *, a=0.25, b=3.0, c=0.05, d=0.5)

Return Rössler's four-dimensional flow, hyperchaotic with two positive Lyapunov exponents for its defaults.

The flow x' = -(y + z), y' = x + a y + w, z' = b + x z, w' = c w - d z stretches the attractor in two directions at once, with the exponents near 0.11 and 0.02 for the parameters of Dilão (2023, Exercise 4.18).

Parameters:

Name Type Description Default
x float

The initial first coordinate.

-10.0
y float

The initial second coordinate.

-6.0
z float

The initial third coordinate.

0.0
w float

The initial fourth coordinate.

10.0
a float

The feedback of the second coordinate on itself.

0.25
b float

The constant drive of the third coordinate.

3.0
c float

The growth of the fourth coordinate.

0.05
d float

The damping of the fourth coordinate by the third.

0.5

Returns:

Name Type Description
system System

The system, with the states rossler.x, rossler.y, rossler.z, and rossler.w.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import hyperchaotic_rossler
>>> hyperchaotic_rossler(c=0.1).elements[0].c
0.1
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_flows.py
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
@register_system(
    field='mathematics/dynamical_systems',
    tags=('chaos', 'ode', 'hyperchaos', 'strange attractor'),
    references=('Rössler 1979', 'Dilão 2023'),
    defaults={'until': 300.0, 'dt': 0.05},
)
def hyperchaotic_rossler(
    x: float = -10.0,
    y: float = -6.0,
    z: float = 0.0,
    w: float = 10.0,
    *,
    a: float = 0.25,
    b: float = 3.0,
    c: float = 0.05,
    d: float = 0.5,
) -> System:
    """Return Rössler's four-dimensional flow, hyperchaotic with two positive Lyapunov exponents for its defaults.

    The flow `x' = -(y + z)`, `y' = x + a y + w`, `z' = b + x z`, `w' = c w - d z` stretches the attractor in two
    directions at once, with the exponents near 0.11 and 0.02 for the parameters of Dilão (2023, Exercise 4.18).

    Args:
        x:
            The initial first coordinate.

        y:
            The initial second coordinate.

        z:
            The initial third coordinate.

        w:
            The initial fourth coordinate.

        a:
            The feedback of the second coordinate on itself.

        b:
            The constant drive of the third coordinate.

        c:
            The growth of the fourth coordinate.

        d:
            The damping of the fourth coordinate by the third.

    Returns:
        system:
            The system, with the states `rossler.x`, `rossler.y`, `rossler.z`, and `rossler.w`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import hyperchaotic_rossler
        >>> hyperchaotic_rossler(c=0.1).elements[0].c
        0.1
    """
    return System(elements=[HyperchaoticRosslerElement('rossler', x=x, y=y, z=z, w=w, a=a, b=b, c=c, d=d)])

ikeda(x=2.0, *, a=1.0, tau=2.0)

Return the Ikeda delay equation x' = a sin x(t - tau) in the form of Dilão (2023, Exercise 6.4).

The rest points x = k π alternate in stability for a > 0: those of odd k attract while a tau < π / 2, and lose stability to an oscillation in a Hopf bifurcation at a tau = π / 2. The history before the start is the initial value.

Parameters:

Name Type Description Default
x float

The initial value, also its history.

2.0
a float

The gain of the delayed feedback.

1.0
tau float

The delay.

2.0

Returns:

Name Type Description
system System

The system, with the state ikeda.x.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import ikeda
>>> ikeda(tau=1.0).elements[0].tau
1.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_flows.py
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
@register_system(
    field='mathematics/dynamical_systems',
    tags=('delay', 'dde', 'hopf bifurcation', 'oscillation'),
    references=('Ikeda and Matsumoto 1987', 'Dilão 2023'),
    defaults={'until': 100.0, 'dt': 0.1},
)
def ikeda(x: float = 2.0, *, a: float = 1.0, tau: float = 2.0) -> System:
    """Return the Ikeda delay equation `x' = a sin x(t - tau)` in the form of Dilão (2023, Exercise 6.4).

    The rest points `x = k π` alternate in stability for `a > 0`: those of odd `k` attract while `a tau < π / 2`, and
    lose stability to an oscillation in a Hopf bifurcation at `a tau = π / 2`. The history before the start is the
    initial value.

    Args:
        x:
            The initial value, also its history.

        a:
            The gain of the delayed feedback.

        tau:
            The delay.

    Returns:
        system:
            The system, with the state `ikeda.x`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import ikeda
        >>> ikeda(tau=1.0).elements[0].tau
        1.0
    """
    return System(elements=[IkedaElement('ikeda', x=x, a=a, tau=tau)])

intermittency_map(x=0.01, *, z=2.0)

Return the Pomeau-Manneville map x' = x + x^z (mod 1), whose long laminar phases near 0 end in chaotic bursts.

Parameters:

Name Type Description Default
x float

The initial value, between 0 and 1.

0.01
z float

The exponent of the tangency at 0, above 1.

2.0

Returns:

Name Type Description
system System

The system, with the state map.x.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import intermittency_map
>>> intermittency_map(z=1.5).elements[0].z
1.5
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
@register_system(
    field='mathematics/dynamical_systems',
    tags=('chaos', 'discrete map', 'intermittency'),
    references=('Pomeau and Manneville 1980', 'Dilão 2023', 'Jensen 2023'),
    defaults={'until': 1000, 'dt': 1},
)
def intermittency_map(x: float = 0.01, *, z: float = 2.0) -> System:
    """Return the Pomeau-Manneville map `x' = x + x^z (mod 1)`, whose long laminar phases near 0 end in chaotic bursts.

    Args:
        x:
            The initial value, between 0 and 1.

        z:
            The exponent of the tangency at 0, above 1.

    Returns:
        system:
            The system, with the state `map.x`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import intermittency_map
        >>> intermittency_map(z=1.5).elements[0].z
        1.5
    """
    burst = MapInteraction(
        'x_map',
        target='map',
        state='x',
        function=lambda s: mod(s.target.x + s.target.x**s.target.z, 1),
    )
    return System(elements=[IntermittencyMapElement('map', x=x, z=z)], interactions=[burst])

koopman_slow_manifold(x1=1.0, x2=-1.0, *, mu=-0.05, lam=-1.0)

Return the quadratic flow x1' = mu x1, x2' = lam (x2 - x1^2), with a slow manifold and a linear embedding.

For lam < mu < 0 the fast direction contracts onto the slow manifold x2 = x1^2, and the state then slides along it to the origin. With the observable x1^2, the coordinates (x1, x2, x1^2) span a Koopman-invariant subspace in which the flow is linear, with the eigenvalues mu, lam, and 2 mu. The Koopman eigenfunctions phi_mu = x1 and phi_lam = x2 - b x1^2 with b = lam / (lam - 2 mu) decay exactly as exp(mu t) and exp(lam t), so trajectories follow the parabolas x2 = b x1^2 + C |x1|^(lam / mu).

Parameters:

Name Type Description Default
x1 float

The initial slow coordinate.

1.0
x2 float

The initial fast coordinate.

-1.0
mu float

The slow eigenvalue.

-0.05
lam float

The fast eigenvalue.

-1.0

Returns:

Name Type Description
system System

The system, with the states flow.x1 and flow.x2.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import koopman_slow_manifold
>>> koopman_slow_manifold(lam=-2.0).elements[0].lam
-2.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_koopman.py
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
@register_system(
    field='mathematics/dynamical_systems',
    tags=('Koopman operator', 'slow manifold', 'eigenfunctions', 'ode'),
    references=('Brunton, Budišić, Kaiser, and Kutz 2022', 'Tu et al. 2014', 'Brunton et al. 2016'),
    defaults={'until': 40.0, 'dt': 0.1},
)
def koopman_slow_manifold(
    x1: float = 1.0,
    x2: float = -1.0,
    *,
    mu: float = -0.05,
    lam: float = -1.0,
) -> System:
    """Return the quadratic flow `x1' = mu x1`, `x2' = lam (x2 - x1^2)`, with a slow manifold and a linear embedding.

    For `lam < mu < 0` the fast direction contracts onto the slow manifold `x2 = x1^2`, and the state then slides
    along it to the origin. With the observable `x1^2`, the coordinates `(x1, x2, x1^2)` span a Koopman-invariant
    subspace in which the flow is linear, with the eigenvalues `mu`, `lam`, and `2 mu`. The Koopman eigenfunctions
    `phi_mu = x1` and `phi_lam = x2 - b x1^2` with `b = lam / (lam - 2 mu)` decay exactly as `exp(mu t)` and
    `exp(lam t)`, so trajectories follow the parabolas `x2 = b x1^2 + C |x1|^(lam / mu)`.

    Args:
        x1:
            The initial slow coordinate.

        x2:
            The initial fast coordinate.

        mu:
            The slow eigenvalue.

        lam:
            The fast eigenvalue.

    Returns:
        system:
            The system, with the states `flow.x1` and `flow.x2`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import koopman_slow_manifold
        >>> koopman_slow_manifold(lam=-2.0).elements[0].lam
        -2.0
    """
    return System(elements=[SlowManifoldElement('flow', x1=x1, x2=x2, mu=mu, lam=lam)])

langford(x=0.1, y=0.0, z=0.0, *, a=0.95, b=0.7, c=0.6, d=3.5, e=0.25, f=0.1)

Return the Langford flow, a rotation whose torus breaks into a strange attractor for the defaults of Dilão.

The flow is x' = (z - b) x - d y, y' = d x + (z - b) y, and z' = c + a z - z³ / 3 - (x² + y²)(1 + e z) + f z x³, with the reference parameters of Dilão (2023, Exercise 3.22). Without f the flow is symmetric under rotations about the z axis.

Parameters:

Name Type Description Default
x float

The initial first coordinate.

0.1
y float

The initial second coordinate.

0.0
z float

The initial height.

0.0
a float

The linear growth of the height.

0.95
b float

The height above which the rotation grows.

0.7
c float

The constant drive of the height.

0.6
d float

The angular frequency of the rotation.

3.5
e float

The coupling of the radius and the height.

0.25
f float

The term that breaks the rotational symmetry.

0.1

Returns:

Name Type Description
system System

The system, with the states langford.x, langford.y, and langford.z.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import langford
>>> langford(f=0.0).elements[0].f
0.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_flows.py
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
@register_system(
    field='mathematics/dynamical_systems',
    tags=('chaos', 'ode', 'torus', 'strange attractor'),
    references=('Langford 1984', 'Dilão 2023'),
    defaults={'until': 200.0, 'dt': 0.05},
)
def langford(
    x: float = 0.1,
    y: float = 0.0,
    z: float = 0.0,
    *,
    a: float = 0.95,
    b: float = 0.7,
    c: float = 0.6,
    d: float = 3.5,
    e: float = 0.25,
    f: float = 0.1,
) -> System:
    """Return the Langford flow, a rotation whose torus breaks into a strange attractor for the defaults of Dilão.

    The flow is `x' = (z - b) x - d y`, `y' = d x + (z - b) y`, and
    `z' = c + a z - z³ / 3 - (x² + y²)(1 + e z) + f z x³`, with the reference parameters of Dilão (2023, Exercise
    3.22). Without `f` the flow is symmetric under rotations about the `z` axis.

    Args:
        x:
            The initial first coordinate.

        y:
            The initial second coordinate.

        z:
            The initial height.

        a:
            The linear growth of the height.

        b:
            The height above which the rotation grows.

        c:
            The constant drive of the height.

        d:
            The angular frequency of the rotation.

        e:
            The coupling of the radius and the height.

        f:
            The term that breaks the rotational symmetry.

    Returns:
        system:
            The system, with the states `langford.x`, `langford.y`, and `langford.z`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import langford
        >>> langford(f=0.0).elements[0].f
        0.0
    """
    return System(elements=[LangfordElement('langford', x=x, y=y, z=z, a=a, b=b, c=c, d=d, e=e, f=f)])

logistic_map(x=0.2, *, r=3.7)

Return the logistic map x_{t+1} = r x_t (1 - x_t), which reaches chaos through period doubling as r grows.

Parameters:

Name Type Description Default
x float

The initial value, between 0 and 1.

0.2
r float

The growth rate, between 0 and 4.

3.7

Returns:

Name Type Description
system System

The system, with the state map.x.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import logistic_map
>>> logistic_map(r=3.2).elements[0].r
3.2
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
@register_system(
    field='mathematics/dynamical_systems',
    tags=('chaos', 'discrete map', 'period doubling'),
    references=('May 1976', 'Satz 2022'),
    defaults={'until': 200, 'dt': 1},
)
def logistic_map(x: float = 0.2, *, r: float = 3.7) -> System:
    """Return the logistic map `x_{t+1} = r x_t (1 - x_t)`, which reaches chaos through period doubling as `r` grows.

    Args:
        x:
            The initial value, between 0 and 1.

        r:
            The growth rate, between 0 and 4.

    Returns:
        system:
            The system, with the state `map.x`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import logistic_map
        >>> logistic_map(r=3.2).elements[0].r
        3.2
    """
    logistic = MapInteraction(
        'x_map',
        target='map',
        state='x',
        function=lambda s: s.target.r * s.target.x * (1 - s.target.x),
    )
    return System(elements=[LogisticMapElement('map', x=x, r=r)], interactions=[logistic])

lorenz(x=1.0, y=1.0, z=1.0, *, sigma=10.0, rho=28.0, beta=8 / 3)

Return the Lorenz-63 system of convection, chaotic on a butterfly-shaped attractor for its standard parameters.

Parameters:

Name Type Description Default
x float

The initial convection intensity.

1.0
y float

The initial temperature difference between rising and falling currents.

1.0
z float

The initial deviation of the vertical temperature profile.

1.0
sigma float

The Prandtl number.

10.0
rho float

The Rayleigh number relative to its critical value.

28.0
beta float

The geometric factor.

8 / 3

Returns:

Name Type Description
system System

The system, with the states lorenz.x, lorenz.y, and lorenz.z.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import lorenz
>>> lorenz(rho=20.0).elements[0].rho
20.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_flows.py
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
@register_system(
    field='mathematics/dynamical_systems',
    tags=('chaos', 'ode', 'strange attractor'),
    references=('Lorenz 1963', 'Datseris and Parlitz 2022'),
    defaults={'until': 50.0, 'dt': 0.01},
)
def lorenz(
    x: float = 1.0,
    y: float = 1.0,
    z: float = 1.0,
    *,
    sigma: float = 10.0,
    rho: float = 28.0,
    beta: float = 8 / 3,
) -> System:
    """Return the Lorenz-63 system of convection, chaotic on a butterfly-shaped attractor for its standard parameters.

    Args:
        x:
            The initial convection intensity.

        y:
            The initial temperature difference between rising and falling currents.

        z:
            The initial deviation of the vertical temperature profile.

        sigma:
            The Prandtl number.

        rho:
            The Rayleigh number relative to its critical value.

        beta:
            The geometric factor.

    Returns:
        system:
            The system, with the states `lorenz.x`, `lorenz.y`, and `lorenz.z`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import lorenz
        >>> lorenz(rho=20.0).elements[0].rho
        20.0
    """
    return System(elements=[LorenzElement('lorenz', x=x, y=y, z=z, sigma=sigma, rho=rho, beta=beta)])

lozi_map(x=0.0, y=0.0, *, a=1.7, b=0.5)

Return the Lozi map x' = 1 + y - a |x|, y' = b x, the piecewise linear Hénon map with a strange attractor.

The fold of the Hénon map becomes a corner, so the attractor is made of straight segments, and for the defaults of Lozi (1978) the orbit is chaotic (Dilão 2023, Exercise 3.16).

Parameters:

Name Type Description Default
x float

The initial first coordinate.

0.0
y float

The initial second coordinate.

0.0
a float

The slope of the fold.

1.7
b float

The contraction.

0.5

Returns:

Name Type Description
system System

The system, with the states map.x and map.y.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import lozi_map
>>> lozi_map(a=1.5).elements[0].a
1.5
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
@register_system(
    field='mathematics/dynamical_systems',
    tags=('chaos', 'discrete map', 'strange attractor', 'piecewise linear'),
    references=('Lozi 1978', 'Dilão 2023'),
    defaults={'until': 1000, 'dt': 1},
)
def lozi_map(x: float = 0.0, y: float = 0.0, *, a: float = 1.7, b: float = 0.5) -> System:
    """Return the Lozi map `x' = 1 + y - a |x|`, `y' = b x`, the piecewise linear Hénon map with a strange attractor.

    The fold of the Hénon map becomes a corner, so the attractor is made of straight segments, and for the defaults of
    Lozi (1978) the orbit is chaotic (Dilão 2023, Exercise 3.16).

    Args:
        x:
            The initial first coordinate.

        y:
            The initial second coordinate.

        a:
            The slope of the fold.

        b:
            The contraction.

    Returns:
        system:
            The system, with the states `map.x` and `map.y`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import lozi_map
        >>> lozi_map(a=1.5).elements[0].a
        1.5
    """
    first = MapInteraction(
        'x_map',
        target='map',
        state='x',
        function=lambda s: 1 + s.target.y - s.target.a * abs_symbolic(s.target.x),
    )
    second = MapInteraction('y_map', target='map', state='y', function=lambda s: s.target.b * s.target.x)
    return System(elements=[LoziMapElement('map', x=x, y=y, a=a, b=b)], interactions=[first, second])

newton_raphson_map(x=0.5, y=0.5)

Return Newton's method for z³ = 1 in the complex plane, z' = (2z³ + 1) / (3z²), in real coordinates.

Every start except a set of measure zero converges to one of the three cube roots of unity, and the boundaries of their basins are fractal.

Parameters:

Name Type Description Default
x float

The initial real part.

0.5
y float

The initial imaginary part.

0.5

Returns:

Name Type Description
system System

The system, with the states map.x and map.y.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import newton_raphson_map
>>> newton_raphson_map(x=1.5).elements[0].x
1.5
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
@register_system(
    field='mathematics/dynamical_systems',
    tags=('discrete map', 'basins', 'fractal'),
    references=('Dilão 2023',),
    defaults={'until': 50, 'dt': 1},
)
def newton_raphson_map(x: float = 0.5, y: float = 0.5) -> System:
    """Return Newton's method for `z³ = 1` in the complex plane, `z' = (2z³ + 1) / (3z²)`, in real coordinates.

    Every start except a set of measure zero converges to one of the three cube roots of unity, and the boundaries of
    their basins are fractal.

    Args:
        x:
            The initial real part.

        y:
            The initial imaginary part.

    Returns:
        system:
            The system, with the states `map.x` and `map.y`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import newton_raphson_map
        >>> newton_raphson_map(x=1.5).elements[0].x
        1.5
    """
    real = MapInteraction(
        'x_map',
        target='map',
        state='x',
        function=lambda s: (
            2 * s.target.x / 3 + (s.target.x**2 - s.target.y**2) / (3 * (s.target.x**2 + s.target.y**2) ** 2)
        ),
    )
    imaginary = MapInteraction(
        'y_map',
        target='map',
        state='y',
        function=lambda s: (
            2 * s.target.y / 3 - 2 * s.target.x * s.target.y / (3 * (s.target.x**2 + s.target.y**2) ** 2)
        ),
    )
    return System(elements=[NewtonMapElement('map', x=x, y=y)], interactions=[real, imaginary])

nose_hoover(x=0.0, y=0.1, z=0.0)

Return the Nosé-Hoover oscillator x' = y, y' = y z - x, z' = 1 - y², with tori next to a chaotic sea.

The flow conserves volume on average and its state space is mixed. From (0, 1.549934227822898, 0) the orbit is periodic, from (0, 1, 0) it winds on a torus around that orbit, and from the default (0, 0.1, 0) it is chaotic (Datseris and Parlitz 2022, Exercise 2.11). Since z' = 1 - y², every bounded orbit has <y²> = 1.

Parameters:

Name Type Description Default
x float

The initial position.

0.0
y float

The initial momentum.

0.1
z float

The initial friction of the thermostat.

0.0

Returns:

Name Type Description
system System

The system, with the states oscillator.x, oscillator.y, and oscillator.z.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import nose_hoover
>>> nose_hoover(y=1.0).elements[0].y
1.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_flows.py
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
@register_system(
    field='mathematics/dynamical_systems',
    tags=('chaos', 'ode', 'conservative', 'thermostat', 'kam'),
    references=('Hoover 1995', 'Datseris and Parlitz 2022'),
    defaults={'until': 200.0, 'dt': 0.05},
)
def nose_hoover(x: float = 0.0, y: float = 0.1, z: float = 0.0) -> System:
    """Return the Nosé-Hoover oscillator `x' = y`, `y' = y z - x`, `z' = 1 - y²`, with tori next to a chaotic sea.

    The flow conserves volume on average and its state space is mixed. From `(0, 1.549934227822898, 0)` the orbit is
    periodic, from `(0, 1, 0)` it winds on a torus around that orbit, and from the default `(0, 0.1, 0)` it is chaotic
    (Datseris and Parlitz 2022, Exercise 2.11). Since `z' = 1 - y²`, every bounded orbit has `<y²> = 1`.

    Args:
        x:
            The initial position.

        y:
            The initial momentum.

        z:
            The initial friction of the thermostat.

    Returns:
        system:
            The system, with the states `oscillator.x`, `oscillator.y`, and `oscillator.z`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import nose_hoover
        >>> nose_hoover(y=1.0).elements[0].y
        1.0
    """
    return System(elements=[NoseHooverElement('oscillator', x=x, y=y, z=z)])

ou_driven_rossler(x=1.0, y=1.0, z=1.0, *, a=0.2, b=0.4, c=5.743, tau=50.0, rho=0.5, eta=0.0)

Return the Rössler flow driven through its bifurcations by a slow Ornstein-Uhlenbeck control parameter.

The flow is x' = -y - z, y' = x + a y + eta, z' = b + z (x - c), Eq. 13 of Cestnik and Martens, and the control follows eta' = (-eta + rho xi) / tau with white noise xi. The control is an Ornstein-Uhlenbeck process with the correlation time tau and the stationary variance rho^2 / (2 tau). A control that varies slowly against the period of the flow sweeps it through the period doublings and chaotic bands of its bifurcation diagram.

Parameters:

Name Type Description Default
x float

The initial first coordinate.

1.0
y float

The initial second coordinate.

1.0
z float

The initial third coordinate.

1.0
a float

The feedback of the second coordinate on itself.

0.2
b float

The constant drive of the third coordinate.

0.4
c float

The threshold of the third coordinate's growth.

5.743
tau float

The correlation time of the control.

50.0
rho float

The amplitude of the noise of the control.

0.5
eta float

The initial control.

0.0

Returns:

Name Type Description
system System

The system, with the states rossler.x, rossler.y, rossler.z, and the control rossler.eta.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import ou_driven_rossler
>>> ou_driven_rossler(tau=10.0).elements[0].tau
10.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_driven_flows.py
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
@register_system(
    field='mathematics/dynamical_systems',
    tags=('Rössler', 'Ornstein-Uhlenbeck', 'sde', 'bifurcation diagram', 'chaos', 'nonstationary'),
    references=('Cestnik and Martens 2025', 'Rössler 1976', 'Uhlenbeck and Ornstein 1930'),
    defaults={'until': 500.0, 'dt': 0.1, 'solver': EulerMaruyamaSolver(dt=0.01)},
)
def ou_driven_rossler(
    x: float = 1.0,
    y: float = 1.0,
    z: float = 1.0,
    *,
    a: float = 0.2,
    b: float = 0.4,
    c: float = 5.743,
    tau: float = 50.0,
    rho: float = 0.5,
    eta: float = 0.0,
) -> System:
    """Return the Rössler flow driven through its bifurcations by a slow Ornstein-Uhlenbeck control parameter.

    The flow is `x' = -y - z`, `y' = x + a y + eta`, `z' = b + z (x - c)`, Eq. 13 of Cestnik and Martens, and the
    control follows `eta' = (-eta + rho xi) / tau` with white noise `xi`. The control is an Ornstein-Uhlenbeck
    process with the correlation time `tau` and the stationary variance `rho^2 / (2 tau)`. A control that varies
    slowly against the period of the flow sweeps it through the period doublings and chaotic bands of its
    bifurcation diagram.

    Args:
        x:
            The initial first coordinate.

        y:
            The initial second coordinate.

        z:
            The initial third coordinate.

        a:
            The feedback of the second coordinate on itself.

        b:
            The constant drive of the third coordinate.

        c:
            The threshold of the third coordinate's growth.

        tau:
            The correlation time of the control.

        rho:
            The amplitude of the noise of the control.

        eta:
            The initial control.

    Returns:
        system:
            The system, with the states `rossler.x`, `rossler.y`, `rossler.z`, and the control `rossler.eta`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import ou_driven_rossler
        >>> ou_driven_rossler(tau=10.0).elements[0].tau
        10.0
    """
    rossler = DrivenRosslerElement('rossler', x=x, y=y, z=z, eta=eta, a=a, b=b, c=c, tau=tau, rho=rho)
    drive = RateInteraction('drive', target='rossler', state='y', rate=lambda s: s.target.eta)
    control = RelaxationInteraction(
        'control',
        target='rossler',
        state='eta',
        time=lambda s: s.target.tau,
        noise=lambda s: s.target.rho / s.target.tau,
    )
    return System(elements=[rossler], interactions=[drive, control])

rossler(x=1.0, y=1.0, z=1.0, *, a=0.2, b=0.2, c=5.7)

Return the Rössler system, a chaotic flow with one folded band for its standard parameters.

Parameters:

Name Type Description Default
x float

The initial first coordinate.

1.0
y float

The initial second coordinate.

1.0
z float

The initial third coordinate.

1.0
a float

The feedback of the second coordinate on itself.

0.2
b float

The constant drive of the third coordinate.

0.2
c float

The threshold of the third coordinate's growth.

5.7

Returns:

Name Type Description
system System

The system, with the states rossler.x, rossler.y, and rossler.z.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import rossler
>>> rossler(c=4.0).elements[0].c
4.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_flows.py
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
@register_system(
    field='mathematics/dynamical_systems',
    tags=('chaos', 'ode', 'strange attractor'),
    references=('Rössler 1976',),
    defaults={'until': 200.0, 'dt': 0.05},
)
def rossler(
    x: float = 1.0,
    y: float = 1.0,
    z: float = 1.0,
    *,
    a: float = 0.2,
    b: float = 0.2,
    c: float = 5.7,
) -> System:
    """Return the Rössler system, a chaotic flow with one folded band for its standard parameters.

    Args:
        x:
            The initial first coordinate.

        y:
            The initial second coordinate.

        z:
            The initial third coordinate.

        a:
            The feedback of the second coordinate on itself.

        b:
            The constant drive of the third coordinate.

        c:
            The threshold of the third coordinate's growth.

    Returns:
        system:
            The system, with the states `rossler.x`, `rossler.y`, and `rossler.z`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import rossler
        >>> rossler(c=4.0).elements[0].c
        4.0
    """
    return System(elements=[RosslerElement('rossler', x=x, y=y, z=z, a=a, b=b, c=c)])

saddle_node_form(x=0.0, *, mu=1.0)

Return the saddle-node normal form x' = μ - x², whose two equilibria ±√μ meet and vanish at μ = 0.

Parameters:

Name Type Description Default
x float

The initial value.

0.0
mu float

The bifurcation parameter.

1.0

Returns:

Name Type Description
system System

The system, with the state form.x.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import saddle_node_form
>>> saddle_node_form(mu=0.5).elements[0].mu
0.5
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_normal_forms.py
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
@register_system(
    field='mathematics/dynamical_systems',
    tags=('bifurcation', 'normal form', 'ode'),
    references=('Gros 2015', 'Dilão 2023'),
    defaults={'until': 10.0, 'dt': 0.05},
)
def saddle_node_form(x: float = 0.0, *, mu: float = 1.0) -> System:
    """Return the saddle-node normal form `x' = μ - x²`, whose two equilibria `±√μ` meet and vanish at μ = 0.

    Args:
        x:
            The initial value.

        mu:
            The bifurcation parameter.

    Returns:
        system:
            The system, with the state `form.x`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import saddle_node_form
        >>> saddle_node_form(mu=0.5).elements[0].mu
        0.5
    """
    return System(elements=[SaddleNodeElement('form', x=x, mu=mu)])

skew_tent_map(n_points=100, *, a=0.3, x=0.4, spread=0.01, random_state=0)

Return an ensemble of the skew tent map, whose density relaxes to the uniform invariant density for any a.

The map is x' = x / a for x < a and x' = (1 - x) / (1 - a) otherwise. Every value has one preimage on each branch, with slopes 1 / a and 1 / (1 - a), so the uniform density is invariant. The points start in a narrow interval and spread over the unit interval until their histogram is flat. For a = 1/2 both slopes are 2, and in floating point every orbit reaches 0 within about 55 steps, so a should differ from 1/2.

Parameters:

Name Type Description Default
n_points int

The number of points of the ensemble.

100
a float

The position of the top of the tent, between 0 and 1.

0.3
x float

The left end of the interval of initial points.

0.4
spread float

The width of the interval of initial points.

0.01
random_state int | Generator | None

The seed or generator of the initial points.

0

Returns:

Name Type Description
system System

The system, with the states points.x.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import skew_tent_map
>>> skew_tent_map(10, a=0.7).elements[0].values['a']
0.7
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_chaotic_ensembles.py
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
@register_system(
    field='mathematics/dynamical_systems',
    tags=('chaos', 'discrete map', 'piecewise linear', 'invariant density'),
    references=('Bertin 2021',),
    defaults={'until': 50, 'dt': 1},
)
def skew_tent_map(
    n_points: int = 100,
    *,
    a: float = 0.3,
    x: float = 0.4,
    spread: float = 0.01,
    random_state: int | np.random.Generator | None = 0,
) -> System:
    """Return an ensemble of the skew tent map, whose density relaxes to the uniform invariant density for any `a`.

    The map is `x' = x / a` for `x < a` and `x' = (1 - x) / (1 - a)` otherwise. Every value has one preimage on each
    branch, with slopes `1 / a` and `1 / (1 - a)`, so the uniform density is invariant. The points start in a narrow
    interval and spread over the unit interval until their histogram is flat. For `a = 1/2` both slopes are 2, and in
    floating point every orbit reaches 0 within about 55 steps, so `a` should differ from 1/2.

    Args:
        n_points:
            The number of points of the ensemble.

        a:
            The position of the top of the tent, between 0 and 1.

        x:
            The left end of the interval of initial points.

        spread:
            The width of the interval of initial points.

        random_state:
            The seed or generator of the initial points.

    Returns:
        system:
            The system, with the states `points.x`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import skew_tent_map
        >>> skew_tent_map(10, a=0.7).elements[0].values['a']
        0.7
    """
    start = _draw_cloud(n_points, x, spread, random_state)
    return System(
        elements=[GroupElement('points', element=SkewTentMapElement, size=n_points, values={'x': start, 'a': a})],
    )

sprott_jerk(x=0.0, velocity=0.0, acceleration=1.0, *, A=0.6)

Return Sprott's jerk equation x''' = -A x'' - x' + |x| - 1, chaotic near A = 0.6.

Parameters:

Name Type Description Default
x float

The initial position.

0.0
velocity float

The initial first derivative.

0.0
acceleration float

The initial second derivative.

1.0
A float

The damping of the second derivative.

0.6

Returns:

Name Type Description
system System

The system, with the state jerk.x of order 3 and its derivatives jerk.x_d1 and jerk.x_d2.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import sprott_jerk
>>> sprott_jerk(A=0.5).elements[0].A
0.5
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_flows.py
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
@register_system(
    field='mathematics/dynamical_systems',
    tags=('chaos', 'ode', 'third order'),
    references=('Sprott 1997', 'Datseris and Parlitz 2022'),
    defaults={'until': 200.0, 'dt': 0.1},
)
def sprott_jerk(
    x: float = 0.0,
    velocity: float = 0.0,
    acceleration: float = 1.0,
    *,
    A: float = 0.6,
) -> System:
    """Return Sprott's jerk equation `x''' = -A x'' - x' + |x| - 1`, chaotic near A = 0.6.

    Args:
        x:
            The initial position.

        velocity:
            The initial first derivative.

        acceleration:
            The initial second derivative.

        A:
            The damping of the second derivative.

    Returns:
        system:
            The system, with the state `jerk.x` of order 3 and its derivatives `jerk.x_d1` and `jerk.x_d2`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import sprott_jerk
        >>> sprott_jerk(A=0.5).elements[0].A
        0.5
    """
    return System(elements=[JerkElement('jerk', x=x, x_d1=velocity, x_d2=acceleration, A=A)])

sprott_mixed_flow(x=2.0, y=0.0, z=0.0)

Return Sprott's flow with a conservative torus and a dissipative chaotic attractor side by side.

The flow is x' = y + 2xy + xz, y' = 1 - 2x² + yz, z' = x - x² - y², whose volumes change at the rate 2(y + z). From (1, 0, 0) the orbit winds on a 2-torus where this rate averages to zero, and from the default (2, 0, 0) it falls onto a chaotic attractor where it averages below zero (Datseris and Parlitz 2022, Exercises 3.17 and 8.16).

Parameters:

Name Type Description Default
x float

The initial first coordinate.

2.0
y float

The initial second coordinate.

0.0
z float

The initial third coordinate.

0.0

Returns:

Name Type Description
system System

The system, with the states flow.x, flow.y, and flow.z.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import sprott_mixed_flow
>>> sprott_mixed_flow(1.0).elements[0].x
1.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_flows.py
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
@register_system(
    field='mathematics/dynamical_systems',
    tags=('chaos', 'ode', 'conservative', 'strange attractor', 'torus'),
    references=('Sprott 2014', 'Datseris and Parlitz 2022'),
    defaults={'until': 200.0, 'dt': 0.05},
)
def sprott_mixed_flow(x: float = 2.0, y: float = 0.0, z: float = 0.0) -> System:
    """Return Sprott's flow with a conservative torus and a dissipative chaotic attractor side by side.

    The flow is `x' = y + 2xy + xz`, `y' = 1 - 2x² + yz`, `z' = x - x² - y²`, whose volumes change at the rate
    `2(y + z)`. From `(1, 0, 0)` the orbit winds on a 2-torus where this rate averages to zero, and from the default
    `(2, 0, 0)` it falls onto a chaotic attractor where it averages below zero (Datseris and Parlitz 2022, Exercises
    3.17 and 8.16).

    Args:
        x:
            The initial first coordinate.

        y:
            The initial second coordinate.

        z:
            The initial third coordinate.

    Returns:
        system:
            The system, with the states `flow.x`, `flow.y`, and `flow.z`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import sprott_mixed_flow
        >>> sprott_mixed_flow(1.0).elements[0].x
        1.0
    """
    return System(elements=[MixedFlowElement('flow', x=x, y=y, z=z)])

standard_map(theta=0.0, p=2 * math.pi * GOLDEN_MEAN, *, K=1.2)

Return the Chirikov standard map p' = p + K sin θ, θ' = θ + p', with global chaos above K ≈ 0.9716.

The last invariant circle that spans the angle, the golden-mean torus, breaks at K ≈ 0.971635. The angle is taken modulo 2π and the momentum is kept on the real line, so its spread measures diffusion.

Parameters:

Name Type Description Default
theta float

The initial angle.

0.0
p float

The initial momentum, by default on the golden-mean torus of the unkicked rotor.

2 * pi * GOLDEN_MEAN
K float

The kick strength.

1.2

Returns:

Name Type Description
system System

The system, with the states map.theta and map.p.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import standard_map
>>> standard_map(K=0.5).elements[0].K
0.5
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
@register_system(
    field='mathematics/dynamical_systems',
    tags=('chaos', 'discrete map', 'hamiltonian', 'kam'),
    references=('Chirikov 1979', 'Datseris and Parlitz 2022', 'Dilão 2023', 'Lindgren 2024'),
    defaults={'until': 1000, 'dt': 1},
)
def standard_map(theta: float = 0.0, p: float = 2 * math.pi * GOLDEN_MEAN, *, K: float = 1.2) -> System:
    """Return the Chirikov standard map `p' = p + K sin θ`, `θ' = θ + p'`, with global chaos above K ≈ 0.9716.

    The last invariant circle that spans the angle, the golden-mean torus, breaks at K ≈ 0.971635.
    The angle is taken modulo 2π and the momentum is kept on the real line, so its spread measures diffusion.

    Args:
        theta:
            The initial angle.

        p:
            The initial momentum, by default on the golden-mean torus of the unkicked rotor.

        K:
            The kick strength.

    Returns:
        system:
            The system, with the states `map.theta` and `map.p`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import standard_map
        >>> standard_map(K=0.5).elements[0].K
        0.5
    """
    kick = MapInteraction(
        'p_map',
        target='map',
        state='p',
        function=lambda s: s.target.p + s.target.K * sin(s.target.theta),
    )
    rotation = MapInteraction(
        'theta_map',
        target='map',
        state='theta',
        function=lambda s: mod(s.target.theta + s.target.p + s.target.K * sin(s.target.theta), 2 * pi),
    )
    return System(elements=[StandardMapElement('map', theta=theta, p=p, K=K)], interactions=[kick, rotation])

subcritical_hopf_form(x=0.1, y=0.0, *, alpha=-0.1, omega=1.0, q=0.0, gamma=1.0, s=0.0)

Return the subcritical Hopf normal form, where a stable focus coexists with a stable limit cycle.

The complex amplitude z = x + iy follows z' = (alpha + iω) z + (1 + iq) |z|² z - (gamma + is) |z|⁴ z, so its modulus follows r' = alpha r + r³ - gamma r⁵. The focus z = 0 is stable for alpha < 0. The stable limit cycle of radius r² = (1 + √(1 + 4 alpha gamma)) / (2 gamma) exists for alpha > -1 / (4 gamma), and an unstable cycle separates the two attractors while alpha < 0. A slow sweep of alpha up and down therefore jumps to the cycle at alpha = 0 and falls back to the focus at alpha = -1 / (4 gamma), a hysteresis loop.

Parameters:

Name Type Description Default
x float

The initial real part of z.

0.1
y float

The initial imaginary part of z.

0.0
alpha float

The bifurcation parameter alpha, the linear growth rate.

-0.1
omega float

The angular frequency ω at small amplitude.

1.0
q float

The nonlinear frequency shift q of the cubic term.

0.0
gamma float

The stabilizing quintic coefficient gamma, positive.

1.0
s float

The nonlinear frequency shift s of the quintic term.

0.0

Returns:

Name Type Description
system System

The system, with the states form.x and form.y.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import subcritical_hopf_form
>>> subcritical_hopf_form(alpha=0.1).elements[0].alpha
0.1
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_subcritical_forms.py
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
@register_system(
    field='mathematics/dynamical_systems',
    tags=('bifurcation', 'normal form', 'ode', 'limit cycle', 'bistability', 'hysteresis'),
    references=('Bertin 2021',),
    defaults={'until': 50.0, 'dt': 0.1},
)
def subcritical_hopf_form(
    x: float = 0.1,
    y: float = 0.0,
    *,
    alpha: float = -0.1,
    omega: float = 1.0,
    q: float = 0.0,
    gamma: float = 1.0,
    s: float = 0.0,
) -> System:
    """Return the subcritical Hopf normal form, where a stable focus coexists with a stable limit cycle.

    The complex amplitude `z = x + iy` follows `z' = (alpha + iω) z + (1 + iq) |z|² z - (gamma + is) |z|⁴ z`, so its
    modulus follows `r' = alpha r + r³ - gamma r⁵`. The focus `z = 0` is stable for `alpha < 0`. The stable limit cycle
    of radius `r² = (1 + √(1 + 4 alpha gamma)) / (2 gamma)` exists for `alpha > -1 / (4 gamma)`, and an unstable cycle
    separates the two attractors while `alpha < 0`. A slow sweep of `alpha` up and down therefore jumps to the cycle at
    `alpha = 0` and falls back to the focus at `alpha = -1 / (4 gamma)`, a hysteresis loop.

    Args:
        x:
            The initial real part of `z`.

        y:
            The initial imaginary part of `z`.

        alpha:
            The bifurcation parameter `alpha`, the linear growth rate.

        omega:
            The angular frequency `ω` at small amplitude.

        q:
            The nonlinear frequency shift `q` of the cubic term.

        gamma:
            The stabilizing quintic coefficient `gamma`, positive.

        s:
            The nonlinear frequency shift `s` of the quintic term.

    Returns:
        system:
            The system, with the states `form.x` and `form.y`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import subcritical_hopf_form
        >>> subcritical_hopf_form(alpha=0.1).elements[0].alpha
        0.1
    """
    return System(
        elements=[SubcriticalHopfElement('form', x=x, y=y, alpha=alpha, omega=omega, q=q, gamma=gamma, s=s)],
    )

takens_bogdanov_form(x=0.2, y=0.0, *, beta1=0.1, beta2=-1.0, sign=-1.0)

Return the Takens-Bogdanov normal form x' = y, y' = β1 + β2 x + x² + s x y, where a saddle-node meets a Hopf.

Parameters:

Name Type Description Default
x float

The initial position.

0.2
y float

The initial velocity.

0.0
beta1 float

The first unfolding parameter.

0.1
beta2 float

The second unfolding parameter.

-1.0
sign float

The sign s of the mixed term, -1 or 1.

-1.0

Returns:

Name Type Description
system System

The system, with the states form.x and form.y.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import takens_bogdanov_form
>>> takens_bogdanov_form(beta1=0.0).elements[0].beta1
0.0
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_normal_forms.py
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
@register_system(
    field='mathematics/dynamical_systems',
    tags=('bifurcation', 'normal form', 'ode', 'codimension two'),
    references=('Gros 2015', 'Dilão 2023'),
    defaults={'until': 50.0, 'dt': 0.1},
)
def takens_bogdanov_form(
    x: float = 0.2,
    y: float = 0.0,
    *,
    beta1: float = 0.1,
    beta2: float = -1.0,
    sign: float = -1.0,
) -> System:
    """Return the Takens-Bogdanov normal form `x' = y`, `y' = β1 + β2 x + x² + s x y`, where a saddle-node meets a Hopf.

    Args:
        x:
            The initial position.

        y:
            The initial velocity.

        beta1:
            The first unfolding parameter.

        beta2:
            The second unfolding parameter.

        sign:
            The sign `s` of the mixed term, `-1` or `1`.

    Returns:
        system:
            The system, with the states `form.x` and `form.y`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import takens_bogdanov_form
        >>> takens_bogdanov_form(beta1=0.0).elements[0].beta1
        0.0
    """
    return System(elements=[TakensBogdanovElement('form', x=x, y=y, beta1=beta1, beta2=beta2, sign=sign)])

tent_map(x=0.3, *, mu=1.99)

Return the tent map x' = μ min(x, 1 - x), chaotic with Lyapunov exponent ln μ for μ above 1.

Parameters:

Name Type Description Default
x float

The initial value, between 0 and 1.

0.3
mu float

The slope, between 0 and 2.

1.99

Returns:

Name Type Description
system System

The system, with the state map.x.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import tent_map
>>> tent_map(mu=1.5).elements[0].mu
1.5
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
@register_system(
    field='mathematics/dynamical_systems',
    tags=('chaos', 'discrete map', 'piecewise linear'),
    references=('Datseris and Parlitz 2022', 'Dilão 2023'),
    defaults={'until': 200, 'dt': 1},
)
def tent_map(x: float = 0.3, *, mu: float = 1.99) -> System:
    """Return the tent map `x' = μ min(x, 1 - x)`, chaotic with Lyapunov exponent `ln μ` for μ above 1.

    Args:
        x:
            The initial value, between 0 and 1.

        mu:
            The slope, between 0 and 2.

    Returns:
        system:
            The system, with the state `map.x`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import tent_map
        >>> tent_map(mu=1.5).elements[0].mu
        1.5
    """
    tent = MapInteraction(
        'x_map',
        target='map',
        state='x',
        function=lambda s: s.target.mu * where(s.target.x < 1 / 2, s.target.x, 1 - s.target.x),
    )
    return System(elements=[TentMapElement('map', x=x, mu=mu)], interactions=[tent])

thomas(x=0.1, y=0.0, z=0.0, *, a=0.18)

Return the Thomas flow x' = -a x + sin y with its cyclic permutations, chaotic for a = 0.18.

The flow is symmetric under the cyclic permutation of its coordinates. As the damping a falls the fixed points give way to limit cycles and then to chaos, and at a = 0 the orbits wander through a lattice of cells, Thomas's labyrinth chaos (Dilão 2023, Exercise 3.23).

Parameters:

Name Type Description Default
x float

The initial first coordinate.

0.1
y float

The initial second coordinate.

0.0
z float

The initial third coordinate.

0.0
a float

The damping of every coordinate.

0.18

Returns:

Name Type Description
system System

The system, with the states thomas.x, thomas.y, and thomas.z.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import thomas
>>> thomas(a=0.2).elements[0].a
0.2
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_flows.py
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
@register_system(
    field='mathematics/dynamical_systems',
    tags=('chaos', 'ode', 'cyclic symmetry', 'strange attractor'),
    references=('Thomas 1999', 'Dilão 2023'),
    defaults={'until': 500.0, 'dt': 0.1},
)
def thomas(x: float = 0.1, y: float = 0.0, z: float = 0.0, *, a: float = 0.18) -> System:
    """Return the Thomas flow `x' = -a x + sin y` with its cyclic permutations, chaotic for `a = 0.18`.

    The flow is symmetric under the cyclic permutation of its coordinates. As the damping `a` falls the fixed points
    give way to limit cycles and then to chaos, and at `a = 0` the orbits wander through a lattice of cells, Thomas's
    labyrinth chaos (Dilão 2023, Exercise 3.23).

    Args:
        x:
            The initial first coordinate.

        y:
            The initial second coordinate.

        z:
            The initial third coordinate.

        a:
            The damping of every coordinate.

    Returns:
        system:
            The system, with the states `thomas.x`, `thomas.y`, and `thomas.z`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import thomas
        >>> thomas(a=0.2).elements[0].a
        0.2
    """
    return System(elements=[ThomasElement('thomas', x=x, y=y, z=z, a=a)])

towel_map(x=0.085, y=-0.121, z=0.075, *, a=3.8, b=3.78)

Return Rössler's towel map, a three-dimensional map with two positive Lyapunov exponents.

x' = a x (1 - x) - 0.05 (y + 0.35)(1 - 2z), y' = 0.1 ((y + 0.35)(1 - 2z) - 1)(1 - 1.9 x), and z' = b z (1 - z) + 0.2 y.

Parameters:

Name Type Description Default
x float

The initial first coordinate.

0.085
y float

The initial second coordinate.

-0.121
z float

The initial third coordinate.

0.075
a float

The growth rate of the first logistic coordinate.

3.8
b float

The growth rate of the third logistic coordinate.

3.78

Returns:

Name Type Description
system System

The system, with the states map.x, map.y, and map.z.

Examples:

>>> from skcomplex.systems.mathematics.dynamical_systems import towel_map
>>> towel_map(a=3.7).elements[0].a
3.7
Source code in src/skcomplex/systems/mathematics/dynamical_systems/_maps.py
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
@register_system(
    field='mathematics/dynamical_systems',
    tags=('chaos', 'discrete map', 'hyperchaos'),
    references=('Rössler 1979', 'Datseris and Parlitz 2022'),
    defaults={'until': 1000, 'dt': 1},
)
def towel_map(
    x: float = 0.085,
    y: float = -0.121,
    z: float = 0.075,
    *,
    a: float = 3.8,
    b: float = 3.78,
) -> System:
    """Return Rössler's towel map, a three-dimensional map with two positive Lyapunov exponents.

    `x' = a x (1 - x) - 0.05 (y + 0.35)(1 - 2z)`, `y' = 0.1 ((y + 0.35)(1 - 2z) - 1)(1 - 1.9 x)`, and
    `z' = b z (1 - z) + 0.2 y`.

    Args:
        x:
            The initial first coordinate.

        y:
            The initial second coordinate.

        z:
            The initial third coordinate.

        a:
            The growth rate of the first logistic coordinate.

        b:
            The growth rate of the third logistic coordinate.

    Returns:
        system:
            The system, with the states `map.x`, `map.y`, and `map.z`.

    Examples:
        >>> from skcomplex.systems.mathematics.dynamical_systems import towel_map
        >>> towel_map(a=3.7).elements[0].a
        3.7
    """
    first = MapInteraction(
        'x_map',
        target='map',
        state='x',
        function=lambda s: (
            s.target.a * s.target.x * (1 - s.target.x) - 0.05 * (s.target.y + 0.35) * (1 - 2 * s.target.z)
        ),
    )
    second = MapInteraction(
        'y_map',
        target='map',
        state='y',
        function=lambda s: 0.1 * ((s.target.y + 0.35) * (1 - 2 * s.target.z) - 1) * (1 - 1.9 * s.target.x),
    )
    third = MapInteraction(
        'z_map',
        target='map',
        state='z',
        function=lambda s: s.target.b * s.target.z * (1 - s.target.z) + 0.2 * s.target.y,
    )
    return System(elements=[TowelMapElement('map', x=x, y=y, z=z, a=a, b=b)], interactions=[first, second, third])