HANDS ON for COMPUTATIONAL METHODS IN COSMOLOGY

Klaus Dolag LMU / MPA (Germany) and Alexander Arth LMU (Germany)

Hands On preparation

Before the school, please prepare the the following exercises. Thereby you should learn how to use commands in a unix shell, how to compile and execute a program, how to define variables, functions and structures/classes in C++ and especially prepare a vector class with useful members functions and operator definitions. You should also know how to write out a data file from your code and how to plot the results with gnuplot.

First step: units and acceleration; a first program

Sample code: See here

Second step: gravitational forces; vectors and loops; gnuplot

Sample code: See here

Hands on I: Numerical integration (Euler and Leapfrog

Sample code: See here

Hands on II: Treating N-Body systems

Sample code: See here