Professional Documents
Culture Documents
MBE 2036
One-Dimensional Unconstrained
Optimization
Part 7
Jia Pan
AC-1 Y6720
Email: jiapan@cityu.edu.hk
1
MEEM2036 Engineering Computing, part 7, ver 4 2
Whats optimization ?
Finding the best result or optimal solution of a problem
Examples:
Power vs. Heat
Design vs. Cost
Find x to minimize or maximize f(x)
f(x) cost function, objective function
One-dimensional vs. Multidimensional
MEEM2036 Engineering Computing, part 7, ver 4 3
1D/2D Functions
Convex function
is convex if for all pairs of and and
, there is
2D convex function
MEEM2036 Engineering Computing, part 7, ver 4 9
V.S.
Both involve: (1) initial guess and (2) search for a point on a function
The optimum is the point where: The root is the point where:
In mathematical terms, f (x)=0 In mathematical terms, f (x)=0
If f(x)<0, the point is a maximum
If f(x)>0, the point is a minimum
Some Optimization methods find an optima by solving the root problem of the first
derivative of the function, i.e. f (x)=0
However, f (x) may be difficult to find analytically. Numerical methods may be needed
to solve the problem.
MEEM2036 Engineering Computing, part 7, ver 4 11
Given:
6( 3)
First Derivate of y : ( 3) ( 3)
=6
( 3)
=12 (x-3)
Given:
First Derivate of y :
Matlab roots
>> roots([12, -30, -24, 12])
ans = 3.0485 -0.9092 0.3608
MEEM2036 Engineering Computing, part 7, ver 4 14
Golden-Section
MEEM2036 Engineering Computing, part 7, ver 4 15
Golden-section
a b
b a
Given golden-section: c
Answer:
Proof:
MEEM2036 Engineering Computing, part 7, ver 4 16
Golden-Section Search
The Golden-Section search is a simple, general-purpose, single-
variable search technique
It is similar in spirit to the bisection approach for locating root
As with Bisection method, we can start by defining an interval
that contains a single answer
That is the interval should contain a single maximum or
minimumit is called unimodal
f(x)
x2 x1
xL xU
l0
l1 l2
l1 = d
l1 l2 l0 xU xL l1 l2 Eq 8.3
For Golden ratio, Eq 8.2
l0 l1
MEEM2036 Engineering Computing, part 7, ver 4 18
l0 - d
= l0 - Rl0
= (1-R)l0 Eq 8.7
x2 x1
xL xU
d
d
l0
MEEM2036 Engineering Computing, part 7, ver 4 21
Prove x2
new
=x1 old
original d old = l0 new xUnew =xUold
d new= R l0new =Rd old = R (Rl0old) = R 2 l0 old Eq 8.8
From Eq 8.6, R2 = 1 - R
new new
Eq 8.8 can be written as d = (1-R) l0old This imply d = l0 old- dold
Golden-Section Search
ii. If f(x2 ) > f(x1 ), then the range of x from x1 to xU can be
eliminated because it does not contain the maximum.
Estimated xoptimal = x2 . For the next round of calculation:
xUnew = x1old
x1new = x2old
f new(x1 ) = f old(x2 )
dnew = R*dold
x2new = xUnew - dnew
Then calculate f new(x2 )
iii. Terminate when a s
Because the original x1 and x2 were chosen using the
golden ratio, we do not have to re-calculate all the
function values for the next iteration
For finding the minimum, f(x1 ) > f(x2 ) change to f(x1 ) <
f(x2 ) and f(x2 ) > f(x1 ) change to f(x2 ) < f(x1 )
MEEM2036 Engineering Computing, part 7, ver 4 23
x2 x1
xL xU
d
d
MEEM2036 Engineering Computing, part 7, ver 4 24
d new=Rd old
xU
d new=Rd old
x2 x1
xL xU
d
d
x x1 x2
xL R(xU xL ) xU R(xU xL )
xL R(xU xL ) xU R(xU xL )
xL xU 2 R(xU xL ) (2R 1)(xU xL ) 0.236(xU xL ) Eq 8.9
MEEM2036 Engineering Computing, part 7, ver 4 27
x2 x1
xL xU
d
d
x xU x1
xU xL R(xU x L )
xU xL R(xU xL ) (1 R)(xU xL ) 0.382(xU xL ) Eq 8.10
MEEM2036 Engineering Computing, part 7, ver 4 28
x U xL
a (1 - R) 100% Eq 8.11
xoptimal
MEEM2036 Engineering Computing, part 7, ver 4 29
Example 1
Problem Statement: Use the Golden-section
search method to find the maximum of:
x2
f(x) 2sinx
10
within the interval xL=0 and xU = 4. The true
optimal value xoptimum = 1.4276. s = 5%
Solution:
5 1
d (4 0) 2.472
2
x1 0 2.472 2.472 x2 4 2.472 1.528
MEEM2036 Engineering Computing, part 7, ver 4 32
Example 1
x2
f(x) 2sinx
10
xU
xL x2 x1
MEEM2036 Engineering Computing, part 7, ver 4 33
Example 1 (cont)
1.528 2
f(x2 ) f(1.528) 2sin(1.528) - 1.765
10
f(x1 ) f(2.472) 0.635
As f(x2) > f(x1 ), the maximum value is in the interval defined by xL, x2 and x1.
xLnew =xLold= 0 xUnew =x1old= 2.472 x1new =x2old= 1.528
Example 1 (cont)
i xL x2 f(x2) x1 f(x1) xU d a
i xL x2 f(x2) x1 f(x1) xU d a
So 8 times 1 0 1.527
9
1.764
7
2.472
1
0.630
0
4 2.472
1
99.
99
Question:
Newtons Method
Newton-Raphson method is an open method for
finding the root x of a function such that f(x)=0. The
formula for finding x is:
f(xi )
xi 1 xi ' Eq 6.2
f (xi )
Optimization: f(xoptimal)=0
The optimization problem can be treated as solving the
root problem of the first derivative of the function, i.e.
f(x)=0
The formula for finding x can be modified as:
f ' (xi )
xi 1 xi "
Eq 8.12
f (xi )
MEEM2036 Engineering Computing, part 7, ver 4 43
5 5
MEEM2036 Engineering Computing, part 7, ver 4 46
1 7.0258 30.2970
2 7.0258 2.9007
3 7.0258 0.0028
4 7.0258 0.0035
5 7.0258
6 1.0577
7 1.0577
8 1.0577
MEEM2036 Engineering Computing, part 7, ver 4 50
Learning Outcomes
After this lecture, the student would be able to understand the
following: