Simulation of n distinct bodies in a 2-fold space using Newton's law of gravitation.

In the testbed, a galaxy is modeled as a system of particles under mutual gravitational attraction. From Newton's law of gravitation, each particle of mass M attracts another particle of mass m with a F= -(GMm/r^3)*r. The most direct approach is to compute the force exerted on each of the n particles by all of the other n-1 particles at each time step. By Newton's second law of motion, F=ma, the force calculation has yielded the acceleration for each particle. Two first-order differential equations involving acceleration and velocity must be solved, using numerical integration, to estimate new positions and velocities of each particle for the next timestep. N-body models and their applications have been studied from the time of Newton to the present day. The computational power becoming available to produce large-n simulations and compare them to deep-space observations will greatly advance our understanding of galaxy formation.
(you might need to click once or twice on the applet the first time you want to use the keys below)

'r' restarts the applet
'up' moves all masses up
'down' moves all masses down
'left' moves all masses left
'right' moves all masses right
'F1' increases the thread sleep interval (slows down animation)
'F2' decreases the thread sleep interval (speeds up animation)
'mouse click' toggles stop/start of the applet



1. Unsolved problems: