
476e0704c300ebc521c31b33ba70eee3.ppt
- Количество слайдов: 56
Process Optimization 3/19/2018
Tier I: Mathematical Methods of Optimization Daniel Grooms Section 1: Introduction 3/19/2018 2
Purpose of this Module • This module gives an introduction to the area of optimization and shows how optimization relates to chemical engineering in general and process integration in particular • This is an introduction so there are many interesting aspects that are not covered here For a more detailed discussion, see the references listed at the end of the module 3/19/2018 3
Introduction to Optimization • What is optimization? – A mathematical process of obtaining the minimum (or maximum) value of a function subject to some given constraints • Optimization is used every day – Examples: – Choosing which route to drive to a destination – Allocating study time for several classes – Cooking order of various items in a meal 3/19/2018 – How often to change a car’s air filter 4
Optimization Applications • Examples of optimization in a chemical plant: – At what temperature to run a reactor? – When to regenerate/change reactor catalyst? – What distillation reflux ratio for desired purity? – What pipe diameter for a piping network? • Optimization can be used to determine the best answer to each of these questions 3/19/2018 5
Benefits of Optimization • Able to systematically determine the best solution • Model created for optimization can be used for other applications • Insights gained during optimization process may identify changes that can be made to improve performance 3/19/2018 6
Optimization Requirements • A clear understanding of what is needed to be optimized. – Ex: minimize cost or maximize product quality? • A clear understanding of the constraints on the optimization. – Ex: safety concerns, customer requirements, budget limits, etc. • A way to represent these mathematically (i. e. a model) 3/19/2018 7
Definitions • Objective function: A representation of whatever you want to minimize or maximize – such as: cost, time, yield, profit, etc. • Variables: Things that can be changed to influence the value of the objective function • Constraints: Equalities or inequalities that limit the amount the variables may be changed 3/19/2018 8
More Definitions • Minimum: A point where the objective function does not decrease when the variable(s) are changed some amount. • Maximum: A point where the objective function does not increase when the variable(s) are changed some amount. Minimum: 3/19/2018 Strict minimum: 9
Modeling Example 1 A chemical plant makes urea and ammonium nitrate. The net profits are $1000 and $1500/ton produced respectively. Both chemicals are made in two steps – reaction and drying. The number of hours necessary for each product is given below: Step/Chemical Urea Ammonium Nitrate Reaction 4 2 Drying 2 5 3/19/2018 10
Modeling Example 1 The reaction step is available for a total of 80 hours per week and the drying step is available for 60 hours per week. There are 75 tons of raw material available. Each ton produced of either product requires 4 tons of raw material. What is the production rate of each chemical that will maximize the net profit of the plant? 3/19/2018 11
Modeling Example 1 • Objective Function: We want to maximize the net profit. Net Profit = Revenue – Cost. Let x 1 = tons of urea produced per week & x 2 = tons of ammonium nitrate produced per week. Revenue = 1000 x 1 + 1500 x 2. There is no data given for costs, so assume Cost = 0. So the objective function is: Maximize 1000 x 1 + 1500 x 2 3/19/2018 12
Modeling Example 1 • Constraints: We are given that the reaction step is available for 80 hrs/week. So, the combined reaction times required for each product cannot exceed this amount. The table says the each ton of urea produced requires 4 hours of reaction and each ton of ammonium nitrate produced requires 2 hours of reaction. This gives the constraint: 3/19/2018 4 x 1 + 2 x 2 ≤ 80 13
Modeling Example 1 We are also given that the drying step is available for 60 hrs/wk. The table says that urea requires 2 hrs/ton produced and ammonium nitrate requires 5 hrs/ton produced. So, we end up with the following constraint: 2 x 1 + 5 x 2 ≤ 60 3/19/2018 14
Modeling Example 1 We are given that the supply of raw material is 75 tons/week and each ton of urea or ammonium nitrate produced requires 4 tons of raw material. This gives our final constraint: 4 x 1 + 4 x 2 ≤ 75 3/19/2018 15
Modeling Example 1 Finally, to ensure a realistic result, it is always prudent to include non-negativity constraints for the variables where applicable. Here, we should not have negative production rates, so we include the two constraints x 1 ≥ 0 & x 2 ≥ 0 3/19/2018 16
Modeling Example 1 So, we have the following problem: Maximize 1000 x 1 + 1500 x 2 Subject to: 4 x 1 + 2 x 2 ≤ 80 Constraint 1 2 x 1 + 5 x 2 ≤ 60 Constraint 2 4 x 1 + 4 x 2 ≤ 75 Constraint 3 x 1, x 2 ≥ 0 When solved, this has an optimal answer of x 1 = 11. 25 tons/wk & x 2 = 7. 5 tons/wk 3/19/2018 17
Graph of Example 1 x 2 Optimum Point Constraint 1 Profit Vector Constraint 2 Constraint 3 x 1 The gray area is called the feasible region and you can see that the optimum point is at the intersections of constraints 2 & 3. Since we are maximizing, we went in the 3/19/2018 direction of the profit vector 18
Modeling Example 2 A company has three plants that produce ethanol and four customers they must deliver ethanol to. The following table gives the delivery costs per ton of ethanol from the plants to the customers. (A dash in the table indicates that a certain plant cannot deliver to a certain customer. ) Plant/Customer C 1 C 2 C 3 C 4 P 1 132 - 97 103 P 2 84 91 - - 106 89 100 98 3/19/2018 P 3 19
Modeling Example 2 The three plants P 1, P 2, & P 3 produce 135, 56, and 93 tons/year, respectively. The four customers, C 1, C 2, C 3, & C 4 require 62, 83, 39, and 91 tons/year, respectively. Determine the transportation scheme that will result in the lowest cost. 3/19/2018 20
Modeling Example 2 • Objective Function: We want to get the lowest cost, so we want to minimize the cost. The cost will be the costs given in the table times the amount transferred from each plant to each customer. Many of the amounts will be zero, but we must include them all because we don’t know which ones we will use. 3/19/2018 21
Modeling Example 2 Let xij be the amount (tons/year) of ethanol transferred from plant Pi to customer Cj. So, x 21 is the amount of ethanol sent from plant P 2 to customer C 1. We will leave out combinations the table says is impossible (like x 12). So, the objective function is: Minimize 132 x 11 + 97 x 13 + 103 x 14 + 84 x 21 + 91 x 22 + 106 x 31 + 89 x 32 + 100 x 33 + 98 x 34. 3/19/2018 22
Modeling Example 2 • Constraints: The ethanol plants cannot produce more ethanol than their capacity limitations. The ethanol each plant produces is the sum of the ethanol it sends to the customers. So, for plant P 1, the limit is 135 tons/year and the constraint is: x 11 + x 13 + x 14 ≤ 135 Since it can send ethanol to customers C 1, 3/19/2018 C 2, & C 4. 23
Modeling Example 2 For plants P 2 & P 3, the limits are 56 and 93 tons/year, so their constraints are: x 21 + x 22 ≤ 56 x 31 + x 32 + x 33 + x 34 ≤ 93 The ≤ sign is used because the plants may produce less than or even up to their limits, but they cannot produce more than the limit. 3/19/2018 24
Modeling Example 2 Also, each of the customers have ethanol requirements that must be met. For example, customer C 1 must receive at least 62 tons/year from either plant P 1, P 2, P 3, or a combination of the three. So, the customer constraint for C 1 is: x 11 + x 21 + x 31 ≥ 62 Since it can receive ethanol from plants P 1, P 2, & P 3. 3/19/2018 25
Modeling Example 2 The requirements for customers C 2, C 3, & C 4 are 83, 39, & 91 tons/year so their constraints are: x 22 + x 32 ≥ 83 x 13 + x 33 ≥ 39 x 14 + x 34 ≥ 91 The ≥ sign is used because it’s alright if the customers receive extra ethanol, but they must receive at least their minimum requirements. 3/19/2018 26
Modeling Example 2 • If the customers had to receive exactly their specified amount of ethanol, we would use equality constraints • However, that is not stated for this problem, so we will leave them as inequality constraints 3/19/2018 27
Modeling Example 2 As in the last example, non-negativity constraints are needed because we cannot have a negative amount of ethanol transferred. x 11, x 13, x 14, x 21, x 22, x 31, x 32, x 33, x 34 ≥ 0 3/19/2018 28
Modeling Example 2 The problem is: Minimize 132 x 11 + 97 x 13 + 103 x 14 + 84 x 21 + 91 x 22 + 106 x 31 + 89 x 32 + 100 x 33 + 98 x 34 Subject to: x 11 + x 13 + x 14 ≤ 135 x 21 + x 22 ≤ 56 x 31 + x 32 + x 33 + x 34 ≤ 93 3/19/2018 29
Modeling Example 2 x 11 + x 21 + x 31 ≥ 62 x 22 + x 32 ≥ 83 x 13 + x 33 ≥ 39 x 14 + x 34 ≥ 91 And: x 11, x 13, x 14, x 21, x 22, x 31, x 32, x 33, x 34 ≥ 0 The optimum result is: x 11 x 13 x 14 x 21 x 22 x 31 x 32 x 33 x 34 0 39 87 56 0 6 83 0 4 3/19/2018 30
Modeling Example 2 • Unlike the previous example, we cannot find the optimum point graphically because we have more than 2 variables • This illustrates the power of mathematical optimization 3/19/2018 31
Maximizing & Minimizing • Maximizing a function is equivalent to minimizing the negative of the function: f(x) 3/19/2018 f(x) x* x 32
f(x) Local & Global Extremum x • Example: Trying to minimize an objective function f(x) which has a single variable, x. • There are two local minimums • There is one global minimum 3/19/2018 33
Calculus Review • 1 st Derivative: Rate of change of the function. Also, tangent line. • 2 nd Derivative: Rate of change of the 1 st derivative 1 Derivatives In this region, the 2 nd derivative is st f(x) In this region, the 2 nd derivative is negative because the slope of the 1 st 3/19/2018 derivative is decreasing positive because the slope of the 1 st derivative is increasing x 34
Calculus Review con’t f(x) x 3/19/2018 • We can see that the slope of the 1 st derivative is zero (flat) at maximums and minimums • Also, the 2 nd derivative is < 0 (negative) at maximums and is > 0 (positive) at minimums 35
Unconstrained Optimization Example Suppose you are deciding how much insulation to put in your house. Assume that the heat lost from the house can be modeled by the equation: k. J/ h where x is the thickness of the insulation in centimeters. 3/19/2018 36
Unconstrained Optimization Example Also, suppose that it costs $0. 50 for your furnace to generate 1 k. J of heat and insulation will cost $1/year for each centimeter of thickness over the course of its lifetime. We want to minimize the cost of lost heat and insulation. 3/19/2018 37
Unconstrained Optimization Example So, the more insulation we install, the less heat will be lost, but insulation can only do so much good and it costs money too, so we need to find the optimum trade-off. Here is a graph of the two costs: Annual Cost 3/19/2018 Insulation Cost Heat Cost Insulation thickness 38
Unconstrained Optimization Example We don’t have any budget constraints or insulation supply constraints, so we just minimize the total cost. The total annual cost of the heat lost is given by: 3/19/2018 39
Unconstrained Optimization Example Each centimeter of insulation costs $1/yr, so the total annual cost of insulation is 1 x $/yr. The total cost is simply the sum of the two costs: 3/19/2018 40
Unconstrained Optimization Example We can find the minimum by using the calculus facts we observed earlier. First, we find where the first derivative is zero (flat). Then we make sure the second derivative is positive, since we are looking for a minimum. 3/19/2018 41
Unconstrained Optimization Example Find the derivative of the total cost: Solve for the derivative equal to zero: 3/19/2018 42
Unconstrained Optimization Example The result is: x = 66. 18 x is the insulation thickness and we obviously cannot have negative thickness. So, our result is x = +66. 18 cm Incidentally, since there is only one positive solution, we have only one minimum. So we know it is the global minimum. 3/19/2018 43
Unconstrained Optimization Example Check the 2 nd derivative: At x= 66. 18, Since the 2 nd derivative is positive, this point is a minimum. 3/19/2018 44
Unconstrained Optimization Example Results Total Cost x* = 66 cm Insulation Thickness So, the best trade-off between cost for heat loss and cost of insulation is if we install about 66 cm of insulation. 3/19/2018 45
The Feasible Region • The feasible region is the set of solutions that satisfy the constraints of an optimization problem • A 2 -variable optimization problem with 4 inequality constraints: x 2 3/19/2018 x 1 Feasible Region 46
Equality Constraints x 2 Equality Constraint Inequality Constraints x 1 • Now, the feasible region is the section of the equality constraint line that is inside the area formed by the inequality constraints 3/19/2018 47
More on the Feasible Region • The optimum point is in the feasible region • If the feasible region is just a point, there are no degrees of freedom to optimize. The constraints are simply a system of equations. • If the feasible region does not exist, the constraints are in conflict: x 2 3/19/2018 48 x 1
Convex Sets • A set is convex if a convex combination of any two points in the set is also in the set • A convex combination: – A convex combination of points x 1 & x 2 is: where • Graphically, a convex combination of two points is a line connecting the two points 3/19/2018 l=1 x 2 l=0 49
Graphical Visualization • A set is convex if, for any two points in the set, the whole length of the connecting line is also in the set The whole line is in the set, so the set is convex This is not in the set, so the set is non-convex • Try these: 3/19/2018 Non-convex Convex Non-convex 50
Convex Functions • f(x) is a convex function if: f(l. x 1+(1 -l). x 2) ≤ l. f(x 1) + (1 -l). f(x 2) where 0 ≤ l ≤ 1 f(x 1) lf(x 1)+(1 -l)f(x 2) f(lx 1+(1 -l)x 2) 3/19/2018 x 1 x 2 51
Convex Functions • In geometric terms, a function is convex if the chord connecting any two points of the function is never less than the values of the function between the two points. 3/19/2018 52
Concave Functions • The definition of a concave function is exactly opposite that of a convex function • If f(x) is a convex function, -f(x) is a concave function 3/19/2018 53
Results of Convexity For the optimization problem minimize: f(x) subject to: gi(x) ≤ 0 i = 1, …, m where x is a vector of n variables. • If f(x) is a convex function and the constraints gi(x) form a convex set, then there is only one minimum of f(x): the global minimum 3/19/2018 54
Implications • This is important because it is usually possible to find a local optimum, but it is very difficult to determine if a local optimum is the global optimum. This is what the optimization process looks like: Start here 3/19/2018 Oops! – Maybe not We found the global minimum! 55
Convexity Conclusions • Having a convex problem (convex objective function & convex set of constraints) is the only way to guarantee a globally optimum solution • Unfortunately, most real-world problems are non-convex • However, convex problems give some insights and have properties we can partially use for non-convex problems 3/19/2018 56