Transcript Document
Golden Section Method Prepared by Shahrzad Kavianirad Submitted to Prof. Dr. Sahand Daneshvar Outline What is the Golden Section Search intermediate points Golden Ratio Algorithm example Golden Section Method • What is the Golden Section Search method used for and how does it work? 1. 𝑎𝑘 < λ𝑘 < 𝑏𝑘 2. 𝜃(𝑎)𝑘 < 𝜃(λ)𝑘 Unimodal function 3. 𝜃(λ) < 𝜃(𝑏) 𝜽𝒌 𝑘 𝜽(𝝁)𝑘 𝜽(𝒂)𝒌 𝒂𝒌 𝝁𝑘 3. New point 4. 𝑎𝑘 < 𝜇𝑘 < λ𝑘 𝛉(λ)𝒌 5. If𝜃(𝑎)𝑘 < 𝜃(λ)𝑘 new points : 𝑎𝑘 < 𝜇𝑘 < λ𝑘 6. If else new points: 𝜇𝑘 < λ𝑘 < 𝑏𝑘 𝜽(𝒃)𝒌 λ𝒌 𝑘 𝒃𝒌 𝑘 How are the intermediate points in the Golden Section Search determined? • Note that 𝑎 + 𝑏 is equal to the distance between the lower and upper boundary points 𝑎𝑘 and 𝑏𝑘 . 𝑎 𝑏 = 𝑎+𝑏 𝑎 𝜃 𝜃 𝜽(𝝁)𝑘 𝛉(λ)𝒌 𝜽(𝒂)𝒌 𝑏 𝑎−𝑏 = 𝑎 𝑏 𝜽(𝒂)𝒌 𝜽(𝒃)𝒌 𝛉(λ)𝒌 𝜽(𝒃)𝒌 a-b b 𝒂𝒌 𝒃𝒌 λ𝒌 a b 𝑘 𝒂𝒌 𝝁𝑘 a λ𝒌 𝒃𝒌 𝑘 Does the Golden Section Search have anything to do with the Golden Ratio? • The Golden Ratio has been used since ancient times in various fields such as architecture, design, art and engineering. To determine the value of the Golden Ratio : 𝑎 𝜑= 𝑏 1 1 + 𝜑 = 𝑜𝑟 𝜑2 + 𝜑 − 1 = 0 𝜑 −1 + 1 − (4 ∗ −1) 5−1 𝜑 = = = 0.61803 2 2 Does the Golden Section Search have anything to do with the Golden Ratio? • In other words, the intermediate points λ𝑘 and 𝜇𝑘 are chosen such that, the ratio of the distance from these points to the boundaries of the search region is equal to the golden ratio. 𝜃 𝜽(𝝁)𝑘 𝜽(λ𝒌 ) 𝜽(𝒂)𝒌 b 𝒂𝒌 𝝁𝑘 a 𝜽(𝒃)𝒌 a λ𝒌 𝒃𝒌 b 𝑘 The Golden Section Search Algorithm 1. Initialization: Determine 𝑎𝑘 and 𝑏𝑘 which is known to contain the maximum of the function 𝜃 2. Determine two intermediate points λ𝑘 and 𝜇𝑘 such that: λ𝑘 = 𝑎𝑘 + 𝑑 𝑎𝑛𝑑𝜇𝑘 = 𝑏𝑘 − 𝑑 Where 𝑑 = 5−1 (𝑏𝑘 2 − 𝑎𝑘 ) • Evaluate 𝜃(λ𝑘 )and𝜃(𝜇𝑘 ) 1. If 𝜃(λ𝑘 ) > 𝜃(𝜇𝑘 ) then : 𝑎𝑘 = 𝜇𝑘 𝜇𝑘 = λ𝑘 𝑏𝑘 = 𝑏𝑘 λ𝑘 = 𝑎𝑘 + 5−1 (𝑏𝑘 2 − 𝑎𝑘 ) The Golden Section Search Algorithm 5. If 𝜃(λ𝑘 ) < 𝜃(𝜇𝑘 ) then : 𝑎𝑘 = 𝑎𝑘 𝑏𝑘 = λ𝑘 λ𝑘 = 𝜇𝑘 𝜇𝑘 = 𝑏𝑘 − 5−1 (𝑏𝑘 2 − 𝑎𝑘 ) 6. If 𝑏𝑘 − 𝑎𝑘 < 𝜀 (a sufficiently small number), then 𝑏𝑘 +𝑎𝑘 the maximum occurs at and stop iterating, else 2 go to Step 2. Example The cross-sectional area A of a gutter with equal base and edge length of 2 is given by : 𝐴 = 4 sin 𝜃(1 + cos 𝜃). Find the angle θ which maximizes the cross sectional area of the gutter. Using an initial interval of [0,π/2], find the solution after 2 iterations. Use an initial ε=0.05 2 2 θ 2 θ Example Iteration 1: Given the values for the boundaries of 𝑎𝑘 = 0 and 𝑏𝑘 = π/2, we can calculate the initial intermediate points as follows: • λ𝑘 = 𝑎𝑘 + 5−1 2 𝑏𝑘 − 𝑎𝑘 = 0 + 5−1 2 • λ𝑘 = 𝑏𝑘 − 5−1 2 𝑏𝑘 − 𝑎𝑘 = 1.5708 − 1.5708 = 0.97080 5−1 2 1.5708 = 0.6 The function is evaluated at the intermediate points as 𝑓(0.97080 ) = 5.1654 and 𝑓(0.6 ) = 4.1227. since 𝜃(λ𝑘 ) > 𝜃(𝜇𝑘 ) we eliminate the region to the left of 𝜇𝑘 and update the lower boundary point as 𝑎𝑘 =𝜇𝑘 . Example • The upper boundary point 𝑏𝑘 remains unchanged. The second intermediate point 𝜇𝑘 is updated to assume the value of λ𝑘 and finally the first intermediate point λ𝑘 is re-calculated as follows: 5−1 2 5−1 2 • λ𝑘 = 𝑎𝑘 + 𝑏𝑘 − 𝑎𝑘 = 0.6 + 1.5708 − 0.6 = 1.2 It is greater To check the stopping criteria : then ε 𝑏𝑘 − 𝑎𝑘 = 1.5708 − 0.6 = 0.97080 The process is repeated in the second iteration. Example Iteration 2 𝑎𝑘 =0.6 , 𝑏𝑘 =1.5708 , λ𝑘 =1.2 , 𝜇𝑘 =0.9708 5−1 5−1 𝜇𝑘 = 𝑏𝑘 − 𝑏𝑘 − 𝑎𝑘 = 1.2 − 1.2 − 0.6 2 2 = 0.82918 0.6 𝑏𝑘 − 𝑎𝑘 1.2 + 0.6 = = 0.9 Max area 2 2 when θ=0.9 or 51.6 degree Example Iteration 𝒂𝒌 𝒃𝒌 λ𝒌 𝝁𝑘 𝜽(λ𝒌 ) 𝜽(𝝁𝒌 ) 𝜀 1 0.00000 1.5708 0.97081 0.59999 5.1654 4.1226 1.5708 2 0.59999 1.5708 1.2000 0.97081 5.0791 5.1654 0.97081 3 0.59999 1.2000 0.97081 0.82917 5.1654 4.9418 0.59999 4 0.82917 1.2000 1.0583 0.97081 5.1955 5.1654 0.37081 5 0.97081 1.2000 1.1124 1.0583 5.1743 5.1955 0.22918 6 0.97081 1.1124 1.0583 1.0249 5.1955 5.1936 0.14164 7 1.0249 1.1124 1.0790 1.0583 5.1909 5.1955 0.08754 8 1.0249 1.0790 1.0583 1.0456 5.1955 5.1961 0.05410 9 1.0249 1.0583 1.0456 1.0377 5.1961 5.1957 0.03344 Golden Section Method