Consider longitudinal oscillations of two masses on springs with fixed ends with general parameters, i.e., we have general masses $m_1$, $m_2$ and spring constants $k_1$, $k_2$ and $k_3$.

For this spring system, the kinetic and potential energy matrices look as follows:
\[ \mathbb{T} = \left( \begin{array}{cc} m_1 & 0 \\ 0 & m_2 \end{array}\right), \qquad \mathbb{U} = \left( \begin{array}{cc} k_1 + k_2 & -k_2 \\ -k_2 & k_2 + k_3 \end{array} \right). \]
The solution of the small oscillations problem consists of finding the eigenvalues and eigenvectors of the matrix $\mathbb{T}^{-1} \mathbb{U}$. We are looking for which $\omega$ the following equation has a nontrivial solution in $\vec{a}$:
\[ (\mathbb{U} - \omega^2 \mathbb{T})\vec{a} = 0 \]
By solving this problem we get:
\[ D = \sqrt{(m_1(k_2+k_3)+m_2(k_1+k_2))^2 - 4m_1m_2(k_1k_2 + k_1k_3 + k_2k_3)} \]
\[ \omega_1^2 = \frac{m_1(k_2+k_3) + m_2(k_1+k_2) - D}{2m_1m_2} \qquad \omega_2^2 = \frac{m_1(k_2+k_3) + m_2(k_1+k_2) + D}{2m_1m_2} \]
\[ \vec{a}_1 = \left( \begin{array}{cc} \frac{m_1(k_2+k_3) - m_2(k_1+k_2) + D}{2m_1k_2} \\ 1 \end{array} \right) \qquad \vec{a}_2 = \left( \begin{array}{cc} \frac{m_1(k_2+k_3) - m_2(k_1+k_2) - D}{2m_1k_2} \\ 1 \end{array} \right) \]
And the general solution of the equations of motion is classically
\[ \vec{x}(t) = A_1 \vec{a}_1 \cos(\omega_1 t + \varphi_1) + A_2 \vec{a}_2 \cos(\omega_2 t + \varphi_2). \]
And here is the actual interactive spring system, where the individual parameters of the system can be set (using somewhat clunky sliders): the amplitudes of individual modes $A_1$ and $A_2$, the phase shift $\varphi$ of the second mode relative to the first (i.e., $\varphi_1 = 0$, $\varphi_2 = \varphi$), the masses of bodies $m_1$ and $m_2$, and the spring constants $k_1$, $k_2$ and $k_3$. The graph on the right shows the trajectory of the system in configuration space (the space of all positions of the given system).
Created with the help of oCanvas (author Johannes Koggdal / library released under MIT license)