root_newton#
- named_arrays.optimize.root_newton(function, guess, jacobian=None, max_abs_error=None, max_iterations=100, callback=None)#
Find the root of a given function using Newton’s method
- Parameters:
function (Callable[[InputT], OutputT]) – a scalar-valued or vector-valued function to find the roots of
guess (InputT) – an initial guess for the root
jacobian (None | Callable[[InputT], OutputT]) – The Jacobian of the function (optional). If
None,named_arrays.jacobian()is used.max_abs_error (None | OutputT) – Maximum absolute error between zero and the function value. If the function value at the current root guess is below this value, the root is considered converged.
max_iterations (int) – Maxmimum number of iterations to carry out before a
ValueErroris raised.callback (None | Callable[[int, InputT, OutputT, AbstractArray], None]) – Optional callback function that is called on every iteration as
callback(i, x, f, converged), whereiis the current iteration,xis the current root guess,fis the current function value, andconvergedis an array storing the convergence state for every root being computed.