Why is Verlet integration better than Euler integration?
Asked Answered
P

3

27

Can someone explain to me why Verlet integration is better than Euler integration? And why RK4 is better than Verlet? I don't understand why it is a better method.

Pompous answered 4/5, 2010 at 22:48 Comment(0)
C
22

The Verlet method is is good at simulating systems with energy conservation, and the reason is that it is symplectic. In order to understand this statement you have to describe a time step in your simulation as a function, f, that maps the state space into itself. In other words each timestep can be written on the following form.

(x(t+dt), v(t+dt)) = f(x(t),v(t))

The time step function, f, of the Verlet method has the special property that it conserves state-space volume. We can write this in mathematical terms. If you have a set A of states in the state space, then you can define f(A) by

f(A) = {f(x)| for x in A}

Now let us assume that the sets A and f(A) are smooth and nice so we can define their volume. Then a symplectic map, f, will always fulfill that the volume of f(A) is the same as the volume of A. (and this will be fulfilled for all nice and smooth choices of A). This is fulfilled by the time step function of the Verlet method, and therefore the Verlet method is a symplectic method.

Now the final question is. Why is a symplectic method good for simulating systems with energy conservation, but I am afraid that you will have to read a book to understand this.

Coon answered 5/5, 2010 at 17:4 Comment(2)
What are x and v is these equations? I think you should give brief definition of each non-obvious variable you use!Kuomintang
@Kuomintang - x is position and v is velocity.Contrapuntal
C
19

The Euler method is a first order integration scheme, i.e. the total error is proportional to the step size. However, it can be numerically unstable, in other words, the accumulated error can overwhelm the calculation giving you nonsense. Please note, this instability can occur regardless of how small you make the step size or whether the system is linear or not. I am not familiar with verlet integration, so I can not speak to its efficacy. But, the Runge-Kutta methods differ from the Euler method in more than just step size.

In essence, they are based on a better way of numerically approximating the derivative. The precise details escape me at the moment. In general, the fourth order Runge-Kutta method is considered the workhorse of the integration schemes, but it does have some disadvantages. It is slightly dissipative, i.e. a small first derivative dependent term is added to your calculation which resembles an added friction. Also, it has a fixed step size which can result can make it difficult to achieve the accuracy you desire. Alternatively, you can use an adaptive stepsize scheme, like the Runge-Kutta-Fehlberg method, which gives fifth order accuracy for an additional 6 function evaluations. This can greatly reduce the time necessary to perform your calculation while improving accuracy, as shown here.

Coccus answered 5/5, 2010 at 4:9 Comment(3)
^Please note, this instability can occur regardless of how small you make the step size or whether the system is linear or not. When you say linear, you are referring to 2nd order (accelerations), not 1st order (velocity), correct? I believe tom10 was referring to a steady non-accelerated velocity.Croesus
@Steve H, when I said linear I was referring to the standard definition of a linear differential equation, not the order of the equation.Coccus
The Euler method is a Runge–Kutta method, so you can't say that Runge–Kutta methods differ from the Euler method. Also, note that there are more than one fourth order Runge–Kutta method, but that one of them is called the RK4 method and is particularly well known. But maybe that is implicit in what you're saying.Butterworth
K
5

If everything just coasts along in a linear way, it wouldn't matter what method you used, but when something interesting (i.e. non-linear) happens, you need to look more carefully, either by considering the non-linearity directly (verlet) or by taking smaller timesteps (rk4).

Kacerek answered 5/5, 2010 at 3:33 Comment(1)
Yeah! I think this is an extremely useful thing to have pointed out, and is lacking from the other otherwise comprehensive answers. If you've no acceleration, Euler integration will give you exact results, except for numerical round off. But you almost certainly do have acceleration. Your velocity changes. It doesn't change instantaneously at the point of iteration – it changes continuously between steps under smooth acceleration. that's why more sophisticated integration techniques aid realism and perhaps other properties like simulation stability.Redbreast

© 2022 - 2024 — McMap. All rights reserved.