WebCab Optimization for COM v2.6

UniDimensionalSolver.SeekExtremeBidir Method 

Seeks a location of a (local) minimum of a unidimensional object function using user selected bracketing and locate algorithms from BracketingAlgorithm and LocateAlgorithm respectively and starting the iterative search in two directions from a given initial point.

public double SeekExtremeBidir(
   double initialPoint,
   BracketingAlgorithm bracketingAlgorithm,
   LocateAlgorithm locateAlgorithm,
   double minDistance,
   double bracketingParameter,
   double tolerance,
   int maxIterations
);

Parameters

initialPoint
The initial point for which the iterative search from the extremum is started from.
bracketingAlgorithm
The bracketing algorithm used selected from the class BracketingAlgorithm.
locateAlgorithm
The locate algorithm used selected from the class LocateAlgorithm.
minDistance
This parameter is required by all bracketing algorithms within BracketingAlgorithm, and usually signifies the minimal distance between the end points of any bracketed interval in which the extremum lies. Therefore, the minDistance parameter should be approximately the same magnitude as tolerance parameter.
bracketingParameter
This parameter is required by some bracketing algorithms. For a detailed explanation as to its meaning and use for particular bracketing algorithms selected please see the BracketingAlgorithm documentation or the Mathematical Documentation chapter of the accompanying PDF documentation.
tolerance
The tolerance used within the exit condition of the iterative locate algorithm used. A reasonable value to take for the tolerance is 1E-5.
maxIterations
The maximum number of iterations used only in the iterative locate algorithms, in such cases a reasonable value to use is 300. If the number of iterations exceeds this number TooManyUniDimensionalIterationsException will be thrown.

Return Value

the point where the function has a local minimum (it can be greater or less than the initialPoint).

Remarks

Remark: This approach in general will yield more precise results than SeekExtremeUnidir, for corresponding choices of the locate and bracketing algorithms, but will also be slower by a factor of two.

Application of this Approach

Before this method is called the uni-dimensional object function of the optimization problem must be set (i.e. provided for the method) using either {@link #setFunction}, or passed using the constructor during the instantiation of the instance of the UniDimensionalSolver class. For further details, detailing exactly how the object function is implemented and then send to an instance of this class we refer the reader to SetFunction documentation. In is true that most users will find the {@link #setFunction} approach to be more user friendly, however it should be pointed out that if your application uses threads then this approach is not thread safe.

Once the object function has been set you should specify the specific bracketing and locate algorithms which are used within this method, by passing as parameters the appropriate procedure from the classs BracketingAlgorithm and LocateAlgorithm.

The iterative search will begin from the point initialPoint, with the accuracy of the result depending on the algorithms chosen and the algorithms settings corresponding to the last four parameters. The last four parameters do not have a general interpretation but there exact meaning and use should become clear once the bracketing and location algorithms are chosen and we refer the read to the corresponding documentation of the classs BracketingAlgorithm and LocateAlgorithm, or the Mathematical Documentation chapter of the PDF documentation for further details.

Exceptions

Exception TypeCondition
TooManyUniDimensionalIterationsExceptionThrown if the number of iterations in locate algorithms is greater than maxIterations.
InvalidUniDimensionalFunctionExceptionThrown if the user function returns invalid values like infinity or NaN.
UniDimensionalExceptionThrown if you use an algorithm which requires derivable functions but the delivered function does not implement the Derivative interface; also thrown if the delivered function does not implement an interface which extends Function.

See Also

UniDimensionalSolver Class | WebCab.COM.Math.Optimization.UniDimensional Namespace