Skip to content

Nonlinear oscillators

Nonlinear oscillator systems.

The package covers Duffing, Toda, Van der Pol, Stuart-Landau, Adler, impulses, billiards, and chaos.

AdlerEquationSystem(phi=0.0, *, detuning=0.5, epsilon=1.0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

The Adler equation Δφ' = Δω + ε sin Δφ.

The equation is that of the phase difference of an oscillator and its drive.

The phase difference locks at a fixed point when |Δω| < ε, inside the Arnold tongue. Outside it, the phase slips by 2π every 2π / sqrt(Δω² - ε²). The system has the phase difference difference.phi.

Parameters:

Name Type Description Default
phi float

The initial phase difference.

0.0
detuning float

The frequency difference Δω.

0.5
epsilon float

The strength of the coupling.

1.0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import AdlerEquationSystem
>>> AdlerEquationSystem(detuning=2.0).prepare().system_.interactions[0].detuning
2.0
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
894
895
896
897
898
899
900
901
902
903
904
905
906
907
def __init__(
    self,
    phi: float = 0.0,
    *,
    detuning: float = 0.5,
    epsilon: float = 1.0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.phi = phi
    self.detuning = detuning
    self.epsilon = epsilon

AdlerInteraction(label, *, target, detuning=0.5, epsilon=1.0)

Bases: Interaction

Adler dynamics phi' = detuning + epsilon sin(phi) of the phase difference of an oscillator and its drive.

Parameters:

Name Type Description Default
label str

The label of the interaction.

required
target Role

The path of the phase difference, whose value is phi.

required
detuning float

The frequency difference Δω.

0.5
epsilon float

The strength of the coupling.

1.0

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import AdlerInteraction
>>> AdlerInteraction('locking', target='difference', detuning=2.0).detuning
2.0
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
837
838
839
840
841
def __init__(self, label: str, *, target: Role, detuning: float = 0.5, epsilon: float = 1.0) -> None:
    super().__init__(label)
    self.target = target
    self.detuning = detuning
    self.epsilon = epsilon

BilliardWallInteraction(label, *, target, wall='disc', direction=0)

Bases: Interaction

Specular reflection of a particle off a wall of a billiard table.

When the guard g of the wall crosses zero in the given direction, the velocity v = (vx, vy) of the particle becomes v - 2 (v . n) n / |n|², with the normal n the gradient of g in the position (x, y). The walls of the tables read the sizes of the particle's table, and some apply only where a condition holds:

  • 'right_wall', 'left_wall', 'top_wall', and 'bottom_wall' are the sides x = ±half_side and y = ±half_side of the Sinai square, and 'disc' its central disc of radius radius.
  • 'cap' is the circle of radius radius above y = 0, 'cap_floor' the line y = 0 beside the stem, 'right_stem_wall' and 'left_stem_wall' the lines x = ±width below it, and 'stem_floor' the line y = -height of the mushroom.
  • 'disc_0', 'disc_1', and 'disc_2' are the discs of radius radius of the three-disk table, centered at the distance spacing / √3 from the origin at the polar angles of ANGLES.

Parameters:

Name Type Description Default
label str

The label of the interaction.

required
target Role

The path of the particle.

required
wall str

The name of the wall.

'disc'
direction int

The direction in which the guard crosses zero, 1 upward, -1 downward, and 0 either way.

0

Raises:

Type Description
ValidationError

The wall is unknown.

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import BilliardWallInteraction
>>> BilliardWallInteraction('cap', target='particle', wall='cap', direction=1).wall
'cap'
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_billiards.py
336
337
338
339
340
def __init__(self, label: str, *, target: Role, wall: str = 'disc', direction: int = 0) -> None:
    super().__init__(label)
    self.target = target
    self.wall = wall
    self.direction = direction

BilliardsSystem(shape='sinai', x=0.1, y=0.6, vx=0.6, vy=0.8, *, half_side=1.0, disc_radius=0.4, cap_radius=1.0, width=0.4, height=1.0, spacing=2.4, label='system', solver='auto', backend='auto')

Bases: BaseSystem

A particle moving freely on a billiard table.

The particle reflects specularly off the walls of the table.

The Sinai table is the square [-half_side, half_side]² with a disc of radius disc_radius at its center, and its motion is chaotic. The mushroom table is the upper half of a disc of radius cap_radius on a stem of half width width and height height, and its phase space mixes regular orbits that stay in the cap with chaotic orbits that enter the stem. The three-disk table is open: three discs of radius disc_radius sit at the corners of an equilateral triangle of side spacing centered at the origin, with one disc below the origin. A particle that comes from far away is scattered chaotically between the discs and leaves again, and the number of its collisions and its outgoing angle depend on its incoming direction through a fractal scattering function. Every bounce is an event, and the speed is conserved. The system has the position particle.x, particle.y and the velocity particle.vx, particle.vy.

Parameters:

Name Type Description Default
shape str

'sinai', 'mushroom', or 'three_disk'.

'sinai'
x float

The initial horizontal position.

0.1
y float

The initial vertical position.

0.6
vx float

The initial horizontal velocity.

0.6
vy float

The initial vertical velocity.

0.8
half_side float

The half side of the Sinai table.

1.0
disc_radius float

The radius of the disc of the Sinai table and of the discs of the three-disk table.

0.4
cap_radius float

The radius of the cap of the mushroom.

1.0
width float

The half width of the stem of the mushroom.

0.4
height float

The height of the stem of the mushroom.

1.0
spacing float

The distance between the centers of the discs of the three-disk table.

2.4
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Raises:

Type Description
ValidationError

The shape is unknown.

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import BilliardsSystem
>>> type(BilliardsSystem('mushroom').prepare().system_.elements[0]).__name__
'MushroomBilliardElement'
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_billiards.py
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
def __init__(
    self,
    shape: str = 'sinai',
    x: float = 0.1,
    y: float = 0.6,
    vx: float = 0.6,
    vy: float = 0.8,
    *,
    half_side: float = 1.0,
    disc_radius: float = 0.4,
    cap_radius: float = 1.0,
    width: float = 0.4,
    height: float = 1.0,
    spacing: float = 2.4,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.shape = shape
    self.x = x
    self.y = y
    self.vx = vx
    self.vy = vy
    self.half_side = half_side
    self.disc_radius = disc_radius
    self.cap_radius = cap_radius
    self.width = width
    self.height = height
    self.spacing = spacing

DuffingSystem(x=1.0, v=0.0, *, delta=0.3, alpha=-1.0, beta=1.0, gamma=0.5, omega=1.2, label='system', solver='auto', backend='auto')

Bases: DynamicalSystem

The forced Duffing oscillator, chaotic here.

The oscillator is x'' = -delta x' - alpha x - beta x^3 + gamma cos(omega t).

The system has the displacement duffing.x of order 2 and its velocity duffing.x'.

Parameters:

Name Type Description Default
x float

The initial displacement.

1.0
v float

The initial velocity.

0.0
delta float

The damping.

0.3
alpha float

The linear stiffness, negative for a double well.

-1.0
beta float

The cubic stiffness.

1.0
gamma float

The amplitude of the forcing.

0.5
omega float

The angular frequency of the forcing.

1.2
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import DuffingSystem
>>> DuffingSystem(gamma=0.3).prepare().system_.elements[0].values['gamma']
0.3
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
def __init__(
    self,
    x: float = 1.0,
    v: float = 0.0,
    *,
    delta: float = 0.3,
    alpha: float = -1.0,
    beta: float = 1.0,
    gamma: float = 0.5,
    omega: float = 1.2,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label=label, solver=solver, backend=backend)
    self.x = x
    self.v = v
    self.delta = delta
    self.alpha = alpha
    self.beta = beta
    self.gamma = gamma
    self.omega = omega

ForcedTodaSystem(x=0.0, v=0.0, *, d=0.1, a=0.88, omega=1.0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

The forced Toda oscillator x'' + d x' + e^x - 1 = a sin(omega t).

It is a passive asymmetric oscillator.

The exponential spring is stiff for x > 0 and soft for x < 0, unlike the symmetric spring of the Duffing oscillator. Its free frequency falls from 1 as the amplitude grows, so the resonance curve bends to low driving frequencies and the response swings far to the soft side. Stronger driving gives coexisting responses and period doubling cascades to chaos as the driving period 2π / ω changes. The system has the displacement toda.x and its velocity toda.x'.

Parameters:

Name Type Description Default
x float

The initial displacement.

0.0
v float

The initial velocity.

0.0
d float

The damping.

0.1
a float

The amplitude of the forcing.

0.88
omega float

The angular frequency of the forcing.

1.0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import ForcedTodaSystem
>>> ForcedTodaSystem(a=1.2).prepare().system_.interactions[0].a
1.2
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
def __init__(
    self,
    x: float = 0.0,
    v: float = 0.0,
    *,
    d: float = 0.1,
    a: float = 0.88,
    omega: float = 1.0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.x = x
    self.v = v
    self.d = d
    self.a = a
    self.omega = omega

ForcedVanDerPolInteraction(label, *, target, mu=1.0, A=1.0, omega=1.0)

Bases: Interaction

Van der Pol dynamics x'' = mu (1 - x²) x' - x + A cos(omega t) of an oscillator driven by a periodic force.

Parameters:

Name Type Description Default
label str

The label of the interaction.

required
target Role

The path of the oscillator.

required
mu Annotated[float, closed_open(0, oo)]

The strength of the nonlinear damping.

1.0
A float

The amplitude of the force.

1.0
omega float

The angular frequency of the force.

1.0

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import ForcedVanDerPolInteraction
>>> ForcedVanDerPolInteraction('drive', target='oscillator', A=0.5).A
0.5
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
707
708
709
710
711
712
713
714
715
716
717
718
719
720
def __init__(
    self,
    label: str,
    *,
    target: Role,
    mu: Annotated[float, RealSet.closed_open(0, oo)] = 1.0,
    A: float = 1.0,
    omega: float = 1.0,
) -> None:
    super().__init__(label)
    self.target = target
    self.mu = mu
    self.A = A
    self.omega = omega

ForcedVanDerPolSystem(x=2.0, v=0.0, *, mu=1.0, A=1.0, omega=1.0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

The Van der Pol oscillator driven by a periodic force.

The oscillator follows x'' = μ (1 - x²) x' - x + A cos(ω t).

A strong enough force entrains the limit cycle, so the oscillator locks to the driving frequency inside Arnold tongues, and the motion can be quasiperiodic or chaotic outside them. The system has the displacement oscillator.x and its velocity oscillator.x'.

Parameters:

Name Type Description Default
x float

The initial displacement.

2.0
v float

The initial velocity.

0.0
mu float

The strength of the nonlinear damping.

1.0
A float

The amplitude of the force.

1.0
omega float

The angular frequency of the force.

1.0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import ForcedVanDerPolSystem
>>> ForcedVanDerPolSystem(A=0.5).prepare().system_.interactions[0].A
0.5
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
def __init__(
    self,
    x: float = 2.0,
    v: float = 0.0,
    *,
    mu: float = 1.0,
    A: float = 1.0,
    omega: float = 1.0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.x = x
    self.v = v
    self.mu = mu
    self.A = A
    self.omega = omega

FreeFlightInteraction(label, *, target)

Bases: Interaction

Free flight x' = vx, y' = vy of a particle in the plane.

Parameters:

Name Type Description Default
label str

The label of the interaction.

required
target Role

The path of the particle.

required

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import FreeFlightInteraction
>>> FreeFlightInteraction('flight', target='particle').target
'particle'
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_billiards.py
280
281
282
def __init__(self, label: str, *, target: Role) -> None:
    super().__init__(label)
    self.target = target

HenonHeilesElement(label, *, x=0.0, y=0.1, px=0.35, py=0.0)

Bases: Element

Star in the Hénon-Heiles potential V = (x^2 + y^2) / 2 + x^2 y - y^3 / 3.

The star has the canonical momenta px, py.

The coordinates and the momenta are states of order 1, which a Hamiltonian interaction moves. Below the escape energy 1 / 6 the motion is regular for small energies and mostly chaotic near the escape energy.

Parameters:

Name Type Description Default
label str

The label of the star.

required
x float

The initial first coordinate.

0.0
y float

The initial second coordinate.

0.1
px float

The initial first momentum.

0.35
py float

The initial second momentum.

0.0

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import HenonHeilesElement
>>> HenonHeilesElement('star').px
0.35
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
128
129
130
131
132
133
def __init__(self, label: str, *, x: float = 0.0, y: float = 0.1, px: float = 0.35, py: float = 0.0) -> None:
    super().__init__(label)
    self.x = x
    self.y = y
    self.px = px
    self.py = py

HenonHeilesSystem(x=0.0, y=0.1, px=0.35, py=0.0, *, label='system', solver='auto', backend='auto')

Bases: BaseSystem

The Hénon-Heiles system of a star in a galactic potential.

The motion is chaotic at higher energies.

The star moves under the Hamiltonian H = (px² + py²) / 2 + (x² + y²) / 2 + x² y - y³ / 3, which is conserved. The system has the coordinates star.x and star.y and their momenta star.px and star.py.

Parameters:

Name Type Description Default
x float

The initial first coordinate.

0.0
y float

The initial second coordinate.

0.1
px float

The initial first momentum.

0.35
py float

The initial second momentum.

0.0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import HenonHeilesSystem
>>> HenonHeilesSystem(px=0.3).prepare().system_.elements[0].px
0.3
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
def __init__(
    self,
    x: float = 0.0,
    y: float = 0.1,
    px: float = 0.35,
    py: float = 0.0,
    *,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.x = x
    self.y = y
    self.px = px
    self.py = py

ImpulsiveOscillatorElement(label, *, x=0.0, H=2.0, values=None)

Bases: Element

Displacement of an oscillator that rings freely between periodic impulses.

The impulses kick its velocity.

A spring interaction gives the restoring force, and kick interactions change the velocity x' by multiples of the amplitude H at their times.

Parameters:

Name Type Description Default
label str

The label of the oscillator.

required
x float

The initial displacement.

0.0
H Annotated[float, closed_open(0, oo)]

The amplitude of the impulses, half the jump of the velocity that one impulse of the symmetric train causes.

2.0
values Mapping[str, object] | None

Further values by name, such as the initial velocity x', or None.

None

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import ImpulsiveOscillatorElement
>>> ImpulsiveOscillatorElement('oscillator').H
2.0
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
164
165
166
167
168
169
170
171
172
173
174
def __init__(
    self,
    label: str,
    *,
    x: float = 0.0,
    H: Annotated[float, RealSet.closed_open(0, oo)] = 2.0,
    values: Mapping[str, object] | None = None,
) -> None:
    super().__init__(label, values=values)
    self.x = x
    self.H = H

ImpulsiveOscillatorSystem(x=0.0, v=2.572, *, H=2.0, a=0.4165, gamma=0.0, spring='tangent', omega0=1.0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

An oscillator kicked by a periodic train of impulses of alternating sign.

The stiff spring gives x'' + tan(x) / cos²(x) = 2 H Σ_k (-1)^k δ(t - (2 k - 1) a), a strongly nonlinear oscillator whose free motion sin x = sin A sin(t / cos A) of amplitude A < π / 2 is known exactly. Between the impulses the oscillator rings freely, and every impulse is an event that kicks its velocity, by -2 H at the times (4 k + 1) a and by 2 H at the times (4 k + 3) a. A motion of amplitude A is periodic with the period 4 a of the impulses when an impulse reverses its velocity, which gives a = q arccos(H q² / sqrt((1 - q²) (1 - q² H²))) with q = cos A, for arctan H < A < π / 2. The defaults start the orbit of amplitude A = 1.2 for H = 2, from x = 0 with the speed tan A.

The temporal dipole shift gamma in (-1, 1) replaces the rectangular wave whose derivative gives the impulses with the derivative of an asymmetric saw-tooth wave: the negative impulses move to (4 k + 1 - gamma) a, the positive ones to (4 k + 3 + gamma) a, and both grow to 2 H / (1 - gamma²). The linear spring gives the harmonic oscillator x'' + omega0² x under the same impulses. The system has the displacement oscillator.x and its velocity oscillator.x', kicked by the impulses pull and push.

Parameters:

Name Type Description Default
x float

The initial displacement.

0.0
v float

The initial velocity.

2.572
H float

The amplitude of the impulses.

2.0
a float

A quarter of the period of the impulses.

0.4165
gamma float

The temporal dipole shift of the impulses, in (-1, 1).

0.0
spring str

The restoring force, 'tangent' for tan(x) / cos²(x) or 'linear' for omega0² x.

'tangent'
omega0 float

The natural frequency of the linear spring.

1.0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Raises:

Type Description
ParameterError

The spring is unknown, the quarter period is not positive, or the shift is outside (-1, 1).

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import ImpulsiveOscillatorSystem
>>> ImpulsiveOscillatorSystem(a=0.5, gamma=0.5).prepare().system_.interactions[1].start
0.25
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
def __init__(
    self,
    x: float = 0.0,
    v: float = 2.572,
    *,
    H: float = 2.0,
    a: float = 0.4165,
    gamma: float = 0.0,
    spring: str = 'tangent',
    omega0: float = 1.0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.x = x
    self.v = v
    self.H = H
    self.a = a
    self.gamma = gamma
    self.spring = spring
    self.omega0 = omega0

ImpulsiveSpringInteraction(label, *, target, spring='tangent', omega0=1.0)

Bases: Interaction

Restoring force of an impulsive oscillator, the stiff tangent spring or a linear one.

The tangent spring gives x'' = -tan(x) / cos²(x) and the linear spring x'' = -omega0² x.

Parameters:

Name Type Description Default
label str

The label of the interaction.

required
target Role

The path of the oscillator.

required
spring str

The restoring force, 'tangent' for tan(x) / cos²(x) or 'linear' for omega0² x.

'tangent'
omega0 Annotated[float, closed_open(0, oo)]

The natural frequency of the linear spring.

1.0

Raises:

Type Description
ParameterError

The spring is unknown.

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import ImpulsiveSpringInteraction
>>> ImpulsiveSpringInteraction('spring', target='oscillator', spring='linear').spring
'linear'
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
def __init__(
    self,
    label: str,
    *,
    target: Role,
    spring: str = 'tangent',
    omega0: Annotated[float, RealSet.closed_open(0, oo)] = 1.0,
) -> None:
    super().__init__(label)
    self.target = target
    self.spring = spring
    self.omega0 = omega0

KickInteraction(label, *, target, state='x', kick=1.0, period=1.0, start=0.0)

Bases: Interaction

Periodic kicks that change the velocity of an oscillator by a fixed amount.

Physics names them kicks, instantaneous changes of momentum at start + j * period for j from 0. Every kick adds kick to the velocity x' of the state x of the target. A kick at the initial time of a run does not fire.

Parameters:

Name Type Description Default
label str

The label of the interaction, unique among the components of its system.

required
target Role

The path of the oscillator whose velocity the kicks change.

required
state str

The name of the state whose velocity the kicks change.

'x'
kick float

The change of the velocity at every kick.

1.0
period float

The period of the kicks.

1.0
start float

The time of the first kick.

0.0

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import KickInteraction
>>> KickInteraction('kick', target='oscillator', kick=-1.0, period=2.0).start
0.0
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
def __init__(
    self,
    label: str,
    *,
    target: Role,
    state: str = 'x',
    kick: float = 1.0,
    period: float = 1.0,
    start: float = 0.0,
) -> None:
    super().__init__(label)
    self.target = target
    self.state = state
    self.kick = kick
    self.period = period
    self.start = start

MushroomBilliardElement(label, *, x=0.1, y=0.6, vx=0.6, vy=0.8, radius=1.0, width=0.4, height=1.0)

Bases: Element

Free particle in a mushroom table.

The table is a half disc cap of radius radius on a stem of half width width.

The particle flies straight, and reflects specularly off the cap, the floor of the cap beside the stem, the walls of the stem, and its floor at depth height. Its phase space mixes regular orbits that stay in the cap with chaotic orbits that enter the stem.

Parameters:

Name Type Description Default
label str

The label of the particle.

required
x float

The initial first coordinate.

0.1
y float

The initial second coordinate.

0.6
vx float

The initial first velocity.

0.6
vy float

The initial second velocity.

0.8
radius Annotated[float, open(0, oo)]

The radius of the cap.

1.0
width Annotated[float, open(0, oo)]

The half width of the stem.

0.4
height Annotated[float, open(0, oo)]

The height of the stem.

1.0

Attributes:

Name Type Description
default_visual_

How the particle is drawn by default, the visual of its class.

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import MushroomBilliardElement
>>> MushroomBilliardElement('ball').width
0.4
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_billiards.py
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
def __init__(
    self,
    label: str,
    *,
    x: float = 0.1,
    y: float = 0.6,
    vx: float = 0.6,
    vy: float = 0.8,
    radius: Annotated[float, RealSet.open(0, oo)] = 1.0,
    width: Annotated[float, RealSet.open(0, oo)] = 0.4,
    height: Annotated[float, RealSet.open(0, oo)] = 1.0,
) -> None:
    super().__init__(label)
    self.x = x
    self.y = y
    self.vx = vx
    self.vy = vy
    self.radius = radius
    self.width = width
    self.height = height

NuclearQuadrupoleSystem(q1=0.0, q2=1.0, p1=0.5, p2=0.0, *, B=0.5, label='system', solver='auto', backend='auto')

Bases: BaseSystem

The quadrupole vibrations of a nuclear surface.

The vibrations are a Hamiltonian system of two degrees of freedom.

The deformation coordinates q = (q1, q2) and their momenta p move under the Hamiltonian H = (q² + p²) / 2 + B q1 (3 q2² - q1²) / √2 + q⁴ / 8, which is conserved. The cubic term has the threefold symmetry of the Hénon-Heiles potential, and the quartic term keeps every orbit bounded, so the motion is regular at low and high energies and largely chaotic in between. The system has the coordinates nucleus.q1 and nucleus.q2, their momenta nucleus.p1 and nucleus.p2, and the observable nucleus.energy.

Parameters:

Name Type Description Default
q1 float

The initial first coordinate.

0.0
q2 float

The initial second coordinate.

1.0
p1 float

The initial first momentum.

0.5
p2 float

The initial second momentum.

0.0
B float

The strength of the cubic term.

0.5
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import NuclearQuadrupoleSystem
>>> NuclearQuadrupoleSystem(B=0.3).prepare().system_.elements[0].B
0.3
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
def __init__(
    self,
    q1: float = 0.0,
    q2: float = 1.0,
    p1: float = 0.5,
    p2: float = 0.0,
    *,
    B: float = 0.5,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.q1 = q1
    self.q2 = q2
    self.p1 = p1
    self.p2 = p2
    self.B = B

QuadrupoleElement(label, *, q1=0.0, q2=1.0, p1=0.5, p2=0.0, B=0.5)

Bases: Element

Surface of a nucleus in the quartic quadrupole potential.

The surface has the coordinates q1, q2 and momenta p1, p2.

The quadrupole deformation of the nuclear surface moves under the Hamiltonian H = (q² + p²) / 2 + B q1 (3 q2² - q1²) / √2 + q⁴ / 8, with q² = q1² + q2², which QuadrupoleMotionInteraction turns into the equations of motion. The cubic term of strength B breaks the rotational symmetry and makes the motion chaotic at intermediate energies, while the quartic term keeps it bounded at every energy.

Parameters:

Name Type Description Default
label str

The label of the nucleus.

required
q1 float

The initial first coordinate.

0.0
q2 float

The initial second coordinate.

1.0
p1 float

The initial first momentum.

0.5
p2 float

The initial second momentum.

0.0
B float

The strength of the cubic term.

0.5

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import QuadrupoleElement
>>> QuadrupoleElement('nucleus').B
0.5
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
def __init__(
    self,
    label: str,
    *,
    q1: float = 0.0,
    q2: float = 1.0,
    p1: float = 0.5,
    p2: float = 0.0,
    B: float = 0.5,
) -> None:
    super().__init__(label)
    self.q1 = q1
    self.q2 = q2
    self.p1 = p1
    self.p2 = p2
    self.B = B

QuadrupoleMotionInteraction(label, *, target)

Bases: Interaction

Motion of the surface of a nucleus in the quartic quadrupole potential.

The coordinates (q1, q2) and the momenta (p1, p2) of the target follow Hamilton's equations q' = dH/dp and p' = -dH/dq of H = (q² + p²) / 2 + B q1 (3 q2² - q1²) / √2 + q⁴ / 8, with the strength B of the target.

Parameters:

Name Type Description Default
label str

The label of the interaction.

required
target Role

The path of the nucleus.

required

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import QuadrupoleMotionInteraction
>>> QuadrupoleMotionInteraction('motion', target='nucleus').target
'nucleus'
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
954
955
956
def __init__(self, label: str, *, target: Role) -> None:
    super().__init__(label)
    self.target = target

SinaiBilliardElement(label, *, x=0.1, y=0.6, vx=0.6, vy=0.8, half_side=1.0, radius=0.4)

Bases: Element

Free particle in the Sinai billiard.

The table is a square of half side half_side with a central disc of radius radius.

The particle flies straight, and its specular reflections off the four walls and the disc make its motion ergodic and chaotic.

Parameters:

Name Type Description Default
label str

The label of the particle.

required
x float

The initial first coordinate.

0.1
y float

The initial second coordinate.

0.6
vx float

The initial first velocity.

0.6
vy float

The initial second velocity.

0.8
half_side Annotated[float, open(0, oo)]

The half side of the square.

1.0
radius Annotated[float, open(0, oo)]

The radius of the disc.

0.4

Attributes:

Name Type Description
default_visual_

How the particle is drawn by default, the visual of its class.

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import SinaiBilliardElement
>>> SinaiBilliardElement('ball').radius
0.4
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_billiards.py
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
def __init__(
    self,
    label: str,
    *,
    x: float = 0.1,
    y: float = 0.6,
    vx: float = 0.6,
    vy: float = 0.8,
    half_side: Annotated[float, RealSet.open(0, oo)] = 1.0,
    radius: Annotated[float, RealSet.open(0, oo)] = 0.4,
) -> None:
    super().__init__(label)
    self.x = x
    self.y = y
    self.vx = vx
    self.vy = vy
    self.half_side = half_side
    self.radius = radius

StuartLandauInteraction(label, *, target, mu=1.0, omega=1.0, beta=0.0)

Bases: Interaction

Stuart-Landau dynamics z' = (mu + i omega) z - (1 + i beta) |z|² z of a complex amplitude.

The amplitude z = x + i y of the target is written as two real values x and y.

Parameters:

Name Type Description Default
label str

The label of the interaction.

required
target Role

The path of the oscillator.

required
mu float

The distance from the Hopf bifurcation.

1.0
omega float

The linear frequency.

1.0
beta float

The nonlinear frequency shift.

0.0

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import StuartLandauInteraction
>>> StuartLandauInteraction('hopf', target='oscillator', beta=0.5).beta
0.5
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
570
571
572
573
574
575
576
577
578
579
580
581
582
583
def __init__(
    self,
    label: str,
    *,
    target: Role,
    mu: float = 1.0,
    omega: float = 1.0,
    beta: float = 0.0,
) -> None:
    super().__init__(label)
    self.target = target
    self.mu = mu
    self.omega = omega
    self.beta = beta

StuartLandauSystem(x=0.1, y=0.0, *, mu=1.0, omega=1.0, beta=0.0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

The Stuart-Landau oscillator z' = (μ + i ω) z - (1 + i β) |z|² z.

It is the normal form of a Hopf bifurcation.

The complex amplitude z = x + i y is written as two real states. For μ > 0 every orbit except the origin settles on the circle of radius sqrt(μ), turning at the frequency ω - β μ. The system has the real part oscillator.x and the imaginary part oscillator.y of the amplitude.

Parameters:

Name Type Description Default
x float

The initial real part of the amplitude.

0.1
y float

The initial imaginary part of the amplitude.

0.0
mu float

The distance from the Hopf bifurcation.

1.0
omega float

The linear frequency.

1.0
beta float

The nonlinear frequency shift.

0.0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import StuartLandauSystem
>>> StuartLandauSystem(mu=0.5).prepare().system_.interactions[0].mu
0.5
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
def __init__(
    self,
    x: float = 0.1,
    y: float = 0.0,
    *,
    mu: float = 1.0,
    omega: float = 1.0,
    beta: float = 0.0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.x = x
    self.y = y
    self.mu = mu
    self.omega = omega
    self.beta = beta

ThreeDiskBilliardElement(label, *, x=0.1, y=0.6, vx=0.6, vy=0.8, spacing=2.4, radius=0.4)

Bases: Element

Free particle scattered by three discs of radius radius.

The discs sit at the corners of a triangle of side spacing.

The centers of the discs lie at the distance spacing / √3 from the origin, at the polar angles -π / 2, π / 6, and 5 π / 6. The particle flies straight and reflects specularly off the discs. The billiard is open, so almost every particle leaves the scattering region after a finite number of collisions, and the number of collisions depends on the incoming direction in a fractal way.

Parameters:

Name Type Description Default
label str

The label of the particle.

required
x float

The initial first coordinate.

0.1
y float

The initial second coordinate.

0.6
vx float

The initial first velocity.

0.6
vy float

The initial second velocity.

0.8
spacing Annotated[float, open(0, oo)]

The distance between the centers of two discs.

2.4
radius Annotated[float, open(0, oo)]

The radius of the discs.

0.4

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import ThreeDiskBilliardElement
>>> ThreeDiskBilliardElement('ball').spacing
2.4
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_billiards.py
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
def __init__(
    self,
    label: str,
    *,
    x: float = 0.1,
    y: float = 0.6,
    vx: float = 0.6,
    vy: float = 0.8,
    spacing: Annotated[float, RealSet.open(0, oo)] = 2.4,
    radius: Annotated[float, RealSet.open(0, oo)] = 0.4,
) -> None:
    super().__init__(label)
    self.x = x
    self.y = y
    self.vx = vx
    self.vy = vy
    self.spacing = spacing
    self.radius = radius

TodaInteraction(label, *, target, d=0.1, a=0.88, omega=1.0)

Bases: Interaction

Forced Toda dynamics x'' = -d x' - (e^x - 1) + a sin(omega t) of a passive asymmetric oscillator.

Parameters:

Name Type Description Default
label str

The label of the interaction.

required
target Role

The path of the oscillator.

required
d Annotated[float, closed_open(0, oo)]

The damping.

0.1
a float

The amplitude of the forcing.

0.88
omega float

The angular frequency of the forcing.

1.0

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import TodaInteraction
>>> TodaInteraction('spring', target='toda', a=1.2).a
1.2
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
def __init__(
    self,
    label: str,
    *,
    target: Role,
    d: Annotated[float, RealSet.closed_open(0, oo)] = 0.1,
    a: float = 0.88,
    omega: float = 1.0,
) -> None:
    super().__init__(label)
    self.target = target
    self.d = d
    self.a = a
    self.omega = omega

VanDerPolElement(label, *, x=2.0, values=None)

Bases: Element

Van der Pol oscillator at the displacement x, with the velocity x'.

ForcedVanDerPolInteraction moves it by x'' = mu (1 - x^2) x' - x + A cos(omega t). The damping is negative for small amplitudes and positive for large ones, so the unforced oscillator, A = 0, settles on a limit cycle of amplitude near 2.

Parameters:

Name Type Description Default
label str

The label of the oscillator.

required
x float

The initial displacement.

2.0
values Mapping[str, object] | None

Further values by name, such as an initial velocity named with a prime, or None.

None

Examples:

>>> from skcomplex.core.systems import System
>>> from skcomplex.systems.physics.nonlinear_oscillators import ForcedVanDerPolInteraction, VanDerPolElement
>>> damping = ForcedVanDerPolInteraction('damping', target='oscillator', A=0.0)
>>> system = System(elements=[VanDerPolElement('oscillator', x=0.1)], interactions=[damping]).prepare()
>>> trajectory = system.simulate(until=50.0, dt=0.1)
>>> round(float(abs(trajectory.get_values('oscillator.x')[-300:]).max()), 1)
2.0
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
259
260
261
262
263
264
265
266
267
def __init__(
    self,
    label: str,
    *,
    x: float = 2.0,
    values: Mapping[str, object] | None = None,
) -> None:
    super().__init__(label, values=values)
    self.x = x

VanDerPolSystem(x=2.0, v=0.0, *, mu=1.0, label='system', solver='auto', backend='auto')

Bases: BaseSystem

The Van der Pol oscillator x'' = μ (1 - x²) x' - x.

The oscillator settles on a limit cycle for μ > 0.

The system has the displacement oscillator.x and its velocity oscillator.x'.

Parameters:

Name Type Description Default
x float

The initial displacement.

2.0
v float

The initial velocity.

0.0
mu float

The strength of the nonlinear damping.

1.0
label str

The label of the system, which names it when it is nested in another one.

'system'
solver BaseSolver | str

The solver of the problem, or 'auto' for the one the system chooses.

'auto'
backend BaseBackend | str

The backend that evaluates the compiled functions, or 'auto' for the one the system chooses.

'auto'

Examples:

>>> from skcomplex.systems.physics.nonlinear_oscillators import VanDerPolSystem
>>> VanDerPolSystem(mu=3.0).prepare().system_.interactions[0].mu
3.0
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
414
415
416
417
418
419
420
421
422
423
424
425
426
427
def __init__(
    self,
    x: float = 2.0,
    v: float = 0.0,
    *,
    mu: float = 1.0,
    label: str = 'system',
    solver: BaseSolver | str = 'auto',
    backend: BaseBackend | str = 'auto',
) -> None:
    super().__init__(label, solver=solver, backend=backend)
    self.x = x
    self.v = v
    self.mu = mu