Jul 14, 2006 03:46 PM
Simple Orbital Simulator
I cooked up a rather simple orbital simulator because I was bored. Then I plugged in some numbers from Wikipedia's entries on the various celestial bodies and came up with a minimally accurate model of the inner solar system.
Once I was done that, which I thought was pretty neat, I decided to see what would happen if I replaced the asteroid belt with a ~0.5 solar mass star. Mars did not survive the experiment. However, the system then settled into a fairly stable system despite Earth's orbit becoming significantly perturbed.
Anyhow, if you'd like to try out my simplistic orbital simulator, you can get version 0.2.0-stable or if you're feeling adventurous, the latest development version (identical, at the time of this posting, but probably not for long)
You must first install Python if you're running Windows (either Official or ActiveState distribution). If you're not running Windows, you can skip this step as you probably already have Python installed.
Now you need to install PyGame.
Once you've completed these two relatively painless installations, you can simply download and double-click the .py file linked above.
Once I was done that, which I thought was pretty neat, I decided to see what would happen if I replaced the asteroid belt with a ~0.5 solar mass star. Mars did not survive the experiment. However, the system then settled into a fairly stable system despite Earth's orbit becoming significantly perturbed.
Anyhow, if you'd like to try out my simplistic orbital simulator, you can get version 0.2.0-stable or if you're feeling adventurous, the latest development version (identical, at the time of this posting, but probably not for long)
Installation
You must first install Python if you're running Windows (either Official or ActiveState distribution). If you're not running Windows, you can skip this step as you probably already have Python installed.
Now you need to install PyGame.
Once you've completed these two relatively painless installations, you can simply download and double-click the .py file linked above.
Controls
| Key | Action |
|---|---|
| P | Play / Pause |
| T | Toggle "Trails" |
| C | Clear Trails |
| + | Zoom in |
| - | Zoom out |
| S | Center on Sun |
| E | Center on Earth |
| N | Center on next object |
Caveats
- Due to laziness, everything is rendered and calculated in a 2D plane. Realistically, the planets in the solar system (except Pluto) are nearly on a plane anyway, so this doesn't make a tremendous amount of difference, however, it will likely make modelling anything other than the solar system problematic.
- Accuracy is probably not extreme:
- The software uses calculations from Newton's Universal Law of Gravitation which is known to be inexact, it makes no effort to include any of the effects of relativity.
- Little effort is made to coerce numbers into the range of maximum accuracy for floating point calculations, and standard 8-byte python/IEEE floats are used which are notoriously inaccurate for calculations on this scale.
- The gravitational calculations are based on a point-source model. All objects in the system are zero-volume point sources of gravitation. I have not even used the oblate ellipsoids they are often approximated as.
- Moons are not included, because they are too close to their planets to be visible without extensive zooming and they have limited effect on solar orbits.
- All smaller objects, rings, asteroid belts, etc have been callously disregarded.
- The vector math can become buggy in two situations: When the direction is nearly 0 degrees or nearly 180 degrees; or when very very large accelerations come into play, for example when two objects are about to collide (but cannot, because they are points and have zero volume)
Link | Add a comment
