In order to discuss symplectic algorithms we have to
explain what "symplectic" actually means. Let us therefore
delve shortly into the beauty of generalized dynamical equations.
Langrange:
Newton's intent was to describe the motion of heavenly bodies. His equations
of motion in their original formulation are best suited for interacting
point masses - even if those "points" are actually planets
or suns. There are two good reasons to desire a more general
formulation of Newtonian mechanics. Firstly, the symmetry of the
physical system may be such that a set of generalized coordinates
would capture this symmetry better than the usual Cartesian coordinates.
Secondly, there may be constraints such that some of the
coordinates, generalized or not, are actually constant - just think
of a pendulum where
the length $r$ of the string has a trivial equation of motion:
$d^{2}r/dt^{2}=0$.
Facing these two challenges Lagrange came up with two approaches which
are usually dubbed Lagrangean equations of the first and second
kind.
Lagrange I:
Here we deal with constraints, still relying on Cartesian
coordinates. Suitable "constraint forces" are introduced
and added to the "physical" forces present in the system.
In this way the system is forced to obey the constraints, without the
need to change the Newtonian equations.
EXAMPLE:Planar pendulum
Writing Newton's equation as
with the gravitational force $K=-mg \vec{e}_{z}$ and the constraint
force $\vec{\textstyle Z}$ we are confronted with the task of determining $\vec{Z}$.
Lagrange taught us to argue thus: the constraint
$\sigma \equiv |\vec{r}^{2}|-l^{2} = 0$ is to be enforced; a suitable
force can only be perpendicular to the lines of equal $\sigma$ - in
other words, it must be proportional to the gradient of $\sigma$:
Now, this is a rather clumsy way to describe a pendulum. But the idea
of constraint forces was brought to fruition in the 1970s in the SHAKE
algorithm of Ryckaert et al.; see
here.
Lagrange II:
A more profound reformulation of the mechanical equations makes
use of generalized coordinates. Introducing the set
$\vec{q} \equiv \{q_{1} \dots q_{n} \}$
of coordinates and the
corresponding generalized velocities
$\dot{\vec{q}} \equiv \{\dot{q}_{1} \dots \dot{q}_{n} \}$
Lagrange wrote the kinetic energy $T$ and the potential energy
$U$ in terms of these new coordinates and introduced the function
$L \equiv T - U$. He then showed that the dynamics of the system
follows the "Lagrange equations of the second kind",
EXAMPLE:Planar pendulum
The obvious choice for generalized coordinates is $(r,\phi)$, where
$r=l$ is the distance of the pendulum mass from the axis, and $\phi$
is the angle between the string and the (negative) $z$-axis.
Since $r$ is constant we have to address only $\phi$ and $\dot{\phi}$.
The potential energy is $U(\phi)=mgl (1-cos \phi)$, and the kinetic
energy is $T(\dot{\phi})=ml^{2}\dot{\phi}^{2}/2$. Thus
$\partial L / \partial \dot{\phi}=ml^{2} \dot{\phi}$ and
$\partial L / \partial \phi=-mgl sin \, \phi$.
Inserting this in the Lagrange equation
we have
$
\frac{\textstyle d}{\textstyle d t}
m l^{2} \dot{\phi} + m g l sin \, \phi =0
\;\;\;{\rm or}\;\;\;
\ddot{\phi} = - \frac{\textstyle g}{\textstyle l} sin \, \phi
$
Well, we knew that all along, didn't we? But Lagrange gave us the
means to derive the equation of constrained motion in a very general
manner.
EXAMPLE:Harmonic oscillator
Of course, Lagrange II must work also in the simple Cartesian case,
and without constraints. Putting $q=x$ and $\dot{q}=\dot{x}$ we
have $T=m \dot{q}^{2}/2$, $U=k q^{2}/2$. Thus
$\partial L / \partial \dot{q}=m \dot{x}$ and
$\partial L / \partial q= - k x$. Therefore,
$ \ddot{x} = - (k/m) x$. Again, no surprises.
Hamilton:
Again, we define generalized coordinates suited to the mechanical
system at hand. However, the generalized velocities are replaced by
something much more elegant: the "conjugate momenta".
These are defined by $p_{i} \equiv \partial L / \partial \dot{q}_{i}$.
Conversely, we may now express the generalized velocities $\dot{q}_{i}$
in terms of $p_{i}$. With this in mind we define the Hamiltonian
$
J \equiv \left(\begin{array}{cc} 0 & I \\ - I & 0 \end{array} \right)
$
is the "symplectic matrix". ("symplectic"
means "intertwined").
EXAMPLE:Planar pendulum
Up to the definition of $T(\dot{q})$ and $U(q)$ we proceed as before. Again writing
$L=T-U= ml^{2}\dot{q}^{2}/2 - mgl (1-cos \, q)$ we find for the conjugate momentum
$
p \equiv \frac{\textstyle \partial L}{\textstyle \partial \dot{q}} = m l^{2} \dot{q}$
Expressing $\dot{q}$ by $p$ we have $\dot{q}= p/ml^{2}$ and from that
$L=p^{2}/2ml^{2}-mgl(1-cos \,q)$. The Hamiltonian then reads
$
H(q,p) \equiv \dot{q} \, p - L(q,p)
= \frac{\textstyle p^{2}}{\textstyle m l^{2}} -L(q,p)
= \frac{\textstyle p^{2}}{\textstyle 2 m l^{2}} + mgl(1-cos \, q)
$
EXAMPLE:Harmonic oscillator:
As in Lagrange II, we put $q=x$ and $\dot{q}=\dot{x}$, with
$T=m \dot{q}^{2}/2$, $U=k q^{2}/2$. Thus
$p \equiv \partial L / \partial \dot{q}=m \dot{x}$, or
$\dot{x} = p/m$. The Hamiltonian is then
$H=p^{2}/m - L = p^{2}/2m + k q^{2}/2$, and indeed
$
\frac{\textstyle d q}{\textstyle dt} = \nabla_{p} H( q, p)
= \frac{\textstyle p}{\textstyle m}
\;\;\;\;\;\;\;\;\;\;
\frac{\textstyle d p}{\textstyle dt} = -\nabla_{q} H( q, p)
= - k \, q
$