Outline: The Importance of A Good Formulation
Outline: The Importance of A Good Formulation
ChE 4G03: Optimization in Chemical Engineering 3 Graphic Solution and Optimization Outcomes
Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 1 / 31 Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 2 / 31
Model-based Optimization
1 The validity of a model is the degree to which inferences drawn from
1 The conclusions are drawn from the model hold for the real system
Procedure:
the model (mathematical 2 The tractability of a model is the degree to which this model admits
program), not from the problem!
Problem Modeling Mathematical convenient analysis – How much analysis is practical
to solve program 2 An inadequate model typically
Analysis
leads to false conclusions Tradeoff:
Assessment
3 The model must be Decision makers almost always confront a tradeoff between validity of
Decisions Solutions computationally tractable: its optimization models and their tractability to analysis
Inference
analysis must be practical!
Very accurate Less accurate
over wide range over narrow range
of conditions of conditions
Dofasco:
Longer Shorter
“We find it useful to formulate the optimization problem even if we cannot computations computations
solve it...” More complex Less complex
Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 3 / 31 Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 4 / 31
Optimization Model Formulation Decision Variables, x
Standard Model: 1 At the formulation stage, decision variables can be grouped into two
categories:
Optimization models (also called mathematical programs) represent ◮ Independent variables, whose values can be changed independently to
problem choices as decision variables and seek values that maximize (or modify the behavior of the system
minimize) objective functions of the decision variables subject to ◮ Dependent variables, whose behavior is determined by the values
constraints on variable values expressing the limits on possible decision selected for the independent variables
choices Such a grouping helps understanding!
2 At the solution stage, independent and dependent variables need not
be distinguished: the solution method just sees an optimization
max f (x) ←− Objective function problem involving many variables
x
s.t.
Examples of Decision Variables:
h(x) = 0 ←− Equality constraints
Design: reactor volume, number of trays, heat exchanger area, etc.
g(x) ≤ 0 ←− Inequality constraints
Operations: temperature, flow, pressure, valve opening, etc.
xmin ≤ x ≤ xmax ←− Variable bounds
Management: feed type, purchase price, sales price, etc.
Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 5 / 31 Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 6 / 31
Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 7 / 31 Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 8 / 31
Decision Variables, x (cont’d) Decision Variables, x (cont’d)
Indexing:
In real applications, optimization models quickly grow to thousands,
Exercise: Decide whether a discrete or a continuous variable would be sometimes millions, of variables: indexed notational schemes are needed to
best employed to model each of the following quantities: keep large models manageable!
1 the optimal temperature of a chemical process 1 Indexes (or subscripts) permit representing collections of similar
2 the warehouse slot assigned a particular product quantities with a single symbol, e.g.
3 whether a capital project is selected for investment {xi : i = 1, . . . , 100}
4 ball bearings in a plant that manufactures 10,000+/day
5 the number of aircraft produced on a defense contract represents 100 similar values with the same x name, distinguishing
them with the index i
2 The first step in formulating a large optimization model is to choose
appropriate indexes for the different dimensions of the problem;
multiple indexes are extremely common!
Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 9 / 31 Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 10 / 31
Inequality Constraints:
g(x) ≤ 0
Exercise:
Propose bounds for 1 These are one-way limits on the system and are essential for
variables in the process optimization
2 Inequality constraints of the form ≥ 0 and ≤ 0 are equivalent. Do you
see why?
3 There can be many of these inequalities, so that g(x) is a vector
(indexing is used for constraints too!)
4 We must be careful to prevent defining a problem incorrectly with no
feasible region or an unbounded solution
Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 13 / 31 Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 14 / 31
Main constraints, g(x) ≤ 0, h(x) = 0 (cont’d) Main constraints, g(x) ≤ 0, h(x) = 0 (cont’d)
What limits the possible solutions to the problem?
Safety
Equality Constraints:
Product quality (contracts)
Equipment damage (long term) h(x) = 0
Equipment operation
1 These describe interactions between the variables in the model
Legal/ethical considerations
2 Equality constraints are written with a zero right-hand side by
Examples: convention
Max. investment available 3 There can be many of these inequalities, so that h(x) is a vector
Max. flow rate due to pump limit (indexing is used for equality constraints too!)
Min. liquid flow rate on trays t = 1, . . . , Nt
4 There cannot be more (independent) equality constraints than
decision variables in the model! Do you see why?
Max. pressure in a closed vessel
Max. region within which an approximation/simplification is
acceptable
Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 15 / 31 Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 16 / 31
Main constraints, g(x) ≤ 0, h(x) = 0 (cont’d) Objective Function, f (x)
Examples of Equality Constraints:
material, energy, current, etc. balances, e.g. for conserved quantity q:
Objective functions in optimization models tell us how to rate decisions
accumulation rate of rate of generate
= − +
of q q in q out rate of q 1 We need a quantitative measure; a qualitative measure such as
“good” or “bad” is not adequate!
constitutive relations, e.g.
2 A scalar objective function is preferred for solving, even though
Q = hA∆T multiple objectives are typical in real life!
E
rA = k0 exp(− RT ) 3 There is no fundamentale or practical difference between max and
min problems:
equilibrium relations, e.g. VLE
max f (x) ⇔ min −f (x)
x x
decisions by the engineer, e.g. FA − 2FB = 0
behavior enforced by controllers, e.g. temperature set-point
Ts = 231 K
Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 17 / 31 Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 18 / 31
Question:
1 Very simple graphic solution have enough power to deal with tiny
models, such as 2- or 3-variable models
Formulate an optimization model in standard form so as to fulfill the
requirements in the most efficient manner. 2 The first issue in graphic solution is the feasible set:
Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 21 / 31 Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 22 / 31
x1 + x2 ≤ 2 x1 + x2 ≤ 2
3x1 + x2 ≥ 3 3x1 + x2 = 3 (x1 )2 + (x2 )2 ≤ 4 1 To find out the best feasible point, the objective function must be
x1 , x2 ≥ 0 |x1 | − x2 ≤ 0 introduced into a plot
x1 , x2 ≥ 0
2 Objective functions are normally plotted in the same coordinate
system as the feasible set by introducing contours:
3 3
3
2 2 The contour Cz of an objective function (in the decision variable space) is
2
the line or curve passing through points having equal objective values z:
1 1
1
∆
Cz = {x : f (x) = z}
1 2 3 1 2 3
2 1 1 2
Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 23 / 31 Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 24 / 31
Examples of Graphic Solutions Optimization Outcomes
Optimum
2 2
min 3x1 + x2 max (x1 ) + (x2 ) An optimal solution x∗ is a feasible choice for decision variables with
x1 ,x2 x1 ,x2
objective function value at least equal to that of any other solution
s.t. x1 + x2 ≤ 2 s.t. x1 + x2 ≤ 2 satisfying all constraints. For a minimization problem:
x1 , x2 ≥ 0 x1 , x2 ≥ 0
f (x∗ ) ≤ f (x), ∀x ∈ S
2
1 Optimal solutions show graphically as points lying on the best
2
objective function contour that intersects the feasible region
1 1 2 The optimal value f ∗ in an optimization model is the objective
function value of any optimal solutions: f ∗ = f (x∗ )
0.5 2 4.5 8
3 An optimization model can have only one optimal value
1 2
0 1.5 3 4.5 6
4 An optimization model may have:
◮ a unique optimal solution
Exercise: Plot the objective function contours in the two-crude case study. ◮ several alternative optimal solutions
◮ no optimal solutions (unbounded or infeasible models)
Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 25 / 31 Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 26 / 31
What is the optimal solution? What is the optimal value? What is the optimal solution? What is the optimal value?
2
2 2
1 1
1 1
Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 27 / 31 Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 28 / 31
Recognizing Optimization Opportunity Recognizing Optimization Opportunity
Class Exercise: What is optimum for the following process system? Class Exercise: What is optimum for the following process system?
F , T in , cAin F , T in , cAin
This is an isothermal CFSTR with This is an isothermal CFSTR with
T , cA , cB , cC the series reaction: T , cA , cB , cC the series reaction:
A→B→C A→B→C
Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 29 / 31 Benoı̂t Chachuat (McMaster University) Formulating an Optimization Problem 4G03 30 / 31