# Homework Help: Lagrangian mechanics: a spring and a bar

1. Sep 6, 2008

### atwood

1. The problem statement, all variables and given/known data
A massless spring (spring constant k) is attached to the ceiling. It is free to move only in the y-direction. A homogenous bar of mass m and
length l is attached from its other end to the lower end of the spring, and the bar is free to move on the xy-plane.

A fancy picture for those who appreciate:

+<--y-->-
|~~~--

|=ceiling, ~~~=spring, --=bar

Find the Lagrangian equations of the system.

2. Relevant equations
$$\frac{d}{dt}\frac{\partial L}{\partial \dot{q}_i}-\frac{\partial L}{\partial q_i}=0$$

3. The attempt at a solution
I suppose there's no gravitational force present, as there's no mention of it, although the spring is attached to the ceiling. But this
problem still stuns me.

First, there's the spring related energy of the system.
$$L=T-V=\frac{1}{2}m\dot{y}^2-\frac{1}{2}ky^2$$

However, in this case the velocity doesn't depend only on y (the location of the moving end of the spring), but it also depends on the
movement of the center of the bar, as it's free to rotate around the end of the spring. Rephrasing the previous:

The center of mass of the bar:
$$y_b=y+\frac{l}{2}cos\theta$$
where theta is the angle away from the vertical
$$\dot{y_b}=\dot{y}-\frac{l}{2}\dot{\theta}sin\theta$$

$$L=T-V=\frac{1}{2}m\dot{y_b}^2-\frac{1}{2}ky^2 =\frac{1}{2}m\left(\dot{y}-\frac{l}{2}\dot{\theta}sin\theta\right)^2-\frac{1}{2}ky^2$$

Secondly, there's the kinetic energy of the bar. The spring is massless so it has no kinetic energy, so the kinetic energy in the previous
equation is the translational energy of the bar. Additionally there's rotational kinetic energy (R) but no potential energy.

$$L=R=\frac{1}{2}J\omega^2$$

Here
$$J=\frac{1}{3}ml^2$$

$$\omega=\dot{\theta}$$

So $$L=(T+R)-V=\frac{1}{2}m\left(\dot{y}-\frac{l}{2}\dot{\theta}sin\theta\right)^2 +\frac{1}{2}J\dot{\theta}^2-\frac{1}{2}ky^2$$

I've been told that there's an error, but I haven't been told where it is. Of course my equations look awful, but knowing that doesn't help.

2. Sep 6, 2008

### Goddar

Your first part looks fine to me; for the second, i wouldn't go for a rotational energy but instead simply get an x-component of kinetic energy where x = l*sin(theta)/2... the rest should follow (you have to focus on the center of mass, where the net force is at work; it would be good to know if you're supposed to include gravity, though...)

3. Sep 8, 2008

### Oberst Villa

I'm pretty sure you are supposed to take gravity into account. Otherwise they would not have said that the spring is attached to the ceiling, but that all the stuff is located on a table with neglectable friction or something like that.

4. Sep 8, 2008

### Goddar

I agree. It also gives the only usable potential energy...