newtonRaphson(function,
lox,
hix,
xacc)
|
|
Newton-Raphson algorithm for root finding. The
algorithm used is a safe version of Newton-Raphson (see page 366 of
Numerical Recipes in C, 2ed).
- Parameters:
function (callable) - function of one numerical variable that uses only those
operations that are defined for DerivVar objects in the module
Scientific.Functions.FirstDerivatives
lox (float ) - lower limit of the search interval
hix (C[{loat}) - upper limit of the search interval
xacc (float ) - requested absolute precision of the root
- Returns:
float
- a root of function between lox and hix
- Raises:
ValueError - if function(lox) and function(hix) have
the same sign, or if there is no convergence after 500 iterations
|