## MAS212 Scientific Computing and Simulation

Semester 1, 2021/22 | 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:

MAS316 | Mathematical modelling of natural systems |

MAS414 | Mathematical Modelling of Natural Systems |

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

- Python essentials [revision and core language features]
- Working with arrays [numpy, vectorization, broadcasting, and efficiency]
- Presenting data [matplotlib for plots and figures]
- Data analysis and statistics [using pandas]
- Solving ordinary differential equations [using scipy.integrate.solve-ivp]
- Numerical methods for ODEs [implicit and explicit methods]
- Models and curve-fitting [linear regression; linear models; non-linear models]
- Linear systems and stability [Gauss-Jordan elimination; Wilson's polynomial]
- Partial differential equations [the heat equation and the Crank-Nicholson method]
- Animations [with the matplotlib.animation module]

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