PDA

View Full Version : ODE Integration techniques demo



cragwolf
16-04-2006, 08:26 AM
I've just completed a little demo showing four commonly used numerical integration techniques used for the ordinary differential equations that one often encounters in game physics. The four methods are Standard Euler, Backwards Euler, Velocity Verlet, and Runge-Kutta. I've applied these techniques to the classic gravitational two-body problem involving the Earth and the Sun. I found that the well-known (http://www.gaffer.org/articles/Timestep.html) fixed-timestep-and-interpolation method suited this problem very well, especially for very large timesteps.

You can check out this screenshot (http://www.ludicity.org/images/integratess.png) to preview the demo, but if you have JEDI-SDL and FreePascal then you can try out the demo yourself because here is the source code:

http://www.ludicity.org/files/integrate.tar.gz (104.9 KB)

To compile just do: fpc -Mobjfpc integrate.pp

Be sure to read the readme.txt file for keyboard commands (you can change the timestep, as well as pause and/or return to the start).

Oh and I've only tested this on Linux, but I hope it will work on other platforms, too.

technomage
16-04-2006, 08:59 AM
Works fine on Win32 too. Nice work :D

aidave
16-04-2006, 09:12 AM
interesting!