Astronomy 415: Spring 2009

"Computational Astrophysics"

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:       room CSS 2428
    Lectures:    Tuesday and Thursday from 12:30pm to 13:45pm
    First class: Tu Jan 27 
    Last  class: Tu May 12

What's New?

Apr 29: Online course evaluation open Apr 28-May 13 - please participate!
Apr 28: Problem Set #6 posted.
Apr 21: Problem Set #4 solutions posted.
Apr 16: Term project assignment posted.
Apr 14: Problem Set #5 posted.
Apr 14: Problem Set #3 solutions posted.
Mar 31: Problem Set #4 posted.
Mar 31: Problem Set #2 solutions posted.
Mar 12: Problem Set #3 posted It is long, start early!
Feb 19: Problem Set #1 solutions posted.
Feb 19: Problem Set #2 posted.
Feb 19: Intro to C tutorial examples posted.
Feb 05: Problem Set #1 posted.
Feb 03: Survey results posted.

Contact info and Notes

Course Outline

The Syllabus is available in HTML and PDF format.

DateLectureReading (NRiC)Lecture Notes

#1Jan 27Introduction to the course--
#2Jan 29Computer architecture-class02.pdf
#3Feb 03Introduction to UNIXtutorial-
#4Feb 05Introduction to C1.1-1.2, tutorial-
#5Feb 10Introduction to C (cont.)1.1-1.2, tutorial-
#6Feb 12Introduction to visualizationtutorialclass05.pdf
#7Feb 17Data representation1.3class05.pdf
#8Feb 19Linear algebra, part 1 (Gauss-Jordan elimination)2.0-2.3class06.pdf
#9Feb 24Linear algebra, part 2 (LU & SVD decomposition)2.4-2.6class07.pdf
#10Feb 26 Root finding in 1-D9.0-9.1, 9.4, 9.6class08.pdf
#11Mar 03Root finding in multi-D, and numerical differentiation5.7class09.pdf
#12Mar 05Statistics and the K-S test14.0-14.3class10.pdf
#13Mar 10Least-squares fitting15.0-15.2, 15.4-15.5class11.pdf
#14Mar 12Random numbers and cryptography7.0-7.2class12.pdf
-Mar 17no class (Spring break)--
-Mar 19no class (Spring break)--
#15Mar 24Numerical integration7.6, 4.0-4.4, 4.6class13.pdf
#16Mar 26Integration of ODEs, part 1 (IVPs)16.0-16.1class14.pdf
#17Mar 31Integration of ODEs, part 2 (leapfrog)-class15.pdf
#18Apr 02Integration of ODEs, part 3 (stiff ODEs & 2-pt BVPs)16.6, 17.0class16.pdf
#19Apr 07Integration of ODEs, part 4-class17.pdf
#20Apr 09N-body techniques, part 1 -class18.pdf
#21Apr 14N-body techniques, part 2 (PP)19.0, 19.4-19.6class19.pdf
#22Apr 16N-body techniques, part 3 (PM)-class20.pdf
#23Apr 21N-body techniques, part 4 (tree)-class21.pdf
#24Apr 23 Integration of PDEs, part 1 (ell & hyp)19.2class22.pdf
#25Apr 28Integration of PDEs, part 2 (hyp & par)-class23.pdf
#26Apr 30Fluid dynamics, part 1 (eqns)19.3class24.pdf
#27May 05Fluid dynamics, part 2 (methods)-class25.pdf
#28May 07Term project presentation--
#29May 12Term project presentation--
-Not coveredFourier transform, part 1 (intro)12.0-12.1, 19.4class26.pdf
-Not coveredFourier transform, part 2 (FFT)12.2, 13.0-13.2, 13.4class27.pdf
-Not coveredOther topics-class28.pdf


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

Course Grading

There are no exams for this course. Class participation is strongly encouraged.

Class Survey Results

The level of computer and programming competence of the students in this class (measured the first day of class) is good as indicated by the result of the class survey. The survey results are available in HTML and PDF format. I will start the lectures with simple and, for some of you, obvious concepts and finish with more complex and challenging topics that should entertain even the most experienced students in the class.


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.

Problem setDateProblem SetSolutionsExtras
#2Feb 19Mar 5HTML/PDFHTML/PDFdata
#3Mar 12Mar 26HTML/PDFHTML/PDFdata
Term ProjectApr 16May 7HTML/PDF
Alternate Term ProjectApr 16May 7HTML/PDF
#6Apr 28May 5HTML/PDFHTML/PDFmovie


Old Class Notes

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

Useful Links

CUDA link: Nvidia webpage with examples to download

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