Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 754 Bytes

README.md

File metadata and controls

29 lines (21 loc) · 754 Bytes

N-body-galaxy

A simple particle-mesh code for N-body simulations on galaxy structure and evolution.

main.py: please initialize the particles in this file

params.py: set the basic simulation parameters here

force.py: calculate acceleration and force

Poisson.py: solve the Poisson equation numerically

mass_assign.py: get density field from particle distribution

profiles.py: custom analytical radial profiles of galaxies

Run the code

  1. Create a new folder data in your work path.
    mkdir ./data
    
  2. Run main.py to get particle data in each timestep.
    python main.py
    
  3. Run visualize.py to visualize the results.
    python visualize.py