Home > Extreme Optimization Mathematics Library for .NET > Reference > Extreme.Mathematics.EquationSolvers Namespace


Extreme Optimization Mathematics Library for .NET

DoglegSystemSolver Class

Represents an algorithm that solves a system of nonlinear equations using Powell's dogleg method.

For a list of all members of this type, see DoglegSystemSolver Members.

System.Object
   IterativeAlgorithm
      ManagedIterativeAlgorithm
         EquationSystemSolver
            DoglegSystemSolver

[Visual Basic]
NotInheritable Public Class DoglegSystemSolver
Inherits EquationSystemSolver
[C#]
public sealed class DoglegSystemSolver : EquationSystemSolver

Remarks

Use the DoglegSystemSolver class to solve a system of nonlinear equations. The class uses a variant of Powell's dogleg method to find a solution. This is the method of choice for most problems.

The target functions are set in one of two ways. The TargetFunction property is a FastMultivariateVectorFunction delegate. This is a function that returns a vector containing the values each target function. Alternatively, the SetTargetFunctions method can be used to provide the target functions as an array of MultivariateRealFunction delegates.

Similarly, the gradients of the target functions can be set in two ways. The JacobianFunction property is a FastMultivariateMatrixFunction delegate that calculates the Jacobian of the system of equations. The Jacobian is a matrix whose rows are the gradients of the target functions. Alternatively, the SetGradientFunctions method lets you supply the gradients of individual target functions as an array of either MultivariateVectorFunction or FastMultivariateVectorFunction delegates.

The starting point for the iteration is set through the InitialGuess property. This property must be set to a valid Vector before the algorithm is run. MaxIterations sets the maximum number of iterations, while MaxEvaluations sets the maximum number of function evaluations.

The Solve method performs the actual approximation of the root. This method returns the Vector that is best approximation that was found. The Status property indicates whether the algorithm was successful. One value to look out for is ConvergedToFalseSolution. This occurs when the algorithm converges to a local minimum of the sum of squares of the function valuies.

The algorithm has two convergence tests. By default, the algorithm terminates when either of these is satisfied. You can deactivate either test by setting its Active property to false. If both tests are deactivated, then the algorithm always terminates when the maximum number of iterations or function evaluations is reached.

The first test is based on the uncertainty in the location of the approximate solution. The SolutionTest property returns a VectorConvergenceTest object that allows you to specify the desired Tolerance and specific ConvergenceCriterion. See the VectorConvergenceTest class for details on how to further customize this test.

The second test is based on the value of the target functions at the approximate solution. The ValueTest property returns a VectorConvergenceTest object that can be used to customize the test. By default, the error is set to the component with the largest absolute value.

The method uses derivative information if it is available. If the JacobianFunction property is a null reference (Nothing in Visual Basic), and no gradient functions have been supplied, then numerical derivatives are used. Special techniques are used to keep the number of numerical derivative evaluations down to a minimum. Even though the algorithm without derivatives takes less time per iteration, it usually requires significantly more iterations to find a solution. Except for very large problems, or when the evaluation of derivatives is very expensive, derivative information should be supplied.

The dogleg algorithm works by minimizing the sum of the squares of the target functions. The approximation to the solution is updated in each step by either a Newton step, a steepest descent step, or a combination of both.

This method produces excellent results in most cases. However, because the algorithm is in essence a minimizer, it is possible that the algorithm gets 'stuck' in a local minimum, and converges to a point that is not a solution of the system of equations. The Status property indicates whether an actual solution was found.

Requirements

Namespace: Extreme.Mathematics.EquationSolvers

Assembly: Extreme.Mathematics (in Extreme.Mathematics.dll)

See Also

DoglegSystemSolver Members | Extreme.Mathematics.EquationSolvers Namespace