Before starting to write your root-finding algorithm to solve nonlinear or even linear problems, take a look at the documentation of the scipy.optimize methods. SciPy contains a collection of scientific computing functions as an extension of Python. Chances are that these open source algorithms might fit into your applications off the shelf.
SciPy implementations in root-finding
Root-finding scalar functions
Some root-finding functions that can be found in the scipy.optimize modules include bisect, newton, brentq, and ridder. Let's set up the examples that we have discussed in the Incremental search section using the implementations by SciPy:
In [ ]:
"""
Documentation at
http://docs.scipy.org...