Description
One possible final project – of course, others are acceptable, just check in
with the professor.
Please get the project in by December 18th. If you need more time, you’ll
need to arrange for an extension.
Make a 3-D nbody code that calculates the forces by computing the potential, where the potential is found by convolving the density with the (softened) potential from a single particle. The acceleration is then found by
taking the gradient of the potential. You will probably wish to use a leapfrog
solver with fixed timestep.
Part 1: Using this code, show that a single particle starting at rest
remains motionless.
Part 2: Next, show that a pair of particles placed in a circular orbit
continue to orbit each other, for at least some reasonable length of time.
Part 3: Set up both periodic and non-periodic boundary conditions. Set
up a problem where hundreds of thousands of particles are initially scattered
randomly throughout the domain. Show the evolution with time for both
periodic and non-periodic boundary conditions. Track the total energy –
how well is it conserved?
Part 4: In cosmology, we start the universe with a scale-invariant power
spectrum, so mass fluctuations are proportional to k
−3
. Start with the particles on a grid, but with masses derived from a realization of k
−3 and use
periodic boundary conditions (although not strictly necessary, you may with
to start with your particles in the center of grid cells rather than at the
corners). How does your universe look now?
1