WebCab Optimization for COM v2.6

UniDimensionalSolver.GlobalExtreme Method 

Seeks the global extreme within an interval of an unidimensional optimization problem with a general object function using information from a user selected set of locate and bracketing algorithms.

public double GlobalExtreme(
   ExtremumTypes extremumType,
   double lowerBound,
   double upperBound,
   int noSubIntervals,
   double tolerance,
   BracketingAlgorithm[] bracketingAlgorithm,
   LocateAlgorithm[] locateAlgorithm,
   int maxIterations
);

Parameters

extremumType
Indicates the type of extreme searched: in the case of a minimum, extremumType == ExtremumTypes.MINIMUM; and in the case of a maximum, extremumType == ExtremumTypes.MAXIMUM.
lowerBound
The coordinate value on the real line of the beginning of the interval over which the global extremum is sought.
upperBound
The coordinate value on the real line of the end of the interval over which the global extremum is sought.
noSubIntervals
The number of intermediate "safety" points to be used, in order to ensure that the advance steps do not get to large. Note that the larger the parameter the less likely we are to miss any local extremum in the search for the global extremum.
tolerance
The tolerance of the result. The actual coordinate value of the extreme will lie in the interval (result - tolerance, result + tolerance). Hence, the value for the tolerance, should reflect the level of accuracy required.
bracketingAlgorithm
The bracketing algorithm used selected from the class BracketingAlgorithm.
locateAlgorithm
The locate algorithm used selected from the class LocateAlgorithm.
maxIterations
The maximum number of iterations which is only used 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 coordinate value of the location of the global extremum within the interval considered of the unidimensional optimization problem considered.

Remarks

Explanation of Approach

This method uses a user defined set of bracketing and locate algorithms from which the "best" point is selected during each iteration in order to improve accuracy in a similar fashion to SeekNextExtreme. However in addition, by varying the noSubIntervals parameter we are able to ensures that the maximum advancing step for each iteration is: (upperBound - lowerBound) / noSubIntervals, where lowerBound and upperBound are the end points of the interval over which the global extremum is sought. These two processes reduce the probability to missing a local extremes which are each candidates of the global extremum being sought within the interval considered which is being sought.

Remark: In addition to this method we also offer the method GlobalExtreme, which is similar in approach to this method except that we have provide a default set of bracketing and locate algorithms which are used at each step.

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 set of bracketing and locate algorithms which are used within this method, by passing as parameters the appropriate procedures from the classs BracketingAlgorithm and LocateAlgorithm.

Finally the initialPoint from which the closest local extremum will be sought within the interval consider, the type of extremum required, the tolerance and the maximum number of iterations used.

Exceptions

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

See Also

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