celeries.mmr.newton#

celeries.mmr.newton(f, x0, jac, max_iter=100, xtol=1e-15, ftol=1e-15, xscale=1, fscale=1, args=())#

Root-finding using a simple Newton method.

Parameters:
ffunction

Function for which we search for the roots.

x0(ndim,) ndarray

Initial guess of the parameters.

jacfunction

Jacobian matrix \(J_{i,j} = \partial f_i / \partial x_j\).

max_iterint

Maximum number of Newton steps.

xtolfloat

Precision on x to consider x-type convergence.

ftolfloat

Precision on f to consider f-type convergence.

xscale(ndim,) ndarray or float

Scaling of the parameters (for x-type convergence). The criterion is \(\forall i\ |\delta x_i * \mathrm{xscale}_i| < \mathrm{xtol}\).

fscale(ndim,) ndarray or float

Scaling of the functions (for f-type convergence). The criterion is \(\forall i\ |\delta f_i * \mathrm{fscale}_i| < \mathrm{ftol}\).

argstuple

Additional arguments to pass to f and jac (should be the same).

Returns:
solNewtonResult

The solution represented as a NewtonResult object.