A Scale Model of the Solar System (original) (raw)
This applet is the obligatory scale model of the solar system. Distance is in AUs, velocity in AUs per hour, mass in units of 1028 pounds, yielding G=1.1716x10-9. Masses and initial positions are accurate to at least 4 digits. The simulation doesn't account for relativity, oblateness of the sun, solar winds, asteroids, galactic gravitational flux, and any number of other things. The numbers in the corner count how many displays have been done and the fractional error in energy conservation. It starts 1am on January 1, 1999. (I had strange masses and a strange value for G for a long time; Frederic Michaud pointed that out in January 2014.)
To start or stop, click. To spin around the sun, click and drag. To rotate and zoom, hold down the shift key, then click and drag. The sun remains in the center; there are no controls to change that, or to change the distance of the observer from the sun.
Here are also some online references for how to build a solar system simulator, a set of stable orbits filling 3-space, a page exploring gravitation with Java, a simulation of Cruithne, and Klemperer rosettes.
The JPL provides the coordinates of all planets now, and at any other time between 1965 and 2050. Thomas Rosin pointed me to it. You need certain settings to get xyz and x'y'z':
Ephemeris Type [change] : | VECTORS |
---|---|
Target Body [change] : | Earth [Geocenter] [399] |
Coordinate Origin [change] : | Solar System Barycenter (SSB) [500@0] |
Time Span [change] : | Start=2020-03-15, Stop=2020-04-14, Step=1 d |
Table Settings [change] : | output units=KM-S; quantities code=2 |
Display/Output [change] : | default (formatted HTML) |
Planet Facts gives lots of facts on the planets (including mass and size).
The Astrophysics Data Systems article server has way more information than I know what to do with, specifically many Astronomy journals online and searchable. You can probably find anything you need just there.
I no longer use the Runge Kutta Fehlberg method to extrapolate the motions of the planets, given their initial position, velocities, and at any given point their acceleration. (Um, Runge Kutta Fehlberg is two Runge Kutta methods of order n and n+1, you evaluate both, and you use the difference between the estimates to decide if your current stepsize is small enough and what your next stepsize should be. The only references I could find were sparsely documented code.)
I use something completely different, a 9th order explicit symmetric multistep method I found. For other methods, see Ernst Hairer's Numerical Integration book . The Verlet method is the simplest and most common for n-body simulation.
I didn't bother with relativity. I suspect the errors inherent in my extrapolations are bigger than the errors due to ignoring relativity, although I haven't confirmed that.
A simulation of a globular cluster
A big number library, for slow high precision floating point arithmetic
Table of Contents