# Setting up equations of motion for various osillation problems

1. Dec 14, 2013

### Emspak

This isn't really a specific homework question, but since it comes up so often I thought to post it here. Maybe it will help others as well!

So, you have the case of two masses, connected by springs. If it's the classic case of two carts attached in series to a wall on one side, with mass m1 and m2, and spring constants k1 and 2, with the displacements to the right as x1 and x2we should have the following:

$m_1 \ddot x = -k_1 x_1 - (-k_2) (x_2-x_1)$
$m_2 \ddot x = -k_2 (x_2-x_1)$

because the force on the frst mass is -k1x1 and that mass is getting pulled not only by the k1 spring but in the other direction by the k2 spring. Since the force depends on displacement, we subtract the x1 from the x2 to get the total. In equation 2 since we only care about the total displacement and force on m2 we can leave out the first spring constant.

When we attach the two carts to a wall on the other side with a third spring k3, the equations change. They would become:
$m_1 \ddot x = -k_1 x_1 +k_2) (x_2-x_1)$
$m_2 \ddot x = -k_2 (x_2-x_1) + k_3 x_2$

because the second mass has a spring pulling on it towards the other wall.

But let's leave the carts unattached to walls on either side -- we have two carts that are running along a track, connected by a spring. What then? since they are only attached by one spring my thought was that the EoM's would look like this:

$m_1 \ddot x = -k_1 x_1$
$m_2 \ddot x = -k_1 x_2$

But that didn't seem right; bt it could be a function of whether I declare one mass "stationary" or not.

Now let's go to three masses. In that case, if they are attached on one side, the EoM should be

$m_1 \ddot x = -k_1 x_1 +k_2 (x_2-x_1) + k_3(x3-(x_2+x_1))$
$m_2 \ddot x = k_1 x_1 -k_2( x_2-x_1) + k_3( x_3 - (x_2-x_1))$
$m_3 \ddot x =k_3 (x_3 -(x_2-x_1)) +k_2( x_2-x_1) +k_1x_1$

But I am curious if I have this right...

so if anyone can tell me if I messed up a sign someplace, or an addition, that would help, as I want to make sure I am doing this kind of thing correctly.

Best and thanks.

2. Dec 15, 2013

### BruceW

this is correct, but remember to write a subscript on the accelerations, so we know which one is which. (i.e. write $\ddot{x}_1$ and $\ddot{x}_2$).

this is not quite right. the distance between the first wall and the first mass is $x_1$ because you defined the first wall to be at $x=0$. But the second wall is definitely not at $x=0$, so the distance from the second mass to the second wall will not be equal to $x_2$.

you are right to be suspicious about this. This is not the right equation. Again, what is the distance between mass 1 and mass 2? It is the distances that are important, not displacements.

3. Dec 15, 2013

### Emspak

this is not quite right. the distance between the first wall and the first mass is $x_1$ because you defined the first wall to be at $x=0$. But the second wall is definitely not at $x=0$, so the distance from the second mass to the second wall will not be equal to $x_2$.

OK, so that means that if we define the second wall as $x_{wall}$

$m_1 \ddot x = -k_1 x_1 +k_2 (x_2-x_1)$
$m_2 \ddot x = -k_2 (x_2-x_1) + k_3 (x_{wall}-x_2)$