Table Of Contents

Previous topic

Computational Physics

Next topic

Phys 420/580 : (Advanced Topics in) Computational Physics

Phys 234 : Introductory Computational Physics

Class Website

The best place for up-to-date information about this course is the class website:

There you will find meeting times for the lectures and labs and a link to pdf versions of the syllabus and schedule. Throughout the term, lecture notes, labs, and assignments will be posted on a regular basis. Announcements, hints, and corrections may also appear from time to time. Be aware that the website includes important instructions that you should read over. It explains how you might obtain one of the recommended texts for free; how to access the computer lab in person or remotely; and what format I use for the midterm, lab test, and final exam.

In order to give you maximum flexibility in how your organize you study schedule, I try to post as much of the course material online as possible and to do so in a timely manner. A warning, though: I do this as a courtesy. In return, I trust that you will not abuse my good will. I still expect students to attend lectures and labs regularly; and I expect not to be punished unfairly in course evaluations because I didn’t, for example, post all of Lecture 19.

Computing platform

This course will emphasize standard open-source tools available under GNU/Linux. Linux is a popular (and free) variant of the Unix operating system that is widely used in the scientific community. Students will be expected to achieve basic proficiency with the BASH shell (including emacs, makefiles), gnuplot, and the GNU Compiler Collection (GCC). The language of instruction will be C++, a version of C that offers a cleaner syntax and that includes object-oriented features and libraries for generic programming. Despite these choices, much of the material we’ll cover will be language- and platform-agnostic.

Goals for the course

Students should leave PHYS 234 able to tackle problems in the physical sciences using computers as a numerical tool. The course emphasizes these skills:

  • fluency in a modern, general-purpose programming language (here, C++)
  • ability to work in a Unix environment
  • familiarity with standard numerical methods
  • some knowledge of how to chose efficient algorithms and data structures
  • an understanding of the limitations of computer arithmetic and how to mitigate against numerical instabilities


Here is a very rough list of topics we might encounter:

  • Introduction to Unix and C++ programming
    • computing environment
      • UNIX shell (bash)
      • GNU compiler collection
      • GNU make
    • g++
      • program, header, and object files
      • compiler flags
      • C preprocessor directives
      • run time vs compile time
    • fundamental data types
      • logical, lexical, integer, and floating-point types
      • type qualifiers
      • internal representations
      • size guarantees
      • casting
      • scope and duration
      • global variables
      • const correctness
    • program structure
      • starting with main
      • comments
      • indenting
      • naming conventions
    • operators
      • arithmetic, logical, bitwise
      • unary, binary, tertiary
      • pre- and post-fix side effects
      • address-of and derefencing
    • objects and functions
      • declaration vs definition
      • prototypes
      • pass-by-value and pass-by-reference semantics
    • control structures
      • branching
      • looping
      • recursion
    • input and output
      • command line arguments
      • streams
      • manipulators
      • file i/o
    • compound data types
      • C arrays
      • C strings
      • enumerations, structures, and unions
      • static vs dynamic memory allocation
      • STL container classes
      • pointers and iterators
    • arrays and matrices
      • row- vs column-major order
      • linear algebra routines
  • Numerical analysis and scientific computation
    • integer representations
      • unsigned binary
      • two’s complement
      • overflow
    • floating-point representations
      • special values
      • denormalization
      • representation error
      • arithmetic operations
      • loss of significance
    • curve fitting
      • interpolation and extrapolation
      • polynomials
      • splines
      • continued fractions
      • Padé approximants
    • least squares
      • pseudo-inverse
      • regression
      • bootstrapping and resampling
    • numerical integration
      • Newton-Cotes
      • Rhomberg integration
      • Gaussian quadrature
      • pseudo-random numbers
      • Monte Carlo integration
    • differentiation
      • finite differences
      • Richardson extrapolation
    • Horner’s scheme
      • polynomial division
      • deflation
      • Cauchy’s bound
    • root finding and extremization
      • Newton-Raphson algorithm
      • secant method
      • steepest-descent strategies
    • iterative solutions
      • self-consistency and convergence
      • basin of attraction
      • sequence transformations and series acceleration
    • ordinary differential equations
      • discretization
      • Euler and Euler-Cromer methods
      • conservation laws
    • Fast Fourier Transforms