Comparing Leapfrog Methods with Other Numerical Methods for Differential Equations

This Demonstration shows the exact and the numerical solution of some ODEs using a variety of numerical methods. Four of these methods are well-known simple standard methods. Additional methods are the well-known leapfrog method and the less-known asynchronous leapfrog method. Further, a straightforward derivative of each of these two methods is considered. Use the dropdown menus to vary the differential equation and the method. Use the sliders to vary the initial value or to change the number and size of the integration steps.


  • [Snapshot]
  • [Snapshot]
  • [Snapshot]
  • [Snapshot]


In comparing the performance of numerical methods for differential equations, one has to take into account the computational complexity of the underlying algorithms. A simple measure (and for many practical applications the most relevant one) counts how often the right-hand side of the differential equation has to be evaluated in one integration step. The leapfrog and asynchronous leapfrog methods excel in needing only one such evaluation and thus compare directly only with the explicit Euler method, which they outperform in a spectacular way. Since the leapfrog methods are second-order methods, they are most naturally compared with the second-order Runge–Kutta method, which is also known as Heun's method. Since Heun's method does two right-hand side evaluations, it is fair to compare one Heun step with a composition of two leapfrog steps of half the step size. To allow such a fair comparison without having to change the step size, such combined half-steps are implemented. They are referred to as densified methods.
Snapshots 1 and 2: behavior for a stiff differential equation; here, the Runge–Kutta methods are superior to the leapfrog methods
Snapshots 3 and 4: behavior for non-stiff differential equations; the densified asynchronous leapfrog method seems to be in most cases more accurate than Heun's method
The leapfrog methods were added by the present author to a program by Edda Eich-Soellner (see Related Links). Apart from additions, virtually no changes have been made to the program of this instructive Demonstration.
[1] U. Mutze. "An Asynchronous Leap-Frog Method." (2008) http://www.ma.utexas.edu/mp_arc/c/08/08-197.pdf.
    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.

Mathematica »
The #1 tool for creating Demonstrations
and anything technical.
Wolfram|Alpha »
Explore anything with the first
computational knowledge engine.
MathWorld »
The web's most extensive
mathematics resource.
Course Assistant Apps »
An app for every course—
right in the palm of your hand.
Wolfram Blog »
Read our views on math,
science, and technology.
Computable Document Format »
The format that makes Demonstrations
(and any information) easy to share and
interact with.
STEM Initiative »
Programs & resources for
educators, schools & students.
Computerbasedmath.org »
Join the initiative for modernizing
math education.
Step-by-Step Solutions »
Walk through homework problems one step at a time, with hints to help along the way.
Wolfram Problem Generator »
Unlimited random practice problems and answers with built-in step-by-step solutions. Practice online or make a printable study sheet.
Wolfram Language »
Knowledge-based programming for everyone.
Powered by Wolfram Mathematica © 2017 Wolfram Demonstrations Project & Contributors  |  Terms of Use  |  Privacy Policy  |  RSS Give us your feedback
Note: To run this Demonstration you need Mathematica 7+ or the free Mathematica Player 7EX
Download or upgrade to Mathematica Player 7EX
I already have Mathematica Player or Mathematica 7+