High performance numerical platform for Hamiltonian systems
In dedication of scientific endeavours on and applications of explicit symplectic integrators, Zymplectic is an installation free, c/c++ based, high performance scientific computation toolbox featuring an excessive assortment of dynamical systems to be simulated by the single largest collection of symplectic partioned Runge-Kutta and Runge-Kutta-Nyström methods.Zymplectic 0.12.0 - 2024.09.06 | Download links |
---|---|
Windows x86-64 | Zymplectic v.0.12.0 win64 gcc Zymplectic v.0.12.0 win64 clang |
Linux x86-64 | Currently unavailable |
SIs preserve the phase-space volume exactly and counteract dissipation of the initial Hamiltonian as opposed to well-acclaimed non-symplectic Runge-Kutta methods. SIs are widely used for long-time numerical integration in the fields of celestial mechanics, accelerator physics, molecular dynamics, and quantum chemistry, and in particular any form of state space analyses that are particularly vulnerable to dissipative errors.
The symplectic Euler method (first order) and the leapfrog method (second order) in spite of their poor accuracy are among the most acclaimed SIs, and are often used without the users' awareness of the symplectic properties.
The Hamiltonian is one of the qualitative physical properties of autonomous dynamical systems that is preserved throughout the numerical integration (see demo, left mouse to start simulation):
In addition to their common application, SIs may also be applied to systems where T or V depend explicitly on time, that are the so-called non-autonomous systems where the Hamiltonian is generally not conserved. $$H = T(p,t)+V(q,t)$$ While explicit system integrators are primarily intended for separable Hamiltonian systems it has been shown that they can be applied to non-separable systems which can not be separated into two terms T(p) and V(q) or in other words that T or V depend irreducibly on both q and p, and without loss of generality may or may not depend explicitly on time:
$$H = f(p,q,t)$$ for any sufficiently smooth function f. Finally, SIs while possibly waiving some symplectic properties, can have their use extended to a wide range of differential equations such as ordinary differential equations that may not be governed by a Hamiltonian.//example implementation of Hénon-Heiles system
#include "math.h"
const double lambda = 1.0;
double _q_init[] = {0.3,0.0}; //initial position
double _p_init[] = {0.0,0.4}; //and momentum
double energy_H(Arg) { //Hamiltonian (optional)
return lambda*q2*(q1@2 - q2@2/3.0) + 0.5*(q1@2 + q2@2 + p1@2 + p2@2);
} //Zymplectic supports the power operator @
void dH(Arg) { //Hamilton's equations
dq1 = q1 + lambda*2*q1*q2;
dq2 = q2 + lambda*(q1@2 - q2@2);
dp1 = p1;
dp2 = p2;
}
void main() {
Z.H(energy_H,dH,0);
}