# Homework Help: Hamiltonian Question

1. Nov 11, 2013

### derrickb

1. The problem statement, all variables and given/known data
The simple form H=T+U is true only if your generalized coordinates are "natural"(relation between generalized and underlying Cartesian coordinates is independent of time). If the generalized coordinates are not natural, you must use the definition H=Ʃpq'-L. To illustrate this point, consider the following: Two children are playing catch inside a railroad car that is moving with varying speed V along a straight horizontal track. For generalized coordinates you can use the position(x,y,z) of the ball relative to a point fixed in the car, but in setting up the Hamiltionian you must use coordinates in an inertial frame-a frame fixed to the ground. Find the Hamiltonian for the ball and show that it is not equal to T+U (neither as measured in the car, nor as measured in the ground-based frame).

2. Relevant equations
L=T-U
H=Ʃpq'-L
Px=$\frac{dL}{dx'}$
Py=$\frac{dL}{dy'}$
Pz=$\frac{dL}{dz'}$

' is time derivative in this case

3. The attempt at a solution
T=.5m(x'2+y'2+z'2)
U=mgz; z is the vertical axis
L=.5m(x'2+y'2+z'2)-mgz

Px=mx'
Py=my'
Pz=mz'
Pv=mv

H=Ʃpq'-L
H=Pxx'+Pyy'+Pzz'+Pvx'-.5m(x'2+y'2+z'2)+mgz
H=Px(Px/m)+Py(Py/m)+Pz(Pz/m)+mv(Px/m)-.5m(x'2+y'2+z'2)+mgz

If I continue this way, I end up with
H=(Px2+Py2+Pz2)/(2m)+Pxv+mgz
H=(Px2+Py2+Pz2)/(2m)-Pxv+mgz

Does anyone see where I went wrong, or is my answer correct, just with different sign convention?

2. Nov 12, 2013

### vela

Staff Emeritus
Shouldn't your expression for T depend on V?