An Adaptive Nonlinear Least-Squares Algorithm

NL2SOL is a FORTRAN77 library which implements an adaptive nonlinear least-squares algorithm, by John Dennis, David Gay, Roy Welsch.

NL2SOL assumes that there are NVAR variables X, and MEQN nonlinear "residual functions" F(X), and that the task is to find a solution X which minimizes the Euclidean norm of ||F(X)||.

NL2SOL is ACM TOMS algorithm 573. The original, true, correct version of ACM TOMS 573 is available in the TOMS subdirectory of the NETLIB web site.


NL2SOL is available in a FORTRAN77 version and a FORTRAN90 version.

Related Data and Programs:

BVLS, a FORTRAN90 library which applies least squares methods to solve a linear system for which lower and upper constraints may have been placed on every variable.

COMPASS_SEARCH, a FORTRAN77 library which seeks the minimizer of a scalar function of several variables using compass search, a direct search algorithm that does not use derivatives.

DQED, a FORTRAN90 library which solves constrained least squares problems.

LAWSON, a FORTRAN77 library which contains routines for solving least squares problems and singular value decompositions, by Lawson and Hanson.

MACHINE, a FORTRAN77 library which supplies the value of certain machine arithmetic constants needed by NL2SOL.

MINPACK, a FORTRAN90 library which carries out the least squares minimization of the residual of a set of linear or nonlinear equations.

PRAXIS, a FORTRAN77 library which minimizes a scalar function of several variables.

TEST_OPT, a FORTRAN90 library which defines test problems requiring the minimization of a scalar function of several variables.

TOMS611, a FORTRAN90 library which can be used to seek the minimizer of a scalar functional of multiple variables.


John Dennis, David Gay, Roy Welsch


  1. Kenneth Brown,
    A Quadratically Convergent Newton-like Method Based upon Gaussian Elimination,
    SIAM Journal on Numerical Analysis,
    Volume 6, pages 560-569, 1969.
  2. John Dennis, David Gay, Roy Welsch,
    Algorithm 573:
    An Adaptive Nonlinear Least-Squares Algorithm,
    ACM Transactions on Mathematical Software,
    Volume 7, Number 3, 1981, pages 367-383.
  3. Philip Gill, Walter Murray,
    Algorithms for the Solution of the Non-linear Least-squares Problem,
    SIAM Journal on Numerical Analysis,
    Volume 15, Number 5, pages 977-991, 1978.
  4. Charles Lawson, Richard Hanson,
    Solving Least Squares Problems,

Source Code:

Examples and Tests:

NL2SOL_PRB1 is a simple test.

NL2SOL_PRB2 is an extensive set of tests.

List of Routines:

You can go up one level to the FORTRAN77 source codes.

Last revised on 03 February 2008