fast_lyapunov_max#

gala.dynamics.nonlinear.fast_lyapunov_max(w0, hamiltonian, dt, n_steps, d0=1e-05, n_steps_per_pullback=10, noffset_orbits=2, t1=0.0, atol=1e-10, rtol=1e-10, nmax=0, return_orbit=True)[source]#

Compute the maximum Lyapunov exponent using a fast C-implemented method.

This function estimates the maximum Lyapunov exponent by integrating the orbit along with several nearby offset orbits and tracking their separation over time. It uses the DOPRI853 integrator for high accuracy.

Parameters:
w0PhaseSpacePosition or array_like

Initial conditions for the primary orbit.

hamiltonianHamiltonian

The Hamiltonian system to integrate in. Must contain a C-implemented potential and frame.

dtfloat

Integration timestep.

n_stepsint

Number of integration steps to run.

d0float, optional

Initial separation between the primary orbit and offset orbits. Default is 1e-5.

n_steps_per_pullbackint, optional

Number of integration steps between each renormalization of the offset vectors. Default is 10.

noffset_orbitsint, optional

Number of offset orbits to use. Default is 2.

t1float, optional

Initial time. Default is 0.0.

atolfloat, optional

Absolute tolerance for the integrator. Default is 1e-10.

rtolfloat, optional

Relative tolerance for the integrator. Default is 1e-10.

nmaxint, optional

Maximum number of function evaluations. Default is 0 (no limit).

return_orbitbool, optional

Whether to return the integrated orbit along with the Lyapunov exponent. Default is True.

Returns:
LEsQuantity

The Lyapunov exponents calculated from each offset orbit.

orbitOrbit, optional

The integrated primary orbit (returned only if return_orbit=True).

Raises:
TypeError

If the Hamiltonian does not contain C-implemented components.

ValueError

If trying to compute Lyapunov exponents for multiple orbits simultaneously.

Notes

The Lyapunov exponent quantifies the rate of exponential divergence of nearby trajectories in phase space. Positive values indicate chaotic motion, while zero or negative values suggest regular motion.

This implementation is optimized for speed and uses C code with the DOPRI853 adaptive Runge-Kutta integrator.