# Lagrangian Mechanics: Pendulum & Trolley

1. Dec 24, 2009

### ian2012

Hi, Hope someone can help me clear up this question. I know the answer but I am unsure of the reasoning behind it, so here it is:

Question:A simple pendulum of mass m and length l hangs from a trolley of mass M running on smooth horizontal rails. The pendulum swings in a plane parallel to the rails.

(a)Using the position x of the trolley and the angle of inclination θ of the pendulum as generalised coordinates, show that the Lagrangian may be written as

$$L=\frac{1}{2}(M+m)\dot{x}^{2}+ml\dot{x}\dot{\theta}cos\theta+\frac{1}{2}ml^{2}\dot{\theta}^{2}+mglcos\theta$$

Answer:Use $$X=lsin\theta$$ and $$Y=lcos\theta$$ as the Cartesian coordinates of the pendulum relative to the trolley.

$$L=\frac{1}{2}M\dot{x}^{2}+\frac{1}{2}m[(\dot{X}+\dot{x})^{2}+\dot{Y}^{2}]+mgY$$

I don't understand why the first term is $$1/2M\dot{x}^{2}$$
and not $$1/2M(\dot{X}+\dot{x})^{2}$$. And I also don't understand why the last potential energy term is only $$mgY$$ and not $$mg(l-Y)$$?

Would appreciate if someone could help me out on this, or if there is an easier way to go about the answer! Many thanks!

Last edited: Dec 24, 2009
2. Dec 24, 2009

### Staff: Mentor

That first term is just the KE of the trolley.
Measured from a reference point at the top of the pendulum, V = -mgY.

3. Dec 24, 2009

### ian2012

Yes I am aware that it is the KE of the trolley. Why isn't the trolley displaced by the pendulum? Since the pendulum is displaced by the trolley? Shouldn't there be an extra displacement term in the KE of the trolley.

4. Dec 24, 2009

### Staff: Mentor

Any displacement of the trolley will be reflected in a change in its position x. The KE of the trolley depends only on the speed of the trolley, which is given by $\dot{x}$.

5. Dec 24, 2009

### ian2012

The second term, the KE of the pendulum depends on the velocity of the trolley, whereas the first term, the KE of the trolley, has no dependence on the velocity of the pendulum. How is this possible since a movement of the pendulum will also affect the trolley? I don't understand why the logic breaks down here.

6. Dec 24, 2009

### Staff: Mentor

No, the KE of the pendulum depends only on the velocity of the pendulum. Since your coordinates are x and θ, the horizontal position of the pendulum is given by x + Lcosθ and is thus indirectly dependent on the position of the trolley. The speed of the pendulum only indirectly depends on the speed of the trolley, since Lcosθ is with respect to the trolley. Since the position of the trolley is one of the generalized coordinates, the KE of the trolley only depends on $\dot{x}$.

7. Dec 24, 2009

### Pinu7

Two things:

1. Remember, the Lagrangian is for a system of particles, not just one so that
$$L=\sum (T-U)$$
i.e. you have to include BOTH the trolley and the pendulum into the calculation.

2. When dealing with a system of particles, I don't believe using relative coordinates suffices.

8. Dec 24, 2009

### Staff: Mentor

Just to be clear: I'm not saying that the motion of the pendulum is independent of the motion of the trolley. Not at all. All I'm saying is that in terms of your chosen coordinates, the KE of the trolley is fully specified by $1/2M\dot{x}^{2}$.

The coupling of the motion comes in when you specify the KE of the pendulum (which includes $\dot{x}$) and in applying the Euler-Lagrange equations.

9. Dec 26, 2009

### ian2012

I understand your reasoning and it makes sense now, thanks.

For the PE term of the answer, how would one know to use the reference point as the top of the pendulum instead of the position of the mass m?

10. Dec 26, 2009

### Staff: Mentor

Any point in the laboratory frame will do as a reference for specifying gravitational PE, since only changes in PE are physically significant. Here we measure the position of the mass m with respect to the top of the top of the pendulum in order to specify its PE, but we could just as well measure its position from the lowest point of the pendulum.

But you can't take the position of the mass itself as a reference point--for one thing, the mass is accelerating; for another, its the PE of that mass that we are trying to specify.

11. Dec 26, 2009

### ian2012

Yea, sorry I meant the lowest point of the pendulum as the reference point. Yeah sure that makes sense. Then the Lagrangian will be different depending on the reference point taken. One will have to spot from the question to take the reference point from the top of the pendulum.