views:

89

answers:

1

I'm trying to develop a physics simulation and I want to implement a fourth-order symplectic integration method. The problem is that I must be getting the math wrong, since my simulation is not working at all when using the symplectic integrator (as compared to a fourth-order Runge-Kutta integrator that works reasonably well for the simulation). I've been googling this forever and all I can find are scientific articles on the subject. I tried to adapt the method used in the articles, but am having no luck. I want to know if anyone has source code for a simulation that makes use of symplectic integrators, preferably to simulate a gravitational field but any symplectic integrator would do. What language the source is in doesn't matter too much, but I would appreciate a language using C-style syntax. Thanks!

+1  A: 

As you asked for source code: From HERE you can download MATLAB and FORTRAN code for symplectic methods for Hamiltonian systems and symmetric methods for reversible problems. And a lot of other methods for dealing with diff equations too.

And in THIS paper you can find the description of the algorithms.

HTH!

belisarius
Thanks, that definitely helps! What I needed was having the equations in papers described in code, and the link you provided does that.
George
@George As you saw, source code examples for symplectic algorithms are scarce on the web. When you are done, consider posting your code somewhere to help others in need.
belisarius
I can definitely appreciate how scare examples are. Although a large number of papers are written on symplectic algorithms used to solve various problems, it seems that those same scientists don't put the code for their algorithms on the web. I will post a link later if I can get a working symplectic algorithm.
George