bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / optimize / _nonlin / Anderson
class
scipy.optimize._nonlin:Anderson
source: build-install/usr/lib/python3.14/site-packages/scipy/optimize/_nonlin.py:1042
Signature
class Anderson(alpha = None, w0 = 0.01, M = 5)Members
Summary
Find a root of a function, using (extended) Anderson mixing.
Extended Summary
The Jacobian is formed by for a 'best' solution in the space spanned by last M vectors. As a result, only a MxM matrix inversions and MxN multiplications are required. [Ey]
Parameters
%(params_basic)salpha: float, optionalInitial guess for the Jacobian is (-1/alpha).
M: float, optionalNumber of previous vectors to retain. Defaults to 5.
w0: float, optionalRegularization parameter for numerical stability. Compared to unity, good values of the order of 0.01.
%(params_extra)s
Examples
The following functions define a system of nonlinear equationsdef fun(x): return [x[0] + 0.5 * (x[0] - x[1])**3 - 1.0, 0.5 * (x[1] - x[0])**3 + x[1]]✓
from scipy import optimize sol = optimize.anderson(fun, [0, 0])✓
sol
✗array([0.84117, 0.15884])
See also
- root
Interface to root finding algorithms for multivariate functions. See
method='anderson'in particular.
Aliases
scipy.optimize._nonlin.Anderson