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:
- Bisection Method:
- Fixed Point Iteration:
- Newton-Raphson Method:
- Secant Method (Newton-Raphson variant):
- Halley's Method (Newton-Raphson variant):
Solving ODEs:
Example of creating movies using MatLab:
For the code used to create the standing waves movie, it is found here.