Creating a Space Flight Simulator Program

CSEF · 2014 Mathematics & Software Third Award

Overview

Objectives/Goals I wrote a real-time, 3D, interactive space flight simulator program. The biggest challenge was predicting the trajectory of a spacecraft. An existing simulator, Kerbal Space Program, uses "Patched Conic Approximation" to predict the trajectory of a spacecraft. Although Patched Conic Approximation is accurate for two bodies, it uses heuristics to handle three or more bodies. I wanted to see if numerical integration could accurately solve the general n-body problem with efficiency sufficient for a real-time simulator. Methods/Materials I wrote programs using Java, JavaFX 8 and JInput. I experimented with two different integration methods: Forward Euler and Trapezoidal. I also tried two methods for determining the length of the time increment: fixed and variable. The results of these experiments allowed me to optimize the performance of numerical integration. Then, I ran experiments comparing the accuracy of numerical integration against Patched Conic Approximation. Results My first two experiments revealed that Trapezoidal is 12 times more efficient than Forward Euler, and variable time increments are 1,260 times more efficient than fixed ones. My optimized algorithm can compute a trajectory in 6 ms. My final experiment revealed that numerical integration can handle more general n-body configurations with significantly greater accuracy than Patched Conic Approximation. Conclusions/Discussion I conclude that numerical integration is superior to Patched Conic Approximation. Numerical integration is efficient enough for a real-time simulator and can duplicate the accuracy of Patched Conic Approximation for two bodies. It is also more accurate for more general scenarios; it can handle thrust and model three or more bodies.

Summary statement

I wanted to see if Numerical Integration is better than Patched Conic Approximation for computing spacecraft trajectories in a real-time, interactive space flight simulator.

Help received

My Dad knew that numerical integration can be used to solve circuit equations and suggested I try using it to solve the laws of motion.

Awards (1)

Competition history

  • CSEF 2014 Mathematics & Software · Entry J1409

Resources

Related projects

Closest projects by meaning, across every fair and year in the corpus.

Browse more like this

Source: California Science & Engineering Fair public projects

Save projects to your library

Sign in with Google to keep track of projects you find interesting, organized into folders. An account also raises your daily allowance for “Has this been done?”, and lets you create a key for the MCP server with a much higher limit than anonymous use. Browsing stays public.

Continue with Google