Mathematik  |  Informatik

 

Jerry Schupp, 2004 | Klingnau, AG

 

This project analyzes two methods for simulating an n-body system of gravitationally interacting objects and presents a way to visualize such a system. Additionally, both approaches are combined with a timestep-scaling system to increase accuracy for close encounters. The approaches evaluated in this paper, a direct one and an oct-tree based approach, are judged on accuracy and speed using a self-made simulation with an implementation of their underlying algorithms. Relations between parameters are worked out both theoretically and then tested experimentally, allowing for a theoretically optimal set of parameters to be determined for a given use case.

Introduction

This paper seeks to investigate different previously discovered methods for simulating gravitational n-body systems. The analysis should be based on energy and momentum conservation, especially compared to computation time. The end goal is to determine a method for achieving an accurate simulation within the best possible timeframe and giving a reason for why this method works. This involves comparing different approaches for their efficacy and answering the question: How efficiently can you determine paths through an n-body system?

Methods

Two simulations, one for each approach, were coded from the ground up using Python. This was done to allow for a direct comparison between the two while excluding any other factors that may improve or worsen performance. Data collection was done by taking measurements of the simulation at regular time intervals and evaluating the results in Excel. Subsequently, hypotheses for how simulation parameters such as the timestep size or the estimation threshold would affect energy and momentum conservation as well as computation time were made. To confirm or deny these predictions, data was collected while varying various parameters. Finally, a visualization was also coded in C# using the Unity engine to allow for easier debugging.

Results

The theoretical predictions for the relationships between the parameters were confirmed. In particular, the prediction that the oct-tree simulation, which makes estimations instead of calculating every interaction accurately, can perform more accurately than a direct approach, was also confirmed in a direct head-to-head experimental comparison between the two using a model of the inner solar system with 2’500 asteroids. The paper additionally predicts that this gap in performance would only widen as more bodies are introduced to the simulation. A visualization was made to aid debugging while also allowing laypeople to better understand the behavior of such systems.

Discussion

Although the paper successfully determined the most effective method for determining paths through an n-body system from the selected ones analyzed in the paper, there are still some avenues for improvement of the simulation’s performance. This includes using a faster language than Python and implementing multiprocessing for constant performance improvements.

Conclusions

There is still significant potential in the field of n-body simulations, with both techniques and computing power improving every year. This project could be further expanded by implementing, analyzing, and comparing more complex methods in addition to the ones already discussed to yield more depth.

 

 

Würdigung durch den Experten

Prof. Dr. Julian Adamek

Die Arbeit befasst sich mit zwei grundlegenden Algorithmen zur Lösung von Bewegungsgleichungen in einem Mehrteilchensystem mit Gravitationswechselwirkung. Herr Schupp vergleicht dabei die direkte Summation aller paarweisen Kräfte mit dem effizienteren Oct-Tree Verfahren. Um die jeweilige Arbeitsweise offenzulegen, wurden beide Algorithmen von Hand in Python nachprogrammiert. In verschiedenen Tests wird die Genauigkeit der erzielten Lösung dem jeweiligen Rechenaufwand gegenübergestellt. Dabei wird sehr anschaulich gezeigt, wie intelligente Algorithmen erhebliche Vorteile bringen können.

Prädikat:

gut

 

 

 

Kantonsschule Wettingen
Lehrerin: Dr. Maria Samaras