Course Term: Trinity
Course Overview:

This week-long course aims to teach people to program scientific software rapidly, efficiently and correctly, using the Python programming language. Python has become one of the most popular languages used in industry and government. This is mainly because it combines remarkable expressive power with very clean, simple and compact syntax; a typical Python program is 5-10 times shorter than the equivalent C++, with a corresponding decrease in development and debugging time. These same attributes explain its growing popularity in the scientific computing community. Python's elegance and power permit mathematicians to express the intent of their algorithms succinctly and beautifully.
This course will first introduce the core Python language using simple examples drawn from mathematics and physics, and then discuss some of the ecosystem of scientific libraries that has grown around it. In particular, we will introduce

  • numpy and scipy, which fill a similar niche to MATLAB. The final example of this section will be to develop an efficient vectorised finite difference discretisation of the Laplace equation in a square domain.
  • the FEniCS software, an extremely beautiful and elegant system for developing finite element models. The final example of this section will be to solve a steady PDE-constrained optimisation example in a nontrivial geometry via the derivation and solution of the associated Karush-Kuhn-Tucker system.
Lecturer(s):

Prof. Patrick Farrell