test_zero


test_zero, a MATLAB code which defines a number of nonlinear functions.

The nonlinear functions are intended for use in demonstrating or testing zero finder algorithms, that is, programs that seek a root of a scalar equation F(X)=0.

The MATLAB function TEST_ZERO evaluates one of several scalar nonlinear test functions, and has the form:

        function [ fx, fp ] = test_zero ( x )
      
To make use of this function while running MATLAB, you must issue the command
        global IPROB
      
and then set IPROB to a value between 1 and 18 to select a particular problem.

The functions, which are accessible by number, are

  1. f(x) = sin ( x ) - x / 2.
  2. f(x) = 2 * x - exp ( - x ).
  3. f(x) = x * exp ( - x ).
  4. f(x) = exp ( x ) - 1 / ( 10 * x )^2.
  5. f(x) = ( x + 3 ) * ( x - 1 )^2.
  6. f(x) = exp ( x ) - 2 - 1 / ( 10 * x )^2 + 2 / ( 100 * x )^3.
  7. f(x) = x^3.
  8. f(x) = cos ( x ) - x.
  9. the Newton Baffler.
  10. the Repeller.
  11. the Pinhead.
  12. Flat Stanley.
  13. Lazy Boy.
  14. the Camel.
  15. a pathological function for Newton's method.
  16. Kepler's Equation.
  17. f(x) = x^3 - 2*x - 5, Wallis's function.
  18. f(x) = (x-1)^7, written term by term.
  19. f(x) = cos(100*x)-4*erf(30*x-10)

Licensing:

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

Languages:

test_zero is available in a C version and a C++ version and a FORTRAN90 version and a MATLAB version and an Octave version and a Python version.

Related Data and Programs:

bisection_integer, a MATLAB code which seeks an integer solution to the equation f(x)=0, using bisection within a user-supplied change of sign interval [a,b].

bisection_rc, a MATLAB code which seeks a solution to the equation f(x)=0 using bisection within a user-supplied change of sign interval [a,b]. the procedure is written using reverse communication (RC).

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

test_nonlin, a MATLAB code which implements test problems for the solution of systems of nonlinear equations.

test_zero_test

zero_rc, a MATLAB code which seeks solutions of a scalar nonlinear equation f(x) = 0, or a system of nonlinear equations, using reverse communication.

Reference:

  1. George Donovan, Arnold Miller, Timothy Moreland,
    Pathological Functions for Newton's Method,
    American Mathematical Monthly, January 1993, pages 53-58.
  2. Peter Colwell,
    Solving Kepler's Equation Over Three Centuries,
    Willmann-Bell, 1993
  3. Arnold Krommer, Christoph Ueberhuber,
    Numerical Integration on Advanced Systems,
    Springer, 1994.

Source Code:


Last revised on 31 March 2019.