An N-body simulation typically works directly in terms of the gravitational forces and accelerations. If you can solve the equations exactly, this is fine, but there are many instances where this is impossible for a reasonable definition of impossible. Therefore, we approximate the solution.
Namely, we find the acceleration of each point mass, then increment the position and velocity using Euler's method.
One thing about this is that energy and momentum will not necessarily be preserved. This can lead to bad phenomenon such as mass coming to close and causing each other to shoot away. Generally, if you are viewing a simulation casually, most of the inaccuracies come in when energy or momentum are badly changed.
Can you do an N-body simulation directly in terms of concepts such as energy, momentum, work, impulse, etc...? Namely, what are some methods such that the energy and momentum are guaranteed to be conserved by the simulation?
We could give each point mass a velocity and position. This allows you to determine both the energy and momentum of each particle. You can then, as gravitational potential energy changes, calculate the corresponding change in kinetic energy, from there the change in velocity. I think work may be involved somewhere here as well (and therefore force). The problem is, this does not really tell you anything about direction.
Anyone know how a N-body simulation that conserves energy and momentum could work?