|
IDL Analyst Reference Guide: Nonlinear Equations |
|
The IMSL_ZEROSYS function solves a system of n nonlinear equations, fi (x) = 0, using a modified Powell hybrid algorithm.
| Note This routine requires an IDL Analyst license. For more information, contact your ITT Visual Information Solutions sales or technical support representative. |
Result = IMSL_ZEROSYS(f, n [, /DOUBLE] [, ERR_REL=value] [, FNORM=value] [, JACOBIAN=string] [, ITMAX=value] [, XGUESS=array])
An array containing a solution of the system of equations.
Scalar string specifying a user-supplied function to evaluate the system of equations to be solved. The f function accepts one parameter containing the point at which the functions are to be evaluated and returns the computed function values at the given point.
Number of equations to be solved and the number of unknowns.
If present and nonzero, double precision is used.
Stopping criterion. The root is accepted if the relative error between two successive approximations to this root is less than ERR_REL. Default: ERR_REL = SQRT(e), where e is the machine precision.
Scalar with the value f 20 + ... + f 2n–1 at the point x.
Scalar string specifying a user-supplied function to evaluate the x n Jacobian. The function accepts as parameter the point at which the Jacobian is to be evaluated and returns a two-dimensional matrix defined by result (i, j) = ¶fi/¶xj.
Maximum allowable number of iterations. Default: ITMAX = 200.
Array with N components containing the initial estimate of the root. Default: XGUESS = 0.
The IMSL_ZEROSYS function is based on the MINPACK subroutine HYBRDJ, which uses a modification of the hybrid algorithm due to M.J.D. Powell. This algorithm is a variation of Newton's Method, which takes precautions to avoid undesirable large steps or increasing residuals. For further discussion, see Moré et al. (1980).
The following 2 x 2 system of nonlinear equations is solved:
f(x) = x0 + x1 – 3
f(x) = x02 + x12 – 9
.RUN
; Define the system through the function f.
FUNCTION f, x
RETURN, [x(0)+x(1)-3, x(0)^2+x(1)^2-9]
END
PM, IMSL_ZEROSYS('f', 2), $
Title = 'Solution of the system:', FORMAT = '(f10.5)'
; Compute the solution and output the results.
Solution of the system:
0.00000
3.00000
MATH_TOO_MANY_FCN_EVALS—Number of function evaluations has exceeded ITMAX. A new initial guess can be tried.
MATH_NO_BETTER_POINT—Keyword ERR_REL is too small. No further improvement in the approximate solution is possible.
MATH_NO_PROGRESS—Iteration has not made good progress. A new initial guess can be tried.
IDL Online Help (March 06, 2007)