Mouse Controls

  • - Right clicking changes the Algorithm being used to Integrate.
  • - Left clicking and dragging left and right moves the view from left to right.
  • - Left clciking and draging up and down shifts the Z and Y angles.
  • - Double clicking shifts between speed mode and Graphical mode.
  • - Mouse wheel scrolling zooms the view in and out.

Please note that any output is delivered to the console. If you can click on a planet (!) you can also follow its path by clicking on the Focus button on the information pane (opened by clicking).

Orbits

This Orbits Simulation is part of an ongoing project to create a solar system simulator that models planetary and celestial motions to gain a solution for the path of an asteroid known as Cruithne 3753.

To achieve this it employs numerical integration with an Adaptive Step Size control to allow me to set a maximum error margin for my results. To this end it employs the RK4 Adaptive algorithm to perform the integration.

As this project has to model a very accurate path for potentially thousands of years a key focus is on the efficiency of the code. For example if it were to run for 20000 years, for 3 planets and the sun with 7 calls to the integration method per step - and with a very small step size we are potentially looking at just over 2 billion calls to the integration method. This doesn't take into account the statistics it has to accumulate along the way either!

The efficiency problem is being faced on several fronts, including...

  • Removing as many distance calculations as possible and storing errors as error squared. Distance calculations and cumulative error calculations require square routes which are computationally very expensive. Where unneccesary square routes are being called they have been either removed or simply stored differantly.
  • Careful ordering of the planets removes as many reiterations of the integration algorithm as possible. By listing Cruithne and Mercury before the other Planets, and the Sun after all the planets we can resolve the stepsize within tolerance quickly thus saving power.