BROYDEN function solves a system of
nonlinear equations (where
dimensions using a globally-convergent Broyden's method. The result is an
-element vector containing the solution.
BROYDEN is based on the routine
described in section 9.7 of
Numerical Recipes in C: The Art of Scientific Computing
(Second Edition), published by Cambridge University Press, and is used by permission.
Result = BROYDEN(
-element vector (where
2) containing an initial guess at the solution of the system.
A scalar string specifying the name of a user-supplied IDL function that defines the system of non-linear equations. This function must accept a vector argument
and return a vector result.
For example, suppose we wish to solve the following system:
To represent this system, we define an IDL function named BROYFUNC:
FUNCTION broyfunc, X
RETURN, [3.0 * X - COS(X*X) - 0.5,$
X^2 - 81.0*(X + 0.1)^2 + SIN(X) + 1.06,$
EXP(-X*X) + 20.0 * X + (10.0*!PI - 3.0)/3.0]
BROYDEN calls an internal function named
to determine whether the routine has converged to a local rather than a global minimum (see
, section 9.7). Use the CHECK keyword to specify a named variable which will be set to 1 if the routine has converged to a local minimum or to 0 if not. If the routine does converge to a local minimum, try restarting from a different initial guess to obtain the global minimum.
Set this keyword to force the computation to be done in double-precision arithmetic.
Use this keyword to specify the maximum allowed number of iterations. The default is 200.
Use this keyword to specify the scaled maximum step length allowed in line searches. The default value is 100.0.
Set the convergence criterion on the function values. The default value is 1.0
Set the criterion for deciding whether spurious convergence to a minimum of the function
has occurred. The default value is 1.0
Set the convergence criterion on
. The default value is 1.0
We can use BROYDEN to solve the non-linear system of equations defined by the BROYFUNC function above:
X = [-1.0, 1.0, 2.0]
result = BROYDEN(X, 'BROYFUNC')
0.500000 -1.10731e-07 -0.523599
The exact solution (to eight-decimal accuracy) is [0.5, 0.0, -0.52359877].