MP468 - Computational Physics

Autumn of 2020   [semester 1 of 2020-2021]

Lecturer:   Masud Haque   (

Lectures and Tutorials

Lecture schedule:   (1) Thursdays 12-1, lecture   (2) Thursdays 2-4, lab


Assignment 10.   Due: Wednesday December 9th.

Assignment 09.   Due: Wednesday December 2nd.

Assignment 08.   Due: Wednesday November 25th.
Discussion/ hints on Assignment 08.

Assignment 07.   Due: Wednesday November 18th.
Discussion/ hints on Assignment 07.

Assignment 06.   Due: Wednesday November 11th.
Discussion/ hints on Assignment 06.

Assignment 05.   Due: Wednesday November 4th.

Assignment 04.   Due: Friday October 23rd.

Assignment 03.   Due: Friday October 16th.

Assignment 02.   Due: Friday October 9th.

Assignment 01.   Due Friday October 2nd.

Lecture Slides

Lecture slides 00.

Lecture slides 01.

Lecture slides 02.

Lecture slides 03.

Lecture slides 04.

Lecture slides 05.

Lecture slides 06.

Lecture slides 07.

Lecture slides 08.

Lecture slides 09.

Problem collections

These collections of problems should give you a sense of what you are expected to have learned.

Problem collection 01:   on random numbers, Monte Carlo methods, and using Monte Carlo for statistical physics problems.

Problem collection 02:   on optimization algorithms.

Problem collection 03:   on ODEs and linear systems (matrices).

Problem collection 04:   on PDE's and Fourier methods.

Previous exam solutions

Some previous exam solutions below.
The lectures, assignments, and problem collections should provide orientation for the topics to be addressed in the 2021 exam. (Some topics might be different from previous years.)

MP468C 2018 exam with solutions.

MP468C 2019 January exam with solutions.

MP468C 2019 Repeat exam with solutions.

Lab Exercises

Lab 10 problems
for the virtual lab on 10th December.

Lab 09: For the virtual lab on 3rd December: Explore and understand this program implementing the forward-time-centered-space (FTCS) scheme for the diffusion equation.
Use it for dt=0.0012 and dt=0.0013 to see if you can observe the onset of instability.

Lab 08 problems
for the virtual lab on 26th November.

Feedback on lab 07, solving ODE using matrix formulation:
Of course, you have to work out the matrix first, which is not trivial. Trying to write or understand a computer program without first figuring out the discretization into a matrix problem? Unlikely to work.
Here is a sample python program where the matrix is constructed by simply looping through matrix indices.
Here is a another sample program. This is a bit more sophisticated because the matrix is created in sparse format. The nonzero elements and their locations are first collected in three 1D arrays called row, col and data.
Here are plots of the solution for N=10, and for N=50, and also for N=100.

Lab 07 problems
for the virtual lab on 19th November. Submit by moodle.

Lab 06 problems
for the virtual lab on 12th November. Submit by moodle.

Lab 05 problems
for the virtual lab on 5th November. Submit by moodle.

Lab 04 problems
for the virtual lab on 22nd October. Submit by moodle.

Lab 03 problems
for the virtual lab on 15th October. Submit by moodle.

Lab 02 problems
for the virtual lab on 8th October. Submit by moodle.

Some discussion/comments on the Lab 01 problems.

Lab 01 problems
For the lab on 1st October.

John Brennan's notes

John's notes for MP468:   John Brennan has written notes for some part of what used to be covered in this module.

Online external links

Hope some of the following are helpful. Please let me know if any of the links are broken!

Textbooks and other general sources

  1. General texts on Numerical Analysis/ Scientific Programming / Computational techniques:

    There are many, many textbooks covering aspects of numerical techniques. Some are listed or discussed below. Of course, not all topics of MP468C are covered in every textbook.
  2. Python-specific information/texts:
  3. Texts on specific subjects covered in MP468C:

    There are many texts on each of the following topics. In MP468C we can only introduce the basics of each topic, very superficially and very selectively. I list a (random-ish and very limited) selection of texts. Each of these texts covers the topic in far more depth than we can hope for in this module.

Unix/ linux tutorial

Unix tutorial prepared by Jonivar some years ago