View
214
Download
1
Category
Tags:
Preview:
Citation preview
Introducción a la Optimización de procesos químicos. Curso 2005/2006
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
Objective function
This is the general formulation that we will be using throughout the course
min max
max ( )
. .
( ) 0
( ) 0
xf x
s t
h x
g x
x x x
=
£
£ £
Equality constraints
Variable Bounds
Inequality constraints
Introducción a la Optimización de procesos químicos. Curso 2005/2006
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.
dependent variables
whose behavior is determined by the values selected for the independent variables.
DESIGN:
OPERATIONS:
MANAGEMENT:
Although they can be grouped this way to help understanding, thesolution method need not distinguish them. We need to solve a setof equations involving many variables.
min max
max ( )
. .
( ) 0
( ) 0
xf x
s t
h x
g x
x x x
=
£
£ £
FORMULATING THE OPTIMIZATION PROBLEM
VARIABLESmin maxx x x£ £
reactor volume, number of trays, heat exch. area, …
temperature, flow, pressure, valve opening, …
feed type, purchase price, sales price, ..
Introducción a la Optimización de procesos químicos. Curso 2005/2006
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.
min max
max ( )
. .
( ) 0
( ) 0
xf x
s t
h x
g x
x x x
=
£
£ £
VARIABLES
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
Some comments on variables
• Typically, we do not define the “decision” and “dependent” variables.
•Since we solve a set of simultaneous equations, all variables are evaluated together.
Exercise: Identify variables in each category.
1
2
3
15
16
17LC-1
LC3
dP-1
dP-2
To flare
T5
T6
TC7
AC1
LAHLAL
PAH
PC-1
P3
FC4
FC7
FC 8
F9
PV-3
T10
L4
T20
LAHLAL
F
30
P20
P23
T45
T44
P21
T
22
P11
P12
T30
T29
min max
max ( )
. .
( ) 0
( ) 0
xf x
s t
h x
g x
x x x
=
£
£ £
FORMULATING THE OPTIMIZATION PROBLEM
VARIABLES
Introducción a la Optimización de procesos químicos. Curso 2005/2006
Some comments on variables
We should always place bounds on variables.
Exercise: Why place bounds?
Exercise: Propose bounds for variables in the process.
1
2
3
15
16
17LC-1
LC3
dP-1
dP-2
To flare
T5
T6
TC7
AC1
LAHLAL
PAH
PC-1
P3
FC4
FC7
FC 8
F9
PV-3
T10
L4
T20
LAHLAL
F
30
P20
P23
T45
T44
P21
T
22
P11
P12
T30
T29
min max
max ( )
. .
( ) 0
( ) 0
xf x
s t
h x
g x
x x x
=
£
£ £
FORMULATING THE OPTIMIZATION PROBLEM
VARIABLES
Introducción a la Optimización de procesos químicos. Curso 2005/2006
OBJECTIVE FUNCTION
min max
max ( )
. .
( ) 0
( ) 0
xf x
s t
h x
g x
x 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
We will formulate most problems with a scalar objective function
This should represent the full effect of x on the objective. Forexample, $/kg is not a good objective unless kg is fixed. Whenneeded, 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.
max ( )xf x
FORMULATING THE OPTIMIZATION PROBLEM
How should I formulate these?
Introducción a la Optimización de procesos químicos. Curso 2005/2006
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
OBJECTIVE FUNCTION
min max
max ( )
. .
( ) 0
( ) 0
xf x
s t
h x
g x
x x x
=
£
£ £
Introducción a la Optimización de procesos químicos. Curso 2005/2006
Some comments on the objective function (continued)
• 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.
FORMULATING THE OPTIMIZATION PROBLEM
min max
max ( )
. .
( ) 0
( ) 0
xf x
s t
h x
g x
x x x
=
£
£ £
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
Introducción a la Optimización de procesos químicos. Curso 2005/2006
EQUALITY CONSTRAINTS. .
( ) 0
s t
h x =
This means “subject to”. The expressions below limit (orconstrain) the allowable values of the variables x. They define thefeasible region
These are equality constraints, e.g., - material, energy, force, current, … - equilibrium - decisions by the engineer ( F1 - .5 F2 = 0 ) - behavior enforced by controls TC set point = 231
BALANCES
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
min max
max ( )
. .
( ) 0
( ) 0
xf x
s t
h x
g x
x x x
=
£
£ £
For example?
Introducción a la Optimización de procesos químicos. Curso 2005/2006
1. Define Goals
2. Prepare information
3. Formulate the model
4. Determine the solution
5. Analyze Results
6. Validate the model
• What decision?• What variable?• Location
• Sketch process• Collect data• State assumptions• Define system
Component Material
Accumulation of component component
component mass mass in mass out
generation of
component mass
ì ü ì ü ì ü= -í ý í ý í ý
î þ î þ î þ
ì ü+í ýî þ
Energy
{ } { }
s
AccumulationH PE KE in H PE KE out
U PE KE
Q-W
ì ü= + + - + +í ý
+ +î þ+
• What type of equations do we use first?
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.
FORMULATING THE OPTIMIZATION PROBLEM
min max
max ( )
. .
( ) 0
( ) 0
xf x
s t
h x
g x
x x x
=
£
£ £
EQUALITY CONSTRAINTS
Introducción a la Optimización de procesos químicos. Curso 2005/2006
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).
( ) 0
( ) 0
ji
ji
h x j
h x for all j
= "
=
å
å
These are equivalent statements
FORMULATING THE OPTIMIZATION PROBLEM
EQUALITY CONSTRAINTS
Introducción a la Optimización de procesos químicos. Curso 2005/2006
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
min max
max ( )
. .
( ) 0
( ) 0
xf x
s t
h x
g x
x x x
=
£
£ £
EQUALITY CONSTRAINTS
Some comments on equality constraints
• 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!
Introducción a la Optimización de procesos químicos. Curso 2005/2006
INEQUALITY CONSTRAINTS. .
( ) 0
s t
g x £min max
max ( )
. .
( ) 0
( ) 0
xf x
s t
h x
g x
x x x
=
£
£ £
FORMULATING THE OPTIMIZATION PROBLEM
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
We must be careful to prevent defining a problem incorrectly withno feasible region.
By multiplying by (-1), we can change the inequality to g(x)<=0So, these two forms are equivalent.
for example?
Introducción a la Optimización de procesos químicos. Curso 2005/2006
DEGREES OF FREEDOM (DOF)
Can we determine the DOF for an optimization problem using the relationship below?
DOF = (# variables) - (# equations)
# variables =
# equations =
FORMULATING THE OPTIMIZATION PROBLEM
min max
max ( )
. .
( ) 0
( ) 0
xf x
s t
h x
g x
x x x
=
£
£ £
For optimization, what value(s) do we expect for the DOF?
The answer explains why optimization is so widely applied!
Introducción a la Optimización de procesos químicos. Curso 2005/2006
Often, we will think of the problem as having
#Opt Var = # var - #equality constr.
We can plot this if only two dimensions.
Opt Var1
Opt
Var
2
feasibleregion
What about points inside?
Which is the best?
FORMULATING THE OPTIMIZATION PROBLEM
DEGREES OF FREEDOM (DOF)
min max
max ( )
. .
( ) 0
( ) 0
xf x
s t
h x
g x
x x x
=
£
£ £
Introducción a la Optimización de procesos químicos. Curso 2005/2006
Opt
Var
2Opt Var1Opt Var1
Opt
Var
2
Case A Case B
We can plot values of the objective function as contours.
Exercise: Where is the optimum for the two cases shown below?
FORMULATING THE OPTIMIZATION PROBLEM
DEGREES OF FREEDOM (DOF)
Introducción a la Optimización de procesos químicos. Curso 2005/2006
This is a typical feasible region for a CSTR with reaction
A B
with reactant and coolant adjusted.
Explain the shape of the feasible region.
From Marlin, Process Control, McGraw-Hill, New York, 1995
T
A
Reactant
Solvent
Coolant
FORMULATING THE OPTIMIZATION PROBLEM
DEGREES OF FREEDOM (DOF)
Introducción a la Optimización de procesos químicos. Curso 2005/2006
The feasible region depends on the degrees of freedom, i.e., the number of variables that are adjusted independently.
We revisit the CSTR, but only the coolant flow can be adjusted.
What is different?
T
A
Reactant
Solvent
Coolant
From Marlin, Process Control, McGraw-Hill, New York, 1995
FORMULATING THE OPTIMIZATION PROBLEM
DEGREES OF FREEDOM (DOF)
Introducción a la Optimización de procesos químicos. Curso 2005/2006
FORMULATING THE OPTIMIZATION PROBLEM
min max
max ( )
. .
( ) 0
( ) 0
xf x
s t
h x
g x
x x x
=
£
£ £
How do we select the appropriate “system” for a specific problem?
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
FORMULATING THE OPTIMIZATION PROBLEM
min max
max ( )
. .
( ) 0
( ) 0
xf x
s t
h x
g x
x x x
=
£
£ £
How do we define a scalar that represents performance, including
• Economics
• Safety
• Product quality
• Product rates (contracts!)
• Flexibility
• …...
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
FORMULATING THE OPTIMIZATION PROBLEM
How accurately must we model the physical process?
• Macroscopic
• 1,2 3, spatial dimensions
• Steady-state or dynamic
• Physical properties
• Rate models (U(f), k0e-E/RT, ..
min max
max ( )
. .
( ) 0
( ) 0
xf x
s t
h x
g x
x x x
=
£
£ £
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
FORMULATING THE OPTIMIZATION PROBLEM
What limits the possible solutions to the problem?
• Safety
• Product quality
• Equipment damage (long term)
• Equipment operation
• Legal/ethical considerations
min max
max ( )
. .
( ) 0
( ) 0
xf x
s t
h x
g x
x x x
=
£
£ £
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
FORMULATING THE OPTIMIZATION PROBLEM
min max
max ( )
. .
( ) 0
( ) 0
xf x
s t
h x
g x
x x x
=
£
£ £
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
Very accurate over wide range of conditions
Longer computing
More complex
Less accurate over a narrow range of conditions
Shorter computing
Less complex
The engineer must select the appropriate balance for each problem. The problem must be tractable. Intractable problems have to be reformulated.
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
Decisions to be made
modelSolver method and software
Solution
Does the formulation and solution method support the solution?
FORMULATING THE OPTIMIZATION PROBLEM
Not known with certainty
• Structure of equations
• Parameter values
“The truth”
• Measurement error
• Disturbances
Uncertainty: We must recognize uncertainty in our methods and estimate bounds of the effects of out solutions.
FORMULATING THE OPTIMIZATION PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
Optimization Formulation: Workshop #1
FORMULATING THE OPTIMIZATION PROBLEM
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:
How many days per year should each plant operate processing each kind of material?
Material processed (kg/day)
Profit(€/kg)
Plant 1 2 1 2
A MA1 MA2 SA1 SA2
B MB1 MB2 SB1 SB2
Introducción a la Optimización de procesos químicos. Curso 2005/2006
Optimization Formulation: Workshop #2
FORMULATING THE OPTIMIZATION PROBLEM
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.
Material reconciliation
(a) 11.1kg/h
(b) 10.8kg/h
(c) 11.4kg/h
(a) 92.4kg/h
(b) 94.3kg/h
(c) 93.8kg/h
A
C
Bplant
Introducción a la Optimización de procesos químicos. Curso 2005/2006
Optimization Formulation: Workshop #3
FORMULATING THE OPTIMIZATION PROBLEM
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.
Material flows allocation
A
B
C
E
F
G
Raw material
Maximum available (kg/day)
Cost (€/kg)
A 40000 1.5
B 30000 2.0
C 25000 2.5
1
2
3
Introducción a la Optimización de procesos químicos. Curso 2005/2006
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
Formulate the optimization problem. The objective function is to maximize the total operating profit per day in units of €/day
Optimization Formulation: Workshop #3 (cont’d)
Introducción a la Optimización de procesos químicos. Curso 2005/2006
Optimization Formulation: Workshop #4
Dump to safe location
FC
LC
CW
TC
fc
fo
fo
L LAHLAL
TAH
T T
TY>
PC
fo
PAH
Problem formulation: We love chemical reactors. Formulate an economic optimization for the reactor in the figure.
The reaction is
A B C
with first order, irreversible rate expressions and arrhenius temperature dependence.
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
1
2
3
15
16
17LC-1
LC3
dP-1
dP-2
To flare
T5
T6
TC7
AC1
LAHLAL
PAH
PC-1
P3
FC4
FC7
FC 8
F9
PV-3
T10
L4
T20
LAHLAL
F
30
P20
P23
T45
T44
P21
T
22
P11
P12
T30
T29
Formulation: Describe the major components of a steady-state optimization model for the distillation tower in the figure.
• Define the objective function
• Identify continuous and discrete variables
• Identify dependent and independent variables
• Give examples of each category of equality constraints
• Give examples of each category of inequality constraints
• Discuss advantages for indexed variables and constraintsFORMULATING THE OPTIMIZATION
PROBLEM
Introducción a la Optimización de procesos químicos. Curso 2005/2006
Optimization Formulation: Workshop #6
T
A
Reactant
Solvent
Coolant
Formulation: Let’s consider a semi-batch chemical reactor.
• Discuss the major difference in this model from others in this section.
• Formulate the model.
• Describe how you would optimize the temperature, feed rates, etc. after you have a computer program to solve the model.
FORMULATING THE OPTIMIZATION PROBLEM
Recommended