Skip to content

Flows

Flows shared by the mathematics packages: the Lorenz flow.

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 for default_visual_.

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.system import System
>>> from skcomplex.engine.runtime import Simulation
>>> from skcomplex.models.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).check().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/models/mathematics/common/flows/_lorenz.py
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
def __init__(
    self,
    label: str,
    visual: VisualSpec | None = None,
    *,
    x: Annotated[float, StateSpec()] = 1.0,
    y: Annotated[float, StateSpec()] = 1.0,
    z: Annotated[float, StateSpec()] = 1.0,
    sigma: Annotated[float, ParameterSpec()] = 10.0,
    rho: Annotated[float, ParameterSpec()] = 28.0,
    beta: Annotated[float, ParameterSpec()] = 8 / 3,
) -> None:
    super().__init__(label, visual=visual)
    self.x = x
    self.y = y
    self.z = z
    self.sigma = sigma
    self.rho = rho
    self.beta = beta