Implements the Newton-Raphson method where the initial point, maximum number of iterations and the precision are passed by the user.
0.0001 then the result will be returned to within 0.0001 etc, assuming that a solution to this level of accuracy is found within the maximum number of iterations allowed. A reasonable value to take for this parameter is 0.00001. For smaller values of the precision parameter the solution will be more precise however the procedure will require more iterations and hence time in order to find the solution to the desired level of accuracy. Generally speaking, if when using a precision 0.00001, we require t ms; then using a precision of 0.001, will take 0.6t ms, and using a precision of 0.0000001, will require 1.4t.A solution of the equation set using SetFunction, to the given level of precision required or NaN if the algorithm fails to produce such a solution.
The Newton-Raphson method is the mostly widely used method for finding the roots of an equation of one real variable. The Newton-Raphson approach does not depend on bracketing the solution (unlike the other algorithms provided) and instead will locally approximate the equation by a linear equation and then solve this approximation which will provide the next point within the iterative sequence which will lead to a solution. The successful application of this approach will depend on:
Assuming that an initial starting point x0, from which a solution to an equation
ƒ(x)=0 has been given, the Newton-Raphson method will produce a sequence of points:
x0, x1, ..., xn,..., using the iterative formula:
xn+1 = xn - ƒ(xn) / ƒ'(xn),
where ƒ'(xn) is the derivative of the equation ƒ, evaluated at the point xn.
The idea behind the above formula is to draw the tangent to the curve at xn and then
trace this line down to the x-axis which will give us our next estimate of the solution
xn+1. By repeating this process the resulting sequence of points will converge to
a solution of the equation in question.
The Newton-Raphson method requires that the derivative is evaluated at a sequence of points and therefore often the viability of this approach will depend on how expensive it is to evaluate the derivative for the equation being considered. However, if the derivative is not particularly expensive to evaluate then the Newton-Raphson approach is generally a very efficient approach.
EquationSolver Class | WebCab.Libraries.Math.EquationSolver Namespace | EquationSolver.NewtonRaphson Overload List | Newton-Raphson - Applies the Fail-Safe Newton-Raphson method without the need to provide the initial starting point or maximum number of iterations.