Example 1. Find the minimum of the unimodal function  [Graphics:Images/GoldenRatioSearchMod_gr_70.gif]  on the interval  [Graphics:Images/GoldenRatioSearchMod_gr_71.gif].  

Solution 1.

[Graphics:../Images/GoldenRatioSearchMod_gr_72.gif]


[Graphics:../Images/GoldenRatioSearchMod_gr_73.gif]

[Graphics:../Images/GoldenRatioSearchMod_gr_74.gif]

Solution by solving  [Graphics:../Images/GoldenRatioSearchMod_gr_75.gif]

    A root-finding method can be used to determine where the derivative  
[Graphics:../Images/GoldenRatioSearchMod_gr_76.gif]  is zero.

Since  
[Graphics:../Images/GoldenRatioSearchMod_gr_77.gif]  and  [Graphics:../Images/GoldenRatioSearchMod_gr_78.gif]  have opposite signs, by the intermediate value theorem a root of [Graphics:../Images/GoldenRatioSearchMod_gr_79.gif] lies in the interval  [Graphics:../Images/GoldenRatioSearchMod_gr_80.gif].  The results obtained by using the secant method with the initial values  [Graphics:../Images/GoldenRatioSearchMod_gr_81.gif]  and  [Graphics:../Images/GoldenRatioSearchMod_gr_82.gif]  are given by the following computations.  

 

[Graphics:../Images/GoldenRatioSearchMod_gr_83.gif]

[Graphics:../Images/GoldenRatioSearchMod_gr_84.gif]

[Graphics:../Images/GoldenRatioSearchMod_gr_85.gif]

    The conclusion from applying the secant method is that  

        
[Graphics:../Images/GoldenRatioSearchMod_gr_86.gif]

The second derivative is  
[Graphics:../Images/GoldenRatioSearchMod_gr_87.gif]  and we compute  

        
[Graphics:../Images/GoldenRatioSearchMod_gr_88.gif]  

Hence, by the
second derivative test, the local minimum of  [Graphics:../Images/GoldenRatioSearchMod_gr_89.gif]  on the interval [Graphics:../Images/GoldenRatioSearchMod_gr_90.gif] is  

        
[Graphics:../Images/GoldenRatioSearchMod_gr_91.gif]  

 

 

Solution using the golden ratio search for the minimum of  [Graphics:../Images/GoldenRatioSearchMod_gr_92.gif]

Let  
[Graphics:../Images/GoldenRatioSearchMod_gr_93.gif]  and  [Graphics:../Images/GoldenRatioSearchMod_gr_94.gif], and start with the initial interval  [Graphics:../Images/GoldenRatioSearchMod_gr_95.gif].   Formulas (1) and (2) yield

 

[Graphics:../Images/GoldenRatioSearchMod_gr_96.gif]


[Graphics:../Images/GoldenRatioSearchMod_gr_97.gif]

 

 

Since  [Graphics:../Images/GoldenRatioSearchMod_gr_98.gif], the new subinterval is  [Graphics:../Images/GoldenRatioSearchMod_gr_99.gif].  
To continue the iteration we set
[Graphics:../Images/GoldenRatioSearchMod_gr_100.gif], [Graphics:../Images/GoldenRatioSearchMod_gr_101.gif], [Graphics:../Images/GoldenRatioSearchMod_gr_102.gif], and compute [Graphics:../Images/GoldenRatioSearchMod_gr_103.gif].  

 

[Graphics:../Images/GoldenRatioSearchMod_gr_104.gif]



[Graphics:../Images/GoldenRatioSearchMod_gr_105.gif]
[Graphics:../Images/GoldenRatioSearchMod_gr_106.gif]
[Graphics:../Images/GoldenRatioSearchMod_gr_107.gif]
[Graphics:../Images/GoldenRatioSearchMod_gr_108.gif]
[Graphics:../Images/GoldenRatioSearchMod_gr_109.gif]
[Graphics:../Images/GoldenRatioSearchMod_gr_110.gif]
[Graphics:../Images/GoldenRatioSearchMod_gr_111.gif]

Now compute and compare [Graphics:../Images/GoldenRatioSearchMod_gr_112.gif] and [Graphics:../Images/GoldenRatioSearchMod_gr_113.gif] to determine the new subinterval and continue the iteration process.  The list of computations are obtained by using the GoldenSearch subroutine are:  

 

[Graphics:../Images/GoldenRatioSearchMod_gr_114.gif]


[Graphics:../Images/GoldenRatioSearchMod_gr_115.gif]

At the twenty-fifth iteration the interval has been narrowed down to

    
[Graphics:../Images/GoldenRatioSearchMod_gr_116.gif].   

This interval has width  [Graphics:../Images/GoldenRatioSearchMod_gr_117.gif].  

However, the computed function values at the endpoints agree to ten decimal places  

        
[Graphics:../Images/GoldenRatioSearchMod_gr_118.gif]  
        
[Graphics:../Images/GoldenRatioSearchMod_gr_119.gif]  

hence the algorithm is terminated. A difficulty in using search methods is that the function may be "flat" near the minimum, and this limits the accuracy that can be obtained.  The secant method was able to find the more accurate answer

        
[Graphics:../Images/GoldenRatioSearchMod_gr_120.gif]
    and
        [Graphics:../Images/GoldenRatioSearchMod_gr_121.gif]

Although the golden ratio search is the slower in this example, it has desirable feature that it can be applied in cases where [Graphics:../Images/GoldenRatioSearchMod_gr_122.gif] is not differentiable.  

Let us compare these answers with Mathematica's subroutine FindMinimum.

[Graphics:../Images/GoldenRatioSearchMod_gr_123.gif]



[Graphics:../Images/GoldenRatioSearchMod_gr_124.gif]
[Graphics:../Images/GoldenRatioSearchMod_gr_125.gif]
[Graphics:../Images/GoldenRatioSearchMod_gr_126.gif]
[Graphics:../Images/GoldenRatioSearchMod_gr_127.gif]
[Graphics:../Images/GoldenRatioSearchMod_gr_128.gif]

This is close to the values obtained with the golden ratio search.  If more decimal places are needed, we can print them out.

[Graphics:../Images/GoldenRatioSearchMod_gr_129.gif]

[Graphics:../Images/GoldenRatioSearchMod_gr_130.gif]

However, they are not as accurate as those computed with the secant method applied to solving  [Graphics:../Images/GoldenRatioSearchMod_gr_131.gif].

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

(c) John H. Mathews 2004