Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

Leapfrog integration

From Wikipedia, the free encyclopedia
Mathematics concept

Innumerical analysis,leapfrog integration is amethod for numerically integratingdifferential equations of the formx¨=d2xdt2=A(x),{\displaystyle {\ddot {x}}={\frac {d^{2}x}{dt^{2}}}=A(x),}or equivalently of the formv˙=dvdt=A(x),x˙=dxdt=v,{\displaystyle {\dot {v}}={\frac {dv}{dt}}=A(x),\qquad {\dot {x}}={\frac {dx}{dt}}=v,}particularly in the case of adynamical system ofclassical mechanics.

Comparison of Euler's and Leapfrog integration energy conserving properties for N bodies orbiting a point source mass. Same time-step used in both simulations.

The method is known by different names in different disciplines. In particular, it is similar to thevelocity Verlet method, which is a variant ofVerlet integration. Leapfrog integration is equivalent to updating positionsx(t){\displaystyle x(t)} and velocitiesv(t)=x˙(t){\displaystyle v(t)={\dot {x}}(t)} at different interleaved time points, staggered in such a way that they "leapfrog" over each other.

Leapfrog integration is asecond-order method, in contrast toEuler 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Δt{\displaystyle \Delta t} is constant, andΔt<2/ω{\displaystyle \Delta t<2/\omega }.[1]

Using Yoshida coefficients, applying the leapfrog integrator multiple times with the correct timesteps, a much higher order integrator can be generated.

Algorithm

[edit]

In leapfrog integration, the equations for updating position and velocity areai=A(xi),vi+1/2=vi1/2+aiΔt,xi+1=xi+vi+1/2Δt,{\displaystyle {\begin{aligned}a_{i}&=A(x_{i}),\\v_{i+1/2}&=v_{i-1/2}+a_{i}\,\Delta t,\\x_{i+1}&=x_{i}+v_{i+1/2}\,\Delta t,\end{aligned}}}

wherexi{\displaystyle x_{i}} is position at stepi{\displaystyle i},vi+1/2{\displaystyle v_{i+1/2\,}} is the velocity, or first derivative ofx{\displaystyle x}, at stepi+1/2{\displaystyle i+1/2\,},ai=A(xi){\displaystyle a_{i}=A(x_{i})} is the acceleration, or second derivative ofx{\displaystyle x}, at stepi{\displaystyle i}, andΔ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]xi+1=xi+viΔt+12aiΔt2,vi+1=vi+12(ai+ai+1)Δt.{\displaystyle {\begin{aligned}x_{i+1}&=x_{i}+v_{i}\,\Delta t+{\tfrac {1}{2}}\,a_{i}\,\Delta t^{\,2},\\v_{i+1}&=v_{i}+{\tfrac {1}{2}}(a_{i}+a_{i+1})\,\Delta t.\end{aligned}}}However, in this synchronized form, the time-stepΔt{\displaystyle \Delta t} must be constant to maintain stability.[3]

The synchronised form can be re-arranged to the 'kick-drift-kick' form;vi+1/2=vi+12aiΔt,xi+1=xi+vi+1/2Δt,vi+1=vi+1/2+12ai+1Δt,{\displaystyle {\begin{aligned}v_{i+1/2}&=v_{i}+{\tfrac {1}{2}}a_{i}\Delta t,\\[2pt]x_{i+1}&=x_{i}+v_{i+1/2}\Delta t,\\[2pt]v_{i+1}&=v_{i+1/2}+{\tfrac {1}{2}}a_{i+1}\Delta t,\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 (ΔtΔ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 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 thetime-reversibility of the Leapfrog method. One can integrate forwardn steps, and then reverse the direction of integration and integrate backwardsn steps to arrive at the same starting position. The second strength is itssymplectic nature, which implies that it conserves the (slightly modified; seesymplectic integrator) energy of a Hamiltonian dynamical system.[4] 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 asymplectic integrator, leapfrog integration is also used inHamiltonian Monte Carlo, a method for drawing random samples from a probability distribution whose overall normalization is unknown.[5]

Yoshida algorithms

[edit]

The leapfrog integrator can be converted into higher order integrators using techniques due toHaruo 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.[6][7]

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

xi1=xi+c1viΔt,vi1=vi+d1a(xi1)Δt,xi2=xi1+c2vi1Δt,vi2=vi1+d2a(xi2)Δt,xi3=xi2+c3vi2Δt,vi3=vi2+d3a(xi3)Δt,xi+1xi4=xi3+c4vi3Δt,vi+1vi4=vi3{\displaystyle {\begin{aligned}x_{i}^{1}&=x_{i}+c_{1}\,v_{i}\,\Delta t,&v_{i}^{1}&=v_{i}+d_{1}\,a(x_{i}^{1})\,\Delta t,\\x_{i}^{2}&=x_{i}^{1}+c_{2}\,v_{i}^{1}\,\Delta t,&v_{i}^{2}&=v_{i}^{1}+d_{2}\,a(x_{i}^{2})\,\Delta t,\\x_{i}^{3}&=x_{i}^{2}+c_{3}\,v_{i}^{2}\,\Delta t,&v_{i}^{3}&=v_{i}^{2}+d_{3}\,a(x_{i}^{3})\,\Delta t,\\x_{i+1}&\equiv x_{i}^{4}=x_{i}^{3}+c_{4}\,v_{i}^{3}\,\Delta t,&v_{i+1}&\equiv v_{i}^{4}=v_{i}^{3}\\\end{aligned}}}

wherexi,vi{\displaystyle x_{i},v_{i}} are the starting position and velocity,xin,vin{\displaystyle x_{i}^{n},v_{i}^{n}} are intermediary position and velocity at intermediary stepn{\displaystyle n},a(xin){\displaystyle a(x_{i}^{n})} is the acceleration at the positionxin{\displaystyle x_{i}^{n}}, andxi+1,vi+1{\displaystyle x_{i+1},v_{i+1}} are the final position and velocity under one 4th order Yoshida step.

Coefficients(c1,c2,c3,c4){\displaystyle (c_{1},c_{2},c_{3},c_{4})} and(d1,d2,d3){\displaystyle (d_{1},d_{2},d_{3})} are derived in[7] (see the equation (4.6))

w023223,w11223,c1=c4w12,c2=c3w0+w12,d1=d3w1,d2w0{\displaystyle {\begin{aligned}w_{0}&\equiv -{\frac {\sqrt[{3}]{2}}{2-{\sqrt[{3}]{2}}}},&w_{1}&\equiv {\frac {1}{2-{\sqrt[{3}]{2}}}},\\[1ex]c_{1}&=c_{4}\equiv {\frac {w_{1}}{2}},&c_{2}=c_{3}&\equiv {\frac {w_{0}+w_{1}}{2}},\\[1ex]d_{1}&=d_{3}\equiv w_{1},&d_{2}&\equiv w_{0}\\\end{aligned}}}

All intermediary steps form oneΔt{\displaystyle \Delta t} step which implies that coefficients sum up to one:i=14ci=1{\textstyle \sum _{i=1}^{4}c_{i}=1} andi=13di=1{\textstyle \sum _{i=1}^{3}d_{i}=1}. 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 ofcn{\displaystyle c_{n}} coefficients:c1=0.6756{\displaystyle c_{1}=0.6756},c2=0.1756{\displaystyle c_{2}=-0.1756},c3=0.1756{\displaystyle c_{3}=-0.1756},c4=0.6756.{\displaystyle c_{4}=0.6756.}

See also

[edit]

References

[edit]
  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". Archived fromthe original on 2023-04-03.
  3. ^Skeel, R. D., "Variable Step Size Destabilizes the Stömer/Leapfrog/Verlet Method",BIT Numerical Mathematics, Vol. 33, 1993, p. 172–175.
  4. ^Tuckerman, Mark E. (2010).Statistical Mechanics: Theory and Molecular Simulation (1 ed.). Oxford University Press. pp. 121–124.ISBN 9780198525264.
  5. ^Bishop, Christopher (2006).Pattern Recognition and Machine Learning. New York:Springer-Verlag. pp. 548–554.ISBN 978-0-387-31073-2.
  6. ^"./Ch07.HTML". Archived fromthe original on 2022-03-31. Retrieved2017-12-21.
  7. ^abYoshida, 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]
First-order methods
Second-order methods
Higher-order methods
Theory
Related
Retrieved from "https://en.wikipedia.org/w/index.php?title=Leapfrog_integration&oldid=1314819516"
Category:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp