Flows
Flows shared by the mathematics packages: the Lorenz and Rössler flows.
LorenzElement(label, visual=None, *, x=1.0, y=1.0, z=1.0, sigma=10.0, rho=28.0, beta=8 / 3)
Bases: Element
Lorenz flow x' = sigma (y - x), y' = x (rho - z) - y, z' = x y - beta z.
A subclass that declares the states with a fractional StateSpec(order=q) gives the fractional Lorenz flow with
Caputo derivatives of order q.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
label
|
str
|
The label of the element. |
required |
visual
|
VisualSpec | None
|
How the element is drawn, or |
None
|
x
|
Annotated[float, StateSpec()]
|
The initial convection intensity. |
1.0
|
y
|
Annotated[float, StateSpec()]
|
The initial temperature difference between rising and falling currents. |
1.0
|
z
|
Annotated[float, StateSpec()]
|
The initial deviation of the vertical temperature profile. |
1.0
|
sigma
|
Annotated[float, ParameterSpec()]
|
The Prandtl number. |
10.0
|
rho
|
Annotated[float, ParameterSpec()]
|
The Rayleigh number relative to its critical value. |
28.0
|
beta
|
Annotated[float, ParameterSpec()]
|
The geometric factor. |
8 / 3
|
Examples:
>>> from skcomplex.core.components.system import System
>>> from skcomplex.core.engine.runtime import Simulation
>>> from skcomplex.systems.mathematics.common.flows import LorenzElement
>>> system = System(elements=[LorenzElement('lorenz', x=0.0, y=0.0, z=2.0, beta=0.5)])
>>> trajectory = Simulation(system, dt=0.5).prepare().run(until=1.0).trajectory_
>>> [round(float(value), 4) for value in trajectory.values('lorenz.z')]
[2.0, 1.5576, 1.2131]
Source code in src/skcomplex/systems/mathematics/common/flows/_lorenz.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | |
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
|
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 | |