Converting 2nd order to 1st order So I have 2 second order odes that I need to convert into 4 first order odes. The odes are:
$$m_1x_1^{\prime\prime} = -k_1(x_1-l_1)+k_3(x_2-x_1-l_3)$$
$$m_2x_2^{\prime\prime} = -k_2(x_2-l_2)-k_3(x_2-x_1-l_3)$$
So I saw these posts so I understand I have to use a change a variable (I think that's what they are called) but I just don't understand the step-by-step portion. I kind of need to be walked through the process to really understand WHAT I'm doing.
 A: The idea is to collect variables, of a lower order, and come up with equations for each of them. There are many ways to accomplish this. I'll outline one.
There are two variables, and each one has two derivatives taken. We have to pick our state variables, and one systematic way to do so is to take the variables, and their derivatives as our new variables. So, let's take the following vector as our new variable:
$$
X = \left[
\begin{array}{c}
x_1' \\ x_2' \\ x_1 \\ x_2
\end{array}
\right]
$$
With derivative
$$
X' = \left[
\begin{array}{c}
x_1'' \\ x_2'' \\ x_1' \\ x_2'
\end{array}
\right]
$$
We're looking for a matrix equation of the form $X' = AX+b$, which expands out into
$$
\left[
\begin{array}{c}
x_1'' \\ x_2'' \\ x_1' \\ x_2'
\end{array}
\right] = 
\left[
\begin{array}{cccc}
a_{11} & a_{12} & a_{13} & a_{14} \\
a_{21} & a_{22} & a_{23} & a_{24} \\
a_{31} & a_{32} & a_{33} & a_{34} \\
a_{41} & a_{42} & a_{43} & a_{44} \\
\end{array}
\right]\left[
\begin{array}{c}
x_1' \\ x_2' \\ x_1 \\ x_2
\end{array}
\right]+
\left[
\begin{array}{c}
b_1 \\ b_2 \\ b_3 \\ b_4
\end{array}
\right]
$$
Now we have to find the matrix coefficient that make that work out. The bottom two rows are easy: they should encode the equations $x_1'=x_1'$ and $x_2'=x_2'$
$$
\left[
\begin{array}{c}
x_1'' \\ x_2'' \\ x_1' \\ x_2'
\end{array}
\right] = 
\left[
\begin{array}{cccc}
a_{11} & a_{12} & a_{13} & a_{14} \\
a_{21} & a_{22} & a_{23} & a_{24} \\
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
\end{array}
\right]\left[
\begin{array}{c}
x_1' \\ x_2' \\ x_1 \\ x_2
\end{array}
\right]+
\left[
\begin{array}{c}
b_1 \\ b_2 \\ 0 \\ 0
\end{array}
\right]
$$
The top two rows have to encode our given equations. Shuffling things around a bit in the original equations lets you see that
$$
\left[
\begin{array}{c}
x_1'' \\ x_2'' \\ x_1' \\ x_2'
\end{array}
\right] = 
\left[
\begin{array}{cccc}
0 & 0 & -\frac{k_1+k_3}{m_1} & \frac{k_3}{m_1} \\
0 & 0 & \frac{k_3}{m_2} & -\frac{k_2+k_3}{m_2} \\
1 & 0 & 0 & 0 \\
0 & 1 & 0 & 0 \\
\end{array}
\right]\left[
\begin{array}{c}
x_1' \\ x_2' \\ x_1 \\ x_2
\end{array}
\right]+
\left[
\begin{array}{c}
\frac{k_1l_1-k_3l_3}{m_1} \\ \frac{k_2l_2+k_3l_3}{m_2} \\ 0 \\ 0
\end{array}
\right]
$$
These are four equations in first order form. To see this, just rename 
$$
X = \left[
\begin{array}{c}
x_1' \\ x_2' \\ x_1 \\ x_2
\end{array}
\right] = 
 \left[
\begin{array}{c}
a \\ b \\ c \\ d
\end{array}
\right]
$$
And write your final system of four equations:
$$
a' = -\frac{k_1+k_3}{m_1}c +  \frac{k_3}{m_1}d + \frac{k_1l_1-k_3l_3}{m_1}\\
b' = \frac{k_3}{m_2}c -\frac{k_2+k_3}{m_2}d + \frac{k_2l_2+k_3l_3}{m_2} \\
c' = a\\
d' = b
$$
A: I will slightly modify these to read
\begin{align*}
x_1^{\prime\prime} &= -\frac{k_1}{m_1}(x_1-l_1)+\frac{k_3}{m_1}(x_2-x_1-l_3) \\
x_2^{\prime\prime} &= -\frac{k_2}{m_2}(x_2-l_2)-\frac{k_3}{m_2}(x_2-x_1-l_3).
\end{align*}
If we let $x_3=x_1'$, then $x_3'=x_1''$.
If we let $x_4=x_2'$, then $x_4'=x_2''$.
Read your system as
\begin{align*}
x_1' &= x_3 \\
x_2' &= x_4 \\
x_3' &= -\frac{k_1}{m_1}(x_1-l_1)+\frac{k_3}{m_1}(x_2-x_1-l_3) \\
x_4' &= -\frac{k_2}{m_2}(x_2-l_2)-\frac{k_3}{m_2}(x_2-x_1-l_3). 
\end{align*}
There was not much to substitute here as you had no first derivatives in your two second order equations.
