Lyapunov Exponents
Calculating the maximal Lyapunov exponent to prove chaos.
The defining characteristic of chaos is sensitive dependence on initial conditions. Two trajectories that start infinitesimally close to each other will diverge exponentially over time.
The rate of this exponential divergence is quantified by the Lyapunov Exponents. If the maximal Lyapunov exponent (MLE or ) is strictly positive, the system is chaotic.
Integration with nolds
Calculating Lyapunov exponents from a single time series (without simultaneously integrating the Jacobian equations, which is difficult for fractional systems) requires time-delay embedding techniques.
The hidden-attractors-fo library wraps the excellent nolds (Nonlinear measures for dynamical systems) package to provide this functionality via Rosenstein’s algorithm.
Note: You must have installed the library with the [analysis] extra to use this feature.
Calculating the MLE
The lyapunov_rosenstein() function takes a 1D time series (one coordinate of the trajectory) and estimates the maximal exponent.
from hidden_attractors.analysis import lyapunov_rosenstein
# Extract the x1 coordinate
x1 = x[:, 0]
# Calculate the MLE
# dt is the integration time step
# tau is the embedding delay (if None, it's auto-calculated)
# emb_dim is the embedding dimension
mle = lyapunov_rosenstein(x1, dt=0.01, tau=None, emb_dim=3)
print(f"Maximal Lyapunov Exponent: {mle:.4f}")
Interpretation
- : The system is chaotic (strange attractor). The magnitude indicates the “strength” of the chaos or predictability horizon.
- : The system is marginally stable, likely a limit cycle or quasi-periodic motion.
- : The system is stable, converging to a fixed point equilibrium.
Caveats for Fractional Systems
Rosenstein’s algorithm was designed for integer-order chaotic data. While it is widely used heuristically on fractional-order time series, the rigorous mathematical foundation of Lyapunov exponents in fractional calculus is still an active area of research. Always corroborate a positive MLE with other metrics like spectral entropy, Poincaré sections, and visual inspection of the attractor.