C201: Numerical Solution of Systems of Nonlinear Equations

Author(s): J.J. Moré, M.Y. Cosnard Library: MATHLIB
Submitter: K.S. Kölbig Submitted: 01.06.1989
Language: Fortran Revised: 01.12.1994

Subroutine subprograms RSNLEQ and DSNLEQ compute a vector tex2html_wrap_inline138 , which approximates an exact solution tex2html_wrap_inline140 of the system of n nonlinear equations with n unknowns

displaymath142

These subroutines incorporate two convergence test, making use of arguments FTOL and XTOL respectively. If tex2html_wrap_inline144 , denotes the result of the current iteration, and tex2html_wrap_inline146 the result of the previous iteration, the calculation is terminated if either of the following tests is successful:

displaymath148

where the maxima are taken over tex2html_wrap_inline150

On computers other than CDC and Cray, only the double-precision version DSNLEQ is available. On CDC and Cray computers, only the single-precision version RSNLEQ is available.

Structure:

SUBROUTINE subprograms
User Entry Names : RSNLEQ, DSNLEQ
Obsolete User Entry Names : SNLEQ tex2html_wrap_inline152 RSNLEQ
Files Referenced : Unit 6
External References: User-supplied SUBROUTINE subprogram

Usage:

For tex2html_wrap_inline154 (type REAL), tex2html_wrap_inline156 (type DOUBLE PRECISION),

    CALL tSNLEQ(N,X,F,FTOL,XTOL,MAXF,IPRT,INFO,SUB,W)
N
(INTEGER) Number n of equations and variables.
X
(type according to t) One-dimensional array of length tex2html_wrap_inline160 N. On entry, tex2html_wrap_inline162 , must contain an estimate to a solution tex2html_wrap_inline164 of the system of equations. On exit, X(i) contains the final estimate to tex2html_wrap_inline166 .
F
(type according to t) One-dimensional array of length tex2html_wrap_inline168 N. On exit, tex2html_wrap_inline170 , contains the final value of the residual tex2html_wrap_inline172 .
FTOL
(type according to t) Accuracy parameter for Test 1.
XTOL
(type according to t) Accuracy parameter for Test 2.
MAXF
(INTEGER) Maximum permitted number of iterations, where each iteration involves N calls to the user-supplied subroutine SUB. The recommended value for MAXF is 50*(N+3).
IPRT
(INTEGER) If tex2html_wrap_inline174 no intermediate results are printed.
If tex2html_wrap_inline176 the values of i and tex2html_wrap_inline178 , are printed after each iteration.
INFO
(INTEGER) On exit, the value of INFO shows the reason why execution was terminated as follows:
0
Unacceptable input arguments ( tex2html_wrap_inline180 or tex2html_wrap_inline182 or tex2html_wrap_inline184 .
1
Test 1 is successful.
2
Test 2 is successful.
3
Test 1 and Test 2 are both successful.
4
Number of iterations is tex2html_wrap_inline186 .
5
Approximate (finite difference) Jacobian matrix is singular
6
Iterations are not making good progress.
7
Iterations are diverging.
8
Iterations are converging, but either (i) XTOL is too small, or (ii) convergence is very slow because the Jacobian is nearly singular near tex2html_wrap_inline188 or because the variables tex2html_wrap_inline190 are badly scaled.
SUB
Name of a user-supplied SUBROUTINE subprogram, declared EXTERNAL in the calling program.
W
(type according to t) Array containing at least N*(N+3) elements required as working-space.

The user-supplied SUBROUTINE subprogram SUB should be of the form

SUBROUTINE SUB(N,X,F,K)
DIMENSION X(*),F(*)
...
Statements which set F(K) equal to the value of tex2html_wrap_inline192 without changing any other element of array F.
...
RETURN
END
where X and F are of type t.

Subroutine SUB should not change the value of the argument K unless the user wants to terminate the execution of tSNLEQ, in which case K should be set equal to a negative integer, whose value will be copied into argument INFO of tSNLEQ before exit.

Method:

A modification of Brent's method as described in Ref. 1.

Error handling:

See description of argument INFO.

Notes:

  1. Whenever possible the equations tex2html_wrap_inline194 should be numbered in order of increasing nonlinearity.
  2. These subroutines do not use any techniques which attempt to obtain global convergence. Convergence may therefore fail to occur if the initial estimate is too far from an exact solution.

This subroutine has been adapted from the Fortran program published in Ref. 2.

References:

  1. J.J. Moré and M.Y. Cosnard, Numerical solution of nonlinear equations, ACM Trans. Math. Software 5 (1979) 64-85.
  2. J.J. Moré and M.Y. Cosnard, Algorithm 554 BRENTM, A FORTRAN subroutine for the numerical solution of systems of nonlinear equations, Collected Algorithms from CACM (1980).
tex2html_wrap_inline196

Michel Goossens Tue Jun 4 20:28:46 METDST 1996