Computational Physics Tutorial

ICTP Autumn College on Plasma Physics, October 2001

Bill Dorland (Imperial College and Univ. of Maryland)
and Greg Hammett (Imperial College and Princeton Plasma Physics Lab)

Main Reference:  Computational Physics Notes by Prof. Angus MacKinnon, Imperial College.

Other useful references:

 ICTP Computer Guide, good collection describing ICTP's excellent computer facilities and software.

Numerical Recipes: The Art of Scientific Computing.  Free online copy of every chapter, enjoyable reading on the history and logic of various algorithms.

Netlib repository of free high-quality numerical software.

Chebyshev and Fourier Spectral Methods, by John P. Boyd.  Excellent description of the best state of the art algorithms.

Attendees at the ICTP have a wide range of backgrounds and computer experience.  Some have primarily done analytic theoretical physics or are rusty on computer skills, while some have written advanced nonlinear plasma simulation codes.  We will try to cover a wide range of topics, starting with some of the fundamentals and including some advanced topics.

Lecture I.  Introduction to numerical methods for ODE's:  Accuracy and stability properties of 1st order Euler, Centered Implicit, Leap Frog, 2cd Order Runge-Kutta.

Project I:  Write a short program to test various algorithms to integrate the equations of motion for a particle gyrating in a constant magnetic field, with and without a drag term.  Try various algorithms, investigating which one conserves energy the best while remaining stable in the presence of drag.  Other extensions of this project in MacKinnon.  Sample programs to start with for this and other projects are accessible on ICTP computers in directory  "/afs/ictp/public/h/hammettg".

Lecture II.   More on ODE's:  Adams-Bashforth algorithm.  Why implicit methods might be difficult to implement (requires inversion of a matrix).  Partially implicit iterative methods.  Why one may want to do centered implicit for wave type problems and off-centered implicit for damping type problems.

Project II:  Extend code of Project I to plot orbits of a particle precessing around a dipole magnetic field (such as particles trapped in the earth's magnetic field).  (For simplicity, use the v_z=0 limit where the particle stays in the (x,y) plane.)  You should be able to show that a second-order method is a hundred times faster than simple first-order Euler for this problem.

Lecture/Demo III:  Demo of Birdsall and Langdon's ES1 Particle code on 2-stream instabilities.

Additional Lectures and Demos in Week III...: Nonlinear PDE's, Spectral methods and dealiasing, Modern programming techniques in Fortran-90, Parallel Programming.