Professional Documents
Culture Documents
Golden Section Method - New Practice
Golden Section Method - New Practice
Golden Section Method - New Practice
2015 Fall
Optimization
Optimization
• Optimization is the process of creating
something that is as effective as possible.
Face Model
5 variables
Global vs. Local
• A global optimum represents the very best
solution while a local optimum is better than
its immediate neighbors.
• Cases that include local optima are called
multimodal.
• Generally desire to find the global optimum.
Golden Ratio
• Two quantities are in the golden ratio if their
ratio is the same as the ratio of their sum to
the larger of the two quantities.
Golden Ratio
Bisection
• The bisection method is a
variation of the incremental
search method in which the
interval is always divided in
half.
• If a function changes sign
over an interval, the function
value at the midpoint is
evaluated.
• The location of the root is
then determined as lying
within the subinterval where
the sign change occurs.
• The absolute error is reduced
by a factor of 2 for each
iteration.
Golden-Section Search
• Search algorithm for finding a minimum on an
interval [xl xu] with a single minimum
(unimodal interval)
Max error
Code for Golden-Section
Homework
Parabolic Interpolation
• It uses parabolic interpolation of three points to
estimate optimum location.
• The location of the maximum/minimum of a parabola
defined as the interpolation of three points (x1, x2,
and x3) is:
1 x 2 x1 f x 2 f x 3 x 2 x 3 f x 2 f x1
2 2
x4 x2
2 x 2 x1 f x 2 f x 3 x 2 x 3 f x 2 f x1
g ' ( xi ) f ( xi )
xi 1 xi xi
g ' ' ( xi ) f ' ( xi )
fminsearch Function Homework
• MATLAB has a built-in function, fminsearch,
that can be used to determine the minimum
of a multidimensional function.
– [xmin, fval] = fminsearch(function, x0)
– xminin this case will be a row vector containing the
location of the minimum, while x0 is an initial guess.
Note that x0 must contain as many entries as the
function expects of it.
• The function must be written in terms of a
single variable, where different dimensions
are represented by different indices of that
variable.
fminsearch Function Homework
• To minimize
f(x,y)=2+x-y+2x2+2xy+y2
rewrite as
f(x1, x2)=2+x1-x2+2(x1)2+2x1x2+(x2)2
• f=@(x) 2+x(1)-x(2)+2*x(1)^2+2*x(1)*x(2)+x(2)^2
[x, fval] = fminsearch(f, [-0.5, 0.5])