Coupled Spring System (3 mass 3 springs) Hello I am having trouble trying to find the correct model for this coupled spring system. The scenario is the following we have: Ceiling - Spring - Mass(1) - Spring(2) - Mass(2) - Spring (3) - Mass(3) End. 
I came up with the following system of differential equations in the 2nd order to model this problem.
$x_1^{''}=[-k_1x_1-k_2(x_2-x_1)-k_3(x_3-x_2)]/m_1$
$x_2^{''}=[-k_2(x_2-x_1)-k_3(x_3-x_2)]/m_2$
$x_3^{''}=-k_3(x_3-x_2)/m_3$
Is this the correct model? Afterwards I am trying to linearize these equations into 6 differential equations that I can input in matlab and plot the position of each spring.
So I linearized them and obtained the following:
$y_1^{'}=y_2$
$y_2^{'}=(-k_1y_1-k_2(y_3-y_1)-k_3(y_5-y_3)/m_1$
$y_3^{'}=y_4$
$y_4^{'}=(-k_2(y_3-y_1)-k_3(y_5-y_3)/m_2$
$y_5^{'}=y_6$
$y_6^{'}=(-k_3(y_5-y_3))/m_3$
I am not sure if this is correct or not. When I plot them in matlab I dont get a sinusoidal wave. A big plus if you guys can tell me how I could animate this system in matlab so that I can see the change in position in all three of the springs. 
 A: From the free body diagram you must have
$$ \begin{align} m_1 \ddot{x}_1 &= F_1 - F_2 \\ m_2 \ddot{x}_2 &= F_2 - F_3 \\ m_2 \ddot{x}_3 &= F_3 \end {align} $$
with the spring forces defined as
$$ \begin{align} F_1 & = -k_1 x_1 \\ F_2  & = -k_2 (x_2-x_1) \\ F_3 & = -k_3 (x_3-x_1) \end{align} $$
The above is combined as 
$$ \begin{bmatrix} m_1 & 0 & 0 \\ 0& m_2 & 0 \\ 0 & 0 & m_3 \end{bmatrix} \begin{pmatrix} 
\ddot{x}_1 \\ \ddot{x}_2 \\ \ddot{x}_3 \end{pmatrix} = - \begin{bmatrix} k_1 + k_2 & -k_2 & 0 \\ -k_2 & k_2 + k_3 & -k_3 \\ 0 & -k_3 & k_3 \end{bmatrix} \begin{pmatrix} 
{x}_1 \\ {x}_2 \\ {x}_3 \end{pmatrix}$$
Which I think matches your equations (you have to check).
To make an ODE out of this you need a state vector
$$ y = \begin{pmatrix} x_1 \\ x_2 \\ x_3 \\ v_1 \\ v_2 \\ v_3 \end{pmatrix} $$
and its derivative
$$ \dot{y} = A\,y $$
$$ \begin{pmatrix} \dot{x}_1 \\ \dot{x}_2 \\ \dot{x}_3 \\ \dot{v}_1 \\ \dot{v}_2 \\ \dot{v}_3 \end{pmatrix}  = \begin{bmatrix} 
  0 & 0 & 0 & 1 & 0 & 0 \\
  0 & 0 & 0 & 0 & 1 & 0 \\
  0 & 0 & 0 & 0 & 0 & 1 \\
- \frac{k_1+k_2}{m_1} & \frac{k_2}{m_1} & 0 & 0 & 0 & 0 \\
\frac{k_2}{m_2} & - \frac{k_2+k_3}{m_2} & \frac{k_3}{m_2} & 0 & 0 & 0 \\
0 & \frac{k_3}{m_3} & - \frac{k_3}{m_3} & 0 & 0 & 0
\end{bmatrix} \begin{pmatrix} x_1 \\ x_2 \\ x_3 \\ v_1 \\ v_2 \\ v_3 \end{pmatrix}$$
As long as $\ddot{x}_i \propto - x_i $ there would be a harmonic response. If you not seeing this, then there is something wrong on how you are using ode45().
