Week 4: September 21 - 25
Mayfly Model
We continue our exploration of the "Mayfly model", paying particular attention to the long-term behavior of the system.
Machine Arithmetic
Although mathematics deals with real numbers of infinite precision, these numbers must be represented in a computer using a finite number of digits. We examine ways in which this can be done effectively, and some of the problems and issues that arise in doing so.
Week 4 Notebook
IPython Notebook
- IPython "magics": %timeit and %%timeit
Python
- List comprehensions
- len
- More plotting options
NumPy
NumPy is the standard package for numerical computing in Python. It uses a new container for numerical data - the ndarray - that supports fast and efficient computation. NumPy also defines routines for accessing and manipulating these arrays.
- Array creation
- Array operations
- Vectorization
- Multi-dimensional arrays
- Array indexing and slicing
Quiz 3
- xrange
- break
- continue
- pow
- Labeling plots
Sample Quiz 3
Assignment 3: Mayfly Model Exploration
Activity:
- Explore the behavior of the system for different "b" values, including both the transient and the asymptotic behavior.
- Generate a picture of the asymptotic behavior for a large number of "b" values.
- What is the repertoire of asymptotic dynamics? Is this what you would expect?
Tools:
- Use plot to examine the transient behaviour of the model.
- Use the "alpha" value option to plot to display the asymptotic behavior with semi-transparent points.
- Use vectorization with NumPy arrays to explore different "b" values without using Python loops.