Formally, we find the value of the
real variable x, such that ƒ(x) = 0, to a given level of
precision.
Overview of the class
Below we describe two important factors which will effects algorithm you choose to use
will most likely be effected by the following two factors:
Finding the Bracketing Interval: Each of the algorithms offered (namely Bisection,
Secant, Ridders, Brent,
Regula-Falsi, Newton-Raphson,
and Fail-Safe Newton-Raphson) are offered
in two forms. One where the initial bracketing interval must be given and another where
the initial bracketing interval is not given by the user. For example algorithm if the
bracketing is handled internally then only the desired precision will be required to be
passed, whereas in the alternative version the bracketing interval end-points and the
maximum number of iterations will also need to be passed. In cases where the bracketing
interval cannot be found either by inspection or by the internal algorithms then the Newton-Raphson
approach should be applied since it only requires an initial starting point from which a solution
will be sort.
Expense the Differentiate: Two algorithms namely Newton-Raphson,
and Fail-Safe Newton-Raphson internally differentiate the function
being considered. The evaluation of the derivative can be expensive and hence the viability or these
two approaches over the others with be determined primarily by this factor.
The function is defined in the Function interface located
in the same package. The way to define a function is by implementing the
Function interface and defining the GetValueAt
method, which should return the value at any point x on the real line.
Detailed Description of the Functionality Provided
The functionality provided within this class uses two basic techniques:
Bracketing the solution: The solution is first bracketed and then this interval in iteratively shrunk (by a variety of
procedures) until a solution is found. The algorithms which use this basic technique include: Bisection, Secant, Brent's,
Regula-Falsi, Ridders' and Fail-Safe Newton Raphson.
Linear Approximation: Here we find the local linear approximation of the equation and solve the linear case in order to
provide a better estimate of the solution. The algorithms which use the technique include: Newton-Raphson and the Fail-Safe
Newton-Raphson.
Below we list all the algorithms which are offered within this class:
Bisection Method
Implementations Available
No need to provide a Bracketing Interval: Bisection
Summary: The Bisection approach is very stable in terms of the convergence and the speed at which the convergence takes place.
However, the Bisection method is often slower than the other algorithms provided.
Summary: If the derivative is not particularly expensive to evaluate then the Newton-Raphson approach is generally a very efficient
approach. Moreover, it only requires that an initial starting point is provided and hence does not depend on our ability to bracket a solution.
Summary: If the derivative is not particularly expensive to evaluate then this approach is ideal for those who want
almost the speed of the Newton-Raphson approach with the security of convergence of the Bisection approach.
Using this class
By following the below steps you will be able to set the equation ƒ(x),
which you wish to solve and then select the algorithm which will return a solution:
Setting the Equation to be solved by calling SetFunction
Calling one of the equation solve algorithms to find a solution of the set equation.
For further details on exact how the equation is set we refer the reader to the
documentation of SetFunction. In the following discussion we consider the
differences between the different algorithms which are offer and provide advice to the
user for the select for an appropriate algorithm.