======================================================================
=                       Hamiltonian mechanics                        =
======================================================================

                             Introduction
======================================================================
Hamiltonian mechanics is a theory developed as a reformulation of
classical mechanics and predicts the same outcomes as non-Hamiltonian
classical mechanics. It uses a different mathematical formalism,
providing a more abstract understanding of the theory. Historically,
it was an important reformulation of classical mechanics, which later
contributed to the formulation of statistical mechanics and quantum
mechanics.

Hamiltonian mechanics was first formulated by William Rowan Hamilton
in 1833, starting from Lagrangian mechanics, a previous reformulation
of classical mechanics introduced by Joseph Louis Lagrange in 1788.


                               Overview
======================================================================
In Hamiltonian mechanics, a classical physical system is described by
a set of canonical coordinates , where each component of the
coordinate  is indexed to the frame of reference of the system.

The time evolution of the system is uniquely defined by Hamilton's
equations:

{{Equation box 1
|indent =:
|equation =
\frac{\mathrm{d}\boldsymbol{p}}{\mathrm{d}t} = -\frac{\partial
\mathcal{H}}{\partial \boldsymbol{q}}\quad,\quad
\frac{\mathrm{d}\boldsymbol{q}}{\mathrm{d}t} = +\frac{\partial
\mathcal{H}}{\partial \boldsymbol{p}}

|cellpadding= 5
|border
|border colour = #0073CF
|background colour=#F5FFFA}}

where  is the Hamiltonian, which often corresponds to the total energy
of the system. For a closed system, it is the sum of the kinetic and
potential energy in the system.

In Newtonian mechanics, the time evolution is obtained by computing
the total force being exerted on each particle of the system, and from
Newton's second law, the time evolutions of both position and velocity
are computed. In contrast, in Hamiltonian mechanics, the time
evolution is obtained by computing the Hamiltonian of the system in
the generalized coordinates and inserting it in the Hamilton's
equations. This approach is equivalent to the one used in Lagrangian
mechanics. In fact, as is shown below, the Hamiltonian is the Legendre
transform of the Lagrangian when holding  and  fixed and defining  as
the dual variable, and thus both approaches give the same equations
for the same generalized momentum. The main motivation to use
Hamiltonian mechanics instead of Lagrangian mechanics comes from the
symplectic structure of Hamiltonian systems.

While Hamiltonian mechanics can be used to describe simple systems
such as a bouncing ball, a pendulum or an oscillating spring in which
energy changes from kinetic to potential and back again over time, its
strength is shown in more complex dynamic systems, such as planetary
orbits in celestial mechanics. The more degrees of freedom the system
has, the more complicated its time evolution is and, in most cases, it
becomes chaotic.


 Basic physical interpretation
===============================
A simple interpretation of Hamiltonian mechanics comes from its
application on a one-dimensional system consisting of one particle of
mass . The Hamiltonian can represent the total energy of the system,
which is the sum of kinetic and potential energy, traditionally
denoted  and , respectively. Here  is the space coordinate and  is the
momentum . Then

:\mathcal{H} = T + V \quad , \quad T = \frac{p^2}{2m} \quad , \quad V
= V(q)

Note that  is a function of  alone, while  is a function of  alone
(i.e.,  and  are scleronomic).

In this example, the time derivative of the momentum  equals the
'Newtonian force', and so the first Hamilton equation means that the
force equals the negative gradient of potential energy. The time
derivative of  is the velocity, and so the second Hamilton equation