# Hamiltonian function for classical hard-sphere elastic collision

I'm trying to find the Hamiltonian function for a system consisting of a single particle in one dimension colliding elastically with a wall at x = 0.

Everything I've read on the topic (e.g. this question Why can't collisions be elastic?) says that the wall can be represented by a step function potential barrier $V = K\theta(x)$ with K any number higher than the maximum momentum of the particle -- often taken to be infinite for simplicity (e.g. V=0 if x < 0, V = $\infty$ if x > 0, so the Hamiltonian would be $H = p^2/2m + K\theta(x)$, where $\theta(x)$ is the step function, $\theta(x) = 0$ for x < 0, $\theta(x) = 1$ if x > 0, and K is a constant that we eventually take to infinity)...but I cannot get that to work.

When I apply the Hamiltonian equations of motion to that Hamiltonian, I end up finding that the collision is only elastic and energy-conserving if K is not only finite, but also dependent on the particle's momentum.

I'm fairly sure that there's just something wrong with my derivation, because using an infinite potential barriers to exclude particles from certain positions is used everywhere in physics (e.g. hard-sphere dynamics in molecular dynamics or billiard dynamics, the Van Der Walls forces, etc)...but I just can't see where I'm going wrong. So, below is my full derivation (I start with two particles of diameter D, and then take the mass of the second particle to be infinity at the end; however, I get the same results if I start with just one particle of diameter D/2).

Note: the problem is specifically getting the Hamiltonian; the equations of motion themselves are trivial to get via e.g. conservation of energy/momentum arguments; x is proportional to |t|, and p to sign(t)).

Variables

D := diameter of particle

K := height of "wall" (nonzero; assumed by most references to be a constant, often infinite, but always greater than the maximum kinetic energy; this derivation only assumes that it is position-independent)

$m_i$ := mass of particle i (for a wall, $m_2 \to \infty$)

$x_1, x_2, p_1, p_2$ := coordinates and momenta of particles

$r = |x_1 - x_2|$ := absolute distance between centers of particles (so $(D - r) >= 0$ iff they are touching)

$H = T + U$

$U(r) = K\theta(D - r)$

$T = p_1^2/2m + p_2^2/2m$

Definitions / abbreviations

$\epsilon(x) := sign(x)$

$\theta(x) := step(x)$

$\partial r/\partial x_1 = \epsilon(x_1 - x_2)$

$\partial r/\partial x_2 = -\epsilon(x_1 - x_2)$

$\partial\theta/\partial x = \delta(x)$

Derivation

(0) Hamilton's equations:

$\partial H/\partial x_1 = -dp_1/dt = \partial U/\partial x_1$

$\partial H/\partial x_2 = -dp_2/dt = \partial U/\partial x_2$

(1) Chain rule (prime means differentiation wrt appropriate x):

$\partial U/\partial x_1 = K\theta'(D - r)(-r') = -K\delta(D - |x_1 - x_2|)\epsilon(x_1 - x_2)$

$\partial U/\partial x_2 = K\theta'(D - r)(-r') = K\delta(D - |x1_ - x_2|)\epsilon(x_1 - x_2)$

(2) note that the derivatives are equal/opposite

$-\partial U/\partial x_1 = dp_1/dt = -dp_2/dt = \partial U/\partial x_2$

(3) find total change in momenta $\Delta P_i$ (and final momenta $p_i(t_2)$)

Let $t_1$ := the time where $x_1 - x_2 = +D$; let $t_0 := t_1 - dt, t_2 := t_1 + dt$

Let $p_1(t_1) = P_1, p_2(t_1) = P_2$

Let $\Delta P_1 := \int_{t_0}^{t_2} (dp_1/dt)~dt = K = -\Delta P_2$

Then $p_1(t_2) = P_1 + K; p_2(t_2) = P_2 - K$

(4) But, energy must be conserved: $T(p_i) = T(p_i + \Delta P_i)$

$(P_1 + K)^2/2m_1 + (P_2 - K)^2/2m_2 = P_1^2/2m_1 + P_2^2/2m_2$

$(P_1^2 + 2KP_1 + K^2)/2m_1 + (P_2^2 - 2KP_2 + K^2)/2m_2 = P_1^2/2m_1 + P_2^2/2m_2$

$(2KP_1 + K^2)/2m_1 + (-2KP_2 + K^2)/2m_2 = 0$

Multiply through by $2m_1m_2$

$(2KP_1 + K^2)m_2 + (-2KP_2 + K^2)m_1 = 0$

$2K(m_2 P_1 + 1/2 K m_2 - m_1 P_2 + 1/2K m_1) = 0$

(5) By definition, |K| > 0. So,

$m_2 P_1 - m_1 P_2 + 1/2K(m_1 + m_2) = 0$

Conclusion:

$K = 2(m_1 P_2 - m_2 P_1)/(m_1 + m_2)$

So to conserve kinetic energy, K (and hence U) must depend on the momentum.

(6)

In the special case where $m_2 \to \infty$:

$1/2K = (m_1 P_2)/(m_1 + m_2) - (m_2 P_1)/(m_1 + m_2)$

$1/2K = (m_1 P_2)/(m_2) - (m_2 P_1)/(m_2)$

$1/2K = 0 - P_1, K = -2P_1$, as expected.

(7) However, since the potential now depends on the momenta, $dx_i/dt$ is no longer simply $p_i/2m_i$; we have

$H = p_1^2/2m_1 + p_2^2/2m_2 + 2(m_1 P_2 - m_2 P_1)\theta(D - r)/(m_1 + m_2)$

$\partial H/\partial p_1 = dx_1/dt = p_1/m_1 - 2m_2\theta(D - r)/(m_1 + m_2)$

$\partial H/\partial p_2 = dx_2/dt = p_2/m_2 + 2m_1\theta(D - r)/(m_1 + m_2)$

(8)

Or in the special case of the wall,

$H = p_1^2/2m_1 + p_2^2/2m_2 -2 P_1\theta(D - r)$

$\partial H/\partial p_1 = dx_1/dt = p_1/m_1 - 2P_1 \theta(D - r)$

$\partial H/\partial p_2 = dx_2/dt = p_2/m_2 + 2P_1 \theta(D - r)$

...which is zero outside of the barrier, but there is ambiguity in the definition of the step function at zero; we can retain the normal equations of motion only if $\theta(0) = 0$.

Any thoughts would be greatly appreciated.

-
Milton, have a look at my related question physics.stackexchange.com/questions/105318 As for you derivation, I bet your calculation of $\Delta P_1$ is wrong, you should conduct the integration more accurately with greater level of details. –  Yrogirg Apr 1 at 13:15
@Yrogirg - thanks for the link, and I think you're right on the source of the error; I mean, by definition the integral over the derivative over an (infinitesimal) interval is the total change, but I was sloppy with the change of variables from x to t. –  Milton Manfried Apr 2 at 14:56