Convex and Concave Functions

OPTIMAL CONTROL
SYSTEMS
AIM
To provide an understanding of
the principles of optimization
techniques in the static and
dynamic contexts.
1
LEARNING OBJECTIVES
On completion of the module the student
should be able to demonstrate:
an understanding of the basic
principles of optimization and the ability to
apply them to linear and non-linear
unconstrained and constrained static
problems,
an understanding of the fundamentals
of optimal control.
2
LABORATORY WORK
The module will be illustrated by laboratory
exercises and demonstrations on the use of
MATLAB and the associated Optimization and
Control Tool Boxes for solving unconstrained and
constrained static optimization problems and for
solving linear quadratic regulator problems.
ASSESSMENT
Via written examination.
MSc only - also laboratory session and report
3
PRINCIPLES OF OPTIMIZATION
Typical engineering problem: You have a
process that can be represented by a
mathematical model. You also have a
performance criterion such as minimum cost.
The goal of optimization is to find the values of
the variables in the process that yield the best
value of the performance criterion.
Two ingredients of an optimization problem:
(i)
process or model
(ii)
performance criterion
4
Some typical performance
criteria:

maximum profit

minimum cost

minimum effort

minimum error

minimum waste

maximum throughput

best product quality
Note the need to express the performance
5
criterion in mathematical form.
Static optimization: variables
have numerical values, fixed
with respect to time.
Dynamic optimization:
variables are functions of
time.
6
Essential Features
Every optimization problem contains
three essential categories:
1.
At least one objective function
to be optimized
2.
Equality constraints
3.
Inequality constraints
7
By a feasible solution we mean a set of variables which
satisfy categories 2 and 3. The region of feasible solutions
is called the feasible region.
x2
nonlinear
inequality
constraints
linear
equality
constraint
linear
inequality
constraint
nonlinear
inequality
constraint
linear inequality constraint
x1
8
An optimal solution is a set of values
of the variables that are contained in
the feasible region and also provide
the best value of the objective
function in category 1.
For a meaningful optimization
problem the model needs to be
underdetermined.
9
Mathematical Description
Minimize : f (x)
objective function
 h(x)  0 equality constraints
Subject to: 
g(x)  0 inequality constraints


where x n , is a vector of n variables (x1, x2, , xn )
h(x) is a vector of equalities of dimension m1
g(x) is a vector of inequalities of dimension m2
10
Steps Used To Solve Optimization Problems
1. Analyse the process in order to make a list of all the
variables.
2. Determine the optimization criterion and specify
the objective function.
3. Develop the mathematical model of the process to
define the equality and inequality constraints.
Identify the independent and dependent variables
to obtain the number of degrees of freedom.
4. If the problem formulation is too large or complex
simplify it if possible.
5. Apply a suitable optimization technique.
6. Check the result and examine it’s sensitivity to
changes in model parameters and assumptions. 11
Classification of
optimization Problems
Properties of f(x)
 single variable or multivariable
 linear or nonlinear
 sum of squares
 quadratic
 smooth or non-smooth
 sparsity
12
Properties of h(x) and g(x)

simple bounds

smooth or non-smooth

sparsity

linear or nonlinear

no constraints
13
Properties of variables x
•time variant or invariant
•continuous or discrete
•take only integer values
•mixed
14
Obstacles and Difficulties
• Objective function and/or the constraint
functions may have finite discontinuities in
the continuous parameter values.
• Objective function and/or the constraint
functions may be non-linear functions of the
variables.
• Objective function and/or the constraint
functions may be defined in terms of
complicated interactions of the variables. This
may prevent calculation of unique values of
the variables at the optimum.
15
• Objective function and/or the constraint
functions may exhibit nearly “flat” behaviour
for some ranges of variables or exponential
behaviour for other ranges. This causes the
problem to be insensitive, or too sensitive.
• The problem may exhibit many local optima
whereas the global optimum is sought. A
solution may be obtained that is less
satisfactory than another solution elsewhere.
• Absence of a feasible region.
• Model-reality differences.
16
Typical Examples of Application
static optimization
• Plant design (sizing and layout).
• Operation (best steady-state operating
condition).
• Parameter estimation (model fitting).
• Allocation of resources.
• Choice of controller parameters (e.g.
gains, time constants) to minimise a given
performance index (e.g. overshoot, settling
time, integral of error squared).
17
dynamic optimization
• Determination of a control signal
u(t) to transfer a dynamic system
from an initial state to a desired
final state to satisfy a given
performance index.
• Optimal plant start-up and/or shut
down.
• Minimum time problems
18
BASIC PRINCIPLES OF STATIC
optimization THEORY
Continuity of Functions
Functions containing discontinuities can
cause difficulty in solving optimization
problems.
Definition: A function of a single variable x
is continuous at a point xo if:
(a) f ( xo ) exists
(b) lim f ( x ) exists
x  xo
(c)
lim f ( x )  f ( xo )
x  xo
19
If f(x) is continuous at every point in a
region R, then f(x) is said to be continuous
throughout R.
f(x) is discontinuous.
f(x)
x
f(x) is continuous, but
f(x)
f ( x)  df ( x) is not.
dx
x
20
Unimodal and Multimodal Functions
A unimodal function f(x) (in the range
specified for x) has a single extremum
(minimum or maximum).
A multimodal function f(x) has two or more
extrema.
If f ( x)  0at the extremum, the point is
called a stationary point.
There is a distinction between the global
extremum (the biggest or smallest between
a set of extrema) and local extrema (any
extremum). Note: many numerical
procedures terminate at a local extremum.21
A multimodal function
f(x) local max (stationary)
global max (not stationary)
stationary point
(saddle point)
local min (stationary)
global min (stationary)
x
22
Multivariate Functions Surface and Contour Plots
We shall be concerned with basic properties of
a scalar function f(x) of n variables (x1,...,xn).
If n = 1, f(x) is a univariate function
If n > 1, f(x) is a multivariate function.
For any multivariate function, the equation
z = f(x) defines a surface in n+1 dimensional
n 1
space  .
23
In the case n = 2, the points z = f(x1,x2)
represent a three dimensional surface.
Let c be a particular value of f(x1,x2). Then
f(x1,x2) = c defines a curve in x1 and x2 on the
plane z = c.
If we consider a selection of different values
of c, we obtain a family of curves which
provide a contour map of the function z =
f(x1,x2).
24
contour map of z  e x1 (4 x12  2 x22  4 x1 x2  2 x2  1)
2
1.5
3 4 5
1.7
1.8
2
6
z = 20
1
1.8
0.5
x2
0
1.7
2
1.0
0.7
0.4
saddle point
-0.5
-1
3
4
-1.5
-2
5
-2.5
-3
-3
0.2
6
local minimum
-2
-1
x1
0
1
2
25
26
27
Example: Surface and
Contour Plots of “Peaks”
Function
z  3(1  x1 ) exp   x  ( x2  1)
2
2
1
2

 10(0.2 x1  x  x )exp( x  x )
3
1
5
2
1 3exp  ( x1  1)  x
2
2
2

2
1
2
2
28
10
multimodal!
5
0
z
-5
-10
20
15
20
15
10
x2
10
5
5
0
x1
0
100
global max
90
80
70
x2
saddle
local min
60
50
40
local max
30
20
10
local max
10
20
global min
30
40
50
x1
60
70
80
90
29
30
Gradient Vector
The slope of f(x) at a point x  x in the direction
of the ith co-ordinate axis is
f ( x)
xi x  x
31
The gradient vector at a point x  x
is normal to the the contour through that
point in the direction of increasing f.
f ( x )
increasing f
x
At a stationary point:
f (x)  0
(a null vector)
32
Note: If f ( x) is a constant vector,
f(x) is then linear.
e.g.
f (x)  c x    f( x ) = c
T
33
Convex and Concave Functions
A function is called concave over a given
region R if:
f (x a  (1   )xb )  f (xa )  (1   ) f (xb )
where: xa , xb  R, and 0    1.
The function is strictly concave if  is
replaced by >.
A function is called convex (strictly convex)
if  is replaced by  (<).
34
concave function
f(x)
f  ( x )  0
xa
convex function
x
xb
f(x)
f ( x )  0
xa
xb
x35
2 f
If f ( x ) 
 0 then f ( x ) is concave.
2
x
2 f
If f ( x ) 
 0 then f ( x ) is convex.
2
x
For a multivariate function f(x) the
conditions are:f(x)
Strictly convex
convex
concave
strictly concave
H(x) Hessian matrix
+ve def
+ve semi def
-ve semi def
-ve def
36
Tests for Convexity and Concavity
H is +ve def (+ve semi def) iff
x Hx  0 ( 0), x  0.
T
H is -ve def (-ve semi def) iff
x Hx  0 ( 0), x  0.
T
Convenient tests: H(x) is strictly convex
(+ve def) (convex) (+ve semi def)) if:
1. all eigenvalues of H(x) are  0 ( 0)
or 2. all principal determinants of H(x) are
 0 ( 0)
37
H(x) is strictly concave (-ve def)
(concave (- ve semi def)) if:
1. all eigenvalues of H(x) are  0 ( 0)
or 2. the principal determinants of H(x)
are alternating in sign:
 1  0,  2  0,  3  0, 
(  1  0,  2  0,  3  0,  )
38
Example
f ( x)  2 x  3x1 x2  2 x
 f ( x)
 4 x1  3x2
 x1
2
1
2
2
 2 f ( x)
 2 f ( x)
4
 3
2
 x1 x2
 x1
 f ( x)
 2 f ( x)
 3x1  4 x2
4
2
 x2
 x2
4 3
 4 3
 H ( x)  
, 1  4,  2 
7

3 4
 3 4 
eigenvalues: |  I 2  H |
 4
3
3
 4
  2  8  7  0
 1  1, 2  7. Hence, f (x) is strictly convex.
39
Convex Region
xb
convex
xa region
xa
non convex
region
xb
A convex set of points exist if for any two points, xa
and xb, in a region, all points:
x  x a  (1   )xb , 0    1
on the straight line joining xa and xb are in the set.
If a region is completely bounded by concave
functions then the functions form a convex region.
40
Necessary and Sufficient Conditions
for an Extremum of an
Unconstrained Function
A condition N is necessary for a result R if R can
be true only if N is true.
R N
A condition S is sufficient for a result R if R is
true if S is true.
SR
A condition T is necessary and sufficient for a
result R iff T is true.
TR
41
There are two necessary and a single sufficient
conditions to guarantee that x* is an extremum of a
function f(x) at x = x*:
1. f(x) is twice continuously differentiable at x*.
2. f (x* )  0 , i.e. a stationary point exists at x*.
3. 2 f (x* )  H(x* ) is +ve def for a minimum to exist
at x*, or -ve def for a maximum to exist at x*
1 and 2 are necessary conditions; 3 is a
sufficient condition.
Note: an extremum may exist at x* even
though it is not possible to demonstrate the
42
fact using the three conditions.
optimization with Equality
Constraints
min f (x);
x
x 
n
subject to: h(x)  0; m constraints (m  n)
Elimination of variables:
example:
min f (x)  4 x12  5x22
(a)
s.t. 2 x1  3x2  6
(b)
x1 , x2
Using (b) to eliminate x1 gives: x1  6  3x2
(c)
2
and substituting into (a) :- f ( x2 )  (6  3x2 )  5x
2
2
432
At a stationary point
f ( x2 )
 0  6(6  3x2 )  10 x2  0
x2
 28 x2  36  x  1286
.
*
2
Then using (c):
6  3x
x 
 1071
.
2
*
1
*
2
Hence, the stationary point (min) is: (1.071, 1.286)
44