This is a discussion of the algorithm to generate the Gravity Set and the MGGS software used to do it. If you are familiar with the techniques for generating the Mandelbrot Set, then you will find that this is similar. The iterative formula is given below. Basically, simple Eulerian integration is used to determine the orbit of the particles. When a preset distance from the center of mass is reached, the number of iterations taken to get there is assigned a color value. The initial state of the particle is determined by its position (which is mapped by the screen), its velocity, which is usually zero (except in the Waterfall map).

In this discussion, I will refer to the placed masses as "stars". "Maps" are the images produced by MGGS -- they are indeed "color maps" of the results of the iterative process.

Given a particle of negligible mass in placed initially at a coordinate in the "star system", the gravitational forces -- or rather, the acceleration due to those forces -- contributed by each star in the system is computed and summed using the gravitational formula.

Using a simple "calculus 101" Eulerian integration process, the velocity of that particle is determined. A second integration step yields the particle's new position.

This three-step process is counted as one iteration. These steps are then repeated using the position of the prior iteration.

At the end of each iteration, the distance from the center of the coordinate system is checked. If it is over a certain limit, then the iterative process is ceased for that particle, and a color is assigned to the number of iterations it took to get the particle there. If the particle does not hit that limit before a preset maximum number of iterations are reached, the iteration is halted anyway.

Delta time is extremely important to this iterative process, and its setting strongly affects the form of the maps. Experimentation with the delta time setting has shown the most interesting maps appear at around delta t = 2 to 7. Deltas set smaller than 1, while producing more accurate results with the integration process, also tends to produce noisy "speckled" maps that take a long time to render. It is clear that the error involved in the integration process plays a prominent role in the results.

In some of the maps, particularly Sunrise and Pinwheel, the Gravitational Constant is set to a negative value. This would be analogous to negative gravity or electric fields. Also note that in most of the maps presented here, the gravitational bodies are arranged in a hexagon at a count of six equal masses. MGGS under Linux also allows for other arrangements of the masses, such as "spoke", "linear", and "random". There is also a custom setting where the mases can be arbitrarily placed. Moreover the position and mass of each individual star may be set manually, and negative masses for stars are allowed. Having a star system of mixed positive and negative masses have indeed produced some of the most interesting maps, such as illustrated to your right.

Zooming in on the gravity set maps reveal an fetching panoply of twists and distortions of structures at higher levels. Particularly, you can see the patterned arrangement of the stars twisted in many interesting ways. There is a self-similarity aspect, but these are not "fractals" in the strictest sense as defined by Mandelbrot. But there are some maps which would appear to pass as "fractals" under the strict definition. The varieties of the maps are endless, and is more interesting to the author than the Mandelbrot and Julia Sets.

Why do these structures repeat themselves in distorted fashion at smaller scales? The reasons are not fully understood, but a possible clue is that the number of iterations it takes to eject a particle from the system is very sensitive to the initial placement of the particle and the delta t setting. The error that is compounded will affect how close particles come to a star, and the closer the particle approaches a star of positive mass, the more likely it will be ejected from the system since close proximity imparts a higher velocity on the particle. The author will attempt to write more about this later.

 

The basic formula is as follows:

mggs_3star_pmm_lost_worlds_13_medium.png (PNG)
mggs_flipflop-3-3_01.png (PNG)