Equivalent to Lagrangian mechanics but formulated in a different way.

Motivation: Lagrangian vs Hamiltonian.

TODO understand original historical motivation, www.youtube.com/watch?v=SZXHoWwBcDc says it is from optics.

Intuitively, the Hamiltonian is the total energy of the system in terms of arbitrary parameters, a bit like Lagrangian mechanics.

Bibliography:

The key difference from Lagrangian mechanics is that the Hamiltonian approach groups variables into pairs of coordinates called the phase space coordinates:This leads to having two times more unknown functions than in the Lagrangian. However, it also leads to a system of partial differential equations with only first order derivatives, which is nicer. Notably, it can be more clearly seen in phase space.

- generalized coordinates, generally positions or angles
- their corresponding conjugate momenta, generally velocities, or angular velocities

Analogous to what the Euler-Lagrange equation is to Lagrangian mechanics, Hamilton's equations give the equations of motion from a given input Hamiltonian:
So once you have the Hamiltonian, you can write down this system of partial differential equations which can then be numerically solved.

$∂q_{j}∂H =−p˙ _{j}∂p_{j}∂H =q˙ _{j}$