MAS212 Scientific Computing and Simulation

Semester 1, 2020/21 10 Credits
Lecturer: Dr Sam Dolan Timetable Reading List
Aims Outcomes Assessment Full Syllabus

The module further develops the students’ skills in computer programming and independent investigation. The students will learn how to solve algebraic and differential equations using Python. The students will learn basic numerical methods, and methods to visualize and analyse numerical results. The students will apply the knowledge to explore the physical behaviours of model equations.

Prerequisites: MAS115 (Mathematical Investigation Skills)
Corequisites: MAS211 (Advanced Calculus and Linear Algebra); MAS222 (Differential Equations)

The following modules have this module as a prerequisite:

MAS316Mathematical modelling of natural systems
MAS414Mathematical Modelling of Natural Systems


Office hours

1pm - 3pm Tuesdays and Wednesdays. Please book a 15-minute slot using Google Calendar.



Aims

  • To further develop the students’ programming skill in the context of scientific computing;
  • To further develop the students’ independent investigation skills;
  • To introduce the knowledge of scientific computing;
  • To further develop the skills of data analysis.

Learning outcomes

  • To be able to use Python to investigate mathematical problems numerically.
  • To learn basic numerical methods for solving ordinary differential equations and linear algebraic equations.
  • To be able to implement basic numerical methods using Python.
  • To be able to analyse the basic properties of the methods.

10 lectures, no tutorials, 10 practicals

Assessment

Two assessed assignments (35%+45%). Three online tests (5% each). Engagement record (5%). These weightings are provisional and may be revised.

Full syllabus

The module in 2020/21 is being reconfigured for online delivery, and so the syllabus may differ slightly from previous years. The provisional weekly schedule in 2020/21 is:

  1. Python essentials [revision and core language features]
  2. Working with arrays [numpy, vectorization, broadcasting, and efficiency]
  3. Presenting data [matplotlib for plots and figures]
  4. Data analysis and statistics [using pandas]
  5. Solving ordinary differential equations [using scipy.integrate.solve-ivp]
  6. Numerical methods for ODEs [implicit and explicit methods]
  7. Models and curve-fitting [linear regression; linear models; non-linear models]
  8. Linear systems and stability [Gauss-Jordan elimination; Wilson's polynomial]
  9. Partial differential equations [the heat equation and the Crank-Nicholson method]
  10. Animations [with the matplotlib.animation module]
The syllabus in 2019/20 was:
  • Week 1: The Python language. Revision: variables; data types; arithmetic; list construction, comprehension, indexing, slicing & manipulation; for & while loops; control flow (if-elif-else; strings; string formatting.
    Introduction to IPython Notebook: Tab completion, getting help and %magic commands (e.g. %timeit).
  • Week 2: Functions. Modules & scripts. Built-in modules (math, cmath, random, decimal, datetime, io, os). Simple file I/O and string processing. Debugging and testing. Workflow.
  • Week 3: Introduction to numpy. Arrays (initialization, slicing). Basic linear algebra. Efficiency.
    Introduction to matplotlib. Simple plotting.
    Examples: (1) Estimating π by Monte Carlo integration; (2) the logistic map.
  • Week 4: Introduction to scipy. Solving differential equations with odeint. Initial conditions. Time-domain plots. Phase plots. Critical points and limit cycles.
    Examples: (1) Logistic equation; (2) Damped harmonic oscillator; (3) van der Pol oscillator; (4) Predator-prey equations.
  • Week 5: Animation with matplotlib.animation.FuncAnimation. Saving an animation. Examples: (1) The logistic map (again); (2) Driven damped oscillator and resonance.
  • Week 6: Elementary numerical methods: Runge-Kutta and Adams-Bashforth methods. Implementation for initial value problems.
  • Week 7: Error, order and stability of numerical methods.
  • Week 8: Fitting models to data. scipy.optimize.curve_fit. Least-squares method and linear algebra.
  • Week 9: Linear algebra. Gaussian elimination; iterative methods; convergence; condition number.
  • Week 10: Fourier series. Convergence and the Gibbs phenomenon.

Reading list

Type Author(s) Title Library Blackwells Amazon
B Christian Hill Learning Scientific Programming with Python Blackwells Amazon

(A = essential, B = recommended, C = background.)

Most books on reading lists should also be available from the Blackwells shop at Jessop West.

Timetable

Mon 11:00 - 11:50 lecture   Blackboard Online
Thu 14:00 - 14:50 lab session (group A) Blackboard Online
Thu 15:00 - 15:50 lab session (group B) Blackboard Online
Thu 16:00 - 16:50 lab session (group C) Blackboard Online