next up previous
Next: Precision and Stability Up: ode Previous: Runge Kutta

Higher Order Systems

Second order differential equations are very common in science and engineering applications. Higher order initial value problems are easily solved using an extension of the first order methods described above. A simple substitution reduces them to a system of first order equations.

For example, in classical mechanics a particle of mass $m$ is subjected to a force $F(x,v,t)$ depending on its position, velocity, and the time. Initial conditions specify the position $x_0$ and velocity $v_0$. Its acceleration is given by

\begin{displaymath}
\frac{d^2x}{dt^2} = F(x,v,t)/m.
\end{displaymath}

We convert this second order differential equation into two first order equations with the substitution $v = dx/dt$:
$\displaystyle \frac{dx}{dt}$ $\textstyle =$ $\displaystyle v$  
$\displaystyle \frac{dv}{dt}$ $\textstyle =$ $\displaystyle F(x,v,t)/m.$ (10)

Any of the above methods, Euler, modified Euler, and Runge Kutta may be used to solve this system of equations. For example, the simple Euler method gives

\begin{eqnarray*}
x(t+h) &=& x(t) + hv(t) \\
v(t+h) &=& v(t) + hF[x(t),v(t),t].
\end{eqnarray*}



The leapfrog method is a second-order method applicable when the force term does not depend on velocity. It is based on a general central difference representation of the derivative:

\begin{displaymath}
\frac{dy}{dt} = \frac{y(t+h/2) - y(t-h/2)}{h} + {\cal O}(h^2).
\end{displaymath}

If use this expression to approximate the derivatives in Eq (10), then we get a new algorithm:
$\displaystyle x(t+h/2)$ $\textstyle =$ $\displaystyle x(t-h/2) + hv(t)$ (11)
$\displaystyle v(t+h/2)$ $\textstyle =$ $\displaystyle v(t-h/2) + hF[x(t),t].$ (12)

The leapfrog method starts by taking a half-step in $x$:

\begin{displaymath}
x(h/2) = x(0) + hv(0)/2.
\end{displaymath}

Next we use Eq (12) with $t = h/2$ to get

\begin{displaymath}
v(h) = v(0) + hF[x(h/2),h/2].
\end{displaymath}

We say that $v$ ``leaps'' over $x(h/2)$. Then we use Eq (11) with $t = h$ to get

\begin{displaymath}
x(3h/2) = x(h/2) + hv(h).
\end{displaymath}

We say that $x$ ``leaps'' over $v(h)$. The process continues until we reach the end of the interval, where it is necessary to conclude with a half step in $x$ to bring it to $t = b$.

With the central difference the local truncation error is ${\cal O}(h^3)$. Since these steps are repeated $N$ times, the global error is ${\cal
O}(h^2)$. The initial and final half steps are simple Euler steps with an error also ${\cal
O}(h^2)$, but there are only two of them, regardless of $N$. So the leapfrog method is second order.


next up previous
Next: Precision and Stability Up: ode Previous: Runge Kutta
Carleton DeTar 2008-12-01