1 MuPAD Tutorial: Second Order ODEs

Second Order ODEs

Homogeneous differential equations of arbitrary order with constant coefficients can be solved in straightforward matter by converting them into system of first order ODEs.

Example:

Example. Consider ODE of order 3:

Consider a second order vector differential equation
\[ \ddot{\bf x} + {\bf A} \, {\bf x} = {\bf 0} , \]
where A is a positive \( n \times n \) square matrix (which means that all its eigenvalues are positive) and x(t) is a colomn-vector of unknown functions to be determined. The general solution
\[ {\bf x}(t) = {\bf \Psi}(t)\,{\bf d} + {\bf \Phi}(t)\, {\bf v}, \]
is expressed through two fundamental matrices
\[ {\bf \Psi}(t) = \cos \left( \sqrt{\bf A}\, t\right) \qquad\mbox{and} \qquad {\bf \Phi}(t) = \dfrac{\sin \left( \sqrt{\bf A} \,t \right)}{\sqrt{\bf A}}, \]
and d and v are initial displacements and velocities, that is, \( {\bf x}(0) = {\bf d} \) and \( \dot{\bf x}(0) = {\bf v} .\) Since these two fundamental matrices are solutions of the same matrix differential equation, but distinct initial conditions:
\[ \ddot{\bf X} + {\bf A} \, {\bf X} = {\bf 0} , \qquad {\bf \Psi}(0) = {\bf I}, \quad \dot{\bf \Psi}(0) = {\bf 0}, \qquad {\bf \Phi}(0) = {\bf 0}, \quad \dot{\bf \Phi}(0) = {\bf I}, \]
The solution \( {\bf x}(t) = {\bf \Psi}(t)\,{\bf d} + {\bf \Phi}(t)\, {\bf v} \) of the vector second order differential equation \( \ddot{\bf x} (t) + {\bf A} \, {\bf x} = {\bf 0} \) satisfies the initial conditions:
\[ {\bf x}(0) = {\bf d} \qquad\mbox{and} \qquad \dot{\bf x}(0) = {\bf v} . \]
This problem can also be solved by converting the given second order vector differential equation to the system of first order differential equations
\[ \dot{\bf y} = {\bf B}\,{\bf y} , \]
where \( {\bf y}(t) = \langle {\bf x}, \dot{\bf x} \rangle \) is 2n column vector of displace ments and velocities, and B is a corresponding \( 2n \times 2n \) matrix. However, this approach is not optimal and requires more efforts, as it will be shown by examples.

 

Example 2.2.1:

Consider the second order vector differential equation \( \ddot{\bf x} + {\bf A}\,{\bf x} = {\bf 0} ,\) where
\[ \left[ \begin{array}{cc} 16& -9 \\ -12 & 13 \end{array} \right] . \]
First, we find its eigenvalues and eigenvectors:
A:=matrix(2,2,[16,-9,-12,13])
\( \left(\begin{array}{cc} 16 & -9\\ -12 & 13 \end{array}\right) \)
linalg:: eigenvalues(A)
\( \left\{4,25\right\} \)

So the matrix A has two positive eigenvalues 4 and 25 (such matrices are called positive).

To solve the given system of differentiql equations of the second order, we need to construct two fundamental matrices

\[ {\bf \Psi}(t) = \cos \left( \sqrt{\bf A}\, t\right) \qquad\mbox{and} \qquad {\bf \Phi}(t) = \dfrac{\sin \left( \sqrt{\bf A} \,t \right)}{\sqrt{\bf A}}, \]
MuPad is so powerful that you can get these matrices with simple commands:
Psi(t):=cos(sqrt(A)*t)
\( \left(\begin{array}{cc} \frac{3\,\cos\left(2\,t\right)}{7}+\frac{4\,\cos\left(5\,t\right)}{7} & \frac{3\,\cos\left(2\,t\right)}{7}-\frac{3\,\cos\left(5\,t\right)}{7}\\ \frac{4\,\cos\left(2\,t\right)}{7}-\frac{4\,\cos\left(5\,t\right)}{7} & \frac{4\,\cos\left(2\,t\right)}{7}+\frac{3\,\cos\left(5\,t\right)}{7} \end{array}\right) \)
Phi(t):= sin(sqrt(A)*t)/sqrt(A)
\( \left(\begin{array}{cc} \frac{3\,\sin\left(2\,t\right)}{14}+\frac{4\,\sin\left(5\,t\right)}{35} & \frac{3\,\sin\left(2\,t\right)}{14}-\frac{3\,\sin\left(5\,t\right)}{35}\\ \frac{2\,\sin\left(2\,t\right)}{7}-\frac{4\,\sin\left(5\,t\right)}{35} & \frac{2\,\sin\left(2\,t\right)}{7}+\frac{3\,\sin\left(5\,t\right)}{35} \end{array}\right) \)

 

Example 2.2.2:

Consider two mass system connected with three spings governed by Hooke's law. Then such mechanical system can be modeled by the following system of ordinary differential equations:
\[ \begin{cases} m_1 \, \dfrac{{\text d}^2 x_1}{{\text d}\,t^2} + \left( k_1 + k_2 \right) x_1 - k_2 \,x_2 &=0 , \\ m_2 \, \dfrac{{\text d}^2 x_2}{{\text d}\,t^2} + \left( k_2 + k_3 \right) x_2 - k_3 \,x_1 &=0 , \\ \end{cases} \qquad \begin{bmatrix} x_1 (0) \\ x_2 (0) \end{bmatrix} = \begin{bmatrix} d_1 \\ d_2 \end{bmatrix} , \qquad \begin{bmatrix} \dot{x}_1 (0) \\ \dot{x}_2 (0) \end{bmatrix} = \begin{bmatrix} v_1 \\ v_2 \end{bmatrix} , \]
where \( x_1 (t) \) and \( x_2 (t) \) are displacements of masses \( m_1 \) and \( m_1 ,\) respectively. Here \( k_1 , \ k_2 , \ k_3 \) are spring constants, and \( d_1 , \ d_2 \) are initial displacements, \( v_1 , \ v_2 \) are initial velocities.

 


 

Example 2.2.3:

Consider the second order vector differential equation \( \ddot{\bf x} + {\bf A}\,{\bf x} = {\bf 0} ,\) where

\[ {\bf A} = \left[ \begin{array}{cc}
1& 4 & 16 \\ 18& 20 & 4 \\ -12 & -14 & -7 \end{array} \right] . \]