-
Notifications
You must be signed in to change notification settings - Fork 0
Examples
The file example1.py computes the solution of a cubic Hamiltonian Lorenz model with N=100 nodes and plots the time series.
The file example2.py computes and plots the Poincaré section of a cubic Hamiltonian Lorenz model with N=6 nodes.
The file example3.py computes the Lyapunov exponents of a cubic Hamiltonian Lorenz model with N=100 nodes.
The file example4.py computes the solution of a custom Hamiltonian Lorenz model with N=100 nodes, defined by
The file example5.py simulates and analyzes a Hamiltonian Lorenz model with Casimir
The file example6.py simulates and compares the dynamics of two Hamiltonian Lorenz models—one based on a cubic Casimir and the other on a regularized hyperbolic sine Casimir—by integrating their equations, analyzing time series, PDFs, and optionally computing Lyapunov exponents.
from hamlorenz import HamLorenz
import numpy as np
N = 100
tf = 1e4
hl = HamLorenz(N)
x0 = hl.generate_initial_conditions(energy=25, casimirs=[24.8, 22.7])
sol = hl.integrate(tf, x0, t_eval=np.arange(tf), method='BM4', step=1e-1)
hl.plot_timeseries(sol)HamLorenz is developed under BSD 2-Clause License, Copyright(c) 2025 cristel.chandre@cnrs.fr