RepositoryCHKHong Kong SAR China
alvinng4

alvinng4/grav_sim

N-body gravity simulation library with C and Python API

142stars
7forks
0issues
2views

grav_sim

N-body gravity simulation library with C and Python API

Target Audience:

  • Physics students
  • Anyone interested in N-body simulations

Features:

  • Ten integrators including WHFast and IAS15
  • Barnes-Hut algorithm with linear octree
  • Particle-Mesh method for cosmological structure formation
  • Multiple sample projects

5 steps to N-body simulation

A short course to teach beginners how to write fast and clean N-body gravity simulations code in Python.

Homepage: https://alvinng4.github.io/grav_sim/5_steps_to_n_body_simulation/

Contents

Image Image

Sample projects

Evolving the solar system for 1 million years

Image Image

Asteroid belt animation

Asteroid belt animation 0
Asteroid belt animation 1
Asteroid belt animation 2

Formation of Kirkwood gaps

Kirkwood gaps 1
Kirkwood gaps 2

Galaxy collision

Galaxy collision

Cosmological structure formation

Cosmological structure formation

Feedback and Bugs

If you found any bugs or want to leave some feedback, please feel free to let me know by opening an issue or sending an email to alvinng324(at)gmail.com.

Similar Projects

Discover other similar projects and AI models.

RepositoryPython
Significant-Gravitas/AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

188.2k
Nov 29, 2026
RepositoryC
hannorein/rebound

💫 An open-source multi-purpose N-body code.

1.2k
Nov 30, 2026
RepositoryC
manodeep/Corrfunc

⚡️⚡️⚡️Blazing fast correlation functions on the CPU.

206
Aug 16, 2026
RepositoryC
SWIFTSIM/SWIFT

Modern astrophysics and cosmology particle-based code. Mirror of gitlab developments at https://gitlab.cosma.dur.ac.uk/swift/swiftsim

164
Nov 26, 2026
RepositoryC
obsproject/obs-studio

OBS Studio - Free and open source software for live streaming and screen recording

80.4k
Nov 29, 2026
RepositoryC++
mockingbirdnest/Principia

𝑛-Body and Extended Body Gravitation for Kerbal Space Program

945
Nov 28, 2026
RepositoryPython
lenstronomy/lenstronomy

Multi-purpose lens modeling software package

226
Dec 1, 2026
RepositoryPython
PyAutoLabs/PyAutoLens

PyAutoLens: Open-Source Strong Gravitational Lensing

189
Nov 28, 2026
Repository
nikosarcevic/HEP-ASTRO-COSMO

HEP/Astroparticle/Astrophysics/Cosmology open source packages. Community effort. Physics people, unite!

159
Mar 16, 2026