## Week 6: October 5 - 9

### The "Butterfly Effect"

The "butterfly effect" describes systems where a small change in the initial conditions can result in large differences in outcome at a later time. We examine this idea using the "Mayfly model" as an example, exploring circumstances in which nearby trajectories either converge or diverge.

### Linear Least Squares

The problem of finding a straight line which best fits a set of points arises naturally when we studied the "butterfly effect". We explore what a "good fit" means, and how to find one.

### Continuous-Time Dynamical Systems

Differential equations lie at the core of a scientific description of the natural world. We explore ways in which the solutions to such equations can be approximated on a computer.

Week 6 Notebook
### NumPy

### Matplotlib: Logarithmic plots

## Quiz

There will be no quiz this week.

## Assignment 5: The Butterfly Effect

Activity:

- Determine if the mayfly model exhibits a butterfly effect for b = 1.5, b = 4.0 and some other b values of your choice.
- Graph the separation of nearby trajectories on a logarithmic scale against time using
**semilogy**.
- Compute the growth rate of the separation during the time when it is growing exponentially.
- Graph both the separation of nearby trajectories and the ``best fit'' line to this separation on the same graph.

Tools:

- Choose a small initial separation, and decide how many generations to plot based on your results.
- Use the "linear least squares" formula developed in class to compute the slope of the best-fit line on the logarithmic graph. The formula should be implemented from scratch in NumPy.