You will require a HTML5 Canvas aware browser to view the simulation.
At present (17/08/2010) Opera 10.6, Firefox 3.6 and Chrome 6.0 will all work on this webpage.
Click to run the simulation
| Particle | Position | Velocity | Acceleration |
| 0 | | | |
| 1 | | | |
| 2 | | | |
| 3 | | | |
| 4 | | | |
The Simulation
The simulation is based on the following rules:
- Each ball is created with a randomly assigned mass between 10 and 30.
- The radius of the ball is equal to its mass.
- The balls are created with random positions at least 10px away from the boundaries
- Their velocities are initialised randomly. Each component may lie between 0 and 2px/ms.
- They repulse each other acording to a force:
F(r) = gm1m2
/ r2
where r is their separation and g is a coupling constant = 100.
At present you can get some pretty fast-moving balls, since I don't check
for the balls being created on top of each other.
I plan to add this in the future, along with collision detection.
For now collisions won't occur too often since the coupling constant
has been made fairly large.