Nonlinear oscillators
Nonlinear oscillators: Duffing, Toda, Van der Pol, Stuart-Landau, Adler, impulses, billiards, and chaos.
AdlerPhaseElement(label, visual=None, *, phi=0.0, detuning=0.5, epsilon=1.0)
Bases: Element
Phase difference of a forced oscillator, phi' = detuning + epsilon sin(phi), the Adler equation.
The phase locks at a fixed point when |detuning| <= epsilon, and slips with the period
2 pi / sqrt(detuning^2 - epsilon^2) otherwise.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the phase difference. |
required |
visual
|
VisualSpec | None
|
How the phase difference is drawn, or |
None
|
phi
|
Annotated[float, StateSpec()]
|
The initial phase difference. |
0.0
|
detuning
|
Annotated[float, ParameterSpec()]
|
The detuning of the natural frequency from the forcing. |
0.5
|
epsilon
|
Annotated[float, ParameterSpec()]
|
The strength of the forcing. |
1.0
|
Attributes:
| Name | Type | Description |
|---|---|---|
default_visual_ |
The visual of the phase difference when it sets none. |
Examples:
>>> from skcomplex.systems.physics.nonlinear_oscillators import AdlerPhaseElement
>>> AdlerPhaseElement('difference').detuning
0.5
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
56 57 58 59 60 61 62 63 64 65 66 67 68 | |
DuffingElement(label, visual=None, *, x=1.0, x_d1=0.0, delta=0.3, alpha=-1.0, beta=1.0, gamma=0.5, omega=1.2)
Bases: Element
Displacement and parameters of the forced Duffing oscillator, whose acceleration a RateInteraction sets.
The acceleration is x'' = -delta x' - alpha x - beta x^3 + gamma cos(omega t).
For alpha < 0 < beta the potential has two wells, and a strong enough forcing drives the oscillator chaotically
between them.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the oscillator. |
required |
visual
|
VisualSpec | None
|
How the oscillator is drawn, or |
None
|
x
|
Annotated[float, StateSpec(order=2)]
|
The initial displacement. |
1.0
|
x_d1
|
float
|
The initial velocity. |
0.0
|
delta
|
Annotated[float, ParameterSpec()]
|
The damping. |
0.3
|
alpha
|
Annotated[float, ParameterSpec()]
|
The linear stiffness. |
-1.0
|
beta
|
Annotated[float, ParameterSpec()]
|
The cubic stiffness. |
1.0
|
gamma
|
Annotated[float, ParameterSpec()]
|
The amplitude of the forcing. |
0.5
|
omega
|
Annotated[float, ParameterSpec()]
|
The frequency of the forcing. |
1.2
|
Attributes:
| Name | Type | Description |
|---|---|---|
default_visual_ |
The visual of the oscillator when it sets none. |
Examples:
>>> from skcomplex.systems.physics.nonlinear_oscillators import DuffingElement
>>> DuffingElement('duffing').alpha
-1.0
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
HenonHeilesElement(label, visual=VisualSpec('bodies', {'positions': ('x', 'y'), 'trail': None}), *, 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, with 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 |
visual
|
VisualSpec | None
|
How the star is drawn. |
VisualSpec('bodies', {'positions': ('x', 'y'), 'trail': None})
|
x
|
Annotated[float, StateSpec()]
|
The initial first coordinate. |
0.0
|
y
|
Annotated[float, StateSpec()]
|
The initial second coordinate. |
0.1
|
px
|
Annotated[float, StateSpec()]
|
The initial first momentum. |
0.35
|
py
|
Annotated[float, StateSpec()]
|
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
184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | |
ImpulsiveOscillatorElement(label, visual=None, *, x=0.0, x_d1=0.0, H=2.0, omega0=1.0)
Bases: Element
Displacement of an oscillator that rings freely between periodic impulses that kick its velocity.
A rate interaction gives the restoring force, and impulse interactions kick the velocity x_d1 by multiples of the
amplitude H at their times, so the element holds the states and the parameters they read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the oscillator. |
required |
visual
|
VisualSpec | None
|
How the oscillator is drawn, or |
None
|
x
|
Annotated[float, StateSpec(order=2)]
|
The initial displacement. |
0.0
|
x_d1
|
float
|
The initial velocity. |
0.0
|
H
|
Annotated[float, ParameterSpec(domain=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
|
omega0
|
Annotated[float, ParameterSpec(domain=closed_open(0, oo))]
|
The natural frequency of a linear spring. |
1.0
|
Attributes:
| Name | Type | Description |
|---|---|---|
default_visual_ |
The visual of the oscillator when it sets 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
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 | |
MushroomBilliardElement(label, visual=None, *, 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: 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 |
visual
|
VisualSpec | None
|
How the particle is drawn, or |
None
|
x
|
Annotated[float, StateSpec()]
|
The initial first coordinate. |
0.1
|
y
|
Annotated[float, StateSpec()]
|
The initial second coordinate. |
0.6
|
vx
|
Annotated[float, StateSpec()]
|
The initial first velocity. |
0.6
|
vy
|
Annotated[float, StateSpec()]
|
The initial second velocity. |
0.8
|
radius
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The radius of the cap. |
1.0
|
width
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The half width of the stem. |
0.4
|
height
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The height of the stem. |
1.0
|
Attributes:
| Name | Type | Description |
|---|---|---|
default_visual_ |
The visual of the particle when it sets none. |
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
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | |
QuadrupoleElement(label, visual=VisualSpec('bodies', {'positions': ('q1', 'q2'), 'trail': None}), *, 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, with 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 a Hamiltonian interaction
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 |
visual
|
VisualSpec | None
|
How the nucleus is drawn. |
VisualSpec('bodies', {'positions': ('q1', 'q2'), 'trail': None})
|
q1
|
Annotated[float, StateSpec()]
|
The initial first coordinate. |
0.0
|
q2
|
Annotated[float, StateSpec()]
|
The initial second coordinate. |
1.0
|
p1
|
Annotated[float, StateSpec()]
|
The initial first momentum. |
0.5
|
p2
|
Annotated[float, StateSpec()]
|
The initial second momentum. |
0.0
|
B
|
Annotated[float, ParameterSpec()]
|
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
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | |
SinaiBilliardElement(label, visual=VisualSpec('bodies', {'positions': ('x', 'y'), 'trail': None, 'outline': _sinai_walls}), *, x=0.1, y=0.6, vx=0.6, vy=0.8, size=1.0, radius=0.4)
Bases: Element
Free particle in a square table of half side size with a central disc of radius radius, the Sinai billiard.
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 |
visual
|
VisualSpec | None
|
How the particle is drawn. |
VisualSpec('bodies', {'positions': ('x', 'y'), 'trail': None, 'outline': _sinai_walls})
|
x
|
Annotated[float, StateSpec()]
|
The initial first coordinate. |
0.1
|
y
|
Annotated[float, StateSpec()]
|
The initial second coordinate. |
0.6
|
vx
|
Annotated[float, StateSpec()]
|
The initial first velocity. |
0.6
|
vy
|
Annotated[float, StateSpec()]
|
The initial second velocity. |
0.8
|
size
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The half side of the square. |
1.0
|
radius
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The radius of the disc. |
0.4
|
Attributes:
| Name | Type | Description |
|---|---|---|
default_visual_ |
The visual of the particle when it sets none. |
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
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | |
ThreeDiskBilliardElement(label, visual=VisualSpec('bodies', {'positions': ('x', 'y'), 'trail': None, 'outline': _three_disk_walls}), *, 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 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 |
visual
|
VisualSpec | None
|
How the particle is drawn. |
VisualSpec('bodies', {'positions': ('x', 'y'), 'trail': None, 'outline': _three_disk_walls})
|
x
|
Annotated[float, StateSpec()]
|
The initial first coordinate. |
0.1
|
y
|
Annotated[float, StateSpec()]
|
The initial second coordinate. |
0.6
|
vx
|
Annotated[float, StateSpec()]
|
The initial first velocity. |
0.6
|
vy
|
Annotated[float, StateSpec()]
|
The initial second velocity. |
0.8
|
spacing
|
Annotated[float, ParameterSpec(domain=open(0, oo))]
|
The distance between the centers of two discs. |
2.4
|
radius
|
Annotated[float, ParameterSpec(domain=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
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | |
TodaElement(label, visual=None, *, x=0.0, x_d1=0.0, d=0.1, a=0.88, omega=1.0)
Bases: Element
Displacement and parameters of the forced Toda oscillator, whose exponential spring is stiff on one side only.
The acceleration is x'' = -d x' - (e^x - 1) + a sin(omega t). The restoring force e^x - 1 grows exponentially
for x > 0 and saturates at -1 for x < 0, so the oscillator is passive and asymmetric, and its resonance curve
bends towards low frequencies.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the oscillator. |
required |
visual
|
VisualSpec | None
|
How the oscillator is drawn, or |
None
|
x
|
Annotated[float, StateSpec(order=2)]
|
The initial displacement. |
0.0
|
x_d1
|
float
|
The initial velocity. |
0.0
|
d
|
Annotated[float, ParameterSpec(domain=closed_open(0, oo))]
|
The damping. |
0.1
|
a
|
Annotated[float, ParameterSpec()]
|
The amplitude of the forcing. |
0.88
|
omega
|
Annotated[float, ParameterSpec()]
|
The frequency of the forcing. |
1.0
|
Attributes:
| Name | Type | Description |
|---|---|---|
default_visual_ |
The visual of the oscillator when it sets none. |
Examples:
>>> from skcomplex.systems.physics.nonlinear_oscillators import TodaElement
>>> TodaElement('toda').d
0.1
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 | |
VanDerPolElement(label, visual=None, *, x=2.0, x_d1=0.0, mu=1.0, A=0.0, omega=1.0)
Bases: Element
Van der Pol oscillator x'' = mu (1 - x^2) x' - x + A cos(omega t), with an optional periodic forcing.
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. A forcing of amplitude A and frequency omega locks it or drives it
quasiperiodically or chaotically.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the oscillator. |
required |
visual
|
VisualSpec | None
|
How the oscillator is drawn, or |
None
|
x
|
Annotated[float, StateSpec(order=2)]
|
The initial displacement. |
2.0
|
x_d1
|
float
|
The initial velocity. |
0.0
|
mu
|
Annotated[float, ParameterSpec(domain=closed_open(0, oo))]
|
The strength of the nonlinear damping. |
1.0
|
A
|
Annotated[float, ParameterSpec()]
|
The amplitude of the forcing. |
0.0
|
omega
|
Annotated[float, ParameterSpec()]
|
The frequency of the forcing. |
1.0
|
Attributes:
| Name | Type | Description |
|---|---|---|
default_visual_ |
The visual of the oscillator when it sets none. |
Examples:
>>> from skcomplex.core.components.system import System
>>> from skcomplex.core.engine.runtime import Simulation
>>> from skcomplex.systems.physics.nonlinear_oscillators import VanDerPolElement
>>> system = System(elements=[VanDerPolElement('oscillator', x=0.1)])
>>> trajectory = Simulation(system, dt=0.1).prepare().run(until=50.0).trajectory_
>>> round(float(abs(trajectory.values('oscillator.x')[-300:]).max()), 1)
2.0
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 | |
adler_equation(phi=0.0, *, detuning=0.5, epsilon=1.0)
Return the Adler equation Δφ' = Δω + ε sin Δφ for 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(Δω² - ε²).
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
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the phase difference |
Examples:
>>> from skcomplex.systems.physics.nonlinear_oscillators import adler_equation
>>> adler_equation(detuning=2.0).elements[0].detuning
2.0
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 | |
billiards(shape='sinai', x=0.1, y=0.6, vx=0.6, vy=0.8, *, size=1.0, disc_radius=0.4, cap_radius=1.0, width=0.4, height=1.0, spacing=2.4)
Return a particle moving freely on a billiard table and reflecting specularly off its walls.
The Sinai table is the square [-size, size]² 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.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape
|
str
|
|
'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
|
size
|
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
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the position |
Raises:
| Type | Description |
|---|---|
ValidationError
|
The shape is unknown. |
Examples:
>>> from skcomplex.systems.physics.nonlinear_oscillators import billiards
>>> type(billiards('mushroom').elements[0]).__name__
'MushroomBilliardElement'
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_billiards.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 355 356 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 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 | |
duffing(x=1.0, v=0.0, *, delta=0.3, alpha=-1.0, beta=1.0, gamma=0.5, omega=1.2)
Return the forced Duffing oscillator x'' = -delta x' - alpha x - beta x^3 + gamma cos(omega t), chaotic here.
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
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the displacement |
Examples:
>>> from skcomplex.systems.physics.nonlinear_oscillators import duffing
>>> duffing(gamma=0.3).elements[0].gamma
0.3
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 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 | |
forced_toda(x=0.0, v=0.0, *, d=0.1, a=0.88, omega=1.0)
Return the forced Toda oscillator x'' + d x' + e^x - 1 = a sin(omega t), 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.
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
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the displacement |
Examples:
>>> from skcomplex.systems.physics.nonlinear_oscillators import forced_toda
>>> forced_toda(a=1.2).elements[0].a
1.2
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
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 | |
forced_van_der_pol(x=2.0, v=0.0, *, mu=1.0, A=1.0, omega=1.0)
Return the Van der Pol oscillator driven by a periodic force, 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.
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
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the displacement |
Examples:
>>> from skcomplex.systems.physics.nonlinear_oscillators import forced_van_der_pol
>>> forced_van_der_pol(A=0.5).elements[0].A
0.5
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
691 692 693 694 695 696 697 698 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 | |
henon_heiles(x=0.0, y=0.1, px=0.35, py=0.0)
Return the Hénon-Heiles system of a star in a galactic potential, whose 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.
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
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the coordinates |
Examples:
>>> from skcomplex.systems.physics.nonlinear_oscillators import henon_heiles
>>> henon_heiles(px=0.3).elements[0].px
0.3
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
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 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 | |
impulsive_oscillator(x=0.0, v=2.572, *, H=2.0, a=0.4165, gamma=0.0, spring='tangent', omega0=1.0)
Return 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.
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 |
0.0
|
spring
|
str
|
The restoring force, |
'tangent'
|
omega0
|
float
|
The natural frequency of the linear spring. |
1.0
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the displacement |
Raises:
| Type | Description |
|---|---|
ParameterError
|
The spring is unknown, the quarter period is not positive, or the shift is outside |
Examples:
>>> from skcomplex.systems.physics.nonlinear_oscillators import impulsive_oscillator
>>> impulsive_oscillator(a=0.5, gamma=0.5).interactions[1].start
0.25
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
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 916 917 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 950 951 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 | |
nuclear_quadrupole(q1=0.0, q2=1.0, p1=0.5, p2=0.0, *, B=0.5)
Return the quadrupole vibrations of a nuclear surface, 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.
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
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the coordinates |
Examples:
>>> from skcomplex.systems.physics.nonlinear_oscillators import nuclear_quadrupole
>>> nuclear_quadrupole(B=0.3).elements[0].B
0.3
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
772 773 774 775 776 777 778 779 780 781 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 | |
stuart_landau(x=0.1, y=0.0, *, mu=1.0, omega=1.0, beta=0.0)
Return the Stuart-Landau oscillator z' = (μ + i ω) z - (1 + i β) |z|² z, 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 ω - β μ.
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
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the real part |
Examples:
>>> from skcomplex.systems.physics.nonlinear_oscillators import stuart_landau
>>> stuart_landau(mu=0.5).elements[0].mu
0.5
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 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 | |
van_der_pol(x=2.0, v=0.0, *, mu=1.0)
Return the Van der Pol oscillator x'' = μ (1 - x²) x' - x, which settles on a limit cycle for μ > 0.
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
|
Returns:
| Name | Type | Description |
|---|---|---|
system |
System
|
The system, with the displacement |
Examples:
>>> from skcomplex.systems.physics.nonlinear_oscillators import van_der_pol
>>> van_der_pol(mu=3.0).elements[0].mu
3.0
Source code in src/skcomplex/systems/physics/nonlinear_oscillators/_oscillators.py
565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 | |