next up previous contents
Next: 6.3 Snap, Crackle, and Up: 6. Exploring with a Previous: 6.1 A Surprisingly Simple

6.2 Comparison with the Leapfrog

When we look at Eqs. 6.1, 6.2, we see some familiar features. Neglecting the higher-order term for the moment, we recognize the leapfrog: the new position is effectively determined by the mid-point velocity $v_{i+1/2}$, here approximated as the average between the two adjacent values $v_{i}$ and $v_{i+1}$. Similarly, the new velocity is effectively determined by the mid-point acceleration.

In fact, the analogy can be made more precise. Recalling the leapfrog, as written centered on integer times, Eqs. 4.4, 4.5:


$\displaystyle {\bf r}_{i+1}$ $\textstyle =$ $\displaystyle {\bf r}_i + {\bf v}_{i} dt + {\bf a}_{i} (dt)^2/2$ (6.7)
$\displaystyle {\bf v}_{i+1}$ $\textstyle =$ $\displaystyle {\bf v}_i + ({\bf a}_i + {\bf a}_{i+1})dt / 2$ (6.8)

we can transform these back into a pseudo-leap form, without using half-integer times explicitly, by rewriting the first equation as:


$\displaystyle {\bf r}_{i+1}$ $\textstyle =$ $\displaystyle {\bf r}_i + {\textstyle\frac{1}{2}}({\bf v}_{i} + {\bf v}_{i+1}) ...
...2}}({\bf v}_{i} - {\bf v}_{i+1}) dt
+ {\textstyle\frac{1}{2}}{\bf a}_{i} (dt)^2$  
  $\textstyle =$ $\displaystyle {\bf r}_i + {\textstyle\frac{1}{2}}({\bf v}_{i} + {\bf v}_{i+1}) ...
...{4}}(-{\bf a}_i-{\bf a}_{i+1})(dt)^2
+ {\textstyle\frac{1}{2}}{\bf a}_{i}(dt)^2$  
  $\textstyle =$ $\displaystyle {\bf r}_i + {\textstyle\frac{1}{2}}({\bf v}_{i} + {\bf v}_{i+1}) dt
+ {\textstyle\frac{1}{4}}({\bf a}_i-{\bf a}_{i+1})(dt)^2$  
  $\textstyle =$ $\displaystyle {\bf r}_i + {\textstyle\frac{1}{2}}({\bf v}_{i} + {\bf v}_{i+1}) dt - {\textstyle\frac{1}{4}}{\bf j}_i (dt)^3$ (6.9)

In the second line, we have simply rearranged terms. In the third line, we have used 6.8, and in the fourth line we have used the definition of ${\bf j}$, while neglecting higher order terms in $dt$.

The next step is to remember that the leapfrog is a second-order scheme. The errors per step are $\propto(dt^3)$, and therefore it does not matter whether or not we include the last term $-{\bf j}_i (dt)^3/4$ into our leapfrog version: this term is lost in the noise, and is not going to improve the accuracy on second-level order. Therefore, we may equally well leave it out. Doing so transforms Eqs. 6.7, 6.8 into:


$\displaystyle {\bf r}_{i+1}$ $\textstyle =$ $\displaystyle {\bf r}_i + {\textstyle\frac{1}{2}}({\bf v}_i + {\bf v}_{i+1})dt$ (6.10)
$\displaystyle {\bf v}_{i+1}$ $\textstyle =$ $\displaystyle {\bf v}_i + {\textstyle\frac{1}{2}}({\bf a}_i + {\bf a}_{i+1})dt$ (6.11)

Here we see explicitly that our good old leapfrog is equivalent, up to its second-order accuracy, with the leading terms $\propto (dt)$ of the Hermite algorithm, Eqs. 6.1, 6.2. It is a curiosity of the leapfrog that at first sight it resembles a first-order scheme, since the second-order terms are hidden in the `leapy' way of using average quantities. Yet, as we have seen, the leapfrog is fully second-order.

In a very similar way, the Hermite scheme is fourth-order, even though it resembles a second-order scheme. For details we refer to the literature, but it is interesting to see in a heuristic way why this is so.


next up previous contents
Next: 6.3 Snap, Crackle, and Up: 6. Exploring with a Previous: 6.1 A Surprisingly Simple
The Art of Computational Science
2004/01/25