Skip to content

Rössler

The Rössler model, a chaotic flow with one folded band for its standard parameters.

  • Name: rossler
  • Field: mathematics/dynamical_systems
  • Formalism: ordinary differential equations
  • References: Rössler 1976

Factory

@register_model(
    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 model, 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 model, with the states `rossler.x`, `rossler.y`, and `rossler.z`.

    Examples:
        >>> from skcomplex.models.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)])

Components

class RosslerElement(Element):
    """Rössler flow `x' = -y - z`, `y' = x + a y`, `z' = b + z (x - c)`.

    Args:
        label:
            The label of the element.

        visual:
            How the element is drawn, or `None` for `default_visual_`.

        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.

    Examples:
        >>> from skcomplex.models.mathematics.dynamical_systems import RosslerElement
        >>> RosslerElement('rossler', c=4.0).c
        4.0
    """

    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

    def _get_laws(self, s: SimpleNamespace) -> list[BaseLaw]:
        """Return the rates of the three coordinates.

        Args:
            s:
                The namespace of the symbols the laws can use.

        Returns:
            laws:
                The laws of the element.
        """
        return [
            RateLaw(s.x, -s.y - s.z),
            RateLaw(s.y, s.x + s.a * s.y),
            RateLaw(s.z, s.b + s.z * (s.x - s.c)),
        ]

Equations

rossler.x: diff(x_rossler(t), t) == -y_rossler(t) - z_rossler(t)
rossler.y: diff(y_rossler(t), t) == a_rossler*y_rossler(t) + x_rossler(t)
rossler.z: diff(z_rossler(t), t) == -(c_rossler - x_rossler(t))*z_rossler(t) + b_rossler