Skip to main content Skip to navigation

# CH925 - MatLab Code

A number of numerical methods used for root finding, and solving ordinary differential equations (ODEs) were covered in this module. I found it was useful to try writing out each method to practice working with MatLab. I have uploaded each piece so that others might find the code useful to cannibalise for workshop questions etc. I've tried commenting the code for the most part so that it's easy to follow.

### Introduction to MatLab:

This is a basic introduction to some of the features of MatLab which may be a useful starting point if you have very little experience with it. You can delete the semicolon after statements to view their outputs (this was for the format of the teaching session given to an introductory class).

Introduction: ### Root Finding Methods:

1. Bisection Method: 2. Fixed Point Iteration: 3. Newton-Raphson Method: 4. Secant Method (Newton-Raphson variant): 5. Halley's Method (Newton-Raphson variant): ### Solving ODEs:

1. Euler's Method: 2. Improved Euler's Method: 3. Runge-Kutta Method: 4. Ode45 example, SEIR model: ### Example of creating movies using MatLab:

For the code used to create the standing waves movie, it is found here. 