# When does Hamiltonian equals to energy of the system?

In classical mechanics, the Hamiltonian is well defined by the Lagrangian. Whereas, energy is a very ambiguous term. We just say $E=T+U$, and usually it equals to Hamiltonian. Does there exist a way that, by just looking at the Lagrangian mathematically, we immediately know the relationship between the Hamiltonian and the energy of the system?

And if we have a system, the Hamiltonian of which does not equal to energy, what is the physical meaning of that difference?

• In what sense is energy ambiguous? Oct 7 '16 at 4:27
• Possible duplicates: physics.stackexchange.com/q/11905/2451 , physics.stackexchange.com/q/43135/2451 and links therein. Oct 7 '16 at 4:38
• Intuitively I would say that the Hamiltonian is the energy of the system when the system is isolated. Oct 7 '16 at 7:26

There are some technical conditions (on the type of constraints in your system) but operationally $H$ is the total energy when $\sum_i \dot q_i p_i$ is $2\times$ the kinetic energy. Then clearly $$H=\sum_i \dot q_i p_i-L=2T-(T-U)=T+U\, .$$
If this is not the case, $H$ may be conserved but it's just not $E$. This occurs in a wide variety of systems, such as the flyball governor, and systems where some external agent maintains a constant rate of rotation (v.g. beads on rotating wires of various shapes.) The dynamics is still constrained to remain on curves or surfaces of constant $H$, but there is usually no physical interpretation to this conserved quantity.
The simplest cases where $H$ is the energy are natural systems, for which the kinetic energy is quadratic in the velocities $$T=\sum_{ij} m_{ij}\dot q_i\dot q_j$$ and there is no explicit time-dependence on $t$ in the Lagrangian.