Examples - cchandre/HamLorenz GitHub Wiki
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 $\phi(x)=\sinh(x)$.
from hamlorenz import HamLorenz
import numpy as np
N = 100
tf = 1e4
hl = HamLorenz(N)
x0 = hl.generate_initial_conditions(N, 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)