Numerical Integration - Jingo
The n-body problem
When there are only two bodies in a system, for example the Sun and one
planet, they orbit their common centre of gravity in elliptical orbits as described by Kepler.
It is relatively easy to compute the position of each body along its orbit
at any given time. If
we introduce another planet then it gets more complicated because the
gravitational attraction between the two planets must be taken into account.
This will cause some disruption or 'perturbation' to the normal elliptical
orbits.
Calculating perturbations is a complex mathematical problem, the
"n-body" problem. There are no straightforward equations to describe this
kind of motion. Numerical Integration is an approach to solving this problem
using the "brute force" of computers.
Numerical Integration
Given that we know the positions and velocities of all the bodies in a
celestial system we can predict their future paths with a fair degree of
accuracy.
- Firstly we calculate the gravitational attractions between all the
bodies in their initial positions.
- Then we calculate the movement of each body during a small time step,
taking into account the initial velocities and the effects of the
gravitational attractions.
- This gives us a new set of positions and velocities that can be used
to repeat the process.
- We can repeat the process as many times as we like, forecasting the
positions of the bodies into the furure.
The problem with this approach is that, during the small
time step, the bodies all move relative to each other so that the
gravitational attractions we originally calculated are no longer correct.
This introduces an error during each time step. If we keep the time step
small then the error will be small - but there will be many steps.
Mathematicians have come up with many different methods to
try and minimise the size of the error and the integrator used in this
website includes a number of different methods.
Jingo
The Jingo (Java
INtegration of Gravitational Orbits) program has been developed to help me
understand and test various numerical integration methods. The objective was
to produce an integrator that could display a variety of interesting orbital
behaviours in the Solar System (and beyond). Java was used as the
development language so that the integrator can be delivered from a website.
Details of the mathematics of the calculations will be
published later.
For most of the Solar System examples the integrator uses actual body masses and heliocentric (i.e. relative to
the centre of the Sun) positions and velocities as at 12:00
on 1st Jan 2000. This data is obtained from the
JPL Horizons telnet
service.
Your system must be enabled for Java applets in order to see
the program in action.
Speed
The "integration step" in most of the examples is variable and determined
by the two bodies that have the shortest "close encounter" time. A fairly
short integration step is used to maintain accuracy.
The "display step" determines how often the positions are updated on the
screen. In most examples this can be modified using the speed control. As a
considerable proportion of the computer power is devoted to producing the
screen image, a long display step can be used to achieve quite high speed
integrations. The overall Solar System example will run a 1000 year
integration in about 5 mins on my 2.4Gh machine.
Accuracy
As mentioned above, there is as small error introduced into each integration
time step. The simulations of the Solar System shown here are produced using the
Yoshida 6th Order integration method. The positions of objects
on the screen are correct to within one or two pixels over an integration period
of at least 1000 years. The calculations include the gravitational effects of
all the bodies shown, they
do not account for relativity or solar wind etc.
|