Professional Documents
Culture Documents
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
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].