Hamiltonian mechanics is a mathematical way of understanding the way something mechanical will behave. It was invented in 1833 by Irish mathematician William Rowan Hamilton.
The value of the Hamiltonian is the total energy of the thing being described. For a closed system, it is the sum of its kinetic and potential energy. There will be a set of differential equations known as the Hamilton equations which show how the thing changes through time.
Hamiltonians can be used to describe such simple systems as a bouncing ball, a pendulum or an oscillating spring in which energy changes between kinetic and potential energy and back again over time. Hamiltonians can also be used to study the orbits of planets and in the behaviour of atoms using the principles of quantum mechanics.