test_zero
test_zero,
a Python 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 functions, which are accessible by number, are
-
f(x) = sin ( x ) - x / 2.
-
f(x) = 2 * x - exp ( - x ).
-
f(x) = x * exp ( - x ).
-
f(x) = exp ( x ) - 1 / ( 10 * x )^2.
-
f(x) = ( x + 3 ) * ( x - 1 )^2.
-
f(x) = exp ( x ) - 2 - 1 / ( 10 * x )^2 + 2 / ( 100 * x )^3.
-
f(x) = x^3.
-
f(x) = cos ( x ) - x.
-
the Newton Baffler.
-
the Repeller.
-
the Pinhead.
-
Flat Stanley.
-
Lazy Boy.
-
the Camel.
-
a pathological function for Newton's method.
-
Kepler's Equation.
-
f(x) = x^3 - 2*x - 5, Wallis's function.
-
f(x) = (x-1)^7, written term by term.
-
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_rc,
a Python 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 Python code which
calls fsolve() which
seeks the solution x of one or more nonlinear equations f(x)=0.
zero_rc,
a Python code which
seeks solutions of a scalar nonlinear equation f(x) = 0,
or a system of nonlinear equations,
using reverse communication.
Reference:
-
George Donovan, Arnold Miller, Timothy Moreland,
Pathological Functions for Newton's Method,
American Mathematical Monthly, January 1993, pages 53-58.
-
Peter Colwell,
Solving Kepler's Equation Over Three Centuries,
Willmann-Bell, 1993
-
Arnold Krommer, Christoph Ueberhuber,
Numerical Integration on Advanced Systems,
Springer, 1994.
PNG images of the graphs of some of the functions were made using MATLAB:
-
p01_fx.png,
an image of P01_FX(X) over [-4,+4].
-
p02_fx.png,
an image of P02_FX(X) over [-0.5, +3.0].
-
p03_fx.png,
an image of P03_FX(X) over [-0.1,+4].
-
p04_fx.png,
an image of P04_FX(X) over [-4,+2].
-
p05_fx.png,
an image of P05_FX(X) over [-4,+2].
-
p06_fx.png,
an image of P06_FX(X) over [-4,+2].
-
p07_fx.png,
an image of P07_FX(X) over [-1,+1].
-
p08_fx.png,
an image of P08_FX(X) over [-4,+4].
-
p09_fx.png,
an image of P09_FX(X) over [5,7].
-
p10_fx.png,
an image of P10_FX(X) over [-2,+2].
-
p11_fx.png,
an image of P11_FX(X) over [+1,+10].
-
p12_fx.png,
an image of P12_FX(X) over [-0.5,+0.5].
-
p13_fx.png,
an image of P13_FX(X) over [0,100].
-
p14_fx.png,
an image of P14_FX(X) over [-0.5,+2.0].
-
p15_fx.png,
an image of P15_FX(X) over [-4,+4].
-
p16_fx.png,
an image of P16_FX(X) over [0,50].
-
p17_fx.png,
an image of P17_FX(X) over [-2,+4].
-
p18_fx.png,
an image of P18_FX(X) over [0.988,1.012].
-
p19_fx.png,
an image of P19_FX(X) over [0.0,1.0].
Source Code:
Last revised on 02 December 2016.