pererossello / galaxy_with_DM_halo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple N-body Galaxy in NFW DM Halo

Example

Python program for N-body simulation of a galaxy inside a Navarro-Frenk-White potential.

Usage

Main functionality inside modules in main/. Notebooks are exercises relying on those modules for performing simulations. This work is part of an assignment for the subject Numerical Simulation of the master degree in astrophysics at Universidad de La Laguna (ULL).

Structure

  • main/
    • make_ics.py: Module for creating initial conditions. Either read from .txt file or generated from scratch with the galaxy_ics() function.
    • nfw.py: Integration orbits of bodies only considering the NFW potential.
    • nbody_nfw.py: Integration orbits of bodies considering both the NFW potential and N-body interaction.
  • data/: Some example data of N-bodies forming a disk galaxy.
  • figures/: Figures for the assignment. Notebooks contain simulations for the specified exercises.

Dependencies

  • numpy: For math operations.
  • numba: For optimization.
  • matplotlib: For plotting.
  • h5py: For saving simulation output data.
  • PIL: For saving frames.
  • ffmpeg: For rendering animations.

License

This project is licensed under the MIT License.

About

License:MIT License


Languages

Language:Jupyter Notebook 96.3%Language:Python 3.7%