# Hamiltonian of two rotating and oscillating masses

1. Apr 2, 2014

### Wavefunction

1. The problem statement, all variables and given/known data

A massless spring of length $b$ and spring constant $k$ connects two particles of masses $m_1$ and $m_2$.
The system rests on a smooth table and may oscillate and rotate.

a) Determine the Lagrange's equations of motion.

b) What are the generalized momenta associated with any cyclic coordinates?

Hint: With the right choice of generalized coordinates, 3 of the 4 should be cyclic. If the force
between the masses is a central force, some of the coordinates we used earlier in the course to
describe central-force motion might be useful.

c) Determine Hamilton's equations of motion.

2. Relevant equations

eq(1) $\frac{∂L}{∂q_j}-\frac{∂}{∂t}\frac{∂L}{∂\dot{q_j}}=0$

eq(2) $H=\sum_ip_i\dot{q_i}-L = T+U$

3. The attempt at a solution

Part A

Step 1) find the Lagrangian

$T = \frac{m_1}{2}[\dot{r_1}^2+r_1^2\dot{θ_1}^2]+\frac{m_2}{2}[\dot{r_2}^2+r_2^2\dot{θ_2}^2]$

$U = \frac{k}{2}[(r_1-b)^2+(r_2-b)^2]$

$L= T-U = \frac{m_1}{2}[\dot{r_1}^2+r_1^2\dot{θ_1}^2]+\frac{m_2}{2}[\dot{r_2}^2+r_2^2\dot{θ_2}^2]-\frac{k}{2}[(r_1-b)^2+(r_2-b)^2]$

Step 2) Use eq(1) to determine Lagrange's eqs of motion:

$\frac{∂L}{∂r_1} = m_1r_1\dot{θ_1}^2-k(r_1-b)$

$\frac{d}{dt}\frac{∂L}{∂\dot{r_1}} = \frac{d}{dt}[m_1\dot{r_1}] =m_1\ddot{r_1}$

eq(3) $m_1r_1\dot{θ_1}^2-k(r_1-b)-m_1\ddot{r_1}= 0$

$\frac{∂L}{∂θ_1} = 0$

$\frac{d}{dt}\frac{∂L}{∂\dot{θ_1}} = \frac{d}{dt}[m_1r_1^2\dot{θ_1}] = m_1[2r_1\dot{r_1}\dot{θ_1}+r_1^2\ddot{θ_1}]$

eq(4) $-m_1[2r_1\dot{r_1}\dot{θ_1}+r_1^2\ddot{θ_1}]=0$

Going through the same steps for $m_2$

eq(5) $m_2r_2\dot{θ_2}^2-k(r_2-b)-m_1\ddot{r_2}= 0$

eq(6) $-m_2[2r_2\dot{r_2}\dot{θ_2}+r_2^2\ddot{θ_2}]=0$

Now I can apply the given constraints: the system is only allowed to rotate on the frictionless table top and oscillate.

eq(a) $θ_1 + π = θ_2$ (This basically means that spring can only extend/compress along the radial direction)

eq(b) $r_1 = a^2r_2$ (Since the system can't translate radially this condition along with eq(a) ensures that the particles oscillating.)

From both of these constraints: $\dot{θ_1}=\dot{θ_2}$, $\ddot{θ_1}=\ddot{θ_2}$, $\dot{r_1}=a^2\dot{r_2}$, and $\ddot{r_1}=a^2\ddot{r_2}$.

Part B

They are constants (e.g $\frac{d}{dt}[m_1r_1^2\dot{θ_1}] = 0$ )

Part C

eq(7) $\dot{q_i} = \frac{∂H}{∂p_i}$

eq(8) $\dot{p_i} = -\frac{∂H}{∂q_i}$

The Hamiltonian is:

$H = \frac{m_1}{2}[\dot{r_1}^2+r_1^2\dot{θ_1}^2]+\frac{m_2}{2}[\dot{r_2}^2+r_2^2\dot{θ_2}^2] + \frac{k}{2}[(r_1-b)^2+(r_2-b)^2]$

For $r_1$:

eq(7) yields: $\dot{r_1} = \frac{p_1}{m_1}$

eq(8) yields: $\dot{p_1} = m_1r_1\dot{θ_1}+k(r_1-b)$

For $r_2$

eq(7) yields: $\dot{r_2} = \frac{p_2}{m_2}$

eq(8) yields: $\dot{p_2} = m_2r_2\dot{θ_2}+k(r_2-b)$

For $θ_1$ (L, in the following parts stands for angular momentum, NOT the Lagrangian)

eq(7) yields: $\dot{θ_1} = \frac{L_1}{m_1r_1^2}$

eq(8) yields: $\dot{L_1} = 0$

For $θ_2$

eq(7) yields: $\dot{θ_2} = \frac{L_2}{m_2r_2^2}$

eq(8) yields: $\dot{L_2} = 0$

Thank you in advance for checking my work(:

2. Apr 3, 2014

### BvU

There is something strange with your U. It should be translation invariant: if I move both masses over the same vector, U should not change. On the other hand, $k$ does not appear, which is not credible.

Your choice of generalized coordinates is also somewhat unpractical. Would you also choose those if e.g. the spring were a stiff rod ?

3. Apr 3, 2014

### BvU

There is also something weird about the problem formulation: the system may oscillate and rotate, but not translate ? So what exactly is the constraint ?

4. Apr 3, 2014

### Wavefunction

Could you go into a little more detail as to how my U is not translation invariant? Also k appears in my equations of motion. Also I would still choose polar coordinates if it were a stiff rod because the two masses could still rotate. Is there another coordinate choices that makes more sense? Polar coordinates make the most sense to me because the two masses are rotating about a central point and oscillating in a radial direction.

5. Apr 3, 2014

### BvU

If I calculate U for e.g. $r_1=10, r_2 = 20, b = 9$ I get 61 k (sorry, I missed that k, so it IS present in the U expression -- disregard that comment). Do it for $r_1=20, r_2 = 30, b = 9$ I get something else, when I think it should give the same result.

The spring energy depends on how much it is stretched or compressed. That is NOT a vector like $r_1-b, r_2 - b$ .

Could you elaborate on what you mean with your choice of polar coordinates ? Where is the origin ?
Perhaps a drawing ?

And what do you mean when you say "the two masses could still rotate" ?

6. Apr 3, 2014

### Wavefunction

As you should get a different $U$ for those different radial positions because your second calculation corresponds to extending the spring by 20 radial units( therefore $U$ should increase).

The origin is at the center of spring. What I mean is that the two masses attached to the spring rotate ( an angular displacement ) and oscillate (along a radial direction). What coordinates do you know that involve those two things?

7. Apr 3, 2014

### Wavefunction

also [itex] r_i-b [\itex] is not a vector.

8. Apr 3, 2014

### TSny

Consider an imaginary circle of radius b centered at the origin of your coordinate system. Suppose the two masses happen to be on the circle at opposite ends of a diameter. What would your expression for U reduce to? Would that be correct?

--------

The hint suggests a judicious choice of coordinates. Note that the configuration of the system can be defined in terms of the position vector of the CM, $\small \vec{R}_{cm}$, and the vector $\vec{r} = \vec{r}_2-\vec{r}_1$ which gives the position of m2 relative to m1.

[EDIT: Although the problem only mentions oscillations and rotations, it seems to me that you are also meant to allow overall translational motion. Otherwise, you wouldn't need 4 coordinates as implied in the problem.]

Last edited: Apr 3, 2014
9. Apr 3, 2014

### BvU

The center of the spring is not a good choice; it is not nailed to the table or anything.

(if m1=m2 something like the center of the spring might be a reasonable choice ... hint hint).

For this problem, you can assume the spring can only exercise a longitudinal force along it's axis.

10. Apr 3, 2014

### Wavefunction

We went over the problem in class so I get what both of you are saying now I need to account for the whole system moving relative to some inertial frame I'll post my recalculation when I get home later today

11. Apr 3, 2014

### Wavefunction

Okay so my take-away(s) from this problem are that unless the particles are constrained I should consider all possible motions with respect to an inertial reference frame. I should also check my Hamilton's equation to make sure they make sense because looking at my old ones compared to the ones I just got I was way off. Thank you again to everyone who helped me!