
Contents:
Computational simulations are a standard tool in astrophysics. In this
lecture we present basic numerical methods for the simulation of
physical problems based on relevant examples from
astrophysics, exercises in C/C++
and Fortran are included. As Fortran is very common in
astrophysics, this lecture also contains an introduction to Fortran.
This course is part I of the specialization "Computational Astrophysics".
Certificate of attendance:
 without mark, e.g., Master of Astrophysics, module PHY765:
"Topics in Advanced Astrophysics" (this module has in total 12 CP!):
at least 1./3. of the total points of the (weekly) exercises
 with a mark (other Master courses):
small programming project at the end of the semester
Exercises (pdf):
 Exercise 1
Plotting data, number representation
 Exercise 2
Loops, arrays, pointers
 Exercise 3
Numerical error, Makefile, Graphical output
 Exercise 4
Euler method, Twobody problem
 Exercise 5
Aspects of the Kepler problem
 Exercise 6
RungeKutta method, The special threebody problem
 Exercise 7
Numerical integration, LaneEmden equation
 Exercise 8
Roots, interpolation
 Exercise 9
Probability distributions, elastic neutron scattering
 Exercise 10
Inelastic neutron scattering, MC integration, random walk, tests
for randomness
 Exercise 11
MC and Parallelization techniques
newton_omp.tgz
 Exercise 12
Fortran  Introduction
 Exercise 13
Fortran  Linear Algebra
 Exercise 14
Fortran  Applications
(Bonus points)


Lectures (pdf):

Introduction  Working with Unix/Linux
(2.0 MB)
Introduction (script)

gnuplot (249 kB)

FYI: Brief intro to LaTeX (1.4 MB)

Review C/C++ (568 kB, 07.05.2020)

Errors, libraries, make, X11 (410 kB)

The twobody problem (366 kB, 10.06.2020)

The threebody problem and integration of
the Newtonian equations of motion
(2.5 MB, 28.05.2020)

Finding roots, interpolation
(982 kB, 18.06.2020)

Boundary value problems, Numerical Integration and Differentiation
(347 kB, 17.06.2020)

Application ODE: The LaneEmden equation
(309 kB, 04.06.2020)

MonteCarlo simulations
(362 kB)

MC integration, random walks, tests for
randomness (810 kB, 25.06.2020)

Techniques of
parallelization, OpenMP
(381 kB)

Introduction to Fortran
(7.6 MB, 23.07.2020)

Linear Algebra

Insert: data analysis
(679 kB)

All slides (8.2 MB)
