test_nonlin, a Python code which defines a set of test problems for nonlinear equation system solvers.

A few of the problems are small (2, 3, or 4 equations in 4 unknowns), but most of the problems may be set to any size whatsoever. The software includes routines defining the initial approximation to the solution of the system, the N function values at any point, and the N by N jacobian matrix at any point.

The list of problems includes:

  1. Generalized Rosenbrock function, 1 < N.
  2. Powell singular function, N = 4.
  3. Powell badly scaled function, N = 2.
  4. Wood function, N = 4.
  5. Helical valley function, N = 3.
  6. Watson function, 1 < N.
  7. Chebyquad function, N arbitrary.
  8. Brown almost linear function, N arbitrary.
  9. Discrete boundary value function, N arbitrary.
  10. Discrete integral equation function, N arbitrary.
  11. Trigonometric function, N arbitrary.
  12. Variably dimensioned function, N arbitrary.
  13. Broyden tridiagonal function, N arbitrary.
  14. Broyden banded function, N arbitrary.
  15. Hammarling 2 by 2 matrix square root problem, N = 4.
  16. Hammarling 3 by 3 matrix square root problem, N = 9.
  17. Dennis and Schnabel example, N = 2.
  18. Sample problem 18, N = 2.
  19. Sample problem 19, N = 2.
  20. Scalar problem, N = 1.
  21. Freudenstein-Roth function, N = 2.
  22. Boggs function, N = 2.
  23. Chandrasekhar function, N arbitrary.


The computer code and data files described and made available on this web page are distributed under the MIT license


test_nonlin is available in a FORTRAN90 version and a MATLAB version and an Octave version and a Python version.

Related Data and Programs:

fsolve_test, a Python code which calls fsolve() which seeks the solution x of one or more nonlinear equations f(x)=0.

test_zero, a Python code which implements test problems for the solution of a single nonlinear equation in one variable.


  1. Subramanyan Chandrasekhar,
    Radiative Transfer,
    Dover, 1960,
    ISBN13: 978-0486605906,
    LC: QB461.C46.
  2. John Dennis, David Gay, Phuong Vu,
    A new nonlinear equations test problem,
    Technical Report 83-16,
    Mathematical Sciences Department,
    Rice University, 1983.
  3. John Dennis, Robert Schnabel,
    Numerical Methods for Unconstrained Optimization and Nonlinear Equations,
    SIAM, 1996,
    ISBN13: 978-0-898713-64-0,
    LC: QA402.5.D44.
  4. Noel deVilliers, David Glasser,
    A continuation method for nonlinear regression,
    SIAM Journal on Numerical Analysis,
    Volume 18, Number 6, December 1981, pages 1139-1154.
  5. Chris Fraley,
    Solution of nonlinear least-squares problems,
    Technical Report STAN-CS-1165,
    Computer Science Department,
    Stanford University, 1987.
  6. Chris Fraley, Software performance on nonlinear least-squares problems,
    Technical Report SOL 88-17,
    Systems Optimization Laboratory,
    Department of Operations Research,
    Stanford University, 1988.
  7. JJ McKeown,
    Specialized versus general-purpose algorithms for functions that are sums of squared terms,
    Mathematical Programming,
    Volume 9, 1975, pages 57-68.
  8. JJ McKeown,
    On algorithms for sums of squares problems,
    in Towards Global Optimisation,
    edited by Laurence Dixon, Gabor Szego,
    North-Holland, 1975, pages 229-257,
    ISBN: 0444109552,
    LC: QA402.5.T7.
  9. Jorge More, Burton Garbow, Kenneth Hillstrom,
    Testing unconstrained optimization software,
    ACM Transactions on Mathematical Software,
    Volume 7, Number 1, March 1981, pages 17-41.
  10. Jorge More, Burton Garbow, Kenneth Hillstrom,
    Algorithm 566: FORTRAN Subroutines for Testing unconstrained optimization software,
    ACM Transactions on Mathematical Software,
    Volume 7, Number 1, March 1981, pages 136-140.
  11. James Ortega, Werner Rheinboldt
    Iterative Solution of Nonlinear Equations in Several Variables,
    SIAM, 1987,
    ISBN13: 978-0898714616,
    LC: QA297.8.O77.
  12. Werner Rheinboldt,
    Methods for Solving Systems of Nonlinear Equations,
    SIAM, 1998,
    ISBN: 089871415X,
    LC: QA214.R44.
  13. Douglas Salane,
    A continuation approach for solving large residual nonlinear least squares problems,
    SIAM Journal on Scientific and Statistical Computing,
    Volume 8, Number 4, July 1987, pages 655-671.

Source Code:

Individual test problems:

Last revised on 16 October 2020.