fbpx
Wikipedia

Leapfrog integration

In numerical analysis, leapfrog integration is a method for numerically integrating differential equations of the form

or equivalently of the form
particularly in the case of a dynamical system of classical mechanics.

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. Leapfrog integration is equivalent to updating positions and velocities at interleaved time points, staggered in such a way that they "leapfrog" over each other.

Leapfrog integration is a second-order 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 .[1]

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:[2]

 

However, in this synchronized form, the time-step   must be constant to maintain stability.[3]

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 gravity simulations, since in that case the acceleration depends only on the positions of the gravitating masses (and not on their velocities), although higher-order integrators (such as Runge–Kutta methods) are more frequently used.

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 sometimes allows for the conservation of a (slightly modified) energy of a dynamical system (only true for certain simple systems). 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, leapfrog integration is also used in Hamiltonian Monte Carlo, a method for drawing random samples from a probability distribution whose overall normalization is unknown.[4]

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.[5][6]

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 [6] (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

References

  1. ^ C. K. Birdsall and A. B. Langdon, Plasma Physics via Computer Simulations, McGraw-Hill Book Company, 1985, p. 56.
  2. ^ 4.1 Two Ways to Write the Leapfrog
  3. ^ Skeel, R. D., "Variable Step Size Destabilizes the Stömer/Leapfrog/Verlet Method", BIT Numerical Mathematics, Vol. 33, 1993, p. 172–175.
  4. ^ Bishop, Christopher (2006). Pattern Recognition and Machine Learning. New York: Springer-Verlag. pp. 548–554. ISBN 978-0-387-31073-2.
  5. ^ "./Ch07.HTML".
  6. ^ a b Yoshida, Haruo (1990). "Construction of higher order symplectic integrators". Physics Letters A. 150 (5–7): 262–268. doi:10.1016/0375-9601(90)90092-3.

External links

  • [1], Drexel University Physics

leapfrog, integration, numerical, analysis, leapfrog, integration, method, numerically, integrating, differential, equations, formx, displaystyle, ddot, frac, equivalently, form, displaystyle, frac, frac, particularly, case, dynamical, system, classical, mecha. In numerical analysis leapfrog integration is a method for numerically integrating differential equations of the formx d 2 x d t 2 A x displaystyle ddot x frac d 2 x dt 2 A x or equivalently of the form v d v d t A x x d x d t v displaystyle dot v frac dv dt A x dot x frac dx dt v particularly in the case of a dynamical system of classical mechanics 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 Leapfrog integration is equivalent to updating positions x t displaystyle x t and velocities v t x t displaystyle v t dot x t at interleaved time points staggered in such a way that they leapfrog over each other Leapfrog integration is a second order 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 D t displaystyle Delta t is constant and D t 2 w displaystyle Delta t leq 2 omega 1 Using Yoshida coefficients applying the leapfrog integrator multiple times with the correct timesteps a much higher order integrator can be generated Contents 1 Algorithm 2 Yoshida algorithms 2 1 4th order Yoshida integrator 3 See also 4 References 5 External linksAlgorithm EditIn leapfrog integration the equations for updating position and velocity are a i A x i v i 1 2 v i 1 2 a i D t x i 1 x i v i 1 2 D t displaystyle begin aligned a i amp A x i v i 1 2 amp v i 1 2 a i Delta t x i 1 amp x i v i 1 2 Delta t end aligned where x i displaystyle x i is position at step i displaystyle i v i 1 2 displaystyle v i 1 2 is the velocity or first derivative of x displaystyle x at step i 1 2 displaystyle i 1 2 a i A x i displaystyle a i A x i is the acceleration or second derivative of x displaystyle x at step i displaystyle i and D t displaystyle Delta t is the size of each time step These equations can be expressed in a form that gives velocity at integer steps as well 2 x i 1 x i v i D t 1 2 a i D t 2 v i 1 v i 1 2 a i a i 1 D t displaystyle begin aligned x i 1 amp x i v i Delta t tfrac 1 2 a i Delta t 2 v i 1 amp v i tfrac 1 2 a i a i 1 Delta t end aligned However in this synchronized form the time step D t displaystyle Delta t must be constant to maintain stability 3 The synchronised form can be re arranged to the kick drift kick form v i 1 2 v i a i D t 2 x i 1 x i v i 1 2 D t v i 1 v i 1 2 a i 1 D t 2 displaystyle begin aligned v i 1 2 amp v i a i frac Delta t 2 x i 1 amp x i v i 1 2 Delta t v i 1 amp v i 1 2 a i 1 frac Delta t 2 end aligned 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 D t D t 2 displaystyle Delta t rightarrow Delta t 2 then only one extra computationally expensive acceleration calculation is required One use of this equation is in gravity simulations since in that case the acceleration depends only on the positions of the gravitating masses and not on their velocities although higher order integrators such as Runge Kutta methods are more frequently used 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 sometimes allows for the conservation of a slightly modified energy of a dynamical system only true for certain simple systems 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 leapfrog integration is also used in Hamiltonian Monte Carlo a method for drawing random samples from a probability distribution whose overall normalization is unknown 4 Yoshida algorithms EditThe 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 5 6 4th order Yoshida integrator Edit 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 x i 1 x i c 1 v i D t v i 1 v i d 1 a x i 1 D t x i 2 x i 1 c 2 v i 1 D t v i 2 v i 1 d 2 a x i 2 D t x i 3 x i 2 c 3 v i 2 D t v i 3 v i 2 d 3 a x i 3 D t x i 1 x i 4 x i 3 c 4 v i 3 D t v i 1 v i 4 v i 3 displaystyle begin aligned x i 1 amp x i c 1 v i Delta t v i 1 amp v i d 1 a x i 1 Delta t x i 2 amp x i 1 c 2 v i 1 Delta t v i 2 amp v i 1 d 2 a x i 2 Delta t x i 3 amp x i 2 c 3 v i 2 Delta t v i 3 amp v i 2 d 3 a x i 3 Delta t x i 1 amp equiv x i 4 x i 3 c 4 v i 3 Delta t v i 1 amp equiv v i 4 v i 3 end aligned where x i v i displaystyle x i v i are the starting position and velocity x i n v i n displaystyle x i n v i n are intermediary position and velocity at intermediary step n displaystyle n a x i n displaystyle a x i n is the acceleration at the position x i n displaystyle x i n and x i 1 v i 1 displaystyle x i 1 v i 1 are the final position and velocity under one 4th order Yoshida step Coefficients c 1 c 2 c 3 c 4 displaystyle c 1 c 2 c 3 c 4 and d 1 d 2 d 3 displaystyle d 1 d 2 d 3 are derived in 6 see the equation 4 6 w 0 2 3 2 2 3 w 1 1 2 2 3 c 1 c 4 w 1 2 c 2 c 3 w 0 w 1 2 d 1 d 3 w 1 d 2 w 0 displaystyle begin aligned w 0 amp equiv frac sqrt 3 2 2 sqrt 3 2 w 1 amp equiv frac 1 2 sqrt 3 2 c 1 amp c 4 equiv frac w 1 2 c 2 c 3 equiv frac w 0 w 1 2 d 1 amp d 3 equiv w 1 d 2 equiv w 0 end aligned All intermediary steps form one D t displaystyle Delta t step which implies that coefficients sum up to one i 1 4 c i 1 textstyle sum i 1 4 c i 1 and i 1 3 d i 1 textstyle sum i 1 3 d i 1 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 c n displaystyle c n coefficients c 1 0 6756 displaystyle c 1 0 6756 c 2 0 1756 displaystyle c 2 0 1756 c 3 0 1756 displaystyle c 3 0 1756 c 4 0 6756 displaystyle c 4 0 6756 See also EditNumerical methods for ordinary differential equations Symplectic integration Euler integration Verlet integration Runge Kutta integrationReferences Edit C K Birdsall and A B Langdon Plasma Physics via Computer Simulations McGraw Hill Book Company 1985 p 56 4 1 Two Ways to Write the Leapfrog Skeel R D Variable Step Size Destabilizes the Stomer Leapfrog Verlet Method BIT Numerical Mathematics Vol 33 1993 p 172 175 Bishop Christopher 2006 Pattern Recognition and Machine Learning New York Springer Verlag pp 548 554 ISBN 978 0 387 31073 2 Ch07 HTML a b Yoshida Haruo 1990 Construction of higher order symplectic integrators Physics Letters A 150 5 7 262 268 doi 10 1016 0375 9601 90 90092 3 External links Edit 1 Drexel University Physics Retrieved from https en wikipedia org w index php title Leapfrog integration amp oldid 1130797317, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.