Harmonic oscillator
Lagrangian Mechanics viewpoint
It is a particle moving in a potential
In Lagrangian Mechanics approach we consider the Lagrangian
Euler-Lagrange tell us
and so
Hamiltonian mechanics viewpoint
The Hamiltonian for a simple harmonic oscillator is given by:
where
The corresponding Hamiltonian equations are:
and
These equations describe the time evolution of the momentum and position of the harmonic oscillator. The first equation is essentially Newton's second law (force equals mass times acceleration), and the second equation is the definition of velocity in terms of momentum.
Energy
The total mechanical energy is:
Differentiation with respect to time shows conservation:
Using the equation of motion (
Since
Related: