Namespaces

Types in MathNet.Numerics.RootFinding

Type Broyden

Namespace MathNet.Numerics.RootFinding

Algorithm by Broyden. Implementation inspired by Press, Teukolsky, Vetterling, and Flannery, "Numerical Recipes in C", 2nd edition, Cambridge University Press

Static Functions

Public Static Functions

Double[] FindRoot(Func<Double[], Double[]> f, Double[] initialGuess, double accuracy, int maxIterations, double jacobianStepSize)

Find a solution of the equation f(x)=0.
Parameters
Func<Double[], Double[]> f

The function to find roots from.

Double[] initialGuess

Initial guess of the root.

double accuracy

Desired accuracy. The root will be refined until the accuracy or the maximum number of iterations is reached. Default 1e-8. Must be greater than 0.

int maxIterations

Maximum number of iterations. Default 100.

double jacobianStepSize

Relative step size for calculating the Jacobian matrix at first step. Default 1.0e-4

Return
Double[]

Returns the root with the specified accuracy.

bool TryFindRoot(Func<Double[], Double[]> f, Double[] initialGuess, double accuracy, int maxIterations, Double[]& root)

bool TryFindRootWithJacobianStep(Func<Double[], Double[]> f, Double[] initialGuess, double accuracy, int maxIterations, double jacobianStepSize, Double[]& root)