MAGIC099: Numerical methods in Python

Course details


Autumn 2017
Monday, October 9th to Friday, December 15th


Live lecture hours
Recorded lecture hours
Total advised study hours


11:05 - 11:55



The aim of this course is to introduce the students to the practical application of a relatively wide spectrum of numerical techniques and familiarise the students with numerical coding.
Often in mathematics, it is possible to prove the existence of a solution to a given problem, but it is not possible to "find it". For example, there are general theorems to prove the existence and uniqueness of an initial value problem for an ordinary differential equation. However, it is in general impossible to find an analytical expression for the solution. In cases like these numerical methods can provide an answer, albeit limited: for example, there are numerical procedures (called algorithms) that, given an initial value problem, will compute its solution.
This module is designed to cover four key areas: linear equations, quadratures (i.e. the evaluation of definite integrals) and the solution of Ordinary and Partial Differential Equations.
The nature of the module is eminently practical: we will cover relatively little of the mathematical background of the numerical techniques that we will study. On the other hand students will be required to do a reasonable amount of programming in Python; the assessment will test their ability to code in Matlab or Python and to put into practice the theoretical methods studied at lectures. Computer laboratory sessions are associated to this module and will complement the lectures.

  • The lectures that explain the theory of numerical methods are pre-recorded and the students are required to study them in their own time.
  • There will be one computer lab a week in the MAGIC room where students and lecturer will discuss programming techniques and review each other's codes.
  • Computer lab worksheet will be made available during the course and discussed in the computer lab sessions.
  • Each participating node will be required to install Python on their MAGIC desktop so that students can display their codes to the lecturer. Instructions on how to install Python will be available.
  • The aim of the labs is to be interactive and with all the nodes actively taking part.


The assessment is through coursework:

    (A) One shorter test of Python knowledge
    (B) Two longer coursework assignment to test programming skills and numerical problem solving.
Note that there will be no separate assessment of the theory part of the course.


Basic knowledge of linear algebra (eigenvalues and basis vectors), calculus (Taylor's theorem), and differential equations (notation and manipulation of ordinary and partial DEs).


Linear Systems
Linear systems, direct methods (Gaussian and LU decomposition), indirect methods (Jacobi, Gauss- Seidel).
Polynomial interpolation methods and adaptive methods.
Initial Value for Ordinary Differential Equations
Basic theory, one-step methods (Euler, Runge-Kutta), predictor-corrector methods, multi-step-methods (Adam-Bashforth, Adam-Moulton). Higher order ODEs and systems of ODEs.
Boundary Value Problems for ODEs
Shooting, finite differences.
Partial Differential Equations
Basic theory, simple PDEs (Poisson, Heat, Wave). Finite difference algorithms for parabolic, hyperbolic and elliptic PDEs.
Non-Linear Equations
Bisection method. Contraction mappings and Newton’s method for functions of one or more variables.
Introduction, commands to solve quadratures and integrate ordinary and partial differential equations. Basic programming techniques.


  • IH

    Ian Hawke

    University of Southampton


Follow the link for a book to take you to the relevant Google Book Search page

You may be able to preview the book there and see links to places where you can buy the book. There is also link marked 'Find this book in a library' - this sometimes works well, but not always - you will need to enter your location, but it will be saved after you do that for the first time.


The assessment for this course will be released on Monday 8th January 2018 and is due in by Sunday 21st January 2018 at 23:59.

The assessment will consist of theory and coding questions. You should submit a Python file to complete the coding questions, with the required interpretation information in comments. You should submit a separate file (eg a PDF scan) of your solution to the theory questions.

Please note that you are not registered for assessment on this course.


Only consortium members have access to these files.

Please log in to view course materials.


Please log in to view lecture recordings.