Here’s an example of one-dimensional unconstrained optimization of the function f(x) = x^2 – 109 using the golden section search method:
- Choose two initial points a and b such that a < b and f(a) > f(b). Let’s choose a = 0 and b = 12.
- Calculate the golden ratio: ϕ = (1 + √5) / 2 ≈ 1.618
- Calculate the points c and d, where c = b – (b – a) / ϕ and d = a + (b – a) / ϕ.
- Evaluate the function at c and d: fc = f(c) and fd = f(d).
- Compare fc and fd. If fc < fd, the minimum must lie between a and d, so set b = d and repeat from step 3. If fc > fd, the minimum must lie between c and b, so set a = c and repeat from step 3.
- Repeat steps 3 to 5 until the difference between a and b is smaller than a specified tolerance (e.g. 0.001).
Here’s the step-by-step process of applying this method to our function:
- Set a = 0 and b = 12.
- Calculate ϕ = 1.618.
- Calculate c = 12 – (12 – 0) / ϕ ≈ 7.39 and d = 0 + (12 – 0) / ϕ ≈ 4.61.
- Evaluate fc = f(7.39) ≈ 2.53 and fd = f(4.61) ≈ -14.11.
- Since fc is less than fd, the minimum must lie between a = 0 and d = 4.61. Set b = d and repeat from step 3.
- Calculate c = 4.61 – (4.61 – 0) / ϕ ≈ 2.85 and d = 0 + (4.61 – 0) / ϕ ≈ 1.76.
- Evaluate fc = f(2.85) ≈ -92.29 and fd = f(1.76) ≈ -107.15.
- Since fc is greater than fd, the minimum must lie between c = 2.85 and b = 4.61. Set a = c and repeat from step 3.
- Calculate c = 4.61 – (4.61 – 2.85) / ϕ ≈ 3.55 and d = 2.85 + (4.61 – 2.85) / ϕ ≈ 4.09.
- Evaluate fc = f(3.55) ≈ -100.27 and fd = f(4.09) ≈ -96.54.
- Since fc is less than fd, the minimum must lie between a = 2.85 and d = 4.09. Set b = d and repeat from step 3.
- Calculate c = 4.09 – (4.09 – 2.85) / ϕ ≈ 3.33 and d = 2.85 + (4.09 – 2.85) / ϕ ≈ 3.61.
- Evaluate fc = f(3.33) ≈ -103.16 and fd = f(3.61) ≈ -105.69.
- Since fc is less than fd, the minimum must lie between a = 2.85 and d = 3.61
Leave a Reply