UNIT 2:
FORMULATING THE OPTIMIZATION PROBLEM
•
•
•
•
•
•
Variables
The objective function
Equality constraints
Inequality constraints
Degrees of freedom
Formulating the problem
Introducción a la Optimización de procesos químicos. Curso 2005/2006
FORMULATING THE OPTIMIZATION
PROBLEM
This is the general formulation that we will be using
throughout the course
max f ( x )
x
Objective function
s.t.
h( x ) = 0
Equality constraints
g ( x) £ 0
Inequality constraints
xmin £ x £ xmax
Variable Bounds
Introducción a la Optimización de procesos químicos. Curso 2005/2006
max f ( x)
x
VARIABLES
xmin £ x £ xmax
Variables can be grouped into two categories
“decision” or “optimization” variables
These are the variables in the system
that are changed independently to
modify the behavior of the system.
s.t.
h( x ) = 0
g ( x) £ 0
xmin £ x £ xmax
dependent variables
whose behavior is determined by the
values selected for the independent
variables.
Although they can be grouped this way to help understanding, the
solution method need not distinguish them. We need to solve a set
of equations involving many variables.
DESIGN: reactor volume, number of trays, heat exch. area, …
OPERATIONS: temperature, flow, pressure, valve opening, …
MANAGEMENT: feed type, purchase price, sales price, ..
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
max f ( x)
x
VARIABLES
s.t.
h( x ) = 0
g ( x) £ 0
xmin £ x £ xmax
Some comments on variables
•
Many variables are continuous, but some are discrete or integer.
Exercise: Should we model the following as continuous or discrete?
- Ball bearings in a plant that manufactures 10,000/day
- Crew on an airplane
- Automobiles in the Missassauga Ford plant
Exercise: Give some additional examples of each.
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
max f ( x)
x
VARIABLES
To flare
s.t.
T
29
PAH
T
30
h( x ) = 0
PC-1
g ( x) £ 0
PV-3
xmin £ x £ xmax
L4
P3
T5
P
12
P
20
LAH
LAL
Some comments on variables
LC-1
17
FC
7
16
dP-1
F
30
15
T6
AC
1
P
21
T10
•Since we solve a set of
simultaneous equations, all
variables are evaluated together.
3
TC
7
T20
FC
4
2
dP-2
• Typically, we do not define the
“decision” and “dependent”
variables.
1
P
11
T
44
T
22
LC
3
LAH
LAL
Exercise: Identify variables in
each category.
F9
FC
8
T
45
P
23
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
max f ( x)
x
VARIABLES
s.t.
To flare
T
29
PAH
h( x ) = 0
T
30
g ( x) £ 0
PC-1
xmin £ x £ xmax
PV-3
L4
P3
T5
P
12
P
20
Some comments on variables
LAH
LAL
LC-1
17
FC
7
16
We should always place
bounds on variables.
dP-1
F
30
15
Exercise: Why place bounds?
T6
AC
1
P
21
T10
3
TC
7
T20
FC
4
2
dP-2
Exercise: Propose bounds for
variables in the process.
1
P
11
T
44
T
22
LC
3
LAH
LAL
F9
FC
8
T
45
P
23
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
max f ( x)
x
OBJECTIVE FUNCTION
s.t.
h( x ) = 0
max f ( x)
x
This is the goal or objective, e.g.,
- maximize profit (minimize cost)
- minimize energy use
- minimize polluting effluents
- minimize mass to construct a vessel
How should I
formulate these?
g ( x) £ 0
xmin £ x £ xmax
We will formulate most problems with a scalar objective function
This should represent the full effect of x on the objective. For
example, $/kg is not a good objective unless kg is fixed. When
needed, include time-value of money.
Also, we need a quantitative measure, not “good” or “bad”.
The symbol “x” represents the variables. It is a vector.
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
max f ( x)
x
OBJECTIVE FUNCTION
s.t.
h( x ) = 0
g ( x) £ 0
xmin £ x £ xmax
Some comments on the objective function
•
A scalar is preferred for solving. However, multiple objectives are typical
in real life.
•
Note that Max (f) is the same as Min (-f)
- Therefore, no fundamental or practical difference between max and
min problems. The same algorithm and software can solve both.
•
Sometimes we use a simple, physical variable, such as yield of a key
product. This assumes that max (profit) is the same as Max(yield), which
might not always be true.
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
max f ( x)
x
OBJECTIVE FUNCTION
s.t.
h( x ) = 0
g ( x) £ 0
Some comments on the objective function (continued)
xmin £ x £ xmax
•
We have difficulty when the models are inaccurate, for example, the
tradeoff between current reactor operation and long-term catalyst activity.
•
Modelling the market response to improved product quality, etc is difficult.
•
We want a “smooth” objective function.
•
The objective function can be a function of indexed variables
Exercise: Write the expression for an objective function that depends on
all variables x(i) and the cost associated with each variable is c(i).
- Express the answer as a summation of indexed variables
- Express the answer as a product of vectors
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
max f ( x)
x
EQUALITY CONSTRAINTS
s.t.
s.t.
h( x ) = 0
h( x) = 0
xmin £ x £ xmax
g ( x) £ 0
This means “subject to”. The expressions below limit (or
constrain) the allowable values of the variables x. They define the
feasible region
For example?
These are equality constraints, e.g.,
- material, energy, force, current, … BALANCES
- equilibrium
- decisions by the engineer ( F1 - .5 F2 = 0 )
- behavior enforced by controls TC set point = 231
By convention, we will write the equations with a zero rhs (right hand side).
There can be many of these equations, so that h(x) is a vector.
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
max f ( x)
x
EQUALITY CONSTRAINTS
s.t.
h( x ) = 0
1. Define Goals
2. Prepare
information
3. Formulate
the model
4. Determine
the solution
5. Analyze
Results
•
•
•
What decision?
What variable?
Location
•
•
•
•
Sketch process
Collect data
State assumptions
Define system
g ( x) £ 0
xmin £ x £ xmax
• What type of equations do we use first?
Component Material
ì Accumulation of ü ì component ü ì component ü
í
ý=í
ý- í
ý
î component mass þ î mass in
þ î mass out þ
ì generation of
ü
+í
ý
î component massþ
Energy
ì Accumulation ü
í
ý = {H + PE + KE in} - {H + PE + KE out}
î U + PE + KE þ
+ Q-Ws
Conservation balances for key variable
• How many equations do we need?
Degrees of freedom = NV - NE = 0
• What after conservation balances?
Constitutive
equations, e.g.,
Q = h A (T)
rA = k 0 e -E/RT
Typically, the solution and optimization are achieved simultaneously.
6. Validate the
model
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
EQUALITY CONSTRAINTS
Some comments on equality constraints
•
The key balances must be strictly observed. If we do not ensure that they
are “closed”, the optimizer will find a way to create mass and energy!
•
The constraints can also have indices. For example, the index could be a
location (tray).
å
h j ( x) = 0
"
j
h j ( x) = 0
for all
j
i
å
These are equivalent
statements
i
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
max f ( x)
x
EQUALITY CONSTRAINTS
s.t.
h( x ) = 0
g ( x) £ 0
Some comments on equality constraints
xmin £ x £ xmax
•
Balances can be on a wide range of entities, e.g.
- material
- time
- boxes in a warehouse
- people working in sections of a plant
•
The models can change. For example, a heat exchanger could have
either one or two phases, with the number of phases depending on the
optimization decisions.
This makes a solution very difficult!
Exercise: F(m,n) is the total mass flow rate leaving unit m and going to
unit n.
Formulate the constraints for material balance for every unit.
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
max f ( x)
x
INEQUALITY CONSTRAINTS
s.t.
h( x ) = 0
s.t.
g ( x) £ 0
g ( x) £ 0
xmin £ x £ xmax
These are “one-way” limits to the system, e.g.,
- maximum investment available
- maximum flow rate due to pump limit
- minimum liquid flow rate on tray # 24
- minimum steam generation in a boiler for stable flame
- maximum pressure of a closed vessel
for example?
We must be careful to prevent defining a problem incorrectly with
no feasible region.
By multiplying by (-1), we can change the inequality to g(x)<=0
So, these two forms are equivalent.
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
max f ( x)
x
s.t.
DEGREES OF FREEDOM (DOF)
h( x ) = 0
g ( x) £ 0
Can we determine the DOF for an optimization problem using
the relationship below?
xmin £ x £ xmax
DOF = (# variables) - (# equations)
# variables =
# equations =
For optimization, what value(s) do we expect for the DOF?
The answer explains why optimization is so widely applied!
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
max f ( x)
x
DEGREES OF FREEDOM (DOF)
s.t.
h( x ) = 0
Often, we will think of the problem as having
g ( x) £ 0
#Opt Var = # var - #equality constr.
xmin £ x £ xmax
Opt Var2
We can plot this if only two dimensions.
feasible
region
What about points
inside?
Which is the best?
Opt Var1
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
DEGREES OF FREEDOM (DOF)
We can plot values of the objective function as contours.
Opt Var2
Opt Var2
Exercise: Where is the optimum for the two cases shown below?
Opt Var1
Case A
FORMULATING THE OPTIMIZATION PROBLEM
Opt Var1
Case B
Introducción a la Optimización de procesos químicos. Curso 2005/2006
DEGREES OF FREEDOM (DOF)
This is a typical feasible
region for a CSTR with
reaction
Solvent
T
AB
with reactant and coolant
adjusted.
A
Reactant
Coolant
Explain the shape of the
feasible region.
From Marlin, Process Control, McGrawHill, New York, 1995
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
DEGREES OF FREEDOM (DOF)
The feasible region depends
on the degrees of freedom,
i.e., the number of variables
that are adjusted
independently.
Solvent
We revisit the CSTR, but
only the coolant flow can be
adjusted.
T
A
Reactant
Coolant
What is different?
From Marlin, Process Control, McGrawHill, New York, 1995
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
FORMULATING THE OPTIMIZATION
PROBLEM
max f ( x )
How do we select the appropriate
“system” for a specific problem?
x
s.t.
h( x ) = 0
g ( x) £ 0
xmin £ x £ xmax
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
FORMULATING THE OPTIMIZATION
PROBLEM
max f ( x )
x
How do we define a scalar that
represents performance, including
• Economics
s.t.
• Safety
h( x ) = 0
• Product rates (contracts!)
g ( x) £ 0
• …...
• Product quality
• Flexibility
xmin £ x £ xmax
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
FORMULATING THE OPTIMIZATION
PROBLEM
max f ( x )
How accurately must we model the
physical process?
x
s.t.
• Macroscopic
h( x ) = 0
• Steady-state or dynamic
g ( x) £ 0
• Rate models (U(f), k0e-E/RT, ..
• 1,2 3, spatial dimensions
• Physical properties
xmin £ x £ xmax
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
FORMULATING THE OPTIMIZATION
PROBLEM
max f ( x )
What limits the possible solutions to
the problem?
x
s.t.
• Safety
• Product quality
h( x ) = 0
g ( x) £ 0
• Equipment damage (long term)
• Equipment operation
• Legal/ethical considerations
xmin £ x £ xmax
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
FORMULATING THE OPTIMIZATION
PROBLEM
max f ( x )
x
s.t.
h( x ) = 0
g ( x) £ 0
xmin £ x £ xmax
Factoid: Many process simulations and
optimizations have a large number of
variables and constraints. Why?
• Entire model is repeated for many
locations, e.g., trays in a tower.
• Model repeated for many components
in a stream.
• Model repeated for many times in a
dynamic system
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
FORMULATING THE OPTIMIZATION
PROBLEM
We use the term “tractable” to describe whether we can
1. Solve the mathematical optimization problem
2. Achieve desired accuracy in the “Real World”
- This prevents us from using a useless, simple model
3. Calculate the solution in an acceptable time. The allowable time
depends on the problem.
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
FORMULATING THE OPTIMIZATION
PROBLEM
The engineer must select the appropriate balance for
each problem. The problem must be tractable.
Intractable problems have to be reformulated.
Very accurate
over wide range
of conditions
Less accurate
over a narrow
range of
conditions
Longer
computing
Shorter
computing
More complex
Less complex
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
FORMULATING THE OPTIMIZATION
PROBLEM
Uncertainty: We must recognize uncertainty in our methods and
estimate bounds of the effects of out solutions.
“The truth”
Not known with certainty
• Structure of equations
• Measurement error
• Parameter values
• Disturbances
Decisions
to be made
model
Solver
method and
software
Solution
Does the formulation and solution method support the solution?
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
Optimization Formulation: Workshop #1
We want to schedule the production in two plants, A and B, each of which
can manufacture two products: 1 and 2. How should the scheduling take
place to maximize profits while meeting the market requirements based on
the following data:
Material processed
(kg/day)
Plant
Profit
(€/kg)
1
2
1
2
A
MA1
MA2
SA1
SA2
B
MB1
MB2
SB1
SB2
How many days per year should each plant operate processing each kind of
material?
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
Optimization Formulation: Workshop #2
Material reconciliation
Suppose the flow rates entering and leaving a process are measures
periodically. Determine the best value for stream A in kg/h for the process
shown from the three hourly measurements indicated of B and C in the
figure, assuming steady-state operation at a fixed operating point.
A
B
plant
(a) 92.4kg/h
(b) 94.3kg/h
(c) 93.8kg/h
(a) 11.1kg/h
C
(b) 10.8kg/h
(c) 11.4kg/h
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
Optimization Formulation: Workshop #3
Material flows allocation
Consider the process diagram of the figure where each product (E,F,G)
requires different amounts of reactants according to the table shown in the
next slide.
The table below show the maxium amount of reactant available per day as
well as the cost per kg.
A
B
1
2
C
3
E
Raw material Maximum
available
(kg/day)
Cost (€/kg)
A
40000
1.5
B
30000
2.0
C
25000
2.5
F
G
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
Optimization Formulation: Workshop #3 (cont’d)
Formulate the optimization problem. The objective function is to
maximize the total operating profit per day in units of €/day
Process
Product
Reactants
requirements
(kg/kg product)
Processing
cost (product)
(€/kg)
Selling price
(product)
(€/kg)
1
E
2/3A,1/3B
1.5
4.0
2
F
2/3A,1/3B
0.5
3.3
3
G
1/2A,1/6B,1/3C
1.0
3.8
Introducción a la Optimización de procesos químicos. Curso 2005/2006
Optimization Formulation: Workshop #4
TAH
Problem formulation: We love
chemical reactors. Formulate
an economic optimization for
the reactor in the figure.
TC
TY
>
PC
T
T
FC
fo
L
fc
The reaction is
A BC
with first order, irreversible rate
expressions and arrhenius
temperature dependence.
PAH
LAH
LAL
LC
fo
CW
fo
Dump to safe
location
Include the objective function, equality constraints, inequality constraints,
and variable bounds.
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
Optimization Formulation: Workshop #5
Formulation: Describe the major
components of a steady-state optimization
model for the distillation tower in the
figure.
To flare
T
29
PAH
T
30
PC-1
PV-3
L4
P3
T5
• Define the objective function
P
12
P
20
LAH
LAL
LC-1
• Identify continuous and discrete variables
17
FC
7
16
• Identify dependent and independent
variables
dP-1
F
30
15
T6
AC
1
P
21
T10
3
TC
7
• Give examples of each category of
equality constraints
T20
1
P
11
• Give examples of each category of
inequality constraints
T
44
T
22
LC
3
LAH
LAL
F9
• Discuss advantages for indexed variables
and constraints
FORMULATING THE OPTIMIZATION PROBLEM
FC
4
2
dP-2
FC
8
T
45
P
23
Introducción a la Optimización de procesos químicos. Curso 2005/2006
Optimization Formulation: Workshop #6
Formulation: Let’s consider a
semi-batch chemical reactor.
Solvent
• Discuss the major difference in
this model from others in this
section.
T
A
• Formulate the model.
Reactant
• Describe how you would optimize
the temperature, feed rates, etc.
after you have a computer
program to solve the model.
FORMULATING THE OPTIMIZATION PROBLEM
Coolant
Introducción a la Optimización de procesos químicos. Curso 2005/2006
© Copyright 2026 Paperzz