Thursday, July 16, 2026

Hamiltonian - General Approach

Notes to a video lecture on UNIZOR.COM

General Approach
to Hamiltonian


In the previous introductory lecture we have examined the way to simplify the system of n Euler-Lagrange differential equations of second order into a system of 2n equations of the first order using coordinates q={qi} and momenta p={pi}.

For simple classical systems the Lagrangian Mechanics uses Euler-Lagrange equations
∂L/∂qi = d/dt ∂L/∂q̇i
where Lagrangian L=T−U,
T is the full kinetic energy of a system (independent of coordinates),
U is its potential energy (independent of velocities).

Instead, we constructed mathematically equivalent system of Hamiltonian equations
i = ∂(T+U)/∂pi
−ṗi = ∂(T+U)/∂qi
and introduced a new function called Hamiltonian
H(q,p) = T(p) + U(q)
where q=(q1,...,qn) are coordinates
and p=(p1,...,pn) are momenta.

This transformation increased the number of variables from n to 2n, but reduced the complexity of differential equations to the first order and made them symmetric and esthetically more appealing.

However, this construction relied on special properties of the system:
kinetic energy T depended only on momenta,
potential energy U depended only on coordinates.

In general mechanical systems, the Lagrangian L(q,q̇,t) may depend on coordinates and velocities in a more complicated way, kinetic and potential energies might not be separable and the Lagrangian might not be written as a sum of a function of p and a function of q.
Therefore, the construction H=T+U is not applicable to the general case.

The Hamiltonian approach is attractive for these simple mechanical systems, so it is natural to ask whether it can be generalized.
More specifically, given a Lagrangian L(q,q̇,t), we'll construct a function H(q,p,t) whose partial derivatives generate the differential equations similar to above and equivalent to Euler-Lagrange equations of motion.

To accomplish this, we will reformulate the expression H=T+U to avoid explicitly using energies and, instead, express H in terms of coordinates, momenta and a Lagrangian.

Recall the calculations of the Hamiltonian for simple mechanical system in the previous introductory lecture:
T = Σi½mi·q̇i² = Σi½pi²/mi

Partial derivative of T by pi produces
∂T/∂pi = pi/mi = q̇i
Therefore,
i = ∂T/∂pi
Our expression for H=T+U in that case can be represented as
H = 2T − (T−U) = 2T − L =
=
Σimi·q̇i² − L =
=
Σi(mi·q̇i)·q̇i − L =
=
Σipi·q̇i − L

The above expression
H(q,p,t) = Σipi·q̇i − L(q,q̇,t)
formally seems to correspond to our task of constructing a function H(q,p,t) from coordinates, momenta and a given Lagrangian L(q,q̇,t).
It does not explicitly rely on kinetic or potential energy. Since it is written only in terms of the Lagrangian, generalized coordinates, generalized velocities, and generalized momenta, it is a natural candidate for the Hamiltonian in the general case.

It's very important to understand the change of a viewpoint on relationship between arguments, which is a key idea of the Hamiltonian Mechanics.
While in the Lagrangian formulation the independent variables are q, and t, in the Hamiltonian approach the independent variables are q, p and t with generalized velocities become dependent on them:
i = q̇i(q,p,t)

Let's check if this expression corresponds to differential equations involving the Hamiltonian.
∂H(q,p,t)/∂pk =
[take into consideration that now qi and pi are independent variables, while generalized velocities i are functions of these variables: i=q̇i(q,p,t)]
= ∂/∂pk
[Σipi·q̇i − L] =
[use chain rule]
= q̇k +
Σipi·(∂q̇i/∂pk) −
Σi(∂L/∂q̇i)·(∂q̇i/∂pk) =
= q̇k+
Σi[pi−∂L/∂q̇i]·(∂q̇i/∂pk) =
[recall that pi=∂L/∂q̇i by definition]
= q̇k

as required.

∂H(q,p,t)/∂qk =
=
Σipi·(∂q̇i/∂qk) − ∂L/∂qk
Σi(∂L/∂q̇i)·(∂q̇i/∂qk) =
=
Σi[pi−∂L/∂q̇i]·(∂q̇i/∂qk) −
− ∂L/∂qk =
[recall that pi=∂L/∂q̇i by definition]
= − ∂L/∂qk =
[using Euler-Lagrange equation]
= − d/dt ∂L/∂q̇k =
[using the definition of generalized momentum]
= − d/dt pk = −ṗk

as required.

So, from the definitions of momenta as
pi = ∂L/∂q̇i
the Hamiltonian as
H(q,p,t) = Σipi·q̇i − L(q,q̇,t)
and Euler-Lagrange equation for L
∂L/∂qi = d/dt ∂L/∂q̇i
follows that both differential equations for H are satisfied:
∂H/∂pi = q̇i
∂H/∂qi = −ṗ

In reverse, assuming Hamiltonian equations are satisfied, we can derive Euler-Lagrang equations.
∂H(q,p,t)/∂qk =
= ∂/∂qk
[Σipi·q̇i − L] =
=
Σipi·(∂q̇i/∂qk) − ∂L/∂qk
Σi(∂L/∂q̇i)·(∂q̇i/∂qk) =
=
Σi[pi−∂L/∂q̇i]·(∂q̇i/∂qk) −
− ∂L/∂qk =
[recall that pi=∂L/∂q̇i by definition]
= − ∂L/∂qk

Since we assumed that Hamiltonian differential equations are true,
∂H(q,p,t)/∂qk = −ṗk
Therefore,
− ∂L/∂qk = −ṗk

From the definition
k = dpk/dt = d/dt ∂L/∂q̇k
follows:
∂L/∂qk = d/dt ∂L/∂q̇k
which is the Euler-Lagrange equation.
That completes the proof that a system of n second order Euler-Lagrange differential equations is equivalent to 2n first order Hamiltonian equations.

The construction of the Hamiltonian
H = Σipi·q̇i − L
from the Lagrangian L is called the Legendre transformation.

No comments: