# Introducción a la Optimización de procesos químicos. Curso 2005/2006 UNIT 2: FORMULATING THE OPTIMIZATION PROBLEM Variables The objective function Equality.

## Presentation on theme: "Introducción a la Optimización de procesos químicos. Curso 2005/2006 UNIT 2: FORMULATING THE OPTIMIZATION PROBLEM Variables The objective function Equality."— Presentation transcript:

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 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, the solution method need not distinguish them. We need to solve a set of equations involving many variables. FORMULATING THE OPTIMIZATION PROBLEM VARIABLES 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. 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. 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. FORMULATING THE OPTIMIZATION PROBLEM VARIABLES

Introducción a la Optimización de procesos químicos. Curso 2005/2006 OBJECTIVE FUNCTION 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. 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 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

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 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 This means “subject to”. The expressions below limit (or constrain) the allowable values of the variables x. They define the feasible 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 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 Energy Typically, the solution and optimization are achieved simultaneously. FORMULATING THE OPTIMIZATION PROBLEM 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). 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 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 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 with no feasible region. By multiplying by (-1), we can change the inequality to g(x)<=0 So, 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 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 Var2 feasible region What about points inside? Which is the best? FORMULATING THE OPTIMIZATION PROBLEM DEGREES OF FREEDOM (DOF)

Introducción a la Optimización de procesos químicos. Curso 2005/2006 Opt Var2 Opt Var1 Opt Var2 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 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 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), k 0 e- E/RT,.. 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 FORMULATING THE OPTIMIZATION PROBLEM

Introducción a la Optimización de procesos químicos. Curso 2005/2006 FORMULATING THE OPTIMIZATION PROBLEM 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 model Solver 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) Plant1212 AM A1 M A2 S A1 S A2 BM B1 M B2 S B1 S B2

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 B plant

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 materialMaximum available (kg/day) Cost (€/kg) A400001.5 B300002.0 C250002.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) 1E2/3A,1/3B1.54.0 2F2/3A,1/3B0.53.3 3G1/2A,1/6B,1/3C1.03.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 L LAH LAL 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 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 constraints FORMULATING 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

Download ppt "Introducción a la Optimización de procesos químicos. Curso 2005/2006 UNIT 2: FORMULATING THE OPTIMIZATION PROBLEM Variables The objective function Equality."

Similar presentations