Title: BASIC CONCEPTS IN OPTIMIZATION: PART III: Continuous
1BASIC CONCEPTS IN OPTIMIZATION PART III
Continuous Constrained
Important concepts for the optimization of
systems with continuous variables and non-linear
equations. We will extend the coverage in Basics
II by adding constraints.
- Convert to Unconstrained - Penalty functions
- Concept of Equality Constrained Optimization
- - linear equalities / non-linear equalities /
Lagrangian - Concept of Inequality Constrained Optimization
- - definition of optimum / Lagrangian
- Optimality Conditions - KKT
2CONSTRAINED OPTIMIZATION
CLASS EXERCISE Is this system constrained or
unconstrained?
- The goal is to maximize CB in the effluent at
S-S - You can adjust only the flow rate of feed
- This is an isothermal CFSTR with the reaction
- A ? B ? C
- You can adjust F, CA0
- You can adjust F, CA0, Fc, and V
Before we solve it, can we recognize it?
3CONSTRAINED OPTIMIZATION
CLASS EXERCISE Is this system constrained or
unconstrained?
Optimization of XD and XB - energy/yield
tradeoff can be unconstrained in some situations
Increasing energy
XB, impurity
0
0
XD, impurity
Why might this be constrained?
4CONSTRAINED OPTIMIZATION
CLASS EXERCISE Is this system constrained or
unconstrained?
Optimization of XD and XB - energy/yield
tradeoff can be unconstrained in some situations
Reboiled vapor
pressure
Please explain the constraints. We need to model!
5CONSTRAINED OPTIMIZATION
CLASS EXERCISE Is this system constrained or
unconstrained?
Optimization of XD and XB - energy/yield
tradeoff can be unconstrained in some situations
Reboiled vapor
pressure
Now, where should we operate?
6Constrained Optimization Convert to Unconstrained
HARD SOFT CONSTRAINTS Convert inequality
constraints to terms in the objective function
that force the solution into (at least towards)
the feasible region.
The penalty parameter, r, can be adjusted using
an iterative method.
7Constrained Optimization Convert to Unconstrained
feasible
External Penalty Functions change the objective
in the infeasible region. For example,
F(x)
f(x)
Increasing r
x
8Constrained Optimization Convert to Unconstrained
- The power of violation lt 1, likely too weak a
penalty - The power of violation 1, can match
unconstrained optimum, but discontinuous
derivatives - The power of violations gt 1 note that 2 gives
continuous derivatives
External Penalty Functions
9Constrained Optimization Convert to Unconstrained
Increasing r
Internal Penalty Functions change the objective
in the feasible region. For example,
F(x)
f(x)
feasible
x
10Constrained Optimization Convert to Unconstrained
Internal Penalty Functions
- Requires a feasible starting point and cannot
have infeasible point at any iteration - Constraints should be normalized to equally
penalize - Must modify r during iterations
11Constrained Optimization Convert to Unconstrained
CLASS EXERCISE Convert the following constrained
optimization to an unconstrained optimization.
A ? B ? C
12Constrained Optimization Convert to Unconstrained
CLASS EXERCISE This solution applies the
external penalty function, r.
13Constrained Optimization Convert to Unconstrained
- The penalty can strongly distort the contours, so
it is not typically used to convert the
constrained to unconstrained problem. - However, we will use these concepts in some
algorithms.
14EQUALITY CONSTRAINED
From Reklaitis et al, 1983
15EQUALITY CONSTRAINED
From Reklaitis et al, 1983
16EQUALITY CONSTRAINED
From Reklaitis et al, 1983
17EQUALITY CONSTRAINED
From Reklaitis et al, 1983
18INEQUALITY CONSTRAINED
INEQUALITY 5-X1-X2gt0
From Reklaitis et al, 1983
19INEQUALITY CONSTRAINED
From Reklaitis et al, 1983
20Constrained Optimization Basic Concepts
GENERAL CONCEPT FOR EQUALITY CONSTRAINED
OPTIMIZATION The constraints introduce
limitations on the allowable moves in the
variables (?x). For equality constrained
problems, the moves must remain on the curve of
the constraint.
Equality constraint
- f(x) 2.2 (x1)- 3( x1)2 .45 (x2)
- - .11 (x2)2
- How many DOF?
- How do we determine the gradient of profit?
x2
Can we move in this direction?
x1
21Equality Constrained Optimization Convert to
Unconstrained
x is a vector of variables (flows, compositions,
etc. ) It has a dimension n.
Dimension n-m
Dimension m
- If we have n variables and m (independent)
EQUALITY constraints, we have n-m degrees of
freedom for optimization. - We can solve the equations analytically to
eliminate m of the variables.
22Equality Constrained Optimization Convert to
Unconstrained
y is a vector of variables (flows, compositions,
etc. It has a dimension n-m. After solving for
y, we can solve for z Z(y)
- We must be able to analytically solve for z as a
function of y and substitute these into the
original problem. - This is always possible for linear equations, not
so for non-linear equations.
23Equality Constrained Optimization Convert to
Unconstrained
CLASS EXERCISE Convert the following constrained
optimization to an unconstrained optimization and
solve.
24Equality Constrained Optimization Convert to
Unconstrained
CLASS EXERCISE Start by eliminating one variable
using the linear equation.
25Equality Constrained Optimization Non-Linear
equalities
What if the equations are not linear The
constraints introduce limitations on the
allowable moves in the variables (?x). For
equality constrained problems, the moves must
remain on the curve of the constraint. Or, at
least near the constraint
Equality constraint
x2
Can we move in this direction?
x1
26Equality Constrained Optimization Non-Linear
equalities
The total derivative of the objective function is
why?
The total derivative of the constraint must be
zero.
How can we use these results to determine the
constrained derivative?
27Equality Constrained Optimization Non-Linear
equalities
Rearrange the constraint equation to solve for
dx1 (we could have solved for dx2).
The derivatives are evaluated at a point (x1,
x2) dh/dx2 ? 0
This is the relationship between x1 and x2 that
is forced by the equality constraint at a
specific point.
28Equality Constrained Optimization Non-Linear
equalities
Replace with result from constrained change
Directional derivative or reduced gradient is
derivative while observing the equality
constraint(s) at a point
29Equality Constrained Optimization Non-Linear
equalities
All points on this curve satisfy h0
f
x1
NECESSARY CONDITION FOR OPTIMALITY From the basic
concept of optimality, the directional or reduced
gradient must be zero for a minimum. (This is
not sufficient).
30Equality Constrained Optimization Non-Linear
equalities
CLASS EXERCISE Express the necessary condition
for the equality constrained minimum of the
following problem.
31Equality Constrained Optimization Non-Linear
equalities
CLASS EXERCISE The method finds a search
direction that approximately remains on the
equality constraint.
How far should we go in this direction?
32Equality Constrained Optimization Non-Linear
equalities
CLASS EXERCISE The method finds a search
direction that approximately remains on the
equality constraint.
How far should we go in this direction?
f(x)
h0
33Equality Constrained Optimization Non-Linear
equalities
GENERALIZE THE CONDITION FOR A MINIMUM FOR MANY
EQUALITY CONSTRAINTS AND MANY VARIABLES.
These are the same conditions we have used
previously, but they are in a reduced space of
moves in x that satisfy h(x)0.
34Equality Constrained Optimization Lagrangian
Lets reconsider the equality constrained problem.
We can define the term to be lambda
Necessary conditions
35Equality Constrained Optimization Lagrangian
The stationarity for the equality constrained
problem
Identical!
Can be restated as the stationarity of the
Lagrangian
Identical!
36Equality Constrained Optimization Lagrangian
The stationarity for the equality constrained
problem occurs at the same values of x as the
stationarity of the Lagrangian!
Definition
Stationarity
? is the Lagrange multiplier its value is
determined by the stationarity conditions.
37Equality Constrained Optimization Lagrangian
CLASS EXERCISE Express the necessary condition
for the equality constrained minimum of the
following problem using Lagrange multipliers.
38Equality Constrained Optimization Lagrangian
CLASS EXERCISE Determine the stationarity
equations.
h 0
f
These non-linear equations define the
stationarity point x1 -2.77 x2 -4.155 ?
0.36
Note, no sign limitation on the Lagrange
multiplier
39Constrained Optimization Lagrangian
How can we interpret the Lagrange multiplier?
Original problem with rhs isolated
Lagrangian
Stationarity or necessary conditions
40Constrained Optimization Lagrangian
Lets simplify to two x variables and one
equality
A
B
Multiply B by ? and subtract from A.
What is the result if we evaluate this at the
stationary point?
41Constrained Optimization Lagrangian
The Lagrange multiplier is the sensitivity of the
objective to the rhs - at the optimum!
42Constrained Optimization Lagrangian
We have just covered an important and complex
issue.
Lets look back and review the material in a less
formal manner, to see the essential logic and
simplicity, and to develop a graphical
interpretation.
43It is easy, I like it!!
It is easy, I like it!!
Constrained Optimization Comparing Linear
Non-Linear Equalities
Lets look at the linearly constrained problem
44Constrained Optimization Comparing Linear
Non-Linear Equalities
Lets look at the non-linearly constrained problem
This is a NL problem, with non-linear constraints
45Constrained Optimization Comparing Linear
Non-Linear Equalities
Non-linear equality constraint, h(x) 0
x2
This is the direction of steepest descent, ?x f
x1
46Constrained Optimization Comparing Linear
Non-Linear Equalities
Lets look ahead an see how we will use this
funny derivative.
Next, we perform a linear search along the
direction and find a local, approximate
minimum Note we use the non-linear equation at
each step along the direction.
x2
Non-linear equality constraint, h(x) 0
x1
47Constrained Optimization Comparing Linear
Non-Linear Equalities
Next, we can return to the constraint we must
solve some NL equations.
x2
x
x
x
x1
48Constrained Optimization Comparing Linear
Non-Linear Equalities
Non-linear equality constraint, h(x) 0
x2
Then, we evaluate the directional derivative
again and repeat the process
x1
49Oh, no!
Constrained Optimization Comparing Linear
Non-Linear Equalities
Lets look at the Lagrangian formulation
This is a NL problem, with non-linear constraints
50Constrained Optimization Comparing Linear
Non-Linear Equalities
Lets look at the Lagrangian formulation
necessary conditions for optimality.
51That wasnt so bad!!
Constrained Optimization Comparing Linear
Non-Linear Equalities
Lets look at the Lagrangian formulation
It can be applied to linear or non-linear
constraints
It can be extended to inequality constraints
There is no sign restriction on the lagrange
multiplier of an equality constraint
52Constrained Optimization
f unconstrained objective function
Unconstrained objective function
x2
Steepest descent for unconstrained optimization
x1
h(x)0
Ignored for the unconstrained problem
53Constrained Optimization
- Caution
- This a 2-dimensional picture of a 3-dimensional
system - The correct lagrange multipliers are only know at
the optimum other values are estimates.
54Constrained Optimization Basic Concepts
GENERAL CONCEPT FOR INEQUALITY CONSTRAINED
OPTIMIZATION
feasible
feasible
When the constraints are not active, no change.
What is the condition when a constraint is active?
55Constrained Optimization Basic Concepts
QUICK REVIEW FOR UNCONSTRAINED Basic Definition
The general definition of a minimum of f(x) is x
is a minimum if f(x) ? f(x ?x) for small ??x
56Inequality Constrained Optimization Basic
Concepts
FOR INEQUALITY CONSTRAINED Basic Definition For
a minimum, all feasible points around the minimum
have objective values higher than at the minimum.
x2
feasible
x1
57Inequality Constrained Optimization Basic
Concepts
FOR INEQUALITY CONSTRAINED
What goes here? , ? , ?
What limitations are placed on the ?x vector?
58Inequality Constrained Optimization Basic
Concepts
FOR INEQUALITY CONSTRAINED
For minimizing
Restrict the ?x vector to feasible directions.
59Inequality Constrained Optimization Basic
Concepts
CLASS EXERCISE Graphically represent the
conditions for the optimum of the system sketched
below.
60Inequality Constrained Optimization Basic
Concepts
We want to extend the Lagrangian for inequality
constraints to formulate optimality
conditions. 1. Subtract a constant to obtain 0
rhs, i.e., g(x) ? 0 2. Define a Lagrangian that
combines the objective and constraints 3. Find
stationarity conditions for this unconstrained
Lagrangian
61Inequality Constrained Optimization Basic
Concepts
Original problem statement
Lagrangian with u Lagrange multipiers
62Inequality Constrained Optimization Basic
Concepts
The stationarity for the inequality constrained
problem occurs at the stationarity of the
Lagrangian!
Definition
Stationarity
63Inequality Constrained Optimization Basic
Concepts
Discuss the interpretation of Lagrange multiplie
rs
- These are the complementarity conditions.
- When gj(x)gt 0 inactive, its Lagrange multiplier
uj 0 - When gj(x) 0 active, its Lagrange
multiplier uj gt 0
64 General Constrained Optimization The Lagrangian
Objective function
Equality constraints
Inequality constraints
x Problem variables (vector) ? Lagrange
multipliers for equalities (vector) u Lagrange
multipliers for inequalities (vector)
65 General Constrained Optimization The Lagrange
multipliers
? Lagrange multipliers for equalities
Shadow price for the constraint u Lagrange
multipliers for inequalities Shadow price
for the active constraints
Complementarity conditions
66 General Constrained Optimization Stationarity
- We note the following important properties
- We have transformed a constrained to an
unconstrained problem with variable bounds - L(x, ?, u) f(x) for feasible x
- A local minimum of L(x, ?, u) occurs at the
local minimum of f(x) thus, we determine the
x and the sensitivities of the constraints, ?,
u
67 General Constrained Optimization Stationarity
Necessary sufficient conditions for optimality
(ga(x)active)
Stationarity Curvature
68General Constrained Optimization
Karesh-Kuhn-Trucker Conditions
Necessary sufficient conditions for optimality
(ga(x)active)
Stationarity curvature
69General Constrained Optimization
Karesh-Kuhn-Trucker Conditions
CLASS EXERCISE What is the meaning of the
requirement that the Lagrange multipliers are
positive?
70General Constrained Optimization
Karesh-Kuhn-Trucker Conditions
CLASS EXERCISE Determine the necessary
conditions for a minimum in the following problem.
71General Constrained Optimization
Karesh-Kuhn-Trucker Conditions
72General Constrained Optimization
Karesh-Kuhn-Trucker Conditions
- The preceding necessary and sufficient
conditions are a form of the famous
Karesh-Kuhn-Trucker (KKT) Conditions for
optimality. - The functions must be twice continuously
differentiable - The active constraints must be linearly
independent at the optimum - The result defines a local minimum
73Constrained Optimization Basic Concepts
- Using the Lagrangian to design NLP solvers.
- We will apply the concepts of the unconstrained
optimizers to L. - However, we must be careful about measuring
progress, because L k1 lt Lk ensures that f k1
lt fk only if the points are feasible. - Our methods must ensure feasibility (for a
non-linear system) or devise a measure of
improvement (merit) that distorts the geometry
to create min(L) min P at the same x.