## MAS212 Scientific Computing and Simulation

Note: This is an old module occurrence.

You may wish to visit the module list for information on current teaching.

 Semester 1, 2016/17 10 Credits Lecturer: Dr Sam Dolan Home page 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:

 MAS316 Mathematical modelling of natural systems MAS414 Mathematical Modelling of Natural Systems

## Office hours

Mon 16:00 G18 Hicks

## 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

Three assessed courseworks, 90%. Two class tests, 10%.

## Full syllabus

• 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.