{ } Raw JSON

bundles / scipy 1.17.1 / scipy / optimize / _nonlin / Anderson

class

scipy.optimize._nonlin:Anderson

source: /scipy/optimize/_nonlin.py :1033

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)s
alpha : float, optional

Initial guess for the Jacobian is (-1/alpha).

M : float, optional

Number of previous vectors to retain. Defaults to 5.

w0 : float, optional

Regularization 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 equations
def fun(x):
    return [x[0]  + 0.5 * (x[0] - x[1])**3 - 1.0,
            0.5 * (x[1] - x[0])**3 + x[1]]
A solution can be obtained as follows.
from scipy import optimize
sol = optimize.anderson(fun, [0, 0])
sol

See also

root

Interface to root finding algorithms for multivariate functions. See method='anderson' in particular.

Aliases

  • scipy.optimize._nonlin.Anderson