MIN_UNCON_GOLDEN Function
Finds the minimum point of a nonsmooth function of a single variable using the golden section search method.
Usage
result = MIN_UNCON_GOLDEN (fcn, a, b)
Input Parameters
fcn—User-supplied function, f(x), to be minimized. Returns the computed function value at the point x.
x—The point at which the function is evaluated.
a—The lower endpoint of the interval in which the minimum of f is to be located.
b—The upper endpoint of the interval in which the minimum of f is to be located.
Returned Value
result—The approximate minimum point of the function f on the original interval [a,b]. If no value can be computed, NaN is returned.
Input Keywords
Double—If present and nonzero, then double precision is used.
Tol—The allowable length of the final subinterval containing the minimum point. Default: Tol = SQRT(ε), where ε is the machine precision.
Output Keywords
Lower—The lower endpoint of the interval in which the minimum of f is located.
Upper—The upper endpoint of the interval in which the minimum of f is located.
Discussion
The function MIN_UNCON_GOLDEN uses the golden section search technique to compute to the desired accuracy the independent variable value that minimizes a function of one independent variable, where a known finite interval contains the minimum and where the function is unimodal in the same known finite interval.
Let τ = Tol. The number of iterations required to compute the minimizing value to accuracy τ is the greatest integer less than or equal to:
where a and b define the interval and:
The first two test points are v1 and v2 that are defined as:
v1 = a + c(b − a), and v2 = b − c(b − a)
If f(v1) < f(v2), then the minimizing value is in the interval (a, v2). In this case, b v2, v2 v1, and v1 a + c(b a). If f(v1) f(v2), the minimizing value is in (v1, b). In this case, a v1, v1 v2, and v2 b c(b a).
The algorithm continues in an analogous manner where only one new test point is computed at each step. This process continues until the desired accuracy τ is achieved. The point, xmin, producing the minimum value for the current iteration is returned.
Mathematically, the algorithm always produces the minimizing value to the desired accuracy, however, numerical problems may be encountered. If f is too flat in part of the region of interest, the function may appear to be constant to the computer in that region. The user may rectify the problem by relaxing the requirement on τ, modifying (scaling, etc.) the form of f or executing the program in a higher precision.
Remarks
1. On exit from MIN_UNCON_GOLDEN without any error messages, the following conditions hold:
(Upper – Lower)  Tol
Lower xmin and xmin Upper
f(xmin) f(Lower) and f(xmin) f(Upper)
 
2. On exit from MIN_UNCON_GOLDEN with the IMSL_NOT_UNIMODAL error, the following conditions hold:
Lower xmin and xmin Upper
f(xmin) f(Lower) and f(xmin) f(Upper) (only one equality can hold)
Further analysis of the function f is necessary in order to determine whether it is not unimodal in the mathematical sense or whether it appears to be not unimodal to the routine due to rounding errors, in which case the Lower, Upper, and xmin returned may be acceptable.
Example
A minimum point of 3x2 − 2x + 4 is found.
FUNCTION flt_fcn, x
   RETURN, 3.0*x*x - 2.0*x + 4.0
END
 
PRO t_min_uncon_golden
 
   a   = 0.0e0
   b   = 5.0e0
   tol = 1.0e-3
   type = 0
 
   xmin = MIN_UNCON_GOLDEN( "flt_fcn", a, b, Tol=tol, $
                             Lower=lower, Upper=upper, $
                             Double=type) 
 
   fx = flt_fcn(xmin)
 
   interval = [lower,upper]
 
   PRINT,"The minimum is at:", xmin
   PRINT,"The function value is:",fx
   final = "The final interval is: " + $
      "("+STRJOIN(STRING(interval),",")+")"
   PRINT, final
 
END
Output
The minimum is at:    0.333421
The function value is:    3.66667
The final interval is: (   0.333091,    0.333956)
Warning Errors
MATH_TOL_TOO_SMALLTol is too small to be satisfied.
Fatal Errors
MATH_NOT_UNIMODAL—Due to rounding errors, the function does not appear to be unimodal.