← All projects
Simulation

Cosmological N-body Simulation

Simulating the hierarchical formation of large-scale cosmic structure from Gaussian initial conditions

C++ · Gasoline2 · MUSIC

Project results

This project was completed as part of the Cosmology and Extragalactic Astrophysics course AST4320 at UiO. It numerically simulates the hierarchical formation of cosmological structure, from small initial density fluctuations to the filaments and haloes of the cosmic web. Initial conditions are generated with MUSIC, which uses the linear matter power spectrum to displace particles from a uniform grid according to the Zel'dovich approximation, producing a realisation of the early-Universe density field at high redshift.

The resulting particle distribution is evolved forward in time with the N-body/SPH code Gasoline2, which computes gravitational forces with a tree algorithm and integrates each particle's trajectory under the combined gravitational field of all the others,

$$\ddot{\mathbf{r}}_i = -G\sum_{j \neq i} m_j \frac{\mathbf{r}_i - \mathbf{r}_j}{|\mathbf{r}_i - \mathbf{r}_j|^3}$$

As the simulation runs, overdense regions collapse and merge under their own gravity, building up the hierarchical, filamentary structure characteristic of the cosmic web. The results were analysed in the Press-Schechter formalism.