Khinchin’s book on statistical mechanics (ISBN=0486601471) introduced me to Hamiltonians. The simple idea there is that H is merely the total energy of the system where H is taken to be some function of the dynamic coordinates pi and qi for 1≤i≤s. This idea is evidently in stark contrast to the historical origin of Hamiltonians which is by way of Lagrangians, in terms of which Hamiltonians are normally introduced.
I characterize pi and qi as positions and momenta respectively for the following but this formalism can be extended to many other physics problems by taking pi and qi to be other physical quantities so long as the two equations above hold. (See conjugate coordinates.)
Note that if H is a serviceable Hamiltonion then so is bH where b is a constant; H and bH predict the same evolution of the dynamic variables but 2H evolves twice as fast as H.
We try ṗ1 = ∂H/∂q1 and q̇1 = −∂H/∂p1 with our proposed H.
ṗ1 = ∂H/∂q1 = mq1 and
q̇1 = −∂H/∂p1 = −hp1.
These simple differential equations yield:
(p1, q1) = (a sin(√(h/m)t + b), a cos(√(h/m)t + b))
for some constants a and b.
Presumably the reader is not yet impressed of the magic of the Hamiltonian; but wait:
|Two masses, one beneath the other.
hinged at the top and at the middle mass
each mass = 1
each link length = 1
g = 1.
We will need the velocity of the lower weight to compute its kinteic energy. The velocity of the upper weight is d(sin2 θ1,)/dt
H = (K.E.) + (P.E.) = (−2 cos(θ1) − cos(θ2)) + (1/2 (θ12)