Numerical integration - verlet algorithm - accuracy

In summary, the conversation discusses three different velocity estimators derived for a problem with an equation of motion and how they are applied to the 1D harmonic oscillator in a computational physics textbook. The leapfrog energy estimator is found to be an order of magnitude worse than the other two estimators due to the fact that the velocity and position are calculated at different time instants, resulting in a deviation of the energy from the continuum value. The reasoning behind this difference is explained as being due to the potential being monotonically increasing or decreasing for many steps at a time, causing a consistent direction of error in the calculation. However, the exact reason for the leapfrog's results being one order worse than the other two remains unclear.
  • #1
QPingy
2
0
In my computational physics textbook, three different velocity estimators are derived for a problem with equation of motion: [itex]\ddot x = F(x)[/itex] where the positions are found by using the Verlet algorithm:
[itex]x(t+h) = 2 x(t) - x(t-h) + h^2 F[x(t)][/itex]

The three velocity estimators are:
[itex]
v(t) = \frac{x(t+h) - x(t-h)}{2h} + \mathcal{O}(h^2)[/itex]
[itex]
v_{improved}(t) = \frac{x(t+h) - x(t-h)}{2h} - \frac{h}{12}\left( F[x(t+h)] - F[x(t-h)] \right) + \mathcal{O}(h^3)
[/itex]
[itex]
v_{leapfrog}(t + h/2) = \frac{x(t+h) - x(t)}{h} + \mathcal{O}(h^2)
[/itex]

I have no problems deriving these equations, so far everything is clear.
But, in the textbook they apply the methods for the 1D harmonic oscillator and they conclude:
The leap-frog energy estimator is an order of magnitude worse than the other two. This is not surprising since the fact that the velocity is not calculated at the same time instants as the position results in deviation of the energy from the continuum value of order h instead of h^2.

So, just because the time instants are different, the leapfrog's results are 1 orde worse than the other two? I can't find an explanation/reasoning for this...

Can someone help me?

Regards,
Jan
 
Physics news on Phys.org
  • #2
QPingy said:
So, just because the time instants are different, the leapfrog's results are 1 orde worse than the other two?
Wrong time also means wrong position and therefore wrong potential. As the potential is monotonically increasing / decreasing for many steps at a time, you get a consistent direction of the error there.
 
  • #3
Okay, but I still don't see why the leapfrog is one order worse than the first estimator. Both use 2 positions, which are calculated using the verlet algorithm. I understand what you're saying about the potential, but I don't get why this would result in such a difference between the 2 estimators...
 

FAQ: Numerical integration - verlet algorithm - accuracy

What is numerical integration?

Numerical integration is a method used to approximate the value of a definite integral by dividing the interval into smaller subintervals and using numerical techniques to estimate the area under the curve.

What is the Verlet algorithm?

The Verlet algorithm is a numerical integration method used to simulate the motion of particles in a system. It is based on the idea of calculating the position and velocity of a particle at a given time by using information from the previous time step.

How accurate is the Verlet algorithm?

The accuracy of the Verlet algorithm depends on the step size used in the calculation. Generally, smaller step sizes result in higher accuracy, but also require more computational resources. It is important to balance accuracy and efficiency when using this algorithm.

What are the advantages of using the Verlet algorithm?

The Verlet algorithm is computationally efficient and has good energy conservation properties. It is also relatively easy to implement and can handle complex systems with many interacting particles.

What are the limitations of the Verlet algorithm?

The Verlet algorithm is not suitable for all types of systems, such as systems with rapidly changing forces or systems with long-range interactions. It also has a tendency to accumulate errors over time, which can affect the accuracy of long-term simulations.

Similar threads

Back
Top