GLOBAL KNOWLEDGE ARK

Physics · Article

Hamiltonian mechanics and phase space

Follow a cart that visits the same position with different momenta, build its Hamiltonian from a Lagrangian, and read its motion as a curve of full states.

Previous article: Small oscillations and normal modes

Back to Physics

After reading, you can

  • Distinguish a position configuration from a position–momentum state.
  • Construct H = pv − L after checking that canonical momentum determines velocity in the stated model.
  • Use the two signed Hamilton equations with compatible units and supplied initial data.
  • Read a phase trajectory, a turning point and an energy level without confusing them.
  • Explain why canonical momentum and the Hamiltonian need their model-specific interpretations.
01

One cart can visit the same place twice

Supply an exact classical point-cart model on a fixed inertial line, with right positive. Its constant mass is m = 4 kg, and its net force is the constant F = +8 N. Position q is measured from a fixed origin. Velocity v = dq/dt is signed: negative means motion toward decreasing q. The equation m dv/dt = F gives acceleration +2 m/s².

Choose q(0) = 2 m and v(0) = −1 m/s, and consider only 0 ≤ t ≤ 2 s. Then v(t) = −1 m/s + (2 m/s²)t and q(t) = 2 m − (1 m/s)t + (1 m/s²)t². At 0.5 s the cart stops instantaneously at 1.75 m, then reverses. At 1 s it is back at 2 m, now moving at +1 m/s. These are supplied mathematical values, not measurements.

The position 2 m alone cannot distinguish those two instants. For this Cartesian positive-mass model, momentum is p = mv, so they have p = −4 kg m/s and p = +4 kg m/s. Keeping both q and p records the distinction that the position alone loses.

Units, standards, and physical constants and Algebra, functions, graphs, and logarithms provide the published preparation for units, substitution and labeled graphs. Read the cart and table first. Derivatives, Taylor series, and local approximation is useful preparation before the partial-derivative reasoning below; we introduce the needed partial-derivative meaning here. No earlier analytical-mechanics lesson is required to identify the two states.

02

Configuration and phase state answer different questions

A configuration specifies where the cart is: here it is one length q. A phase state includes that coordinate and its canonical momentum p. For the present model p = mv, so the pair (q, p) also determines velocity. A point in the phase plane represents a full instantaneous state, rather than another spatial position.

The phase plane therefore has two mathematical coordinates for this one-dimensional physical motion. Its horizontal coordinate has units m; its vertical coordinate has units kg m/s. They are not perpendicular spatial directions measured in the same unit. A drawn slope or pixel distance is not a physical speed or distance.

For a regular classical model with n independent configuration coordinates, a local canonical description uses n coordinate–momentum pairs, hence 2n phase coordinates. This counts independent state variables, not spatial directions or SI dimensions. Redundant coordinates and degenerate momentum–velocity relations need additional treatment; do not apply this count without its conditions.

03

Replace velocity by canonical momentum

For our supplied force choose potential energy V(q) = −Fq, with zero at q = 0. Its negative position derivative is +F. Kinetic energy is K = mv²/2. Define the Lagrangian L(q, v) = K − V = mv²/2 + Fq. Here L, K and V have units J; q and v are separate arguments of L.

Canonical momentum is defined by p = ∂L/∂v, taking the velocity partial while holding q and any explicit time fixed. A partial derivative changes one argument and holds the others fixed. In this model p = mv. Since m = 4 kg is positive, every finite p gives exactly one velocity v = p/m.

Now define the Hamiltonian by H(q, p) = pv − L(q, v), with v replaced everywhere by p/m. The product pv has units J. Substitution gives H = p²/m − [p²/(2m) + Fq], hence H(q, p) = p²/(2m) − Fq. It is a function of position and momentum; velocity has been eliminated.

This replacement is a Legendre transformation in the velocity argument. Its key condition here is the explicit unique inverse v = p/m. More generally, a sufficiently smooth L with a nonsingular velocity Hessian has a local inverse near the point considered. The Hessian is the matrix of second velocity partials; in our one-coordinate case it is simply ∂²L/∂v² = m. A local inverse does not promise a single global inverse for every possible momentum.

04

Two rates evolve the full state

Hamilton’s equations are dq/dt = ∂H/∂p; dp/dt = −∂H/∂q. Hold q and explicit time fixed in the momentum partial; hold p and explicit time fixed in the position partial. The minus sign belongs to the momentum-rate equation. For our H, the two rates are dq/dt = p/m and dp/dt = +F.

The units explain their different jobs. ∂H/∂p has units J/(kg m/s) = m/s, the position rate. ∂H/∂q has units J/m = N, and its negative is the momentum rate. Thus p is a momentum value, while dp/dt is a force-sized rate; they cannot be substituted for one another.

For a regular Lagrangian model the local equation of motion is dp/dt = ∂L/∂q. At fixed explicit time, differentiate H = pv − L: the p dv term cancels (∂L/∂v)dv because p = ∂L/∂v. The remainder is dH = v dp − (∂L/∂q)dq. Comparing its two coefficients gives the Hamilton equations. This argument uses the valid local Lagrangian equation and the velocity inverse; it is not a rule for an arbitrary chosen function L.

With the given initial momentum, integration gives p(t) = −4 kg m/s + (8 N)t. Dividing by 4 kg gives the stated velocity, and accumulating that velocity from q(0) = 2 m gives the stated position. The two first-order equations require both initial q and initial p; H alone does not supply those data.

05

Read the phase curve and position history

The upper panel plots p vertically against q horizontally. Its solid curve is the selected sequence of states (q(t), p(t)); its two arrows indicate increasing time only. The lower dashed curve plots q against actual time t. Matching shapes identify the same five times in both panels. The phase curve is not the cart’s spatial path and its arrows are not force or momentum vectors.

At 0 and 1 s, the top plot has two different points above q = 2 m: p = −4 and +4 kg m/s. At the diamond, t = 0.5 s, p = 0 and dq/dt = 0, but dp/dt = +8 N. The cart turns there; its phase state keeps changing. A phase fixed point would require both rates to be zero.

The table gives kinetic energy K, potential energy V and their sum H at each selected time. All sums are −14 J. Eliminating time gives q/(1 m) = [p/(1 kg m/s)]²/64 + 7/4 on the drawn momentum segment −4 ≤ p/(1 kg m/s) ≤ 12. The denominators make this an equation between dimensionless numbers.

The graphs use exact quadratic curves for this supplied model and separate declared scales. Their drawing controls are not observed states or midpoint samples. Only the selected 0 to 2 s history is shown. The table is the numerical equivalent of the marked states.

Read a full state beside its position historyThe phase panel has position q from 0 to 5 m horizontally and canonical momentum p from −8 to 16 kg m/s vertically. It starts at (2 m, −4 kg m/s), turns in position at (1.75 m, 0 kg m/s) and finishes at (4 m, 12 kg m/s). At 1 s it has returned to q = 2 m with p = +4 kg m/s. The lower panel plots position against time from 0 to 2 s, with the same five marker shapes. Both panels use exact quadratic curves with separately labeled axes; the table gives all marked states and energies.Position–momentum statesMomentum p (kg m/s)012345−8−40481216Position q (m)Position against timePosition q (m)00.511.52012345Time t (s)

Solid curve: the selected phase trajectory (q(t), p(t))

Dashed curve: the selected position history q(t)

Matching shapes in both panels: circle 0 s; diamond 0.5 s; square 1 s; triangle 1.5 s; cross 2 s.

Phase arrows indicate increasing time only; they are not force or momentum vectors.

Turning diamond: q = 1.75 m, p = 0 at 0.5 s; dq/dt = 0 but dp/dt = +8 N.

Same q = 2 m, different states: p = −4 kg m/s at 0 s and +4 kg m/s at 1 s.

Quadratic drawing controls are not sampled states or time-midpoint observations.

Native drawing scales: phase q 144 px/m and p 55/6 px/(kg m/s); lower t 360 px/s and q 44 px/m. The phase axes have different physical dimensions.

m = 4 kg; F = +8 N; q(0) = 2 m; p(0) = −4 kg m/s; V = −Fq.

Only the selected 0 ≤ t ≤ 2 s segment is drawn. Phase coordinates are state variables, not two spatial directions; pixel lengths and slopes are not a physical distance or velocity scale.

K = p²/(2m); V = −Fq; H = K + V = −14 J at every marked state.

The solid phase curve shows the selected position–momentum states; the dashed position curve shows the same times. Matching shapes identify exact supplied states, including the turning diamond and two distinct states at q = 2 m. The arrows indicate increasing time only. These are calculated curves of the stipulated model, not measured data or a spatial path.
Exact states and energies for the supplied 4 kg cart with constant +8 N force; V = −Fq and τ = t/(1 s).
t (s)q (m)p (kg m/s)K (J)V (J)H (J)
02−42−16−14
0.51.7500−14−14
1242−16−14
1.52.7588−22−14
241218−32−14
06

An energy level does not select an initial state

For the fixed inertial Cartesian form L = mv²/2 − V(q), the Hamiltonian equals K + V. Our H has no explicit time argument: it is autonomous. Along a solution of Hamilton’s equations, dH/dt = (∂H/∂q)(dq/dt) + (∂H/∂p)(dp/dt) = 0, since the two terms cancel. The cart changes its kinetic and potential energies while their sum remains −14 J.

Consider a different free-particle model with the same m = 4 kg but V = 0. Its H = p²/(2m). The energy level H = 2 J admits p = −4 kg m/s and p = +4 kg m/s. At q = 2 m these are two distinct possible initial states, with velocities −1 and +1 m/s. After 1 s their positions are 1 and 3 m respectively. An energy value alone has not chosen the direction or initial position.

For a suitably smooth explicitly time-dependent H(q, p, t), the chain rule and Hamilton’s equations instead give dH/dt = ∂H/∂t along the solution. The partial holds q and p fixed. No explicit time dependence is a sufficient condition for conservation here; explicit time dependence removes that automatic conclusion. The value of the partial along the actual solution still decides whether H changes.

07

Canonical momentum follows the chosen Lagrangian

Keep a free 4 kg particle on the fixed line, but stipulate Lᵦ = mv²/2 + bv with constant b = 3 kg m/s. The added term has units J. Its canonical momentum is p = mv + b, so v = (p − b)/m. The ordinary kinetic momentum remains mv. The same symbol p should not silently stand for both quantities.

Substituting this inverse into p v − Lᵦ gives Hᵦ = (p − b)²/(2m). At v = 2 m/s, kinetic momentum is 8 kg m/s, canonical momentum is 11 kg m/s, Lᵦ is 14 J and Hᵦ is 8 J. The constant b shifts the canonical momentum coordinate; it does not supply another force.

Indeed bv = d(bq)/dt when b is constant. Adding its time integral changes the action only by bq at the final endpoint minus bq at the initial one; bq has units J s. With endpoint positions and times fixed, that addition leaves the stationary-action equation unchanged. Directly, dp/dt = m dv/dt and ∂Lᵦ/∂q = 0 still give the free-particle equation. This explicit boundary-term example makes no electromagnetic claim.

For contrast, stipulate only Lₛ = bv as a degenerate mathematical example. Then p = b for every velocity and ∂²Lₛ/∂v² = 0. The expression pv − Lₛ vanishes when p = b, but it does not provide an ordinary velocity inverse or a Hamiltonian on an open set of independent (q, p) states. This is a failure of the simple replacement procedure, not a physical zero-mass-cart model.

08

Keep the model and coordinate conditions visible

The cart’s momentum unit kg m/s comes from its length coordinate and its stated Lagrangian. In other generalized coordinates, the conjugate momentum’s unit follows p = ∂L/∂q̇. For example, an angle coordinate does not require the same conjugate-momentum unit as a length coordinate. A label p alone specifies neither a spatial direction nor an ordinary kinetic momentum.

Likewise, H is constructed by the velocity replacement, not by automatically adding every term named energy. H = K + V was justified for our stated inertial Cartesian quadratic-kinetic form and coordinate-only potential. Other Lagrangians, coordinate choices or time dependence require their own energy interpretation and domain checks.

Use this sequence: state the model and independent coordinates, define canonical momenta, check a valid velocity inverse, construct H, apply the signed rate equations, and supply the initial state. Inspect units and domains at each step. Poisson brackets is the next mapped topic; neither that notation nor a general coordinate-transformation theory is needed for this lesson’s cart.

Worked examples

The turning state still changes

For the main 4 kg, +8 N cart, find the turning time and state. Does the full phase state stop changing there?

  1. Set p(t) = −4 kg m/s + (8 N)t to zero. This gives t = 0.5 s, within the supplied interval.
  2. Substitute into q(t): 2 m − 0.5 m + 0.25 m = 1.75 m. The turning state is (q, p) = (1.75 m, 0 kg m/s).
  3. Hamilton’s rates there are dq/dt = p/m = 0 and dp/dt = F = +8 N. Zero instantaneous velocity does not cancel the force-sized momentum rate.

The cart turns at 0.5 s and 1.75 m. It is not a phase fixed point: its momentum continues to change at +8 N.

One free-particle energy, two momentum branches

For a free 4 kg particle with V = 0 and q(0) = 2 m, compare the two possible momenta at H = 2 J during 0 ≤ t ≤ 1 s.

  1. Solve p²/(2m) = 2 J. The squared momentum is 2(4 kg)(2 J) = 16 (kg m/s)², so p = −4 or +4 kg m/s.
  2. The two velocities p/m are −1 and +1 m/s. Since ∂H/∂q = 0, each momentum remains constant in this free model.
  3. Use q(t) = q(0) + vt. At 1 s, the positions are 1 m and 3 m. Both histories have energy 2 J, but they begin with different full states.

The energy level has both momentum branches. Initial momentum selects the direction; energy and initial position alone do not.

A velocity term changes the canonical momentum

Use Lᵦ = mv²/2 + bv with m = 4 kg, b = 3 kg m/s and v = 2 m/s. Find p, mv, Lᵦ and Hᵦ.

  1. Differentiate with respect to v: p = mv + b = 8 kg m/s + 3 kg m/s = 11 kg m/s. The kinetic momentum mv is still 8 kg m/s.
  2. K = (4 kg)(2 m/s)²/2 = 8 J and bv = (3 kg m/s)(2 m/s) = 6 J, hence Lᵦ = 14 J.
  3. Form pv − Lᵦ = (11 kg m/s)(2 m/s) − 14 J = 8 J. Equivalently, (p − b)²/(2m) gives the same Hᵦ.

p = 11 kg m/s; mv = 8 kg m/s; Lᵦ = 14 J; Hᵦ = 8 J. Canonical and kinetic momenta differ in this stipulated Lagrangian.

Try it yourself

  1. At t = 1.5 s in the main cart model, find q, p and H. State their units.

    Show the answer and reasoning

    q = 2.75 m; p = 8 kg m/s; H = −14 J.

    The position is 2 − 1.5 + 2.25 = 2.75 m and momentum is −4 + 12 = 8 kg m/s. K = 8 J and V = −22 J, so their sum is −14 J.

  2. A reader calls the main cart’s p = 0 turning state a phase fixed point. Which two rates must be checked, and what are they?

    Show the answer and reasoning

    dq/dt = 0, but dp/dt = +8 N. It is not a phase fixed point.

    Both rates must vanish for a stationary phase state. Only the position rate vanishes instantaneously here; the nonzero momentum rate carries the state onward.

  3. Evaluate ∂H/∂p and ∂H/∂q at the initial main-cart state, then give dq/dt and dp/dt.

    Show the answer and reasoning

    ∂H/∂p = −1 m/s; ∂H/∂q = −8 N; dq/dt = −1 m/s; dp/dt = +8 N.

    p/m = (−4 kg m/s)/(4 kg) = −1 m/s and the position partial of −Fq is −F. Hamilton’s momentum equation takes the negative of that partial.

  4. For a free 4 kg particle with V = 0 and H = 8 J, find the possible signed momenta and velocities. Does the energy select one sign?

    Show the answer and reasoning

    p = −8 or +8 kg m/s; v = −2 or +2 m/s. The energy does not select a sign.

    p² = 2mH = 64 (kg m/s)². Both square roots give the same positive energy; divide each by 4 kg to obtain its signed velocity.

  5. Add the constant 5 J to the main model’s potential, changing V to V + 5 J. What is the Hamiltonian value on the same trajectory, and do the canonical rates change?

    Show the answer and reasoning

    H becomes −9 J on that trajectory. Both canonical rates are unchanged.

    For this standard kinetic form, H changes to H + 5 J. A constant has zero position and momentum partial derivatives, so it changes neither force nor velocity. The energy reference changed, not the motion law.

  6. For the mathematical Lₛ = bv with b = 3 kg m/s, can p = 3 kg m/s determine velocity uniquely? Check v = −2 and +5 m/s.

    Show the answer and reasoning

    No. Both velocities, and every other finite velocity, give the same p = b.

    ∂Lₛ/∂v = b is independent of v. The zero velocity Hessian admits no ordinary local velocity inverse here. Writing pv − Lₛ = 0 at p = b does not cure that failure or establish a physical zero-mass model.

What to carry forward

  • A phase state contains coordinates and canonical momenta; one position or one energy value may admit different states.
  • Construct H = pv − L only after a valid velocity replacement has been established in the stated domain.
  • Hamilton’s equations have distinct units and a minus sign in the momentum-rate equation.
  • Zero velocity at a turning point does not imply a phase fixed point when momentum still changes.
  • Canonical momentum and the Hamiltonian’s physical interpretation follow the chosen Lagrangian and coordinate conditions.

References

Sources for the concepts and teaching approaches in this article.

  1. Notes for Classical Mechanics II course, CMI, Spring 2014Govind S. Krishnaswami · Chennai Mathematical Institute · Spring 2014 course, notes dated 25 October 2016Course notes · PDF§3.1 Hamilton’s equations and §3.2 velocity Legendre transformation§2.1: configuration, phase states and free-particle energy branches§2.4–2.5: boundary terms and canonical momentumcmi.ac.in
  2. Mecánica: Apuntes de clase 2023Gustavo Castellano · FaMAF, Universidad Nacional de Córdoba · 2023Course notes · PDFChapter 7 and §7.1: Formulación hamiltoniana; Función de Hamilton o hamiltonianofamaf.unc.edu.ar