Skip to content

Fractional damped oscillator

The fractional damped oscillator D^alpha x = v, D^alpha v = -omega^2 x - 2 gamma v.

  • Name: fractional_oscillator
  • Field: mathematics/fractional_dynamics
  • Formalism: fractional differential equations
  • References: Podlubny 1999; Trzaska 2023

Factory

@register_model(
    field='mathematics/fractional_dynamics',
    tags=('fractional', 'memory', 'oscillator'),
    references=('Podlubny 1999', 'Trzaska 2023'),
    defaults={'until': 30.0, 'dt': 0.1},
)
def fractional_oscillator(
    x: float = 1.0,
    v: float = 0.0,
    *,
    order: float = 0.8,
    omega: float = 1.0,
    gamma: float = 0.0,
) -> System:
    """Return the fractional damped oscillator `D^alpha x = v`, `D^alpha v = -omega^2 x - 2 gamma v`.

    With `gamma = 0` the system is the fractional oscillation equation of order `2 alpha`, whose memory damps the
    oscillations for `1/2 < alpha < 1` without any friction. Order 1 gives the harmonic oscillator.

    Args:
        x:
            The initial displacement.

        v:
            The initial value of the first state's derivative of order `alpha`.

        order:
            The order `alpha` of the Caputo derivatives, in `(0, 1]`.

        omega:
            The angular frequency.

        gamma:
            The damping rate.

    Returns:
        system:
            The model, with the states `oscillator.x` and `oscillator.v`.

    Examples:
        >>> from skcomplex.models.mathematics.fractional_dynamics import fractional_oscillator
        >>> fractional_oscillator(order=0.9).elements[0].omega
        1.0
    """
    return System(elements=[oscillator_type(float(order))('oscillator', x=x, v=v, omega=omega, gamma=gamma)])

Components

    class FractionalElement(OscillatorElement):
        def __init__(
            self,
            label: str,
            visual: VisualSpec | None = None,
            *,
            x: Annotated[float, StateSpec(order=order)] = 1.0,
            v: Annotated[float, StateSpec(order=order)] = 0.0,
            omega: float = 1.0,
            gamma: float = 0.0,
        ) -> None:
            super().__init__(label, visual=visual, x=x, v=v, omega=omega, gamma=gamma)

Equations

oscillator.x: caputo(x_oscillator(t), t, 4/5) == v_oscillator(t)
oscillator.v: caputo(v_oscillator(t), t, 4/5) == -omega_oscillator^2*x_oscillator(t) - 2*gamma_oscillator*v_oscillator(t)