RK4 with adaptative step versus fourth order leapfrog integrator

  • Context: Undergrad 
  • Thread starter Thread starter Dalor
  • Start date Start date
  • Tags Tags
    Rk4
Click For Summary
SUMMARY

The discussion centers on the comparison between the RK4 integrator with adaptive step size, as implemented in GEANT4, and the fourth order leapfrog integrator for solving particle trajectories in time-independent fields. Initial tests indicate that the RK4 method performs slightly better in terms of efficiency and energy conservation, especially for unstable trajectories. The consensus is that while both integrators yield similar results, the leapfrog integrator is less suited for adaptive step sizes due to its inherent design, which complicates implementation and may degrade performance.

PREREQUISITES
  • Understanding of numerical integration methods, specifically RK4 and leapfrog integrators.
  • Familiarity with particle trajectory simulations in physics.
  • Knowledge of adaptive step size techniques in numerical analysis.
  • Basic concepts of symplectic integrators and their applications in Hamiltonian systems.
NEXT STEPS
  • Research the implementation of fourth order leapfrog integrators in various simulation environments.
  • Explore the use of Wolfram Alpha for solving differential equations analytically.
  • Investigate the limitations and advantages of symplectic integrators for long-term simulations.
  • Examine literature on adaptive step size methods in the context of symplectic integrators.
USEFUL FOR

This discussion is beneficial for physicists, numerical analysts, and software developers involved in particle simulation and numerical integration, particularly those seeking to optimize energy conservation in computational models.

Dalor
Messages
9
Reaction score
0
TL;DR
I am trying to solve the trajectory of particle in a time independent field and I'm looking for the most efficient way, ie smallest error on the energy for a given calculation's time. I thought 4th order leapfrog integrator was better than RK4 but quick try does not seems to agree.
Summary: I am trying to solve the trajectory of particle in a time independent field and I'm looking for the most efficient way, ie smallest error on the energy for a given calculation's time. I thought 4th order leapfrog integrator was better than RK4 but quick try does not seems to agree.

(first thing : I don't know much about integrator)

I want to solve the trajectory of particle in a analytic field I know ( it is not possible to use symplectic method due to complicated evaluation such as elliptic integral etc. ). Right know I use a RK4 integrator with adaptative step ( the one in GEANT4). But from reading here and there I thought 4th order integrator could be better for energy conservation. So for testing, I try to solve simple system (particle in a 2D quadratic potential) in scilab with RK4 and 4th order leap frog integrator and the efficency (error versus solving time) was very close (with a small advantage for RK4 method). So it seems that there is not much difference between RK and leapfrog.
I have to add that trajectory i want to solve are not stable trajectory (they can but by accident) and maybe in this situation all integrator are more or less equivalent ?

So my question is : in which situation 4th order leapfrog integrators are better than RK4. Is this possible to use those with adaptative step ?

( I eventually wish to replace the RK4 adaptative step integrator of GEANT4 by a new one)
 
Last edited:
Physics news on Phys.org
Dalor said:
Summary: I am trying to solve the trajectory of particle in a time independent field and I'm looking for the most efficient way, ie smallest error on the energy for a given calculation's time. I thought 4th order leapfrog integrator was better than RK4 but quick try does not seems to agree.

I have to add that trajectory i want to solve are not stable trajectory (they can but by accident) and maybe in this situation all integrator are more or less equivalent ?
Ah yes if unstable, all numerical integration will eventually fail unless you keep shortening the time step size toward zero.

Can you solve the differential equations to find a closed form time domain solution? If so, then just evaluate that solution instead of integrating. A site like Wolfram Alpha could help you find the solution.
 
Dalor said:
So my question is : in which situation 4th order leapfrog integrators are better than RK4. Is this possible to use those with adaptative step ?
Symplectic integrators are most useful for long term simulations as they do not suffer from "energy drift" (a simplification, but it will have to do for now!). I use them for hamiltonian system simulations.

Unfortunately, adaptive step size is not really in the "spirit" of how symplectic integrators work. There have been many attempts in the literature, but as far as I have seen they all increase implementation complexity to a ridiculous level, and lose performance in the process.
 

Similar threads

  • · Replies 65 ·
3
Replies
65
Views
9K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 13 ·
Replies
13
Views
5K
  • · Replies 14 ·
Replies
14
Views
3K
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 19 ·
Replies
19
Views
19K