ORBITS: Solar System Resonances
This simulation is based on "flocking polygons 25."
To see previous uncorrected versions, go back to flocking polygons.
All source code, applications and images on this page, or accessed from this page, are Copyright © Nicholas Gessler and/or on behalf of those who created them.
Do not assume that all code blocks in any one application are entirely
compatible with the code blocks in other applications.
Please verify the compatibility yourself before you cut-and-paste.
Wikipedia on Numerical Models of the Solar System
|
|
TO DO:
- Specific visualization shapes for agents: hexagons, stars, polygons...
- Manage agent births and deaths.
- Adapt nearest neighbor functions for toroidal space.
- Introduce nearest neighbor functions that discriminate between different types.
- Create zoned pie-shaped visual fields weighing those ahead and behind you differently.
- Implement predator / prey scenarios.
- Implement age, sex, hunger, and exchanges of local and global information.
|
TO DO:
- Generate statistics on multiagent behavior.
- Allow user to enter values in all Edit boxes.
- Implement traffic flow expecting retrograde congestion waves.
- Implement gestures.
- Implement memory of encounters to build social networks.
- Implementing Sugar-Scape trade in resources.
- Enable interaction with an environmental map (Digital Elevation Model or BMP image).
|
 |
|
|
|
Nice models I & 2 (Hal Levison, Southwest Research Institute, Boulder, Colorado). Sky & Telescops. |
Kirkwood Gaps (based on a plot by Alan Chamberlain, JPL/Caltech, California posted on Wikipedia). |
Jupiter Trojan (red & green) and Hilda (white) family of asteroids (Pulkovo Astronomical Observatory, Russian Academy of Sciences, St. Petersburgh. |
Horseshoe orbits and the 5 Lagrage points (Xander 1989 talk, NASA). |
|
|
 |
|
xxxxx xxxxx
Rule 20: Mars and Jupiter each attracted to the Sun. Gravity 0.001, 0.01 and 0.30 run for one Jovian year.
xxxxx xxxxx
Rule 21: Jupiter attracted to the Sun. Gravity 0.001, 0.01 and 0.30 run for one Jovian year.
xxxxx xxxxx
Rule 22: Mars and Jupiter each attracted to the Sun and attracted to one another. Gravity 0.001, 0.01 and 0.30 run for one Jovian year.
|
|
XE6 - Flocking / Orbits -
Version 40 - Nick Gessler - 7 October 2016
Improvements:
- Rule 20: Mars and Jupiter each interacting with the Sun but not with one anoher.
Their relative masses are exaggerated in the proportions 0.1, 0.3 and 1.0.
- Rule 21: Jupiter interacts with the Sun.
Jupiter's relative mass can be set to 0.001 (accurate), 0.02 or 0.30.
- True orbits for Mars and Jupiter were calibrated using 700 agents launched eastward.
Mars: radius 123 pixels (1.520 AU), agent 107/700, velocity dX = 2840.
Jupiter radius 420 pixels (5.200 AU), agent 538/700, velocity dX = 1546.
- Counterclockwise orbits have been implemented.
- Asteroids may be inserted as a ring of agents with a given velocity and distance in AU.
- Screenshots may be automatically saved each Jovian year. Be careful, since each screen shot is 5Mb in size.
Some orbital resonances to explore (AU values are entered as thousandths):
For stable circular orbits, velocities are computed as 110,731 or 111,484 divided by the square root of AU.
- Resonance 1:1 set Velocity = 1546 / AU = 5200 (1.00) * Synchronous orbit.
- Resonance 6:5 set Velocity = 1639 / AU = 4606 (1.20) *
- Resonance 5:4 set Velocity = 1661 / AU = 4482 (1.25) *
- Resonance 4:3 set Velocity = 1697 / AU = 4293 (1.30) *
- Resonance 3:2 set Velocity = 1765 / AU = 3969 (1.5)
- Resonance 2:1 set Velocity = 1940 / AU = 3275 (2.0)
- Resonance 7:3 set Velocity = 2042 / AU = 2955
- Resonance 5:2 set Velocity = 2090 / AU = 2822
- Resonance 3:1 set Velocity = 2220 / AU = 2500 (3.0)
Important variables and functions (line numbers may differ from the present version). |
|
XE6 - Flocking / Orbits -
Version 38 - Nick Gessler - 26 September 2017
The user may now select the number of iterations an experiment will run.
Set the "Stop at..." RadioGroup (underneath the "Run" button) to the number of iterations you wish to run..
Select the "Population" size for your experiments. Press "Reset" to zeroize the iterations counter.
To initialize "Rule 20" select a different rule and then select "Rule 20" again.
For your experiment, sSelect "Evolve Random" or "Evolve Clockwise." Than press "Run."
Once the simulation stops, set "Stop at..." to infinity "∞". Select "Space / Infinite" and "Display / Clear Now." Press "Run."
Set "Agent Visualization / Shape" to "Fixed Triangle," "Size" to 5-10, "Trail" to "no," and "Pen" to "Brush." Set "Track" at the bottom left to "Yes."
Press "Run" and scroll through each of the agents in your population to see if they are orbiting prograde or retrograde.
XE6 - Flocking / Orbits -
Version 37 - Nick Gessler - 20 October 2015
Improvements:
- Ghost triangles have been removed.
- Martian and Jovian orbits are now "true."
- Orbital "repulsors" have been instantiated.
- Some Unicode symbols have been incorporated
- "Drop agents from top of screen" has been implemented.
- "Fall to Earth" has been implemented.
- Rule 20 has been optimized to capture moons by increasing the mass of Mars and Jupiter.
Some important variables and functions. |

Martian and Jovian orbits are now "true." Mars (red orbit) now captures one moon. Note the displacement of orbits away from Jupiter.
 
Traffic / Explode from cursor.
 
Drop agents from top of screen between two suns. / Explode from cursor while avoiding nearest neighbor.
 
Traffic variations.
|
|
XE6 - Flocking / Orbits -
Version 35 - Nick Gessler - 18 March 2015
The control panel has been enlarged and slightly modified.
Three "Evolve" mechanisms have been implemented:
- Evolve Random - New asteroids are introduced with random speeds, directions and positions.
- Evolve Clockwise - New asteroids are introduced clockwise from the radius at random velocities and positions.
- Evolve Launch Velocity - New asteroids are introduced clockwise from the radius at random
positions with uniform speeds selected by the user
A Measure Radius feature (the twohorizontal white lines) has been added for confirming circular orbits.
|
|
Flocking / Orbits -
Version 34 - Nick Gessler - 2 April 2014
A new "Auto Run" function has been implemented.
All "Launches" are in agent.Tag order and are equally distributed.
A "Traffic" rule has been included (agent.seeking must be set to "Next").
Shown to left is one of the many configurations resulting from "Launches" with non-orbital rules.
|
|
Flocking / Orbits -
Version 33 - Nick Gessler - 26 March 2014
When "Space" is set to "Evolving," the number of new asteroids thrown in is also counted.
The orbiting rules have been renumbered and a modification has been made to the orbits in the
"Orbit Sun, Mars Jupiter" rules.
"20 Orbit Sun, Mars, Jupiter 1" retains the exaggerated masses of 1.0, 0.1 and 0.3 respectively.
"21 Orbit Sun, Mars, Jupiter 2" uses more realistic masses
of 1.0, 3.2x10-7 and 7.2x10-4 respectively.
However, with #2 gravitation is so low that tuning becomes even more critical.
You can now "Launch" asteroieds from Mars, from Jupiter and from multiple points along the radius.
You can also set the velocity at which those asteroids will be launched.
The asteroids will all be equally distributed.
The "Launch Asteroids" velocity is presently fixed.
Using "18 Orbit One Sun" and a population of 700 asteroids, by varying the gravity,one can obtain
perfectly circular orbits of varying diameter as in the table below. Note that
by adjusting the coloring
of asteroid speed, one can judge a perfect circle by its uniformity of color.
Gravity |
Agent (Tag) |
Oribtal Diameter (cm) |
150 |
79 |
1.8 |
217 |
59 |
2.7 |
300 |
112 |
3.8 |
399 |
164 |
4.8 |
488 |
230 |
6.3 |
598 |
283 |
7.3 |
698 |
346 |
9.0 |
806 |
407 |
10.0 |
905 |
474 |
11.4 |
1005 |
527 |
12.5 |
Ideally, for a given gravity, we would like the launch velocities that give perfect circular orbits at different radii
so that the "Launch Asteroids" button will ultimately launch all asteroids into circular orbits.
For the data from a four-hour run click here.
|
|
Flocking / Orbits -
Version 32 - Nick Gessler - 18 November 2013
3D has been improved by changing the visualization to a constant size triangle.
A spiraling-upwards rule has been added. Reduce the population and equalize agent depth for a clearer view.
The impact Mars and impact Jupiter events have been debugged. A trackbar should be added to set the magnitude of the impact.
The image to the left shows the result of the impact on Mars event.
For the data from a four-hour run click here.
|
|
Flocking / Orbits -
Version 31 - Nick Gessler - 11 November 2013
Autorun (the screen can be cleared every 15, 30 or 60 seconds) with
Solar System Resonances
Asteroids orbiting the Sun (rule 17), two binary Suns (rule 18), and the Sun, Mars & Jupiter (rule 19).
Tracking has been improved by shift-wheel-clicking to identify a single agent to be rendered.
The controls have been more conveniently reorganized.
The image to the left shows the result of tracking 16 moons of Jupiter that were captured after a six-hour run.
The image is a PhotoShopped composit of the 8 prograde and 8 retrograde moons with the new control panel superimposed.
For a clear view of the composite (without the control panel) click here.
For the data from a four-hour run click here.
|

The Sun is the yellow dot.
Mars' orbit is shown by the red/yellow arc.
Jupiter's orbit is shown by the blue arc in what looks like fringe at the right.
The green lines show the orbits of perhaps 20-30 asteroids in the asteroid belt,
many more inside the orbit of Mars,
and 18 captured by and orbiting Jupiter. |

The Sun, mars and Jupiter are colored as in the image to the left.
The asteroid orbits are colored according to the direction they are travelling.
Although Mars and Jupiter are orbiting clockwise, most of the asteroids are orbiting countercloskwise.
This retrograde motion is surprising since most asteroids in our Solar System travel prograde orbits. |
|
Flocking / Orbits -
Version 30 - Nick Gessler - 1 November 2013
Autorun (the screen can be cleared every 30, 60 or 90 seconds)with
Solar System Resonances
Asteroids orbiting the Sun (rule 17), two binary Suns (rule 18), and the Sun, Mars & Jupiter (rule 19).
New with this version: Any of up to 100 individual agent asteroids may be tracked.
The target asteroid will render in Green while the others will render in Gray.
To speed up evolution the selected rendering intervals have been increased.
The initial randomized speeds of asteroids have been slowed.
"Explosions" on the surfaces or orbiting Mars and Jupiter have been tentatively implemented (but incorrectly).
For the orbital rules, space is set to "evolutionary" by default. Once an asteroid flies off-screen, it is returned with a new x, y, dx and dy.
If space is set to "infinite," asteroids that fly off-screen continue their orbits and consume computer cycles.
Flocking / Orbits -
Version 29 - Nick Gessler - 7 November 2013
Autorun (the screen can be cleared every 30, 60 or 90 seconds)with
Solar System Resonances
Asteroids orbiting the Sun (rule 17), two binary Suns (rule 18), and the Sun, Mars & Jupiter (rule 19).
SWEET SPOTS IN THE CODE |
|
Solar System Resonances - Asteroids orbiting the Sun, Mars & Jupiter.
Version 28 - Nick Gessler - 20 May 2013
New with this version: Any of up to 100 agent asteroids may be tracked.
The target asteroid will render in Green while the others will render in Gray.
The selected rendering intervals have been increased.
Initial randomized speeds of asteroids have been slowed.
"Explosions" along the orbits of Mars and Jupiter have been implemented (but not correctly).
In the control box, choose one of the last three rules:
- Rule 17: Asteroids orbiting around one Sun.
- Rule 18: Asteroids orbiting around two Suns.
- Rule 19: Asteroids orbiting around one Sun, Mars* and Jupiter*.
Wheel-down on the black background to hide/show the control box.
Right-click the black background for a smaller pop-up control.
Clear the screen periodically.
By default, space is "evolutionary;" once an asteroid flies off-screen, it is returned with a new x, y, dx and dy.
If space is "infinite," asteroids that fly off-screen continue their orbits off-screen and may or may not return in practical time.
Visualizations of long runs are shown full-size below
* Mars and Jupiter have clockwork orbits.
** Mars and Jupiter will soon have natural orbits.
A clockwork orbit, if it differs from a natural orbit, will throw the asteroids out of their natural orbits. |
|
Solar System Resonances - Asteroids orbiting the Sun, Mars & Jupiter.
Version 27a - Nick Gessler - 10 May 2013
New with this version: Rendering is made to a TImage and drawn to the PaintBox at user-selected intervals.
The image can be saved as a .bmp and the asteroid positions and speeds can be saved and opened.
Agent coloring may be chosen as either a complete spectrum around the edges of the color cube or a short spectrum along one edge.
In the control box, choose one of the last three rules:
- Rule 17: Asteroids orbiting around one Sun.
- Rule 18: Asteroids orbiting around two Suns.
- Rule 19: Asteroids orbiting around one Sun, Mars* and Jupiter*.
Wheel-down on the black background to hide/show the control box.
Right-click the black background for a smaller pop-up control.
Clear the screen periodically.
By default, orbits are run with a population of 10.
By default, space is "evolutionary;" once an asteroid flies off-screen, it is returned with a new x, y, dx and dy.
If space is "infinite," asteroids that fly off-screen continue their orbits off-screen and may or may not return in practical time.
Visualizations of long runs are shown full-size below
* Mars and Jupiter have clockwork orbits.
** Mars and Jupiter will soon have natural orbits.
A clockwork orbit, if it differs from a natural orbit, will throw the asteroids out of their natural orbits. |
After a night of 243,186,104 iterations. Agents colored by individual tag.
xxx xxx
Composite.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx One orbit.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Several orbits. |
After a night of 243,186,104 iterations. Agents colored by direction.
xxx xxx
Grays, from black to white.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Full spectrum from cool to hot.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Oranges, from yellow to red.
|

One Sun (yellow), Mars (red) and Jupiter (white).
Note that there are at least two moons (straw and magenta) orbiting Jupiter and that the Asteroid Belt is depleted near Jupiter.
The stationary Sun and the orbits of Mars and Jupiter are clock-work, but their relative masses, speeds and distances are accurate. |
Two Suns, 10 Asteroids.
Note the saddle-shaped orbits. |
Two Suns, 10 Asteroids.
More orbits: circles, ellipses, figure-eights and saddles. |
Two Suns, 10 Asteroids.
Note the figure-eight and elliptical orbits. |
One Sun, 10 Asteroids.
Note that the orbits are quite stable. |
|
|
|
|