Optimization MECH 510 Design of Thermal Systems American University of Beirut Department of Mechanical Engineering Design of Thermal Systems 1 What is Optimization? Optimization is the process of finding the conditions that give maximum or minimum values of a function Optimization has always been an expected role of engineers Often a design is difficult to optimize because of its complexity. In such cases, it may be possible to optimize subsystems and then choose to optimize a combination of them 2 American University of Beirut Design of Thermal Systems Levels of Optimization There are two levels of optimization: Comparison of alternate concepts Optimization within a concept Optimization Methods A complete optimization procedure consists of proposing all reasonable alternate concepts, optimizing the design of each concept, and then choosing the best of the optimized designs. 3 American University of Beirut Design of Thermal Systems Mathematical Representation of Optimization Problems -1 The elements of the mathematical statement of optimization are: Objective Function Constraints Equality Constraints Inequality Constraints Optimization goal Maximizing (ex: cooling, production…) Minimizing (ex: cost) 4 American University of Beirut Design of Thermal Systems Mathematical Representation of Optimization Problems -2 Objective Function y y ( x1, x2 ,......, xn ) (1) Independent Variables To Optimize 5 American University of Beirut Design of Thermal Systems Mathematical Representation of Optimization Problems -3 Equality Constraints 1 1( x1, x2 ,......., xn ) 0 (2) ...................................... m m ( x1, x2 ,......., xn ) 0 (3) Inequality Constraints 1 1( x1, x2 ,......., xn ) L (4) ...................................... m m ( x1, x2 ,......., xn ) L (5) 6 American University of Beirut Design of Thermal Systems Example #1 Determine the objective function for building a minimum cost cylindrical refrigeration tank of volume 50 m3, if the circular ends cost 10$/m2, the cylindrical wall costs 6$/mm2 and it costs 80$/m2 to refrigerate over the useful life. Let x and L be respectively the diameter and length of the cylinder: L 4 V 200 x2 x2 x2 x2 f (10)(2) 6 x L 80 2 L 4 4 45 x 2 86 x L Substituting for L we get f 45 x 2 American University of Beirut Design of Thermal Systems 17200 x L x 7 Also it is very difficult to determine global minimum but rather we will look for a strong local minimum. 8 American University of Beirut Design of Thermal Systems Mathematical Representation of Optimization Problems -4Additional properties of the optimum: Additive constant appearing in the objective function does not affect the independent variables at which the optimum occurs: min [a Y ( x1,...., xn )] a min [Y ( x1,...., xn )] (6) Maximum of a function appears at the same state point at which the minimum of the negative of negative of the function occurs: max [ y ( x1,...., xn )] min [ y ( x1,...., xn )] (7) 9 American University of Beirut Design of Thermal Systems Optimization Procedures -1 Calculus Methods: Lagrange Multipliers The basis of this method is to use derivatives to indicate the optimum Performs optimization where equality constraints exists but the method can not directly accommodate inequality constraints A necessary requirement for using calculus methods is the ability to extract derivatives of the objective function and constraints 10 American University of Beirut Design of Thermal Systems Optimization Procedures -2 Search Methods These methods involve examining a number of combinations of values of the independent variables and drawing conclusions from the magnitude of the objective function at these combinations When applying search methods to continuous functions, since only discrete points are examined, the exact optimum can only be approached, not reached, by a finite number of trials 11 American University of Beirut Design of Thermal Systems Setting Up the Mathematical Statement of the Opt. Problem -1 One of the first steps in performing an optimization is to translate the physical situation into a mathematical statement [equations (1) to (5)] In the optimization of thermal systems, establishing the object function is often simple and sometimes even a trivial task The challenge is in writing the constraints 12 American University of Beirut Design of Thermal Systems Setting Up the Mathematical Statement of the Opt. Problem -2 Strategy for Writing Constraints 1. Specify all the direct constraints (ex: requirements of capacity, limitations of temperature and pressure) 2. 3. Describe in equation form the component characteristics and properties of working substances Write mass and energy balances Note: 1. and 3. usually provide a set of equations containing more variables than exist in the objective function. The set of constraint equations is then reduced in number by eliminating variables that do not exist in the objective function 13 American University of Beirut Design of Thermal Systems Example Between two stages of air compression, the air is to be cooled from 95 to 10°C. The facility to perform this cooling, shown in the next figure, first cools the air in a pre-cooler and then in a refrigeration unit. Water passes through the condenser of the refrigeration unit, then into the pre-cooler, and finally to a cooling tower, where heat is rejected to the atmosphere. The flow rate of compressed air is 1.2 kg/s, and the specific heat is 1.0 kJ/(kg K). The flow rate of water is 2.3 kg/s, and its specific heat is 4.19 kJ/(kg K). The water leaves the cooling tower at a temperature 24°C. The system is to be designed for minimum first cost, where this first cost comprises the cost of the refrigeration unit, precooler, and cooling tower, designated x , x , & x , 1 2 3 American University of Beirut respectively, in dollars. Design of Thermal Systems 14 Example (continued) Where the costs are: Refrigeration Unit: x1 48q1 Precooler: x2 Cooling tower: x3 25q3 (8) 50q2 ( t3 t1) t3 t1 (9) (10) And the q ‘s are rates of heat transfer in kilowatts, as designated in the Figure. The compression power P kW required by the refrigeration unit in O.25q1, and both q1 and the compression power must be absorbed by the condenser cooling water passing through the refrigeration unit. Required: Develop the objective function Develop the constraint equations for an optimization to provide minimum first cost 15 American University of Beirut Design of Thermal Systems Example (Figure) 16 American University of Beirut Design of Thermal Systems Example (Solution) The goal of this example is only to set up the optimization problem in the form of equations (1) to (5) and not to perform the actual optimization. y y ( x1, x2 ,......, xn ) 1 1( x1, x2 ,......., xn ) L ...................................... m m ( x1, x2 ,......., xn ) L 1 1( x1, x2 ,......., xn ) 0 ...................................... m m ( x1, x2 ,......., xn ) 0 Before proceeding, however, it would be instructive to examine qualitatively the optimization features of this system. Since the pre-cooler is a simple heat exchanger, under most operating conditions it is less costly for a given heat- transfer rate than the refrigeration unit. It would appear preferable, then, to do as much cooling of the air as possible with the pre-cooler. 17 American University of Beirut Design of Thermal Systems However, as the temperature t3 approaches the value of t1, the size of the pre-cooler becomes very large. Some capacity is required of the refrigeration unit in order to cool the air below 24°C. The cooling tower must reject all the heat from the system, which includes the heat from the air as well as the compression power to drive the refrigeration unit. Shifting more cooling load to the refrigeration unit increases the size and cost of the cooling tower moderately. 18 American University of Beirut Design of Thermal Systems Example (Solution) (a) The first assignment is to develop the expression for the objective function. Since the total first cost is to be minimized, the objective function will be the first cost in terms of the variables of optimization. A choice must be made of these variables; the objective function could conceivably be written in terms of the costs of the individual components (the x ‘s), the energy flow rates (the q ‘s), or even the temperatures (t1, t2, and t3). The most straightforward choice is to use the component costs: Total cost: y =? (11) 19 American University of Beirut Design of Thermal Systems Total cost: y =x1 + x2 + x3 (11) If the q’s are chosen as the variables of optimization, it is necessary to start with (11) and express the x’s in terms of the q’s. Refrigeration Unit: x1 48q1 Precooler: x2 Cooling tower: x3 25q3 50q2 ( t3 t1) t3 t1 given 20 American University of Beirut Design of Thermal Systems Example (Solution) (b) The next task is to write the constraints, and this means developing the set of equations in terms of the variables used in the objective function. Establishing the objective function is usually a simple process; the major challenge is setting up the constraints. The advice in the early part of this section was to specify the direct constraints, the component characteristics, and finally the energy and mass balances. This expanded set of equations is then reduced by eliminating the variables that do not appear in the objective function. A direct constraint is the requirement that the airflow rate of 1.2 kg/s be cooled from 95 to 10°C, This requirement can be expressed in two equations: q1 ? (12) q2 ? (13) 21 American University of Beirut Design of Thermal Systems Energy Balances (12) (13) q1 (1.2 kg / s )[1.0 kJ /(kg.K )](t 3 10) q2 (1.2 kg / s )[1.0 kJ /(kg.K )](95 t 3 ) American University of Beirut22 Design of Thermal Systems Example (Solution) Under the heading of component characteristics fall the expression for the compression power equaling 0.25q1 and the relationships of the sizes (costs) to the capacity, equations (8) to (10). The final category includes energy and mass balances: Refrigeration unit: Pre-cooler: Cooling tower: 23 American University of Beirut Design of Thermal Systems Example (Solution) (14) The final category includes energy and mass balances: (15) Refrigeration unit: q1 + P = (2.3 kg/s) [4.19 kJ/(kg K)] (t1 -24) (16) Pre-cooler: (1.2)(1.0)(95 - t3) = (2.3)(4.19)(t2 - t1) Cooling tower: (2.3)(4.19)(t2-24) = q3 The complete set of constraint equations is ?? American University of Beirut Design of Thermal Systems 24 Example (Solution) The complete set of constraint equations is q1 = (1.2)(1.0)(t3 — 10) q2 = (1 2)(1.0)(95 — t3) P = 0.25q1 x1= 48q1 x2 50q2 t3 t1 (17) (18) (19) (20) (21) x3 = 25q3 q1 + P = (2.3 kg/s) [4.19 kJ/(kg K)] (t1 -24) (1.2)(1.0)(95 - t3) = (2.3)(4.19)(t2 - t1) (2.3)(4.19)(t2-24) = q3 (22) (23) (24) (25) 25 American University of Beirut Design of Thermal Systems Example (Solution) There are nine equations in the set, equations (17) to (25) and ten unknowns, q1, q2, q3, P, x1, x2, x3, t1, t2, and t3. The next operation is to eliminate in this set of equations all but the variables of optimization, x1, x2, and x3. As the elimination of variables and equations proceeds, there will always be one more unknown than the number of equations, so when all but the three x’s are eliminated, there should be two equations remaining. These two constraint equations are equations (27) and (28), so the complete mathematical statement of this optimization problem is as follows: Minimize y =x1 + x2 + x3 (26) subject to 0.01466 x1x2 - 14x2 + 1.042 x1 = 5100 7.69 x3 - x1 =19,615 (27) (28) 26 American University of Beirut Design of Thermal Systems Example (Discussion) The objective of this chapter is to introduce procedures for setting up the mathematical statement of the optimization problem. With one of the methods in the subsequent chapters the execution of the optimization process would show that the optimal values of x1, x2, and x3 are $1450, $496, and $2738, respectively. Equation (9) [or (21)] was presented as valid if t3 > t1, and this condition could legitimately be listed as one of the constraints. If t3 < t1, x2 becomes negative, which is physically impossible. 27 American University of Beirut Design of Thermal Systems Example (Discussion) The constraints are an integral part of the statement of the optimization problem. The objective function without the constraints is meaningless because the x ‘s could all shrink to zero and there would be no cost for the system. The constraint in Eq. (27) requires a positive value of which is the same as requiring the existence of a refrigeration unit. From heat-transfer considerations the pre-cooler can cool the air no lower than a temperature of 24°C. Substituting x1 = 0 in Eq. (27) makes x2 negative, which is physically impossible. Equation (27) does permit x2 to be zero, in which case all cooling is performed by the refrigeration unit. The constraint equation (28) imposes a minimum value of the coolingtower size and cost x . As the size of the refrigeration unit and x1 increases, x3 also increases because of the compression power associated with the refrigeration unit. 28 American University of Beirut Design of Thermal Systems