next up previous
Next: MATLAB code for the Up: tutorial6 Previous: Overview

Example: the nonlinear pendulum equation and reformulation as two first-order equations

Consider the second order nonlinear ODE describing the motion of a pendulum:

\begin{displaymath}
\frac{d^2 y}{d t^2} + \sin y = 0 .
\end{displaymath} (2)

Here the variable $y$ corresponds to the angle that the pendulum makes with the vertical, measured in radians. (There is no simple analytic solution to the nonlinear pendulum equation in terms of elementary functions.) To completely specify the problem we need two initial conditions: $y(0)=A$, say, and $y'(0)=B$.

\bgroup\color{red}\framebox{\em HAND CALCULATION}\egroup \bgroup\color{black}$\phantom{0}$\egroupIf the pendulum motions are of small amplitude, then \bgroup\color{black}$y$\egroup, the angle that the pendulum makes with the vertical is small, so that \bgroup\color{black}$\sin y \approx y$\egroup. Then the linearized form of eqn. (2) is:

\begin{displaymath}
\frac{d^2 y}{d t^2} + y = 0 .
\end{displaymath} (3)

If \bgroup\color{black}$y(0)=0.5$\egroup and \bgroup\color{black}$y'(0)=0$\egroup show by substituting back into eqn. (3) that the solution for the linearized equation is
\begin{displaymath}
y=0.5 \cos t
\end{displaymath} (4)

and that this form satisfies the two initial conditions.

\bgroup\color{red}\framebox{\em HAND CALCULATION}\egroup \bgroup\color{black}$\phantom{0}$\egroupBy contrast with the small amplitude pendulum equation (3) there is no elementary analytical solution to eqn. (2). Therefore we have to solve the full nonlinear equation numerically. However, in order to demonstrate how things work and to test that we are doing everything correctly we will first solve the linearized eqn. (3) numerically.

In order to do this we have to re-write the second-order ODE as two first-order ODEs involving \bgroup\color{black}$y_1=y$\egroup and \bgroup\color{black}$y_2=dy/dt= dy_1/dt$\egroup .

The first equation follows from these definitions, i.e.

\begin{displaymath}
\frac{dy_1}{dt} = y_2.
\end{displaymath} (5)

The second equation comes from the ODE we are attempting to re-write. Thus for eqn. (3), for example, we find

\begin{displaymath}\bgroup\color{black}
\frac{d^2 y}{d t^2} + y = 0
\qquad\Righ...
...
\qquad\Rightarrow\hfill\quad \frac{d}{dt} y_2 = - y_1
\egroup\end{displaymath}

so that, together with eqn. (5) we have

\begin{displaymath}\bgroup\color{black}
\frac{dy_1}{dt} = y_2; \quad \frac{dy_2}{dt} = -y_1
\egroup\end{displaymath}

\bgroup\color{red}\framebox{\em HAND CALCULATION}\egroup \bgroup\color{black}$\phantom{0}$\egroupDetermine the two first-order equations corresponding to the full nonlinear pendulum equation (2).


next up previous
Next: MATLAB code for the Up: tutorial6 Previous: Overview
Charlie Macaskill 2004-07-26