11 Root finding by trial-and-error
17 Mar 2016An elementary numerical problem is to find the root of an equation
The applications are manifold. For instance, if the function is a derivative of another function then finding a root allows us to find extrema (maxima or mimima) or saddle points (depending on the values of the higher derivatives) of the function .
Trial-and-error root finding methods move along the function graph and, depending on current values, investigate new regions of the function. They continue until they either converge on an answer to a pre-set precision or fail (perhaps after a maximum number of steps). Trial-and-error search is a common technique for cases where analytic solutions are lacking or not practical.
We will study two algorithms: bisection and Newton-Raphson searching.
The Jupyter notebook 11_Root_finding.ipynb contains the lecture notes (which were life-coded). The derivations of the bisection and the Newton-Raphson algorithms (PDF) can be found in the board notes. Skeleton code for in-class problem exercises can be found in the notebook 11_Root_finding-students.ipynb.1
Additional resources:
- Computational Physics: Chapter 7
- 11_Root_finding notebook (PDF)
Footnotes
-
As usual,
git pull
the resources repository to get a local copy of the notebook. Then copy the notebook into your work directory in order to complete the exercises. ↩