Zymplectic project

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 that contains the single largest collection of symplectic partioned Runge-Kutta (SPRK) and Runge-Kutta-Nyström (RKN) methods.

Zymplectic 0.2.6 - 2020.05.01 Download links
Documentation Currently unavailable
Windows x86-64 Zymplectic v.0.2.6 win64 gcc

Zymplectic v.0.2.6 win64 clang
Linux x86-64 Currently unavailable
See Downloads section for more information

Introduction

Explicit symplectic integrators (SIs, singular SI) are numerical integration schemes for separable Hamiltonian systems: $$H=T(p)+V(q)$$ where H is the Hamiltonian typically associated with the energy of the system. T and V is typically associated with the kinetic and potential energy respectively. p and q denotes the canonical coordinates which are often associated with momentum and position obeying: $$\dot{p}= -\frac{\partial H}{\partial q}$$ $$\dot{q}= \frac{\partial H}{\partial p}$$ The time evolution of the autonomous and separable Hamiltonian system can be calculated numerically by canonical tranformation of coordinates (q0,p0) → (qs,ps) over the time τ:

$$q_i=q_{i - 1} + \tau c_i\frac{\partial T}{\partial p}(p_{i - 1}) $$ $$p_i=p_{i - 1} - \tau d_i\frac{\partial V}{\partial q}(q_i)$$ where s is the number of stages equal to the number of splitting coefficints c or d. The accuracy and integration order depends on the choice of the splitting coefficients.

SIs preserve the phase-space volume exactly and counteract dissipation of the initial Hamiltonian as opposed to non-symplectic integrators such as the widely used Runge-Kutta methods. SIs are particularly useful for long-time numerical integration in the fields of celestial mechanics, accelerator physics, molecular dynamics, and quantum chemistry, although symplectic integrators may also be applied for more general or abstract differential equations.

The leapfrog integrator (second order) in spite of its poor accuracy is among the most acclaimed SIs, and is often used without the users' awareness of its symplectic properties.

SIs scope of use can be extended to non-separable systems where T and V may depend on both q and p and non-autonomous systems where H depends explicitly on time:

$$H = f(p,q,t)$$ for any function f with a smooth second order derivative in the area of integration.

The Zymplectic project

Zymplectic is vastly different from other ODE-libraries such as GSL or JuliaDiffEq. First of all, the scope of the project is limited to Hamiltonian systems. The bundled binary of Zymplectic does not include a library with numerical methods. Instead Zymplectic is designed to load a file expressing the Hamiltonian system (e.g. TheSolarSystem.cpp), which is interpreted, compiled, loaded and runs the simulation with any desired method or settings optionally set in the graphical user interface. Zymplectic automatically plots relevant data, including simulated objects, the Hamiltonian error and optionally energy surfaces and object tracking. Users need not to know any large number of functions or calling conventions to make a simulation code, greatly reducing the abstraction of coding aiding the user in expressing advanced Hamiltonian systems. The c++ files loaded by Zymplectic are macro-augmented to further enhance the ease of use with no negative impact on flexibility or performance. Zymplectic is fully functional without installation and does not require any IDE or compilers since Zymplectic is bundled with either gcc or clang. Those who pursue "open source methods" may find it convenient that Zymplectic includes all integrator coefficients and that the program exports a cpp file that includes any selected integration method for the user to compile in his/her own software (currently redacted, will be available later).

Zymplectic includes a large library of high accuracy high order SIs discovered by several authors over the last three decades (see references below - incomplete).

Further reading

  • Efficient fourth order symplectic integrators for near-harmonic separable Hamiltonian systems. Nielsen, Kristian Mads Egeris. 2015 get article (1)(2)
  • Survey on Symplectic Integrators. Markiewicz, D. 1999, Preprint Univ. California at Berkeley get article
  • Splitting Methods for Non-autonomous Hamiltonian Equations. Blanes, Sergio and Moan, P. C. 1, 2001, Journal of Computational Physics, Vol. 170, pp. 205-230 get article
  • Composition constants for raising the orders of unconventional schemes for ordinary differential equations. Kahan, William and Li, Ren-Cang. 219, 1997, Mathematics of Computation, Vol. 66, pp. 1089-1099 get article
  • Fourth-order symplectic integration. Forest, Etienne and Ruth, Ronald D. 1, 1990, Physics D, Vol. 43, pp. 105-117 get article
  • Construction of higher order symplectic integrators. Yoshida, Haruo. 5-7, 1990, Physics Letters A, Vol. 150, pp. 262-268 get article
  • New families of symplectic splitting methods for numerical integration in dynamical astronomy. Blanes, Sergio, et al. s.l. : Applied Numerical Mathematics, June 2013, Applied Numerical Mathematics, Vol. 68, pp. 58-72 get article
  • High precision symplectic integrators for the Solar System. Farrés, Ariadna, et al. 2, 2013, Celestial Mechanics and Dynamical Astronomy, Vol. 116, pp. 141-174 get article
  • High order symplectic integrators for perturbed Hamiltonian systems. Lasker, Jacques and Robutel, Philippe. 1, 2001, Celestial Mechanics and Dynamical Astronomy, Vol. 80, pp. 39-62 get article
  • Optimized fifth order symplectic integrators for orbital problems. Tselios, Kostas and Simos, T.E. 1, 2013, Revista Mexicana de Astronomía y Astrofísica, Vol. 49, pp. 11-24 get article
  • Weekly highlights

    The list was last updated 2020.05.01

    Zymplectic project goal

    Zymplectic is a numerical integration platform intended for scientific and educational purposes.

  • To have an efficient numerical engine that can run on any supported OS without any programming environment set up.
  • To collect all integrator coefficients of SPRK and RKN methods scattered over hundreds of challenging articles often behind paywalls.
  • To simplify the task of numerical integration without compromising the flexibility required by complex numerical systems.
  • To showcase applications and properties of Hamiltonian systems.
  • To test and benchmark newly discovered methods and to aid future endeavours in the field of explicit symplectic integration.
  • To make numerical integration accessible to a wider audience, hopefully also reaching those with no experience in c/c++ and only basic understanding in physics and calculus.
  • Zymplectic core features

    Zymplectic is a numerical engine for simulating any separable, non-separable, autonomous and non-autonomous Hamiltonian systems.

  • Prebuilt engine with no installation or compilation required
  • Bundled with GCC or clang to dynamically compile c++ code
  • Numerous example systems to be simulated with a single click
  • Built-in Kahan summation for reducing truncation errors
  • Practical 2D display of the simulation and integration error
  • Biggest online library of SPRK and RKN integrator coefficients
  • Benchmarking to identify the best methods for a given system
  • Export integrators to c++ code to use in your own programs compile systems to C code (temporarily redacted)
  • Ease of use

    Zymplectic requires only declarations of the Hamiltonian gradient, initial conditions and and a simple initialization to run. This is done in macro-augmented c++ code, allowing simple declarations of even very complex Hamiltonian systems. A simple but functional implementation of the Hénon-Heiles is shown below
    const double lambda = 1.0;
    
    double energy_H(Arg) { //Hamiltonian (optional)
    	double x2 = q1*q1;
    	double y2 = q2*q2;	
    	return lambda*q2*(x2-y2/3.0) + 0.5*(x2 + y2 + p1*p1 + p2*p2);
    }
    
    void dH(Arg) { //Gradient
    	dq1 = q1 + lambda*2.0*q1*q2;
    	dq2 = q2 + lambda*(q1*q1 - q2*q2);
    	dp1 = p1;
    	dp2 = p2;
    }
    
    double _q_init[] = {0.3,0.0}; //initial position
    double _p_init[] = {0.0,0.4}; //and momentum
    
    void main() {
    	Z.H(energy_H,dH,0);
    }
    Each object can also be paired with other objects or assigned to seperate kinetic and potential energies. This allows easy construction of more complicated physical systems with very few lines of code.

    User interface

    Zymplectic's interface includes the GUI control panel, an interactive glut-display window and an output console