Gravity Sucks!

Version 1.2 of 1/9/2020-12:30 p.m.

Screensaver

Back in the days of Macintosh infamy, there was a NOVA screen-saver for the Mac, called "Gravity Sucks!". It filled the screen with small to large bubbles, which attracted each other via Newton's Law of Universal Gravitation (NLUG). The strength of attraction, the mass and the velocity were all adjustable through fine controls.

Funny as it may sound, this little screen-saver was a numerical solution to the N-body Problem in two dimensions.

Resultant Animation

Attempting to model the graphics using some Maple code produces some interesting animation[1]. The main code is similar to the code[2] found in the document Travelling to the Moon by Solving the N-body Problem, but restricted to 2D.

Gravity Sucks!
"GravitySucks!" with N=14 and tN=90[1]

Collisions

The code takes care of collisions, by altering the masses of the collided masses as follows: When two masses collide, one mass takes the sum of the masses and its velocity is adjusted to compensate for the added mass using the conservation of momentum, as:

m1*v1+m2*v2=(m1+m2)*vx

Then, one mass is zeroed-out, which is a fundamental condition which is checked for the animation to work correctly. Objects with zero mass are ignored, so the animation continues normally.

Notes

  1. Download a Maple 9 worksheet which shows the complete 2D animation for Gravity Sucks, here.This animation is essentially a simulation of how gravity starts accumulating mass to form celestial bodies. From molecules to stars and planets. There's always a critical mass whose presence causes the ignition of cold mass into a star, hence changing color can be used to signal the birth of a star. For the above case, the birth of a star happens at 500 unit masses.
  2. Download a Maple 13 worksheet which shows the complete 3D animation, here.