This is the course web page for MAS212 Scientific Computing and
Simulation in 2018/19.
Last year's material is here.
MAS212 is a 10credit, Level 2, firstsemester module which covers various techniques in scientific computing, and their implementation in Python. The course is intended to follow on from MAS115 Mathematical Investigation Skills.
This year I will also use MOLE for some course materials, such as video clips.
We will be using the Anaconda distribution of Python (version 3.6), which includes Jupyter Notebook and Spyder.
Anaconda3 is available on (the majority of) Managed Desktop machines. From the Start Menu, select the folder "Anaconda3 (64bit)".
To install Anaconda on your own computer, use the link below, and choose the Python 3.6 version
There are many books on Python and scientific computing. For this course, I recommend:
A range of material is available on the web, including:
In this course we will use Jupyter notebooks to combine code, text, plots and media. To view a notebook in the browser, click on the links in the left column. (Alternatively, copyandpaste the notebook's URL in to the box at nbviewer.jupyter.org).
To interact and modify a notebook, rightclick on a link in the right column (.ipynb) and download to your Jupyter notebook directory.
Title  Description  notebook 

Fern  The Barnsley Fern: an image of a fern with selfsimilar (fractal) properties, generated by iterating certain affine transformations.  .ipynb 
ODE_Example  Shows how to (a) solve a firstorder singlevariable ODE using scipy.integrate.odeint, and plot; (b) solve a secondorder equation by writing as a pair of firstorder equations; (c) solve predatorprey equations.  .ipynb 
Curve_Fit_Example  Shows how to (a) generate a data set with simulated noise; (b) save and then reload the data; (c) fit the data to a simple model using scipy.optimize.curve_fit().  .ipynb 
Media_Example  Shows how to load and interact with various media: data, images, web pages, YouTube videos and maps.  .ipynb 
Week  Lectures  Computer labs  Solutions 

0  Revise Python for the class test with:    
1  L1: Introducing the course  Lab Class 1: Jupyter Notebook  .html .ipynb 
2  L2: Arrays in numpy The Mandelbrot set: 
Class Test 1 (.ipynb)  Class Test 1 answers (.html) 
3  L3: Plotting  Lab Class 3: matplotlib  .html .ipynb 
4  L4: Ordinary differential equations  Lab Class 4: Solving ODEs with scipy.integrate.odeint()  .html .ipynb 
5  L5: Numerical methods for ODEs  Lab Class 5: Explicit methods for ODEs  .html .ipynb 
6  L6: Implicit methods for ODEs  Lab Class 6: Implicit methods for ODEs  .html .ipynb 
7  Lecture 7: Animations  Lab Class 7: Animations Codes 5 and 6 by J Vanderplas  .html .ipynb 
8 
Lecture 8: Curve fitting.

Lab Class 8: Fitting data  .html .ipynb 
9 
Lecture 9: Linear systems and conditioning. 
Lab Class 9: GaussJordan elimination  .html .ipynb 
10  Lecture 10: The discrete Fourier transform.  Class Test 2 (.ipynb) 
#  Title  Summary  Due  Feedback 

1  Rational approximations  Use Python to find rational approximations to real numbers such as sqrt(2), pi and the golden ratio.  Sun 21st Oct (23:59pm).  
2  Predatorprey equations  An investigation into the behaviour of rabbit and fox populations.  Sun 25th Nov (23:59pm). 
Example report Code: .ipynb .html 
3  Pulsars  In which you will fit a model function to a data set, to examine the profile of the radiowave emission from a rotating neutron star.  Sun 16th Dec (23:59pm). 
To take a test, right click on ".ipynb" link, save the file in your notebooks directory (choose 'All Files' not 'Text Documents'), and then open the notebook using Jupyter Notebook. Read the rubric. Then click on a question and select 'Insert Cell Below'. Change the cell type to 'code' or 'markup', as appropriate. Completed tests will be submitted here.
To view a test, left click on the ".html" link.
2018/19:Description  Links  Due 

(2018) Class Test 2  .ipynb .html  23:59 Sunday 9th Dec 2018 
(2018) Class Test 1 answers  .ipynb .html   
Description  Links 

(2017) Class Test 1 with answers 
.ipynb
.html 
(2017) Class Test 1 
.ipynb
.html 
(2016) Class Test 1 with answers  .ipynb .html Marker's notes 
(2016) Class Test 1  .ipynb 