# 1.6 Systems of ODE's and Eigenvalue Stability

## 1.6.1 Nonlinear Systems

For a system of ODE's, we have the same canonical form as for a scalar (see Equation 1.8),

 $u_ t = f(u,t), \label{equ:ODEsystem_ nonlinear}$ (1.84)

except that $$u$$ and $$f$$ are vectors of the same length, $$d$$:

 $u = [u_1, u_2, u_3, \cdots , u_ d]^ T \qquad f = [f_1, f_2, f_3, \cdots , f_ d]^ T$ (1.85)

## Nonlinear Pendulum

One manner in which a system of ODE's occurs is for higher-order ODE's. A classic example of this is a second-order oscillator such as a pendulum. The nonlinear dynamics of a pendulum of length $$L$$ satisfy the following second-order system of equations:

 $\theta _{tt} + \frac{g}{L}\sin \theta = 0. \label{equ:nonpendulum}$ (1.86)

To transform this into a system of first-order equations, we define the angular rate, $$\omega$$,

 $\theta _ t = \omega .$ (1.87)

Then, Equation 1.86 becomes,

 $\omega _ t + \frac{g}{L}\sin \theta = 0.$ (1.88)

For this example,

 $u = \left(\begin{array}{c} \omega \\ \theta \end{array} \right) \qquad f = \left(\begin{array}{c} -\frac{g}{L}\sin \theta \\ \omega \end{array} \right)$ (1.89)

A forward Euler method was used to simulate the motion of a pendulum (with $$L$$ = 1 m, $$g = 9.8$$ m/sec$$^2$$) released from rest at an angle of $$45^\circ$$ at a timestep of $${\Delta t}= 0.02$$ seconds. The results are shown in Figure 1.8. While the oscillatory motion is evident, the amplitude is growing which is not expected physically. This would indicate some kind of numerical stability problem. Note, however, that if a smaller $${\Delta t}$$ were used, the amplification would still be present but not as significant.

Figure 1.8: Forward Euler solution for nonlinear pendulum with $$L$$ = 1 m, $$g = 9.8$$ m/sec$$^2$$, and $${\Delta t}= 0.02$$ seconds.

The same problem was also simulated using the midpoint method. These results are shown in Figure 1.9. For this method and $${\Delta t}$$ choice, the oscillation amplitude is constant and indicates that the midpoint method is a better choice for this problem than the forward Euler method.

Figure 1.9: Midpoint solution for nonlinear pendulum with $$L$$ = 1 m, $$g = 9.8$$ m/sec$$^2$$, and $${\Delta t}= 0.02$$ seconds.