Optimization and Convexity Concepts
Optimization and Convexity Concepts
Chapter 4
1
CONTINUITY OF FUNCTIONS
2
Chapter 4 CONTINUITY OF FUNCTIONS
4
DISCRETE FUNCTIONS
5
DISCRETE FUNCTIONS
•You can then disregard the discrete nature of the function and
optimize the cost as if the diameter were a continuous variable.
6
DISCRETE FUNCTIONS
7
4.2 NLP PROBLEM STATEMENT
lj, uj : are lower and upper bounds on the variables with lj<uj.
If ai=bi, the ith constraint is an equality constraint.
•Problem 4.1 is nonlinear if one or more of the functions f, g1, .
. .,gn , are nonlinear.
•It is unconstrained if there are no constraint functions gi, and
no bounds on the xi, and
9
4.2 NLP PROBLEM STATEMENT
10
4.2 NLP PROBLEM STATEMENT
11
4.2 NLP PROBLEM STATEMENT
space of x is examined.
•A global minimum occurs if Equation (4.2) holds for all x∈F.
12
NLP GEOMETRY
13
Chapter 4 FUNCTION PLOT
14
Chapter 4 surf(x1,x2,fx)
15
surf(x1,x2,fx)
35
Chapter 4
30
25
20
f(x)
15
10
0
6
4 6
5
4
2 3
2
0 1
0
-1
-2 -2
x2
x1
16
contour3(x1,x2,fx,30)
35
Chapter 4
30
25
20
f(x)
15
10
0
6
4 6
5
4
2 3
2
0 1
0
-1
-2 -2
x2
x1 17
Chapter 4 contour3(x1,x2,fx,30)
18
Chapter 4 contour3(x1,x2,fx,30)
19
Chapter 4 contour3(x1,x2,fx,30)
6
6
5
5
4
4
3
3
2
2
1
1
0 0
x2 -1 -1 x1
-2 -2
20
Chapter 4 contour(x1,x2,fx)
6
15 15
25
25
5 10
10
20
20
4 5
15
15
10
3
15
x2
10
5
1
10
15
0
5
15
20
20
10
-1 10
25
25
15
15 21
-2
-2 -1 0 1 2 3 4 5 6
x1
Chapter 4 contour(x1,x2,fx)
6
15 15
25
25
5 10
10
20
20
4 5
15
15
10
5
3
15
x2
10
5
1
10
15
0
5
15
20
20
10
-1 10
25
25
15
15
-2
-2 -1 0 1 2 3 4 5 6
x1 22
surfc(x1,x2,fx)
35
Chapter 4
30
25
20
f(x)
15
10
0
6
4 6
5
4
2 3
2
0 1
0
-1 23
-2 -2
x2
x1
NLP GEOMETRY-EXAMPLE
24
Chapter 4 NLP GEOMETRY-EXAMPLE
25
20
15
6
f(x)
X: 3
10 Y: 4
5
Z: 0
4
5
3
0 2
8
7 1
6
5
4 3
2 x1
1 0
0
x2
25
NLP GEOMETRY-EXAMPLE
25
Chapter 4
20
15
f(x)
10
5 X: 3
Y: 4
Z: 0 6
4
0 2
8 7 6 5 4 3 2 1 0
0
x1
x2
26
25
20
15
X: 3
f(x)
10 Y: 4 6
Z: 0
5
4
0
8 2
6
4
2 x1
0 0
x2
27
NLP GEOMETRY-EXAMPLE
28
29
NLP GEOMETRY-2 DIMENSIONAL
7
6
Chapter 4
4
x2
3
X: 2
Y: 3
Z: 2
0
0 1 2 3 4 5 6 7
x1 30
Chapter 4 NLP GEOMETRY-2 DIMENSIONAL
31
Chapter 4 NLP GEOMETRY
34
Chapter 4 MATLAB-FMINCON
35
Chapter 4 MATLAB-FMINCON
36
Chapter 4 MATLAB-FMINCON
37
•objective function f, with
two minima as shown in
Figure 4.7.
Chapter 4
•Note that the minimum at the boundary point x1=3, x2=2 is the
global minimum at f=3; the feasible local minimum in the
interior of the constraints is at f=4.
38
4.3 CONVEXITY AND ITS APPLICATIONS
•Convex set
• A set of points (or a region) is defined as a convex set in n-
dimensional space if, for all pairs of points x1 and x2 in the set,
Chapter 4
39
Chapter 4 CONVEX SET
40
CONVEX SET
41
CONVEX SET
42
CONVEX SET
•A mathematical statement of a convex set is:
•For every pair of points x1 and x2 in a convex set, the point x
given by a linear combination of the two points
Chapter 4
43
CONVEX FUNCTION
A function f(x) defined on a convex set F is said to be a convex
function if the following relation holds
Chapter 4
44
Chapter 4 CONVEX FUNCTION
A convex function cannot have any value larger than the values
of the function obtained by linear interpolation between x1 and
x2 (the cord between x1 and x2 shown in the top figure in Figure
45
4.10).
CONVEXITY
Figure 4.10 illustrates both a strictly convex and a strictly
concave function.
Chapter 4
Linear functions are both convex and concave, but not strictly
convex or concave, respectively. 46
CONVEX FUNCTION
47
Chapter 4 NLP GEOMETRY
in which
(a) f(x) is a convex function, and
(b) each inequality constraint is a convex function
the following property can be shown to be true
The local minimum of f(x) is also the global minimum.
49
THE CONVEX PROGRAMMING PROBLEM
50
HESSIAN MATRIX
•H is symmetric.
If f has continuous second partial derivatives, then
51
LEADING PRINCIPAL MINORS
1 2
A2
2 1 1 2 1
•the leading principal minor (order 3) is itself. A3 2 1 1
0 0 1
54
VECTOR-MATRIX PRODUCTS
•If the two vectors are orthogonal, then xTy=0. This means that
the vectors x and y are perpendicular to each other.
55
CONVEX FUNCTION
3. xTAx
Here A is a square matrix of dimension n×n and the product is a
scalar. Q=xT1×nAn×nxn×1
Chapter 4
Q(x1, x2, x3) = x12 + x22 + 3x2x3− x32 is a quadratic form in three
variables
f(x1, x2) = x12 − x22 + 3x1+ 2x2 is polynomial of degree two but
not a quadratic form.
57
Chapter 4 QUADRATIC FORMS
58
QUADRATIC FORMS
1 2 6 x1
f x1 x2 x
2 6 18 2
If x is an n-vector, then the general expression for a quadratic
form is f =1/2xTAx, where A is a symmetric matrix.
A quadratic form can also be expressed in index notation as
59
QUADRATIC FORMS
1 2 6 x1
f x1 x2 x
Chapter 4
2 6 18 2
1 3 x1
f x1 x2 12 x
3 9 22 2 21
x1
x1 3x2 3x1 9 x2 12 x12 3x2 x1 3x1 x2 9 x22
x2 21
f x12 6 x1 x2 9 x22
60
GRADIENT VECTOR
The gradient vector (nabla symbol, ∇), is the vector of the first
partial derivatives of f(x) as follows
Chapter 4
61
QUADRATIC FORMS,GRADIENT VECTOR, HESSIAN
62
QUADRATIC FORMS
1 T
f x 6 x1 x2 9 x2 x Ax
1
2 2
2
Find A
Chapter 4
A Hessian matrix
f
2 x1 6 x2
x1
f
6 x1 18 x2
x2
2f 2f
x 2 x 1x 2 2 6
A H 2
1
f
f 6 18
2
2
x 2 x 1 x 2 63
QUADRATIC FORMS
f x1 8 x1 x2 2 x3 3x4
f x2 x1 10 x2 4 x3 5 x4
f ( x )
Chapter 4
Gradient f x3 2 x1 4 x2 12 x3 6 x4
f x4 3x1 5 x2 6 x3 14 x4
2
f x4x1 f x4x2
2
2 f x4x3 2 f x42 3 5 6 14
8 1 2 3
1 10 4 5
A
2 4 12 6
3 5 6 14
64
TYPES OF QUADRATIC FORM
a quadratic form is positive definite if
Q=xTAx>0 for any nonzero vector x, and Q=xTAx=0 for vector
x=0 (also, A is called positive definite)
Chapter 4
65
TYPES OF QUADRATIC FORM
66
TYPES OF QUADRATIC FORM
67
TYPES OF QUADRATIC FORM
68
TYPES OF QUADRATIC FORM
69
TYPES OF QUADRATIC FORM
70
Chapter 4 TYPES OF QUADRATIC FORM
71
TYPES OF QUADRATIC FORM
For
4 2 0
2 9 0
0 0 2
Chapter 4
4 2
A1 4 4 A2 32
2 9
4 2 0
A3 2 9 0 2(4 9 2 2) 64
0 0 2
72
TYPES OF QUADRATIC FORM
For
2 0 2
0 4 4
2 4 6
Chapter 4
2 0
A1 2 2 A2 8
0 4
2 0 2
A3 0 4 4 0
2 4 6
73
EIGENVALUE TEST FOR DETERMINING THE SIGN OF A
QUADRATIC FORM
•All eigenvalues of a positive definite matrix are strictly
positive (λi>0 i=1,2,…,n).
Chapter 4
75
Chapter 4 Determination of convexity an concavity
76
EXAMPLE 4.4 DETERMINATION OF POSITIVE-
DEFINITENESS OF A FUNCTION
Chapter 4
77
f ( x )
2 x1 x2 0
1 2 x1
indefinite Hessien x (2, 4)
f ( x )
Chapter 4
2 1 x1 2 0
x2
6
x 10
6
x 10 5
6 4
5
3
4
f(x)
3 2
f(x)
2
1
1
0
0
2000
-1 -1
2000 1000 2000
1000 0 0
0
-1000 -2000 -1000 -500 0 500 1000
78
1500 2000
-1000 -2000 -1500
-2000 -2000 x2
x2 x1 x1
EXAMPLE: DETERMINATION OF CONVEXITY AND
CONCAVITY
Determine whether the following functions are convex or
concave.
Chapter 4
79
Chapter 4 CONVEX FUNCTION
80
Chapter 4 CONVEX FUNCTION
81
4.5 NECESSARY AND SUFFICIENT CONDITIONS FOR AN
EXTREMUM OF AN UNCONSTRAINED FUNCTION
82
4.5 NECESSARY AND SUFFICIENT CONDITIONS FOR AN
EXTREMUM OF AN UNCONSTRAINED FUNCTION
Chapter 4
83
NECESSARY CONDITION FOR AN EXTREMUM OF AN
SINGLE FUNCTION
is defined at c, then
df ( x)
f (c) 0
dx c
Proof.
•To show that f ′ (c) is zero at a local extremum, we show first
that f ′ (c) cannot be positive and second that it cannot be
negative. The only number that is neither positive or negative is
zero, so that is what f ′ (c) must be. 84
NECESSARY CONDITION FOR AN EXTREMUM OF AN
SINGLE FUNCTION
•Suppose that f has a local maximum value at x=c so that
f(x)-f(c)≤ 0 for all values of x sufficiently close to c.
Chapter 4
85
NECESSARY CONDITION FOR AN EXTREMUM OF AN
SINGLE FUNCTION
•Similarly,
Chapter 4
•Therefore f ′ (c) = 0.
•The proof for minimum values is similar.
86
NECESSARY CONDITION FOR AN EXTREMUM OF A TWO
VARIABLES FUNCTION
f
0
x (x*, y*)
f
0
y (x*, y*)
87
NECESSARY CONDITION FOR AN EXTREMUM OF A
MULTIPLE VARIABLES FUNCTION
at x* equals zero:
f (x)
x
1
f (x)
f (x) x2 0
f ( x )
xn
88
SUFFICIENT CONDITION FOR AN EXTREMUM OF A
SINGLE VARIABLES FUNCTION
dy 1 d2y
y ( x) y( x0 ) x x0 x x0 Higher Order Terms
2
2
dx x x0 2! dx x x0
Chapter 4
dy
x0 : Stationary Po int 0
dx x x0
1 d2y
y ( x) y ( x0 ) x x0
2
2! dx 2 x x0
1 d2y
y ( x) y ( x0 ) x x0
2
2! dx 2 x x0 0
0
d2y
Local Minimum : y( x) y( x0 ) 0 0 Convex functuion
dx 2 x x0
d2y
Local Maximum : y( x) y( x0 ) 0 0 Concave functuion
dx 2 x x0 89
SUFFICIENT CONDITION FOR AN EXTREMUM OF A
SINGLE VARIABLES FUNCTION
d2y
0 unknown (We Can't judge)
dx 2 x x0
Chapter 4
d2y 1 d3y
0 y ( x) y ( x0 ) x x0
3
dx 2 x x0
3! dx3 x x0
d3y 1 d4y
0 y ( x) y ( x0 ) x x0
4
dx3 x x0
4! dx 4 x x0
d4y 1 d5y
0 y ( x) y ( x0 ) x x0
5
dx 4 x x0
4! dx5 x x0
90
SUFFICIENT CONDITION FOR AN EXTREMUM OF A
SINGLE VARIABLES FUNCTION
Chapter 4
d2y d3y d n 1 y
3 n 1 0
dx 2 x x0
dx x x0
dx x x0
dny
0
dx n x x0
1 dny
y ( x) y ( x0 ) x x0
n
n ! dx n x x0
Sign
Sign
91
SUFFICIENT CONDITION FOR AN EXTREMUM OF A
SINGLE VARIABLES FUNCTION
1 dny
y ( x) y ( x0 ) x x0
n
n ! dx n
Chapter 4
Sign x x0
Sign
n : even x x0 0
n
dny
0 y ( x0 ) is min imum
dx n x x0
dny
0 y ( x0 ) is max imum
dx n x x0
92
SUFFICIENT CONDITION FOR AN EXTREMUM OF A
SINGLE VARIABLES FUNCTION
1 dny
y ( x) y ( x0 ) x x0
n
n ! dx n
Chapter 4
Sign x x0
Sign
n : odd
x x0 x x0 0
n
x x0 x x0 0
n
infelection point
93
SUFFICIENT CONDITION FOR AN EXTREMUM OF A
SINGLE VARIABLES FUNCTION
•Suppose x* is a stationary point, f '(x*=0).
•Let n be the first higher order derivative that is not zero. The
Chapter 4
evaluated:
f '''(x) = 720x2 + 1080x +240
f '''(0) =240 ≠ 0
Since the non zero highest derivative has an odd order (n=3), it
can be concluded from the theorem that x=0 is not an optimum
but an inflection (saddle) point.
96
SUFFICIENT CONDITION FOR AN EXTREMUM OF A TWO
VARIABLES FUNCTION
f f
f f ( x x ) ( y y )
( x, y ) (x ,y )
x ( x , y ) y ( x , y )
1 2 f
2
f
2
2 f
2
(x x ) 2( x x )( y y ) (y y ) ...
2! x 2 xy y 2 ( x , y )
x ( x x ) & y ( y y )
f f
f f ( x , y )
x y
( x, y )
x ( x , y ) y ( x , y )
1 2 2 f 2 f 2 f
2
x 2xy y 2
...
2! x 2
xy y ( x , y ) 97
SUFFICIENT CONDITION FOR AN EXTREMUM OF A TWO
VARIABLES FUNCTION
2 f 2 f
x 2 xy
f f x 1 x
f f x x y 2 y ...
( x, y ) ( x , y )
y ( x , y ) y 2 f f
Chapter 4
xy y 2 ( x , y )
98
4.5 SUFFICIENT CONDITIONS FOR AN EXTREMUM
99
SUFFICIENT CONDITION FOR AN EXTREMUM OF A TWO
VARIABLES FUNCTION
1 T
f (x) f (x ) Δx H(x )Δx
2
x* is a local minimum if
100
SUFFICIENT CONDITION FOR AN EXTREMUM OF A TWO
VARIABLES FUNCTION
101
SUFFICIENT CONDITION FOR AN EXTREMUM OF A TWO
VARIABLES FUNCTION
•we have the following outcomes
Chapter 4
102
EXAMPLE
Solution: Let A be the total area of metal used to make the box,
and let x and y be the length and width and z the height. Then
A=2xz+2yz+xy
Also
xyz = 10
103
EXAMPLE
because the volume is 10 m3. This implies that z=10/xy .Putting
this into the formula for A gives:
Chapter 4
104
EXAMPLE
Since the zero root y=0 is obviously not consistent with having
Chapter 4
105
EXAMPLE
2 A 2 A 40
Chapter 4
x 2 xy x3
1
H 2
A A 1
2 40
2
yx y y 3
40
2.1743 1 2 1
H 1 2 0, 2 2 2 11 3 0
1 40 1 2
2.1743
106
EXAMPLE: CALCULATION OF EXTREMA
f ( x ) (0, 0)
3x1 4 x1 x1 (3x1 4) 0
2
(0, 8 / 3)
x1
x
f ( x ) (4 / 3, 0)
3x2 8 x2 x2 (3x2 8) 0
2
x2 (4 / 3, 8 / 3)
2 f ( x)
6 x1 4
x12
2 f ( x)
0
2 f ( x) x1 x2
6 x2 8
x22
107
EXAMPLE: CALCULATION OF EXTREMA
2 f ( x) 2 f ( x)
x 2 x1 x2 6 x1 4 0
H ( x) 2 1
f ( x) 2 f ( x ) 0 6 x2 8
Chapter 4
x1 x2 x22
4 0
H ( x ) x (0,0)
0 8
H1 4 0
H 2 4 8 0 32 0
2
H is Pos. Def. (0,0) is min point,f(0,0)=6
4 0 1 4
0
0 8 2 8
108
EXAMPLE: CALCULATION OF EXTREMA
2 f ( x) 2 f ( x)
x 2 x1 x2 6 x1 4 0
H ( x) 2 1
f ( x) 2 f ( x ) 0 6 x2 8
x1 x2 x22
Chapter 4
4 0
H ( x ) x (0, 8 )
3 0 8
H1 4 0
418
H 2 4 8 0 32 0
2
H is Indefinite. (0,-8/3) is saddle point,f(0,-8/3)=
27
4 0 4
0 1
0 8 2 8
109
EXAMPLE: CALCULATION OF EXTREMA
2 f ( x) 2 f ( x)
x 2 x1 x2 6 x1 4 0
H ( x) 2 1
f ( x) 2 f ( x ) 0 6 x2 8
x1 x2 x22
Chapter 4
4 0
H ( x ) x ( 4 ,0)
3 0 8
H1 4 0
4 418
H 2 4 8 0 32 0
2
H is Indefinite. (- ,0) is saddle point,f(0,-8/3)=
3 27
4 0 4
0 1
0 8 2 8
110
EXAMPLE: CALCULATION OF EXTREMA
2 f ( x) 2 f ( x)
x 2 x1 x2 6 x1 4 0
H ( x) 2 1
f ( x) 2 f ( x ) 0 6 x2 8
Chapter 4
x1 x2 x22
4 0
H ( x ) x ( 4 , 8 )
3 3 0 8
H1 4 0 H is Negetive Definite
H 2 4 8 02 32 0 4 8 4 8
( , ) is local maximum point,f( , )=6
4 0 4 3 3 3 3
0 1
0 8 2 8
111
EXAMPLE 4.11 CALCULATION OF EXTREMA
f ( x )
4.5 2 x1 2 x2 4 x13 4 x1 x2 0
x1
f ( x )
4 4 x2 2 x1 2 x12 0
x2
112
Chapter 4 EXAMPLE 4.11 CALCULATION OF EXTREMA
(1.94,3.85)
x (1.05,1.03)
(0.61,1.49)
113
EXAMPLE 4.11 CALCULATION OF EXTREMA
f ( x )
4.5 2 x1 2 x2 4 x13 4 x1 x2 0
x1
f ( x )
Chapter 4
4 4 x2 2 x1 2 x12 0
x2
2 f ( x)
2 12 x1 4 x2
2
x12
2 f ( x)
4
2 f ( x) x22
2 4 x1
x1 x2
114
EXAMPLE 4.11 CALCULATION OF EXTREMA
2 f ( x) 2 f ( x)
x 2 x1 x2 2 12 x12 4 x2 2 4 x1
H ( x) 2 1
f ( x) f ( x)
2 2 4 x1 4
Chapter 4
x1 x2 x22
31.76 9.76
H ( x ) x (1.94,3.85)
9.76 4
H1 31.794 0
H 2 31.76 4 9.762 31.78 0
115
EXAMPLE 4.11 CALCULATION OF EXTREMA
2 f ( x) 2 f ( x)
x 2 x1 x2 2 12 x12 4 x2 2 4 x1
H ( x) 2 1
f ( x) 2 f ( x ) 2 4 x1 4
x1 x2 x22
Chapter 4
11.11 2.2
H ( x ) x ( 1.05,1.03)
2.2 4
H1 11.11 0
H 2 11.11 4 2.22 39.6 0
2 f ( x) 2 f ( x)
x 2 x1 x2 2 12 x12 4 x2 2 4 x1
H ( x) 2 1
f ( x) f ( x) 2 4 x1
Chapter 4
2
4
x1 x2 x22
0.505 4.44
H ( x ) x (0.61,1.49)
4.44 4
H1 0.505 0
H 2 0.505 4 4.442 17.69 0
118
Chapter 4 FMINUNC
119
Chapter 4 FMINUNC
120
Chapter 4 FMINUNC
121
Chapter 4 FMINUNC
122
Chapter 4 EXAMPLE
123
4.4 INTERPRETATION OF THE OBJECTIVE FUNCTION IN
TERMS OF ITS QUADRATICAPPROXIMATION
125
Chapter 4 ELLIPTICAL-CIRCULAR CONTOURS
126
Chapter 4 HYPERPBOLIC CONTOURS
127
Chapter 4 HYPERPBOLIC CONTOURS
128
Chapter 4
129
The End
130