In general, a system with output $y$ and input $u$ may be represented by the following differential equation, where $m\le n$ for physically realizable systems.
$$ f(y,~\frac{dy}{dt},~\cdots,~\frac{d^ny}{dt^n},~u,~\frac{du}{dt},~\cdots,~\frac{d^mu}{dt^n})=0 $$
In a linear system, $f$, is constituted by a linear combination of its parameters with coefficients $a_0\cdots a_n$ and $b_0 \cdots b_m$.
For a system of point masses $m_1\cdots m_n$ interconnected by springs and dampers we may express an input-output model. This model has an with input of the force vector $\bold F$ and output of position vector
$$ \bold M\ddot{\bold x}+\bold C\dot{\bold x}+\bold K\bold x=\bold F $$
The position vector $\bold x$ includes the position of every mass according to $\bold x=[x_1\>...\>x_n]^T$
The mass matrix $\bold M$ includes masses $m_1\cdots m_n$ simply arranged along the diagonal.
The diagonal of the damping matrix $\bold C$ includes all of the damping coefficients $c_{ij}$ which connect masses $m_i$ and $m_j$. The $i^{th}$ diagonal term in $\bold C$ constitutes the sum of all damping coefficients for damper connected to mass $i$. The off diagonal term $\bold C_{ij}$ is simply the negative of the coefficient between masses $i,j$, that is, $-c_{ij}$.
The stiffness matrix $\bold K$ is structured just as the damping matrix $\bold C$.
$$ \begin{bmatrix} m_1&.&0\\ .&.&.\\ 0&.&m_n \end{bmatrix} \ddot{\bold x}+ \begin{bmatrix} \Sigma c_{1k}&.&-c_{1n}\\ .&.&.\\ -c_{1n}&.&\Sigma c_{nk} \end{bmatrix} \dot{\bold x}+ \begin{bmatrix} \Sigma k_{1k}&.&-k_{1n}\\ .&.&.\\ -k_{1n}&.&\Sigma k_{nk} \end{bmatrix} \bold x= \begin{bmatrix} f_1\\ .\\ f_n \end{bmatrix} $$
As it turns out, state-space models are much more powerful than input-output models. In short, a state-space model is constituted by series of state variables grouped into a state-vector which completely describes the system, and a differential equation involving the state vector which can be solved to find the state trajectory, the system’s state over time.
A linear state-space model may be expressed as follows. Therein, $\bold q(t)$ is the state vector, $\bold A$ is the $n\times n$ state matrix, $\bold u(t)$ is the input vector, and $\bold B$ is the $n\times m$ input matrix. Further, $\bold y(t)$ is the output vector, $\bold C$ is the $p\times n$ output matrix, $\bold D$ is the $p\times m$ direct output (or feedforward) matrix.
$$ \bold{\dot q=Aq+Bu} $$
$$ \bold{y=Cq+Du} $$
An input-output model may be converted to a state-space model appropriately by selecting the state variables.
$$ f(y,~\frac{dy}{dt},~\cdots,~\frac{d^ny}{dt^n},~u,~\frac{du}{dt},~\cdots,~\frac{d^mu}{dt^n})=0 $$