Computational Astrophysics

Course content

The course gives an introduction to numerical methods for contemporary computational astrophysics. It covers theory and practice for numerical methods including fluid and particle dynamics, gravitational collapse, and radiative energy transfer. It gives an overview of computational models for microphysical processes, such as cooling, heating, dust dynamics, and astrochemistry. The course exercises introduce and illustrate the methods applying them to concrete examples from astrophysics, and give a “hands-on” feeling for how and in what context they are used. During the course exercises, the students will build a highly modular yet simple core program based on Jupyter notebooks written in python, which includes most of the methods covered in the lectures. The course also touches on technical aspects, such as high performance computing and efficient code development.


MSc Programme in Physics

MSc Programme in Physics with a minor subject

Learning outcome


  • Modeling the dynamics of the interstellar medium, including fluids, magnetic fields, and heating and cooling.
  • Modeling gravitational collapse
  • Solving the radiation transfer equation
  • Using radiative transfer in connection with analysis and modeling of observations
  • Modeling particle dynamics and gas-particle interaction


The student will come to know the fundamental equations that govern astrophysical dynamics, including fluids, magnetic fields, radiative energy transfer and coupled gas-particle interaction, and how to solve them with modern numerical methods. In addition, the student will achieve knowledge of the basic computational techniques used in modern astrophysics including the principles of adaptive mesh refinement techniques and the difference between mesh and particle methods.


The course gives basic competences in numerical modelling, and will establish a foundation for a M.Sc. project based on numerical modelling.

Lectures, exercises and projects work

See Absalon for final course material. The following is an example of expected course literature.


P. Bodenheimer, G. P. Laughlin, M. Rozyczka, T. Plewa, H. W. Yorke: “Numerical Methods in Astrophysics”.  Complemented with lecture notes.

The student is expected to have a basic understanding of astrophysics such as that covered by the Bsc course “The Foundation of Astrophysics”, or equivalently by the courses “Stars and Planets” and “Extragalactic Astrophysics”. It is an advantage to have some programming experience, such as that acquired in “Introduction to Computing for Physicists”. It is recommended but not required that the student has followed an M.Sc. course on theoretical astrophysics.

Academic qualifications equivalent to a BSc degree is recommended.

The course is identical to the discontinued course NFYK14018U Computational Astrophysics: Star and Planet Formation. Therefore you cannot register for NFYK21004U - Computational Astrophysics, if you have already passed NFYK14018U Computational Astrophysics: Star and Planet Formation.
If you are registered with examination attempts in NFYK14018U Computational Astrophysics: Star and Planet Formation without having passed the course, you have to use your last examination attempts to pass the exam in NFYK21004U - Computational Astrophysics. You have a total of three examination attempts.

7,5 ECTS
Type of assessment
Continuous assessment
Written assignment, 4 days
The exam consists of two parts:
The continuous part of the evaluation, wich consists of 2-3 exercises per week, counts for 70% of the final grade. The student must have turned in at least 60% of the weekly exercises.
A written 4-day report (Monday to Thursday) with an oral defense (Friday) counts for 30% of the final grade.
All aids allowed
Marking scale
7-point grading scale
Censorship form
No external censorship
two internal examiners; the course responsible and an internal censor.
Criteria for exam assessment

see learning outcome

Single subject courses (day)

  • Category
  • Hours
  • Lectures
  • 28
  • Preparation
  • 92
  • Theory exercises
  • 28
  • Project work
  • 28
  • Exam
  • 30
  • English
  • 206