You are on page 1of 3

TP4

“Golden section method”


Instructed by CHHORN Sopheaktra
1. Introduction
Golden section method is a bracket that use to search for optimal point
(local optima). The golden-section search is a simple, general-purpose,
single-variable search technique. It is similar in spirit to the bisection
approach for locating roots. The objective of this TP is to understand
how golden section work, learn about golden ration and Solve one-
dimensional optimization problems using the Golden Section Search method.

2. Basic theory

f(x2)

f(x1)

f(xl)
f(xu)

xl x2 x1 xu

l0
l1 l2
Rather than using only two function values (which are sufficient to detect
a sign change, and hence a zero), we would need three function values to
detect whether a maximum occurred. Thus, an additional point within the
interval has to be chosen. Next, we have to pick a fourth point. Then the
test for the maximum could be applied to discern whether the maximum
occurred within the first three or the last three points. The key to making
this approach efficient is the wise choice of the intermediate points. As
in bisection, the goal is to minimize function evaluations by replacing
old values with new values. This goal can be achieved by specifying that
the following two conditions hold:
l0  l1  l2

l1 l2

l0 l1

l2
If we suppose that R  , we get:
l1

1 5 1
1+R  or R   0.61803
R 2
Where R is called golden ratio.
To complete above condition, both point x1 and x2 can be set as:

d = R(xu  xl)

x1  xl +d

x2  xu - d

If f(x1)> f(x2), the maximum point is in the interval [ x2 x1 x u ]

If f(x2)> f(x1), the maximum point is in the interval [ xl x2 x1 ]

3. Algorithms of golden section method


 Define function, lower bound and upper bound of the function
 For first iteration, calculate value d and set x1  xl - d and x2  xu - d
 If f(x1)> f(x2) the new interval is [ x2 x1 x u ] for the next iteration,
calculate d = R  d and set the new value as xl  x2 , x2  x1 , x1  xl +d
and xopt  x1

 If f(x2)> f(x1) the new interval is [ xl x2 x1 ] or the next iteration,


calculate d = R  d and set the new value as xu  x1 , x1  x2 , x2  xu - d
and xopt  x2

xu  xl
 Using relative error for stopping condition  a =(1- R)
xopt

4. Practice
 Using golden section method to find the maximum point of function
2sin(x)-x2/10. We know that the maximum point of this function is
within the interval of [0 4].

You might also like