...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Home  Libraries  People  FAQ  More 
This concept describes how to define a symplectic system written with generalized
coordinate q
and generalized
momentum p
:
q'(t) = f(p)
p'(t) = g(q)
Such a situation is typically found for Hamiltonian systems with a separable Hamiltonian:
H(p,q) = H_{kin}(p) + V(q)
which gives the equations of motion:
q'(t) = dH_{kin} / dp = f(p)
p'(t) = dV / dq = g(q)
The algorithmic implementation of this situation is described by a pair of
callable objects for f and g with
a specific parameter signature. Such a system should be implemented as a
std::pair of functions or a functors. Symplectic systems are used in symplectic
steppers like symplectic_rkn_sb3a_mclachlan
.
System
A type that is a model of SymplecticSystem
Coor
The type of the coordinate q
Momentum
The type of the momentum p
CoorDeriv
The type of the derivative of coordinate q'
MomentumDeriv
The type of the derivative of momentum p'
sys
An object of the type System
q
Object of type Coor
p
Object of type Momentum
dqdt
Object of type CoorDeriv
dpdt
Object of type MomentumDeriv
Name 
Expression 
Type 
Semantics 

Check for pair 


Check if System is a pair 
Calculate dq/dt = f(p) 


Calculates f(p), the result is stored into

Calculate dp/dt = g(q) 


Calculates g(q), the result is stored into
