VIEWS: 3 PAGES: 24 POSTED ON: 3/25/2013
FORMULATING THE OPTIMIZATION PROBLEM “If do not know where we are going, any path will do.” • The importance of formulation • The standard formulation • Degrees of Freedom • The operating window DOFASCO: We find it useful to formulate the optimization problem completely, even if we cannot solve it. FORMULATING THE OPTIMIZATION PROBLEM While walking home after the first Chem. Eng. 4G03 class, you began to worry about passing the course. Fortunately, you notice a magic lantern, which you rub. A Genie appears and grants you ONE wish. You wish for the highest grade in 4G03. What happens? What did the Genie do to grant your wish? Your classmates you Oh no! The Genie tricks the class, minus you, into a bus that runs over a cliff. Everyone in the bus perishes; but you receive the highest grade in 4G03. You are very mad at the Genie, but he says that he only did what you asked. FORMULATING THE OPTIMIZATION PROBLEM LESSONS LEARNED • The Genie gave you what you asked for - not what you intended. • An Optimizer is like the Genie. Therefore, we must formulate the problem carefully and check the results for surprises! • If we maximize profit, can we - pollution the environment? - endanger workers? - produce products that are shabby or dangerous? - design a plant that only functions for six months? FORMULATING THE OPTIMIZATION PROBLEM This is the general formulation that we will be using throughout the course max P Objective function x s.t . h( x ) 0 Equality constraints Inequality constraints g( x ) 0 x min x x max Variable Bounds max P x FORMULATING THE s.t . h( x ) 0 OPTIMIZATION PROBLEM g( x ) 0 x min x x max Objective This is the goal or objective, e.g., Function - maximize profit (minimize cost) - minimize energy use max P - minimize polluting effluents X - minimize mass to construct a vessel We will formulate most problems with a scalar objective function, i.e., a single value. min P This should represent the full effect of x on the objective. For X 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 value of the material may depend on the composition, enthalpy, flow rate, etc. The symbol “x” represents the variables. It is a vector. max P x FORMULATING THE s.t . h( x ) 0 OPTIMIZATION PROBLEM g( x ) 0 x min x x max Some comments on the objective function • A scalar is preferred for solving. However, multiple objectives are typical in real life. • Note that Max (P) is the same as Min (-P) • 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. max P x FORMULATING THE s.t . h( x ) 0 OPTIMIZATION PROBLEM g( x ) 0 x min x x max 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” function. max P x s.t . FORMULATING THE h( x ) 0 OPTIMIZATION PROBLEM g( x ) 0 x min x x max s.t. This means “subject to”. The expressions below limit (or constrain) the allowable values of the variables x. They define the feasible region. Equality These are equality constraints, e.g., Constraints - material, energy, force, current, … BALANCES - equilibrium h(x) = 0 - decisions by the engineer ( F1 - .5 F2 = 0 ) - behavior enforced by controls TC set point = 231 C - sub-sections of a model used in other parts of the model, rate = - kCA 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. max P x FORMULATING THE s.t . h( x ) 0 OPTIMIZATION PROBLEM g( x ) 0 x min x x max 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 models may change. For example, a heat exchanger could have either one or two phases, with the number of phases depending on the optimization decisions. max P x s.t . FORMULATING THE h( x ) 0 OPTIMIZATION PROBLEM g( x ) 0 x min x x max Inequality These are “one-way” limits to the system, e.g., constraints - maximum investment available - maximum flow rate due to pump limit g(x) 0 - minimum liquid flow rate on tray # 24 - minimum steam generation in a boiler for stable flame - maximum pressure of a closed vessel - maximum region within which we think that the model is acceptable These are essential for optimization. We have not formulated inequalities in previous course, although we have learned the underlying technologies. By convention, we will write the equations with a zero rhs (right hand side). 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. max P x s.t . FORMULATING THE h( x ) 0 OPTIMIZATION PROBLEM g( x ) 0 x min x x max Variables Variables can be grouped into two categories and their Some are “decision” or “optimization” variables. These are Bounds the variables in the system that are changed independently to modify the behavior of the system. xmin x Some are dependent variables whose behavior is determined x xmax 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. Examples of variables are DESIGN: reactor volume, number of trays, heat exch. area, … OPERATIONS: temperature, flow, pressure, valve opening, … MANAGEMENT: feed type, purchase price, sales price, .. These bounds limit the values of the variables. Note that setting the min and max values equal sets the variable to a constant value. max P x FORMULATING THE s.t . h( x ) 0 OPTIMIZATION PROBLEM g( x ) 0 x min x x max Some comments on variables • Many variables are continuous, but some are discrete or integer. Give some examples of each. • Typically, we do not define the “decision” variables. Since we solve a set of simultaneous equations, are variables are determined together. • We should always place bounds on variables. Why? FORMULATING THE OPTIMIZATION PROBLEM When modelling, we always encounter the issue max P of Degrees of Freedom (DOF). How do we x determine the ODF for an optimization s.t . problem using the relationship below? h( x ) 0 DOF = (# variables) - (# equations) g( x ) 0 # variables = x min x x max # equations = FORMULATING THE OPTIMIZATION PROBLEM In 3G03 and 3P03, we required the models to max P have DOF=0. Why? x s.t . h( x ) 0 For optimization, what value(s) do we expect g( x ) 0 for the DOF? x min x x max The answer explains why optimization is so widely applied! FORMULATING THE OPTIMIZATION PROBLEM Often, we will think of the problem as having max P #Opt Var = # var - #equality constr. x s.t . We can plot this if only two dimensions. h( x ) 0 g( x ) 0 What about points Opt Var2 inside? feasible x min x x max region Which is the best? Opt Var1 FORMULATING THE OPTIMIZATION PROBLEM We can plot values of the objective function as contours. Where is the optimum for the two cases shown below? Opt Var2 Opt Var2 Opt Var1 Opt Var1 Case A Case B FORMULATING THE OPTIMIZATION PROBLEM Variables and objective function can be plotted in 3D T FA FORMULATING THE OPTIMIZATION PROBLEM How do we select the appropriate max P “system” for a specific problem? x s.t . h( x ) 0 g( x ) 0 x min x x max FORMULATING THE OPTIMIZATION PROBLEM How do we select the appropriate “system” for a specific problem? max P Marlin’s Rule 1 x s.t . We must consult people with a broader responsibility/knowledge h( x ) 0 than “system S” to determine the true objectives of “system S”. g( x ) 0 x min x x max FORMULATING THE OPTIMIZATION PROBLEM How do we define a scalar that represents performance, max P including x • Economics s.t . • Safety h( x ) 0 • Product quality g( x ) 0 • Product rates (contracts!) x min x x max • Flexibility • …... FORMULATING THE OPTIMIZATION PROBLEM max P How accurately must we model x the physical process? s.t . • Macroscopic h( x ) 0 • 1,2 3, spatial dimensions • Steady-state or dynamic g( x ) 0 • Physical properties x min x x max • Rate models (U(f), k0e-E/RT, .. FORMULATING THE OPTIMIZATION PROBLEM max P What limits the possible x solutions to the problem? s.t . • Safety h( x ) 0 • Product quality • Equipment damage (long g( x ) 0 term) x min x x max • Equipment operation • Legal/ethical considerations FORMULATING THE OPTIMIZATION PROBLEM No one solution or • More to learn approach is suitable for • Must have optimization! toolkit of models max P and solvers x s.t . h( x ) 0 • Lots of opportunity for g( x ) 0 ingenuity x min x x max • Makes engineers valuable