Galaxy

Stellar Simulation
Galaxy is a free Linux computer program which simulates the motion of stars under the influence of gravity. Create a field of random stars to begin with, then watch the stars move as they are accelerated by their mutual gravitational attractions. Watch how the attractive forces accelerate individual stars and send them careening in new directions. Watch how large groups of stars develop into interesting patterns over time, such as clusters and spiral arms.

Tarball with source code, make file, user guide: downloads
DEB and RPM package: packages   

Warning: this program works poorly with recent releases of compiz (e.g. Ubuntu Unity). A large star count may cause jerky window updates and may even freeze the desktop and require a reboot. As far as I know, other window managers work OK. This program stresses the graphics library with thousands of small updates per second. 

The following simulations need typically 2-20 minutes, depending on processor speed and star count.

1000 stars (click for full-size image)

2000 stars

4000 stars

8000 stars

16000 stars