IGLib
1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
|
Solver for single variable nonlinear exuations by the Newton method. More...
Public Member Functions | |
ZeroFinderNewton (IRealFunction function, double toleranceFunctionValue, int maxIterations, double maxStepSize, double numericalDifferentiationStep) | |
Constructs a new solver for finding zeros of nonlinear functions. More... | |
ZeroFinderNewton (IRealFunction function, double initialGuess, double toleranceFunctionValue, int maxIterations, double maxStepSize, double numericalDifferentiationStep) | |
Constructs a new solver for finding zeros of nonlinear functions. More... | |
ZeroFinderNewton (IRealFunction function, double initialGuess, double toleranceFunctionValue, int maxIterations) | |
Constructs a new solver for finding zeros of nonlinear functions. More... | |
ZeroFinderNewton (IRealFunction function) | |
Constructs a new solver for finding zeros of nonlinear functions. More... | |
ZeroFinderNewton (DlgFunctionValue function, DlgFunctionValue functionDerivative, double toleranceFunctionValue, int maxIterations, double maxStepSize, double numericalDifferentiationStep) | |
Constructs a new solver for finding zeros of nonlinear functions. More... | |
ZeroFinderNewton (DlgFunctionValue function, DlgFunctionValue functionDerivative, double initialGuess, double toleranceFunctionValue, int maxIterations, double maxStepSize, double numericalDifferentiationStep) | |
Constructs a new solver for finding zeros of nonlinear functions. More... | |
ZeroFinderNewton (DlgFunctionValue function, DlgFunctionValue functionDerivative, double initialGuess, double toleranceFunctionValue, int maxIterations) | |
Constructs a new solver for finding zeros of nonlinear functions. More... | |
ZeroFinderNewton (DlgFunctionValue function, DlgFunctionValue functionDerivative) | |
Constructs a new solver for finding zeros of nonlinear functions. More... | |
ZeroFinderNewton (DlgFunctionValue function) | |
Constructs a new solver for finding zeros of nonlinear functions. More... | |
override void | Solve () |
Tries to find problem solution (function zero) by the Newton's method according to settings and solution data. More... | |
![]() | |
ZeroFinderBase (IRealFunction function, double toleranceFunctionValue, int maxIterations, double maxStepSize, double numericalDifferentiationStep) | |
Constructs a new solver for finding zeros of nonlinear functions. More... | |
ZeroFinderBase (IRealFunction function, double initialGuess, double toleranceFunctionValue, int maxIterations, double maxStepSize, double numericalDifferentiationStep) | |
Constructs a new solver for finding zeros of nonlinear functions. More... | |
ZeroFinderBase (IRealFunction function, double initialGuess, double toleranceFunctionValue, int maxIterations) | |
Constructs a new solver for finding zeros of nonlinear functions. More... | |
ZeroFinderBase (IRealFunction function) | |
Constructs a new solver for finding zeros of nonlinear functions. More... | |
ZeroFinderBase (DlgFunctionValue function, DlgFunctionValue functionDerivative, double toleranceFunctionValue, int maxIterations, double maxStepSize, double numericalDifferentiationStep) | |
Constructs a new solver for finding zeros of nonlinear functions. More... | |
ZeroFinderBase (DlgFunctionValue function, DlgFunctionValue functionDerivative, double initialGuess, double toleranceFunctionValue, int maxIterations, double maxStepSize, double numericalDifferentiationStep) | |
Constructs a new solver for finding zeros of nonlinear functions. More... | |
ZeroFinderBase (DlgFunctionValue function, DlgFunctionValue functionDerivative, double initialGuess, double toleranceFunctionValue, int maxIterations) | |
Constructs a new solver for finding zeros of nonlinear functions. More... | |
ZeroFinderBase (DlgFunctionValue function, DlgFunctionValue functionDerivative) | |
Constructs a new solver for finding zeros of nonlinear functions. More... | |
ZeroFinderBase (DlgFunctionValue function) | |
Constructs a new solver for finding zeros of nonlinear functions. More... | |
void | SetFunction (DlgFunctionValue valueDelegate, DlgFunctionValue derivativeDelegate) |
Sets definition of the function whose zeros are searched for. More... | |
virtual double | FunctionValue (double x) |
calculates and returns value of the function whose zeros are searched for at the specified value of independent variable. More... | |
virtual double | FunctionDerivative (double x) |
calculates and returns derivative of the function whose zeros are searched for at the specified value of independent variable. More... | |
virtual double | NumericalFunctionDerivative (double x) |
Calculates and returns numerical derivative of the function whose zero is searched for. More... | |
Protected Attributes | |
int | _maxIterationsNewton = DefaultMaxIterations |
double | _maxStepSizeNewton = DefauleMaxStepSizeNewton |
![]() | |
int | _outputLevel = DefaultOutputLevel |
int | _maxIterations = DefaultMaxIterations |
double | _toleranceFunctionValue = DefaultToleranceFunctionValue |
double | _initialGuess = DefaultInitialGuess |
double | _maxStepSize = DefaultMaxStepSize |
double | _stepReductionFactor = DefaultStepReductionFactor |
int | _maxStepReductions = DefaultMaxStepReductions |
double | _numericalDifferentiationStep = DefaultNumericalDifferentiationStep |
IRealFunction | _function |
int | _numIterations = 0 |
int | _numFunctionEvaluations = 0 |
int | _numDerivativeEvaluations = 0 |
double | _solution = double.NaN |
double | _functionValueInSolution = double.NaN |
bool | _isSolutionObtained = false |
bool | _recordLastFunctionValue = true |
double | _lastFunctionArgument = double.NaN |
Static Protected Attributes | |
static int | _defaultMaxIterationsNewton = 100 |
static double | _defaultMaxStepSizeNewton = 1.0e50 |
![]() | |
static int | _defaultOutputLevel = 0 |
static int | _defaultMaxiIterations = 1000 |
static double | _defaultInitialGuess = 0 |
static double | _defaultToleranceFunctionValue = 1.0e-6 |
static double | _defaultMaxStepSize = double.MaxValue |
static double | _defaultStepReductionFactor = 4.0 |
static int | _defaultMaxStepReductions = 20 |
static double | _defaultNumericalDifferentiationStep = 1.0e-4 |
Properties | |
static int | DefaultMaxIterationsNewton [get, set] |
Default value for the maximal number of iterations for the Newton's method. More... | |
static double | DefauleMaxStepSizeNewton [get, set] |
Default value for the maximal step size in the Newton's method. More... | |
override int | MaxIterations [get, set] |
Maximal number of iterations. More... | |
override double | MaxStepSize [get, set] |
Maximal step size for zefo finding by teh Newton method. More... | |
![]() | |
static int | DefaultOutputLevel [get, set] |
Default output level for nonlinear equation solvers. More... | |
static int | DefaultMaxIterations [get, set] |
Default value for the maximal number of iterations. More... | |
static double | DefaultInitialGuess [get, set] |
Default value for the initial guess in solvers for finding zeros of nonlinear functions. More... | |
static double | DefaultToleranceFunctionValue [get, set] |
Default tolerance on absolute value of the function in solution. More... | |
static double | DefaultMaxStepSize [get, set] |
Default value for maximal step size. More... | |
static double | DefaultStepReductionFactor [get, set] |
Default value for step reduction factor. More... | |
static int | DefaultMaxStepReductions [get, set] |
Default value for maximal number of step reductions. More... | |
static double | DefaultNumericalDifferentiationStep [get, set] |
Default value for the step size for numerical differentiation. More... | |
virtual int | OutputLevel [get, set] |
Level of console output for nonlinear equation solvers. More... | |
virtual int | MaxIterations [get, set] |
Maximal number of iterations. More... | |
virtual double | ToleranceFunctionValue [get, set] |
Tolerance on absolute value of the function in solution. More... | |
double | InitialGuess [get, set] |
Initial guess for finding function zero. More... | |
virtual double | MaxStepSize [get, set] |
Default value maximal step size. More... | |
virtual double | StepReductionFactor [get, set] |
Step reduction factor. More... | |
virtual int | MaxStepReductions [get, set] |
Maximal number of step reductions. More... | |
virtual double | NumericalDifferentiationStep [get, set] |
Step size for numerical differentiation. More... | |
IRealFunction | Function [get, set] |
virtual int | NumIterations [get, protected set] |
Number of iterations performed up to the current point. More... | |
virtual int | NumFunctionEvaluations [get, protected set] |
Number of function evaluations performed by the solution algorithm up to the current point. More... | |
virtual int | NumDerivativeEvaluations [get, protected set] |
Number of function derivative evaluations performed by the solution algorithm up to the current point. More... | |
virtual double | Solution [get, protected set] |
Calculated solution of the problem (i.e. zero of the function whose value is calculated by the FunctionValue method). More... | |
double | FunctionValueInSolution [get, protected set] |
Value of the function whose zero is searched for in the calculated approximate solution. More... | |
bool | IsSolutionObtained [get, protected set] |
Flag specifying whether the problem has been successfully solved. More... | |
Additional Inherited Members | |
![]() | |
static void | ExampleNewton () |
Example where a nonlinear equation equation is solved by a solver class for finding zeros of a function by the Newton's method. More... | |
static void | ExampleNewton (DlgFunctionValue function, DlgFunctionValue functionDerivative) |
Example where a nonlinear equation equation is solved by a solver class for finding zeros of a function by the Newton's method. More... | |
static double | ExampleFunction (double x) |
Example function whose zero is searched for in the example. More... | |
static double | ExampleFunctionDerivative (double x) |
Derivative of the example function whose zero is searched for in the example. More... | |
![]() | |
virtual void | ResetSolutionData () |
Resets output data that contains information about the solution and solution procedure. More... | |
virtual void | ResetProblemDependentData () |
Resets data that is not valid any more when problem changes. More... | |
virtual void | ResetSolutionAndProblemDependentData () |
Resets the following data: More... | |
Solver for single variable nonlinear exuations by the Newton method.
|
inline |
Constructs a new solver for finding zeros of nonlinear functions.
function | Function whose zeros are searched for. May also contain method for derivative calculation. |
toleranceFunctionValue | Tolerance on absolute function value in solution. |
If less or equal to 0 then the default value is taken.
maxIterations | Maximal number of iteratioins. |
If less or equal to 0 then the default value is taken.
maxStepSize | Maximal step size. |
If less or equal to 0 then default value is taken.
numericalDifferentiationStep | Step size for numerical differentiation (when used internally). |
If less or equal to 0 then the default value is used.
|
inline |
Constructs a new solver for finding zeros of nonlinear functions.
function | Function whose zeros are searched for. May also contain method for derivative calculation. |
initialGuess | Initial guess. |
toleranceFunctionValue | Tolerance on absolute function value in solution. |
If less or equal to 0 then the default value is taken.
maxIterations | Maximal number of iteratioins. |
If less or equal to 0 then the default value is taken.
maxStepSize | Maximal step size. |
If less or equal to 0 then default value is taken.
numericalDifferentiationStep | Step size for numerical differentiation (when used internally). |
If less or equal to 0 then the default value is used.
|
inline |
Constructs a new solver for finding zeros of nonlinear functions.
function | Function whose zeros are searched for. May also contain method for derivative calculation. |
initialGuess | Initial guess. |
toleranceFunctionValue | Tolerance on absolute function value in solution. |
If less or equal to 0 then the default value is taken.
maxIterations | Maximal number of iteratioins. |
If less or equal to 0 then the default value is taken.
|
inline |
Constructs a new solver for finding zeros of nonlinear functions.
function | Function whose zeros are searched for. May also contain method for derivative calculation. |
|
inline |
Constructs a new solver for finding zeros of nonlinear functions.
function | Function whose zeros are searched for. |
functionDerivative | Derivative of the function whose zeros are searched for. |
If null then derivatives will be calculated by numerical differentiation when necessary.
toleranceFunctionValue | Tolerance on absolute function value in solution. |
If less or equal to 0 then the default value is taken.
maxIterations | Maximal number of iteratioins. |
If less or equal to 0 then the default value is taken.
maxStepSize | Maximal step size. |
If less or equal to 0 then default value is taken.
numericalDifferentiationStep | Step size for numerical differentiation (when used internally). |
If less or equal to 0 then the default value is used.
|
inline |
Constructs a new solver for finding zeros of nonlinear functions.
function | Function whose zeros are searched for. |
functionDerivative | Derivative of the function whose zeros are searched for. |
If null then derivatives will be calculated by numerical differentiation when necessary.
initialGuess | Initial guess. |
toleranceFunctionValue | Tolerance on absolute function value in solution. |
If less or equal to 0 then the default value is taken.
maxIterations | Maximal number of iteratioins. |
If less or equal to 0 then the default value is taken.
maxStepSize | Maximal step size. |
If less or equal to 0 then default value is taken.
numericalDifferentiationStep | Step size for numerical differentiation (when used internally). |
If less or equal to 0 then the default value is used.
|
inline |
Constructs a new solver for finding zeros of nonlinear functions.
function | Function whose zeros are searched for. |
functionDerivative | Derivative of the function whose zeros are searched for. |
If null then derivatives will be calculated by numerical differentiation when necessary.
initialGuess | Initial guess. |
toleranceFunctionValue | Tolerance on absolute function value in solution. |
If less or equal to 0 then the default value is taken.
maxIterations | Maximal number of iteratioins. |
If less or equal to 0 then the default value is taken.
|
inline |
Constructs a new solver for finding zeros of nonlinear functions.
function | Function whose zeros are searched for. |
functionDerivative | Derivative of the function whose zeros are searched for. |
If null then derivatives will be calculated by numerical differentiation when necessary.
|
inline |
Constructs a new solver for finding zeros of nonlinear functions.
Since function for calculation of function derivatives is not set, derivatives will be calculated numerically if needed.
function | Function whose zeros are searched for. |
|
inlinevirtual |
Tries to find problem solution (function zero) by the Newton's method according to settings and solution data.
Implements IG.Num.ZeroFinderBase.
Referenced by IG.Num.ZeroFinderBase.ExampleNewton().
|
staticprotected |
|
staticprotected |
|
protected |
|
protected |
|
staticgetset |
Default value for the maximal number of iterations for the Newton's method.
Must be greater or equal to 1.
|
staticgetset |
Default value for the maximal step size in the Newton's method.
|
getset |
Maximal number of iterations.
Must be greater or equal to 1.
Default value is defined by the ZeroFinderNewton.DefaultMaxIterationsNewton property.
Referenced by IG.Num.ZeroFinderBase.ExampleNewton().
|
getset |
Maximal step size for zefo finding by teh Newton method.
Must be greater than 0.
Default value is defined by the ZeroFinderNewton.DefauleMaxStepSizeNewton property.
Referenced by IG.Num.ZeroFinderBase.ExampleNewton().