Represents a root finder based on the Newton-Raphson algorithm.

Namespace: Extreme.Mathematics.EquationSolvers
Assembly: Extreme.Numerics (Extreme.Numerics)

Syntax

Visual Basic (Declaration)
Public NotInheritable Class NewtonRaphsonSolver _
	Inherits EquationSolver
C#
public sealed class NewtonRaphsonSolver : EquationSolver
C++
public ref class NewtonRaphsonSolver sealed : public EquationSolver

Methods

IconTypeDescription
Equals(Object)
Determines whether the specified Object is equal to the current Object.
Finalize()
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
GetHashCode()
Serves as a hash function for a particular type.
GetType()
Gets the Type of the current instance.
IncrementEvaluations()
Increments the number of evaluations by one.
IncrementEvaluations(Int32)
Increments the number of evaluations by the specified amount.
MemberwiseClone()
Creates a shallow copy of the current Object.
SetResultProperties(Object, Double, AlgorithmStatus, Int32)
Sets the results of an algorithm's execution.
SetResultProperties(Object, Double)
Sets the results of an algorithm's execution.
Solve(Double)
Attempts to find a root or zero of the target function.
ThrowException()
Interprets the AlgorithmStatus and throws the appropriate exception.
ToString()
Returns a String that represents the current Object.

Constructors

IconTypeDescription
NewtonRaphsonSolverNew()
Constructs a new NewtonRaphsonSolver object.
NewtonRaphsonSolverNew(RealFunction, RealFunction, Double)
Constructs a new NewtonRaphsonSolver object.
NewtonRaphsonSolverNew(RealFunction, RealFunction, Double, ConvergenceCriterion, Double)
Constructs a new NewtonRaphsonSolver object.

Properties

IconTypeDescription
AbsoluteTolerance
Gets or sets the absolute tolerance used in the convergence test.
ConvergenceCriterion
Gets or sets a value specifying the criterion that is to be used in the convergence test for the algorithm.
DerivativeOfTargetFunction
Gets or sets the derivative of the target function.
EstimatedError
Gets a value indicating the size of the absolute error of the result.
EvaluationsNeeded
Gets the number of evaluations needed to execute the algorithm.
EvaluationsRemaining
Gets the number of evaluations still available.
InitialGuess
Gets or sets the initial value for the Newton-Raphson iteration.
IterationResultCode
Gets the AlgorithmStatus following an execution of the algorithm.
IterationsNeeded
Gets the number of iterations needed by the algorithm to reach the desired accuracy.
IterationsRemaining
Gets the number of iterations remaining.
MaxEvaluations
Gets or sets the maximum number of evaluations during the calculation.
MaxIterations
Gets or sets the maximum number of iterations to use when approximating the roots of the target function.
RelativeTolerance
Gets or sets the relative tolerance used in the convergence test.
Result
Gets the result of an algorithm after it has executed.
Status
Gets the AlgorithmStatus following an execution of the algorithm.
TargetFunction
Gets or sets the target function for the EquationSolver.
ThrowExceptionOnFailure
Gets or sets a value indicating whether to throw an exception when the algorithm fails to converge.

Remarks

The Newton-Raphson algorithm starts from a single starting value. It then uses the derivative of the target function to find successive approximations of the root.

NewtonRaphsonSolver inherits from EquationSolver, which in turn inherits from IterativeAlgorithm. All properties of IterativeAlgorithm are available. The AbsoluteTolerance and RelativeTolerance properties set the desired precision as specified by the ConvergenceCriterion property. The default value for both tolerances is SqrtEpsilon (roughly 10-8). MaxIterations sets the maximum number of iterations.

The TargetFunction property is a RealFunction delegate that specifies the function we want to find a root for. The LowerBound and UpperBound properties specify the bounds of the bracketing interval. The target function must have a different sign at each end of this interval.

The Solve(Double) method performs the actual approximation of the root. This method returns the best approximation that was found. The Status property indicates whether the algorithm was successful. The EstimatedError property gives an upper bound for the difference between the approximated and the actual root.

Inheritance Hierarchy

System.Object
  Extreme.Mathematics.IterativeAlgorithm
    Extreme.Mathematics.EquationSolvers.EquationSolver
      Extreme.Mathematics.EquationSolvers.NewtonRaphsonSolver