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
Resources
Related projects
CSEF · 2005
Simulation and Animation of the n-Body Problem in Two-Bodies
CSEF · 2018
Accuracy of Integration Schemes in Planet Trajectory Simulations
CWSF · 2026
A State-Dependent Hybrid Integrator: Optimizing Computational Efficiency in High-Eccentricity Orbits
ISEF · 2025
Taylor Integration to Model the Dynamics of the Restricted Three-Body Problem
CSEF · 2011
Simulating Incompressible Fluid Flow with the Navier-Stokes Equation
CSEF · 2019
A Novel Analytical Approach to Determining Parameter Derivatives of an Object under Motion Constraints
ISEF · 2017
Dancing with the Stars: Simulating Multi-Star Solar Systems and the Probability of Planetary Ejection
ISEF · 2018
Survival of the Fittest: Using Biological Concepts to Maximize Efficiency
Closest projects by meaning, across every fair and year in the corpus.
Browse more like this
Source: California Science & Engineering Fair public projects