Running the Simulations

    The simulations can be performed using a number of N-body codes but the TREECODE was implemented for these simulations because of its flexability. This code works by looking at forces between particles which are close to each other in more detail than those which are further apart. The figure below illustrates how this would work in one dimension.


    The system of particles is broken down by factors of two until each box at the bottom  contain just one particle each. The forces on any individual particle are then calculated between it and enough boxes to contain all of the particles. The exact boxes which are used depends on the distance between it and the particle in question. For example the particle marked nine would have its force calculated using boxes 10, 8, 4 and 2.
    After calculating the total force on a particle the particle is moved forward one timestep. This process is repeated until the required time has passed.