In the mathematical field of numerical ordinary differential equations, a geometric integrator is a numerical method that preserves geometric properties of the exact flow of a differential equation.
Pendulum example We can motivate the study of geometric integrators by considering the motion of a pendulum. Assume that we have a pendulum whose bob has mass m = 1 {\displaystyle m=1} and whose rod is massless of length ℓ = 1 {\displaystyle \ell =1} . Take the acceleration due to gravity to be g = 1 {\displaystyle g=1} . Denote by q ( t ) {\displaystyle q(t)} the angular displacement of the rod from the vertical, and by p ( t ) {\displaystyle p(t)} the pendulum's momentum. The Hamiltonian of the system, the sum of its kinetic and potential energies, is
H ( q , p ) = T ( p ) + U ( q ) = 1 2 p 2 − cos q , {\displaystyle H(q,p)=T(p)+U(q)={\frac {1}{2}}p^{2}-\cos q,}
which gives Hamilton's equations
( q ˙ , p ˙ ) = ( ∂ H ∂ p , − ∂ H ∂ q ) = ( p , − sin q ) . {\displaystyle ({\dot {q}},{\dot {p}})=\left({\frac {\partial H}{\partial p}},-{\frac {\partial H}{\partial q}}\right)=(p,-\sin q).\,}
It is natural to take the configuration space Q {\displaystyle Q} of all q {\displaystyle q} to be the unit circle S 1 {\displaystyle \mathbb {S} ^{1}} , so that ( q , p ) {\displaystyle (q,p)} lies on the cylinder S 1 × R {\displaystyle \mathbb {S} ^{1}\times \mathbb {R} } . However, we will take ( q , p ) ∈ R 2 {\displaystyle (q,p)\in \mathbb {R} ^{2}} , simply because ( q , p ) {\displaystyle (q,p)} -space is then easier to plot. Define z ( t ) = ( q ( t ) , p ( t ) ) T {\displaystyle z(t)=(q(t),p(t))^{\mathrm {T} }} and f ( z ) = ( p , − sin q ) T {\displaystyle f(z)=(p,-\sin q)^{\mathrm {T} }} . Let us experiment by using some simple numerical methods to integrate this system. As usual, we select a constant step size, h {\displaystyle h} , and for an arbitrary non-negative integer k {\displaystyle k} we write z k := z ( k h ) {\displaystyle z_{k}:=z(kh)} . We use the following methods.
z k + 1 = z k + h f ( z k ) {\displaystyle z_{k+1}=z_{k}+hf(z_{k})\,} (explicit Euler),
z k + 1 = z k + h f ( z k + 1 ) {\displaystyle z_{k+1}=z_{k}+hf(z_{k+1})\,} (implicit Euler),
z k + 1 = z k + h f ( q k , p k + 1 ) {\displaystyle z_{k+1}=z_{k}+hf(q_{k},p_{k+1})\,} (symplectic Euler),
… excerpt ends here. Continue reading the full article.

