Click or drag to resize
ZerosFunction Class
Finds the real zeros of a real, continuous, univariate function, f(x).
Inheritance Hierarchy
SystemObject
  Imsl.MathZerosFunction

Namespace: Imsl.Math
Assembly: ImslCS (in ImslCS.dll) Version: 6.5.2.0
Syntax
[SerializableAttribute]
public class ZerosFunction

The ZerosFunction type exposes the following members.

Constructors
  NameDescription
Public methodZerosFunction
Creates an instance of the solver.
Top
Methods
  NameDescription
Public methodComputeZeros
Returns the zeros of a univariate function.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodSetBounds
Sets the closed interval in which to search for the roots.
Public methodSetGuess
Sets the initial guess for the zeros.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Properties
  NameDescription
Public propertyAbsoluteError
The second convergence criterion.
Public propertyAllConverged
Returns true if the iterations for all of the roots have converged.
Public propertyError
First convergence criterion.
Public propertyMaxEvaluations
The maximum number of function evaluations allowed.
Public propertyMinimumSeparation
Sets the minimum separation between accepted roots.
Public propertyMullerTolerance
Tolerance used during refinement to determine if Müllers method is started.
Public propertyNumberOfEvaluations
The actual number of function evaluations performed.
Public propertyNumberOfRoots
The requested number of roots to be found.
Public propertyNumberOfRootsFound
Returns the number of zeros found.
Public propertyXScale
Sets the the scaling in the x-coordinate.
Top
Remarks

ZerosFunction computes n real zeros of a real, continuous, univariate function f. The search for the zeros of the function can be limited to a specified interval, or extended over the entire real line. The algorithm is generally more efficient if an interval is specified. The user supplied function, f(x), must return valid results for all values in the specified interval. If no interval is given, the user-supplied function must return valid results for all real numbers.

The function has two convergence criteria. The first criterion accepts a root, x, if

\left| f\left(x\right) \right|\le \tau
where \tau = Error, see property Error.

The second criterion accepts a root if it is known to be inside of an interval of length at most AbsoluteError, see property AbsoluteError.

A root is accepted if it satisfies either criteria and is not within MinimumSeparation of another accepted root, see property MinimumSeparation.

If initial guesses for the roots are given, Müller's method (Müller 1956) is used for each of these guesses. For each guess, the Müller iteration is stopped if the next step would be outside of the bound, if given. The iteration is also stopped if the algorithm cannot make further progress in finding a root.

If no guesses for the zeros were given, or if Müller's method with the guesses did not find the requested number of roots, a meta-algorithm, combining Müller's and Brent's methods, is used. Müller's method is used primarily to find the roots of functions, such as f(x) = x^2, where the function does not cross the y=0 line. Brent's method is used to find other types of roots.

The meta-algorithm successively refines the interval using a one-dimensional Faure low-discrepancy sequence. The Faure sequence may be scaled by setting the bound interval [a,b] using the SetBounds method. The Faure sequence will be scaled from (0,1) to (a,b).

If no bound on the function's domain is given, the entire real line must be searched for roots. In this case the Faure sequence is scaled from (0, 1) to \left( -\infty, +\infty \right) using the mapping

h(u) = \mbox{XScale} \cdot{\tan{(\pi( u - 1/2))}}
where XScale is set by the XScale property.

At each step of the iteration, the next point in the Faure sequence is added to the list of breakpoints defining the subintervals. Call the points x_0=a, x_1=b, x_2, x_3, \ldots. The new point, x_s splits an existing subinterval, [x_p, x_q].

The function is evaluated at x_s. If its value is small enough, specifically if

\left|f\left(x_s\right)\right|\lt \hbox{MullerTolerance}
then Müller's method is used with x_p, x_q and x_s as starting values. If a root is found, it is added to the list of roots. If more roots are required, the new Faure point is used.

If Müller's method did not find a root using the new point, the function value at the point is compared with the function values at the endpoints of the subinterval it divides. If f\left(x_p\right)f\left(x_s\right) \lt 0 and no root has previously been found in [x_p,x_s], then Brent's method is used to find a root in this interval. Similarly, if the function changes sign over the interval [x_s,x_q], and a root has not already been found in the subinterval, Brent's method is used.

See Also

Reference

Other Resources