# Homework Help: Lagrangian of a system of several masses and springs

1. Apr 21, 2010

### fluidistic

1. The problem statement, all variables and given/known data
I challenged myself with a problem I invented, but I'm stuck.
Consider a 1 dimensional problem consisting of 3 masses, each one separated by a spring. So that from the left to the right of my sketch we have $$m_1$$, a spring ($$k_1$$ with natural length $$l_1$$), $$m_2$$, another spring ($$k_2$$, $$l_2$$) and $$m_3$$. Find the equations of motion of the system.

2. Relevant equations
$$L=L_1+L_2+L_3$$ where $$L_i=T_i-V_i$$.
After this, Euler-Lagrange equations.

3. The attempt at a solution
For the first mass I reached $$L_1=\frac{m_1 \dot x ^2}{2}-\frac{k_1 (\Delta x_1 )^2}{2}$$ though this $$\Delta x_1$$ really bothers me.
Now to find $$L_2$$, $$V_2$$ is a real headache. Because this mass is connected to 2 springs, I'm not sure at all how to calculate the potential energy of it. Maybe adding both springs' extensions? I mean $$V_2=\frac{k_1 (\Delta x_1)^2 + k_2 (\Delta x_2)^2}{2}$$?
Its kinetic energy would be $$T_2=\dot x ^2 + 2 \dot x \Delta \dot x_1 + (\Delta x_1)^2$$. Am I in the right direction?

2. Apr 21, 2010

### zachzach

I think you need three different x positions, one for each mass. That way your answer will be three equations of motion, one for each mass. This way you could also write $$\Delta x_1$$ = x_2 - x_1

3. Apr 21, 2010

### vela

Staff Emeritus
Breaking the Lagrangian up by masses isn't a good idea because the potential energies aren't quantities associated with any single mass, but with each spring. In terms of the xi's, what is the distance between the ends of spring 1? Once you have that, it's easy to write down what the potential energy stored by spring 1 is in terms of your variables.

4. Apr 21, 2010

### fluidistic

Good observation. Actually that's what I partly did. Hence my equation for $$T_2$$. I took $$\vec r _2$$ or your $$x_2$$ as $$x+l_1+\Delta x_1$$.

Oh... hmm. Looking at zach's reply, x_2-x_1 is the distance between the ends of spring 1. So the potential energy of these 2 masses (or not?) would be $$\frac{k_1 (l_1 +x_2 - x_1 )^2}{2}$$? I'm not sure whether it's a "+x_2-x_1" or "-x_2+x_1" and also the second's mass is also attached to the other spring...

5. Apr 21, 2010

### vela

Staff Emeritus
The masses don't have potential energy; the springs do.

Your expression for the potential energy of spring 1 is almost correct, but not quite.

6. Apr 22, 2010

### fluidistic

Oh you're right.
Correct me if I'm wrong. I assumed 5 Lagrangians. 3 for the masses and 2 for the springs. The springs only carry a potential energy while the masses only a kinetic energy. Is this right?
If so, I reach the following Lagrangian: $$L=\frac{m_1\dot x_1 ^2}{2}+\frac{k_1}{2}(l_1 - x_2 ^2 + 2 x_1 x_2 - x_1 ^2)+\frac{m_2 \dot x_2 ^2}{2}+\frac{k_2}{2}(l_2-x_3 ^2 + 2 x_2 x_3 - x_2 ^2)+\frac{m_3 \dot x_3 ^2}{2}$$.

As for the motion equations, I get $$m_1 \ddot x_1 + k_1 (x_1-x_2)=0$$.
$$k_1 (x_1-x_2)+k_2 (x_3-x_2)-m_2 \ddot x_2 =0$$.
And $$k_2(x_2-x_3)-m_3 \ddot x_3=0$$. They look too simple in my opinion... What do you think?

7. Apr 22, 2010

### vela

Staff Emeritus
The equations of motion look okay. They're just what you'd get if you applied F=ma to each mass, right?

Your Lagrangian, as you typed it, is obviously wrong. The units don't work out in the spring terms. You can't combine l1 with x12 for instance.

8. Apr 22, 2010

### fluidistic

I guess so. But I applied Euler-Lagrange's equations to my wrong Lagrangian to get them.
Ah right... Err... But is the following true:
.

9. Apr 22, 2010

### fluidistic

I see my error. My Lagrangian was $$L=\frac{m_1 \dot x_1 ^2}{2}+\frac{k_1}{2}[l_1- (x_2 -x_1)]^2 + \frac{m_2 \dot x_2 ^2}{2}+\frac{k_2}{2}[l_2 - (x_3-x_2)]^2+\frac{m_3 \dot x_3 ^2}{2}$$.
It gives me the equations $$m_1 \ddot x_1 +k_1 [(x_2 - x_1)-l_1]=0$$.
$$m_2 \ddot x_2 + k_1 [l_1 +(x_2 - x_1)]-k_2 [l_2 -(x_3-x_2)]=0$$ and $$m_3 \ddot x_3 +k_2 [l_2 - (x_3 - x_2)]=0$$.
Does this looks nicer?

10. Apr 22, 2010

### vela

Staff Emeritus
Looks good.

11. Apr 22, 2010

### fluidistic

Ok thank you. :)