Skip to content

Alex2262/CelestialBodies

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

An N-body celestial body simulator

This is an N-body simulator using python and Numba for JIT compilation to optimize certain bottlenecks (e.g. in force calculations).

This project was inspired by the problem discussed in the novel Three Body Problem by Liu Cixin. The three body problem has been proven to have no general, closed form solution. While a series solution exists, it is slow to converge; thus, inspiring me to create a simulation.

The asymptotic Barnes-Hut algorithm with time complexity O(N log N) is implemented; however, it is quite slow due to python's limited speed in calculations.

The PyGame library is used for the GUI.

Three Body Problem simulation:

Screenshot 2024-10-10 at 8 33 06 PM Screenshot 2024-10-10 at 8 35 48 PM

A visualization of 50,000 objects in simulation:

Screenshot 2024-10-30 at 5 43 33 PM

A visualization of the Barnes-Hut Algorithm in action:

Screenshot 2025-08-27 at 4 30 15 PM

About

An N-body celestial simulator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages