The Runge-Kutta Method

The Runge-Kutta (RK) method is a method of numerically integrating ordinary differential equations (ODEs). An estimation is found by taking the midpoint of an interval to cancel out lower-order terms. The power of this method (or family of methods) is that there are different orders of these methods. An arbitrarily large-ordered RK method can be derived, attaining an arbitrarily small error. The downside to high-order derivations, however, is additional complexity and function calls, slowing down the calculation. The Runge-Kutta method of order 4 (RK4) is considered the standard of numerically estimating the value of an integral, and strikes a balance between precision and performance. However, different orders are also used, such as RK2 when speed is more important than precision. It is important to note that even RK2, the second order Runge-Kutta method, is already more precise than the standard Euler’s method.

This method gives rise to countless possibilities, as the uses of integration are boundless. For example, RK methods can be used for flow visualization. To do this, we integrate the position of each point in small step sizes. This is continuously done until the particle goes out of the field, or the end time is reached. The result produces something like this:

or another example:

Similarly, the RK method can solve sets of ODEs to numerically solve equations of motion. A fun example can be found here involving a pendulum, allowing you to change various physical elements.

Finally, another example allows for the calculation needed to simulate 2D metaballs. Due to the requirement to perform multiple consecutive calculations, the error increases through time, resulting in incorrect simulations. Hence, RK2 or RK4 is required as opposed to Euler’s method for accuracy, enabling a simulation like so to be found:


Runge-Kutta method: http://mathworld.wolfram.com/Runge-KuttaMethod.htmlNSDL Annotation
Flow visualization: http://web.cs.wpi.edu/~matt/courses/cs563/talks/flowvis/flowvis.html
Pendulum physics: http://www.myphysicslab.com/pendulum1.html
Metaball simulating: http://www.niksula.cs.hut.fi/~hkankaan/Homepages/metaballs.html

Posted in Topics: Uncategorized

Jump down to leave a comment.

Leave a Comment

You must be logged in to post a comment.



* You can follow any responses to this entry through the RSS 2.0 feed.