In
numerical analysis
Numerical analysis is the study of algorithms that use numerical approximation (as opposed to symbolic computation, symbolic manipulations) for the problems of mathematical analysis (as distinguished from discrete mathematics). It is the study of ...
, leapfrog integration is a
method
Method (, methodos, from μετά/meta "in pursuit or quest of" + ὁδός/hodos "a method, system; a way or manner" of doing, saying, etc.), literally means a pursuit of knowledge, investigation, mode of prosecuting such inquiry, or system. In re ...
for numerically integrating
differential equations of the form
or equivalently of the form
particularly in the case of a
dynamical system
In mathematics, a dynamical system is a system in which a Function (mathematics), function describes the time dependence of a Point (geometry), point in an ambient space, such as in a parametric curve. Examples include the mathematical models ...
of
classical mechanics
Classical mechanics is a Theoretical physics, physical theory describing the motion of objects such as projectiles, parts of Machine (mechanical), machinery, spacecraft, planets, stars, and galaxies. The development of classical mechanics inv ...
.

The method is known by different names in different disciplines. In particular, it is similar to the velocity Verlet method, which is a variant of
Verlet integration
Verlet integration () is a numerical method used to integrate Newton's equations of motion. It is frequently used to calculate trajectories of particles in molecular dynamics simulations and computer graphics. The algorithm was first used in 17 ...
. Leapfrog integration is equivalent to updating positions
and velocities
at different interleaved time points, staggered in such a way that they "
leapfrog
Leapfrog is a children's game of physical movement of the body in which players vault over each other's stooped backs.
History
Games of this sort have been called by this name since at least the late sixteenth century.second-order
Second-order may refer to:
Mathematics
* Second order approximation, an approximation that includes quadratic terms
* Second-order arithmetic, an axiomatization allowing quantification of sets of numbers
* Second-order differential equation, a d ...
method, in contrast to
Euler integration, which is only first-order, yet requires the same number of function evaluations per step. Unlike Euler integration, it is stable for oscillatory motion, as long as the time-step
is constant, and
.
Using Yoshida coefficients, applying the leapfrog integrator multiple times with the correct timesteps, a much higher order integrator can be generated.
Algorithm
In leapfrog integration, the equations for updating position and velocity are
where
is position at step
,
is the velocity, or first derivative of
, at step
,
is the acceleration, or second derivative of
, at step
, and
is the size of each time step. These equations can be expressed in a form that gives velocity at integer steps as well:
However, in this synchronized form, the time-step
must be constant to maintain stability.
The synchronised form can be re-arranged to the 'kick-drift-kick' form;
which is primarily used where variable time-steps are required. The separation of the acceleration calculation onto the beginning and end of a step means that if time resolution is increased by a factor of two (
), then only one extra (computationally expensive) acceleration calculation is required.
One use of this equation is in Newtonian gravity simulations, since in that case the acceleration depends only on the positions of the gravitating masses (and not on their velocities).
There are two primary strengths to leapfrog integration when applied to mechanics problems. The first is the
time-reversibility of the Leapfrog method. One can integrate forward ''n'' steps, and then reverse the direction of integration and integrate backwards ''n'' steps to arrive at the same starting position. The second strength is its
symplectic nature, which implies that it conserves the (slightly modified; see
symplectic integrator
In mathematics, a symplectic integrator (SI) is a Numerical ordinary differential equations, numerical integration scheme for Hamiltonian systems. Symplectic integrators form the subclass of geometric integrators which, by definition, are canonical ...
) energy of a Hamiltonian dynamical system. This is especially useful when computing orbital dynamics, as many other integration schemes, such as the (order-4)
Runge–Kutta method, do not conserve energy and allow the system to drift substantially over time.
Because of its time-reversibility, and because it is a
symplectic integrator
In mathematics, a symplectic integrator (SI) is a Numerical ordinary differential equations, numerical integration scheme for Hamiltonian systems. Symplectic integrators form the subclass of geometric integrators which, by definition, are canonical ...
, leapfrog integration is also used in
Hamiltonian Monte Carlo
The Hamiltonian Monte Carlo algorithm (originally known as hybrid Monte Carlo) is a Markov chain Monte Carlo method for obtaining a sequence of random samples whose distribution converges to a target probability distribution that is difficult to ...
, a method for drawing random samples from a probability distribution whose overall normalization is unknown.
Yoshida algorithms
The leapfrog integrator can be converted into higher order integrators using techniques due to
Haruo Yoshida. In this approach, the leapfrog is applied over a number of different timesteps. It turns out that when the correct timesteps are used in sequence, the errors cancel and far higher order integrators can be easily produced.
4th order Yoshida integrator
One step under the 4th order Yoshida integrator requires four intermediary steps. The position and velocity are computed at different times. Only three (computationally expensive) acceleration calculations are required.
The equations for the 4th order integrator to update position and velocity are
where
are the starting position and velocity,
are intermediary position and velocity at intermediary step
,
is the acceleration at the position
, and
are the final position and velocity under one 4th order Yoshida step.
Coefficients
and
are derived in
[ (see the equation (4.6))
All intermediary steps form one step which implies that coefficients sum up to one: and . Please note that position and velocity are computed at different times and some intermediary steps are backwards in time. To illustrate this, we give the numerical values of coefficients: , , ,
]
See also
*Numerical methods for ordinary differential equations
Numerical methods for ordinary differential equations are methods used to find Numerical analysis, numerical approximations to the solutions of ordinary differential equations (ODEs). Their use is also known as "numerical integration", although ...
* Symplectic integration
* Euler integration
*Verlet integration
Verlet integration () is a numerical method used to integrate Newton's equations of motion. It is frequently used to calculate trajectories of particles in molecular dynamics simulations and computer graphics. The algorithm was first used in 17 ...
* Runge–Kutta integration
References
External links
Drexel University Physics
{{Numerical integrators
Numerical differential equations