Astro 496

This is the course website for Astro 496, Spring 2018

Assignment 2 - Particle Code

Due: 2018-03-29

This assigment is to build an N-body code that functions in 3D.

Your N-body code should be built in Python, and will need to meet these requirements:


You need to implement integrators that can be toggled by a parameter (specified at runtime) in each of these methods:

Force Calculation

You need to implement force calculation via both:

Background Potentials

You will need to implement background potentials.

Initial Conditions

Your initial conditions files will be in HDF5, and will follow this data format:

  /particle_positions     [Nx3] float64
  /particle_velocities    [Nx3] float64
  /particle_masses        [N]   float64


Your work must include a notebook that demonstrates the particle evolution over time for each of the initial conditions settings that are provided.

Reproducible Research

Following the guidelines outlined in week 4’s lectures, your work must be structured in a manner that enables people to reproduce it and examine it.


Your code must be documented; this does not mean extensive comments, but it does mean that each routine must have a brief outline of what it is doing. You must also provide a notebook or other report that walks through how to utilize the code and what to expect.

You must evaluate the following items: