Astronomy 615: Fall 2015

Computational Astrophysics

Milky Way in CDM and WDM (Polisensky & Ricotti 2011) 

This course will provide the astronomy student with a basic knowledge of numerical methods in astrophysics. By the end of the course students should be comfortable working in a Unix environment, compiling and running codes, and employing a variety of visualization techniques to analyze the results. This process will be motivated by concrete examples of modern problems in astrophysics that demand numerical approaches.

The exact details of the material covered will depend on the existing level of computer sophistication among the class participants. However, in broad outline the major course topics will include linear algebra, root finding, least-square fitting, Monte Carlo methods, numerical integration, N-body methods, fluid dynamics, FFTs and time-series analysis.


    Instructor:  Massimo Ricotti
    Class:       CSS 0201
    Lectures:    Monday and Wednesday from 2:00pm to 3:15pm
    First class: Mon Aug 31
    Last  class: Wed Dec 09

What's New?

Dec 16th: Final - Wed Dec 16th from 10:30am-12:30pm in CSS 0201 - (non-official date agreed upon by all students)
Dec 10: Sample Final exam posted.
Nov 30: Online course evaluation open Nov 30-Dec 13 - please participate.
Nov 18: Problem Set #6 posted (the last one! due Dec 7).
Nov 4: Problem Set #5 posted (due Nov 18).
Oct 26: Problem Set #4 posted (due Nov 4).
Oct 7: Sample Midterm exams posted.
Oct 7: Problem Set #3 posted (due Oct 21).
Sept 23: Problem Set #2 posted (due Oct 5th).
Sept 23: Tutorial on GNU's GDB Debugger and Pointers.
Sep 14: Play with C examples.
Sep 14: Problem Set #1 posted (due Sep 23rd).
Sep 02: Survey result posted.
Aug 31: First class

Contact info and Notes

Course Outline

The Syllabus is available in PDF format.


There are no required textbooks
Numerical recipes in FORTRAN [or in C], by Press, W.H. et al.

Course Grading

Note that the homework is the most important part of the class. However, because this is a graduate class, there will be 2 questions in the qualifyer exam concerning this class. So, midterm and final are a necessary evil to prepare you for the qualifyer. In class participation is strongly encouraged.

Sample of Past Midterm Exams

Sample of Past Final Exams

Class Survey

Survey results


Homework will be assigned every week or every other week. Their due dates will be announced at the time they are assigned. On the due date the students will be expected to turn in their homework in class. The homework turned in will be graded and returned to the students. I will provide solutions and discuss them in class.

Link to Numerical Recipes sources in C and in FORTRAN: it is preferable to compile the recipes as separate files rather than cut and paste the functions into your source code.

Note that in order to use NRiC routines the easiest way is to include nr.h header file and nrutil.c and nrutil.h to use vectors and matrices. You can find these files here.

No homework assigned yet.

DateLectureReading (NRiC)Lecture Notes

#1Aug 31Introduction to the course and survey--
#2Sep 02Computer architectureComputer architectureclass02.pdf
-Sep 07no class Labor Day--
#3Sep 09Introduction to UNIXtutorial-
#4Sep 14Introduction to C1.1-1.2, tutorial-
#5Sep 16Examples in C and debugger 1.1-1.2, tutorialGDB.pdf
#6Sep 21Examples in C and debugger (cont)1.1-1.2, tutorial-
#7Sep 23Data representation1.3class05.pdf/pres05.pdf
#8Sep 28Linear algebra, part 1 (Gauss-Jordan elimination)2.0-2.3class06.pdf/pres06.pdf
#9Sep 30Linear algebra, part 2 (LU & SVD decomposition)2.4-2.6class07.pdf/pres07.pdf
#10Oct 05 Root finding in 1-D9.0-9.1, 9.4, 9.6class08.pdf/pres08.pdf
#11Oct 07Root finding in multi-D, and numerical differentiation5.7class09.pdf/pres09.pdf
#12Oct 12Statistics and the K-S test14.0-14.3class10.pdf/pres10.pdf
--Oct 14MIDTERM----
#13Oct 19Least-squares fitting15.0-15.2, 15.4-15.5class11.pdf/pres11.pdf
#14Oct 21Random numbers and cryptography7.0-7.2class12.pdf/pres12.pdf
#15Oct 26Numerical integration7.6, 4.0-4.4, 4.6class13.pdf/pres13.pdf
#16Oct 28Integration of ODEs, part 1 (IVPs)16.0-16.1class14.pdf/pres14.pdf
#17Nov 02Integration of ODEs, part 2 (leapfrog)-class15.pdf/pres15.pdf
#18Nov 04Integration of ODEs, part 3 (stiff ODEs & 2-pt BVPs)16.6, 17.0class16.pdf/pres16.pdf
#19Nov 09Integration of ODEs, part 4-class17.pdf/pres17.pdf
#20Nov 11N-body techniques, part 1 -class18.pdf/pres18.pdf
#21Nov 16N-body techniques, part 2 (PP)19.0, 19.4-19.6class19.pdf/pres19.pdf
#22Nov 18N-body techniques, cont--
#23Nov 23N-body techniques, part 3 (PM)-class20.pdf/pres20.pdf
#24Nov 25N-body techniques, part 4 (Tree)-class21.pdf/pres21.pdf
#25Nov 30Integration of PDEs, part 1 (ell & hyp) 19.2class22.pdf/pres22.pdf
#26Dec 02 Integration of PDEs, part 2 (hyp & par)19.2class23.pdf/pres23.pdf
#27Dec 07Fluid dynamics, part 1 (eqns)19.3class24.pdf/pres24.pdf
#28Dec 09Fluid dynamics, part 2 (methods)-class25.pdf/pres25.pdf
-Likely not coveredFourier transform, part 2 (FFT)12.2, 13.0-13.2, 13.4class27.pdf
-Likely not coveredOther topics-class28.pdf
--Dec 16FINAL (10:30am-12:30pm)----
Problem setDateProblem SetExtras
#1Sep 14Sep 23HTML/PDF 
#2Sept 23Oct 5HTML/PDF 
#3Oct 7Oct 21HTML/PDFdata
#4Oct 26Nov 4HTML/PDF 
#5Nov 4Nov 18HTML/PDF 
#6Nov 18Dec 7HTML/PDF 


Old Class Notes

    These notes were part of the "first edition" of this course (ASTR688N) in Spring 2001.

Useful Links


Debugger's Links: Using GNU's GDB Debugger Debugging Floating Point Exceptions

OpenMP links: OpenMP Tutorial

Wiki OpenMP

CUDA and GPU computing: Nvidia webpage with examples to download Wiki OpenCL Wiki CUDA

Check out the UMD Astronomy Computing Wiki!

(In the listings below, a "W" link indicates a Wikipedia entry on the topic is available.)

Online Tutorials Free Software General Stuff