Presentation is loading. Please wait.

Presentation is loading. Please wait.

Mathematical Optimization Dr. Mario Richard Eden Department of Chemical Engineering Auburn University Lecture No. 7 November 1, 2004 CHEN 4460.

Similar presentations


Presentation on theme: "Mathematical Optimization Dr. Mario Richard Eden Department of Chemical Engineering Auburn University Lecture No. 7 November 1, 2004 CHEN 4460."— Presentation transcript:

1 Mathematical Optimization Dr. Mario Richard Eden Department of Chemical Engineering Auburn University Lecture No. 7 November 1, 2004 CHEN 4460

2 Optimization Basics 1:8 What is Optimization?What is Optimization? –The purpose of optimization is to maximize (or minimize) the value of a function (called objective function) subject to a number of restrictions (called constraints). ExamplesExamples 1.Maximizereactor conversion Subject toreactor modeling equations kinetic equations limitations on T, P and x

3 Optimization Basics 2:8 Examples (Continued)Examples (Continued) 2.Minimizecost of plant Subject tomaterial and energy balance equations equipment modeling equations environmental, technical and logical constraints

4 Optimization Basics 3:8 Examples (Continued)Examples (Continued) 3.Maximizeyour grade in this course Subject toextracurricular activities full-time-job requirements constant demand by other courses and/or your advisor/boss

5 Optimization Basics 4:8 General Formulation of Optimization ProblemsGeneral Formulation of Optimization Problems min (or max) f(x 1,x 2,……,x N ) subject tog 1 (x 1,x 2,……,x N )≤0 g 2 (x 1,x 2,……,x N )≤0 g m (x 1,x 2,……,x N )≤0 h 1 (x 1,x 2,……,x N )=0 h 2 (x 1,x 2,……,x N )=0 h E (x 1,x 2,……,x N )=0 Inequality Constraints Equality Constraints Feasibility Any vector (or point) which satisfies all the constraints of the optimization program is called a feasible vector (or a feasible point) The set of all feasible points is called feasibility region or feasibility domain Any optimal solution must lie within the feasibility region!

6 Optimization Basics 5:8 Classification of Optimization ProblemsClassification of Optimization Problems –Linear Programs (LP’s) A mathematical program is linear ifA mathematical program is linear if f(x 1,x 2,……,x N ) and g i (x 1,x 2,……,x N )≤0 are linear in each of their arguments: f(x 1,x 2,……,x N ) = c 1 x 1 + c 2 x 2 + …. c N x N g i (x 1,x 2,……,x N ) = a i1 x 1 + a i2 x 2 + …. a iN x N where c i and a ij are known constants. Linear Programs (LP’s) can be solved to yield a global optimum. Solver routines can guarantee a truly optimal solution.

7 Optimization Basics 6:8 Classification of Optimization Problems (Cont’d)Classification of Optimization Problems (Cont’d) –Non-Linear Programs (NLP’s) A mathematical program is non-linear if any of the arguments are non-linear. For example:A mathematical program is non-linear if any of the arguments are non-linear. For example: min3x + 6y 2 s.t. 5x + x  y ≥ 0 –Integer Programming Optimization programs in which ALL the variables must assume integer values. The most commonly used integer variables are the zero/one binary integer variables.Optimization programs in which ALL the variables must assume integer values. The most commonly used integer variables are the zero/one binary integer variables. Integer variables are often used as decision variables, e.g. to choose between two reactor types.Integer variables are often used as decision variables, e.g. to choose between two reactor types. Non-Linear Programs (NLP’s) can be solved to yield a local optimum. Solver routines can not always guarantee a globally optimal solution.

8 Optimization Basics 7:8 Classification of Optimization Problems (Cont’d)Classification of Optimization Problems (Cont’d) –Mixed Integer Linear Programs (MILP’s) Linear programs in which SOME of the variables are real and other variables are integersLinear programs in which SOME of the variables are real and other variables are integers Can be solved as individual LP’s by fixing the integer variables, thus a global optimum can be identified.Can be solved as individual LP’s by fixing the integer variables, thus a global optimum can be identified. –Mixed Integer Non-Linear Programs (MINLP’s) Non-linear programs in which SOME of the variables are real and other variables are integersNon-linear programs in which SOME of the variables are real and other variables are integers Can be solved as individual NLP’s by fixing the integer variables, but depending on the nature of the NLP’s it may not be possible to find a global optimum.Can be solved as individual NLP’s by fixing the integer variables, but depending on the nature of the NLP’s it may not be possible to find a global optimum.

9 Optimization Basics 8:8 Formulation of Optimization ProblemsFormulation of Optimization Problems –Step 1 Determine the quantity to be optimized and express it as a mathematical function (this is your objective function)Determine the quantity to be optimized and express it as a mathematical function (this is your objective function) Doing so also serves to define variables to be optimized (input variables or optimization variables)Doing so also serves to define variables to be optimized (input variables or optimization variables) –Step 2 Identify all stipulated requirements, restrictions, and limitations, and express them mathematically. These requirements constitute the constraintsIdentify all stipulated requirements, restrictions, and limitations, and express them mathematically. These requirements constitute the constraints –Step 3 Express any hidden conditions. Such conditions are not stipulated explicitly in the problem, but are apparent from the physical situation, e.g. non-negativity constraintsExpress any hidden conditions. Such conditions are not stipulated explicitly in the problem, but are apparent from the physical situation, e.g. non-negativity constraints

10 Optimization Example 1:8 Hydrogen Sulfide ScrubbingHydrogen Sulfide Scrubbing –Two variable grades of MEA. –First grade consists of 80 weight% MEA and 20% weight water. Its cost is 80 cent/kg. –Second grade consists of 68 weight% MEA and 32 weight% water. Its cost is 60 cent/kg. –It is desired to mix the two grades so as to obtain an MEA solution that contains no more than 25 weight% water. –What is the optimal mixing ratio of the two grades which will minimize the cost of MEA solution (per kg)?

11 Optimization Example 2:8 Hydrogen Sulfide Scrubbing (Continued)Hydrogen Sulfide Scrubbing (Continued) –Objective functionmin z = 80  x1 + 60  x2 –Constraints Water content limitation0.20  x1 + 0.32  x2 ≤ 0.25Water content limitation0.20  x1 + 0.32  x2 ≤ 0.25 Overall material balancex1 + x2 =1Overall material balancex1 + x2 =1 Non-negativityx1 ≥ 0Non-negativityx1 ≥ 0 x2 ≥ 0 Variables (Basis 1 kg solution) x1Amount of grade 1 (kg) x2Amount of grade 2 (kg) zCost of 1 kg solution (cents)

12 Optimization Example 3:8 Hydrogen Sulfide Scrubbing (Continued)Hydrogen Sulfide Scrubbing (Continued) –Feasibility region The set of points (x1, x2) satisfying all the constraints, including the non-negativity conditions.The set of points (x1, x2) satisfying all the constraints, including the non-negativity conditions. Constraint on water content 0.20  x1 + 0.32  x2 ≤ 0.25Constraint on water content 0.20  x1 + 0.32  x2 ≤ 0.25

13 Optimization Example 4:8 Hydrogen Sulfide Scrubbing (Continued)Hydrogen Sulfide Scrubbing (Continued) –Feasibility region Non-negativity constraintsx1 ≥ 0, x2 ≥ 0Non-negativity constraintsx1 ≥ 0, x2 ≥ 0

14 Optimization Example 5:8 Hydrogen Sulfide Scrubbing (Continued)Hydrogen Sulfide Scrubbing (Continued) –Feasibility region Mass balance constraintx1 + x2 = 1Mass balance constraintx1 + x2 = 1

15 Optimization Example 6:8 Hydrogen Sulfide Scrubbing (Continued)Hydrogen Sulfide Scrubbing (Continued) –Feasibility region Any optimal solution must lie within the feasibility region!

16 Optimization Example 7:8 Hydrogen Sulfide Scrubbing (Continued)Hydrogen Sulfide Scrubbing (Continued) –By plotting objective function curves for arbitrary values of z (here 70 and 75) we can evaluate the results: Optimal Point Intersection between x1 + x2 = 1 and 0.20x1 + 0.32x2 = 0.25 In addition 70 < z min < 75

17 Optimization Example 8:8 Hydrogen Sulfide Scrubbing (Continued)Hydrogen Sulfide Scrubbing (Continued) –Solving the two equations simultaneously yields the optimum amounts of the two MEA solutions along with the minimum cost of the mixture

18 Optimization Software 1:2 LINGOLINGO –Included on the CD in El-Halwagi’s book. –To start entering a new optimization problem type: Model: –Enter the objective function by typing: min = ……;or max = ……; –Then enter the constraints. –Each line must end by a semi-colon ; –The final statement in the problem should be “end”

19 Optimization Software 2:2 Resolving the MEA Mixing Problem using LINGOResolving the MEA Mixing Problem using LINGO Input Model: min = 80*x1 + 60*x2; 0.2*x1 + 0.32*x2 < 0.25; x1 + x2 = 1; x1 > 0; x2 > 0; end Output Rows= 5 Vars= 2 No. integer vars= 0 ( all are linear) Nonzeros= 10 Constraint nonz= 6( 4 are +- 1) Density=0.667 Smallest and largest elements in absolute value= 0.200000 80.0000 No. : 2, Obj=MIN, GUBs <= 2 Single cols= 0 Optimal solution found at step: 0 Objective value: 71.66667 Variable Value Reduced Cost X1 0.5833333 0.0000000E+00 X2 0.4166667 0.0000000E+00 Row Slack or Surplus Dual Price 1 71.66667 1.000000 2 0.0000000E+00 166.6667 3 0.0000000E+00 -113.3333 4 0.5833333 0.0000000E+00 5 0.4166667 0.0000000E+00 Value of objective function:71.6667 Value of variable x1:0.5833 Value of variable x2:0.4167

20 More Examples 1:11 Lab ExperimentLab Experiment –Determine the kinetics of a certain reaction by mixing two species, A and B. The cost of raw materials A and B are 2 and 3 $/kg, respectively. –Let x1 and x2 be the weights of A and B (kg) to be employed in the experiment –The operating cost of the experiment is given by: OC = 4  (x1) 2 + 5  (x2) 2 –The total cost of raw materials for the experiment should be exactly $6. Minimize the operating cost!

21 More Examples 2:11 Lab Experiment (Continued)Lab Experiment (Continued) Input Model: min = 4*x1^2 + 5*x2^2; 2*x1 + 3*x2 = 6; x1 > 0; x2 > 0; end Output Rows= 4 Vars= 2 No. integer vars= 0 Nonlinear rows= 1 Nonlinear vars= 2 Nonlinear constraints= 0 Nonzeros= 7 Constraint nonz= 4 Density=0.583 Optimal solution found at step: 4 Objective value: 12.85714 Variable Value Reduced Cost X1 1.071429 0.0000000E+00 X2 1.285714 0.0000000E+00 Row Slack or Surplus Dual Price 1 12.85714 1.000000 2 0.0000000E+00 -4.285715 3 1.071429 0.1939524E-07 4 1.285714 0.0000000E+00 Value of objective function:12.857 Value of variable x1:1.071 Value of variable x2:1.286

22 More Examples 3:11 Coal Conversion PlantCoal Conversion Plant –What are the optimal production rates of gaseous and liquid fuels that maximize the net profit of the plant? 3x1 + 2x2 ≤ 18 x1 ≤ 4 2x2 ≤ 12

23 More Examples 4:11 Coal Conversion Plant (Continued)Coal Conversion Plant (Continued) –Objective functionmax z = 3  x1 + 5  x2 –Constraints Pretreatment capacity3  x1 + 2  x2 ≤ 18Pretreatment capacity3  x1 + 2  x2 ≤ 18 Gasification capacityx1 ≤ 4Gasification capacityx1 ≤ 4 Liquefaction capacity2  x2 ≤ 12Liquefaction capacity2  x2 ≤ 12 Non-negativityx1 ≥ 0Non-negativityx1 ≥ 0 x2 ≥ 0

24 More Examples 5:11 Coal Conversion Plant (Continued)Coal Conversion Plant (Continued) –Graphical solution Maximum profit Z = 36 for x1 = 2 and x2 = 6

25 More Examples 6:11 Coal Conversion Plant (Continued)Coal Conversion Plant (Continued) –LINGO Input Model: max = 3*x1 + 5*x2; 3*x1 + 2*x2 <= 18; x1 <= 4; 2*x2 <= 12; x1 > 0; x2 > 0; end Output Rows= 6 Vars= 2 No. integer vars= 0 ( all are linear) Nonzeros= 11 Constraint nonz= 6( 3 are +- 1) Density=0.611 Smallest and largest elements in absolute value= 1.00000 18.0000 No. : 2, Obj=MAX, GUBs <= 2 Single cols= 0 Optimal solution found at step: 1 Objective value: 36.00000 Variable Value Reduced Cost X1 2.000000 0.0000000E+00 X2 6.000000 0.0000000E+00 Row Slack or Surplus Dual Price 1 36.00000 1.000000 2 2.000000 0.0000000E+00 3 0.0000000E+00 1.500000 4 0.0000000E+00 1.000000 5 2.000000 0.0000000E+00 6 6.000000 0.0000000E+00 Value of objective function:36 Value of variable x1:2 Value of variable x2:6

26 More Examples 7:11 Methanol DeliveryMethanol Delivery –Supply methanol for three UAT plants located in towns A, B, and C –Daily methanol requirements for UAT plants: UAT locationTons/day A 6 A 6 B 1 B 1 C 10 C 10 –Methanol production plants AU plant1234 Capacity7532

27 More Examples 8:11 Methanol Delivery (Continued)Methanol Delivery (Continued) –Shipping cost (100 $/ton) –Schedule the methanol delivery system to minimize the transportation cost

28 More Examples 9:11 Methanol Delivery (Continued)Methanol Delivery (Continued) –We define the transportation loads (tons/day) going from each AU methanol plant to each UAT plant as follows: –Total transportation cost (Z) Z = 2X1A + X1B + 5X1C + 3X2A + 0X2B + 8X2C + 11X3A + 6X3B + 15X3C + 7X4A + X4B + 9X4C

29 More Examples 10:11 Methanol Delivery (Continued)Methanol Delivery (Continued) –Objective function min Z =2X1A + X1B + 5X1C + 3X2A + 0X2B + 8X2C + 11X3A + 0X2B + 8X2C + 11X3A + 6X3B+ 15X3C + 7X4A + X4B + 9X4C + 6X3B+ 15X3C + 7X4A + X4B + 9X4C –Constraints Availability/supplyX1A + X1B + X1C = 7Availability/supplyX1A + X1B + X1C = 7 X2A + X2B + X2C = 5 X3A + X3B + X3C = 3 X4A + X4B + X4C = 2 Requirements/demandX1A + X2A + X3A + X4A = 6Requirements/demandX1A + X2A + X3A + X4A = 6 X1B + X2B + X3B + X4B = 1 X1C + X2C + X3C + X4C = 10

30 More Examples 11:11 Methanol Delivery (Continued)Methanol Delivery (Continued) –Constraints Non-negativityX1A ≥ 0Non-negativityX1A ≥ 0 X1B ≥ 0 X1C ≥ 0 X2A ≥ 0 X2B ≥ 0 X2C ≥ 0 X3A ≥ 0 X3B ≥ 0 X3C ≥ 0 X4A ≥ 0 X4B ≥ 0 X4C ≥ 0

31 Mixed Integer Programs 1:7 Use of 0-1 Binary Integer VariablesUse of 0-1 Binary Integer Variables –Commonly used to represent binary choices –Dichotomy modeling

32 Mixed Integer Programs 2:7 The Assignment ProblemThe Assignment Problem –Assignment of n people to do m jobs –Each job must be done by exactly one person –Each person can at most do one job –The cost of person j doing job i is C ij –The problem is to assign the people to the jobs so as to minimize the total cost of completing all the jobs. –We can assign integer variables to describe whether a certain person does a certain job or not

33 Mixed Integer Programs 3:7 The Assignment Problem (Continued)The Assignment Problem (Continued) –The event of person j doing job i is designated X ij –The objective function can be written as: –Since exactly one person will do job i, and each person at most can do one job, we get:

34 Mixed Integer Programs 4:7 Plant Layout – An Assignment ProblemPlant Layout – An Assignment Problem –Four new reactors R1, R2, R3 and R4 are to be installed in a chemical plant –Four vacant spaces 1, 2, 3 and 4 are available –Cost of assigning reactor i to space j (in thousands of dollars) is –Assign the reactors to the spaces to minimize the total cost

35 Mixed Integer Programs 5:7 Plant Layout – An Assignment Problem (Cont’d)Plant Layout – An Assignment Problem (Cont’d) –Let X ij denote the existence (or absence) of reactor i in space j, i.e. if X ij =1 then reactor i exists in space j –Objective function min Z = 15X11 + 11X12 + 13X13 + 15X14 + 13X21 + 12X22 + 12X23 + 17X24 +14X31 + 15X32 + 10X33 + 14X34 + 17X41 + 13X42 + 11X43 + 16X44 + 17X41 + 13X42 + 11X43 + 16X44

36 Mixed Integer Programs 6:7 Plant Layout – An Assignment Problem (Cont’d)Plant Layout – An Assignment Problem (Cont’d) –Constraints Each space must be assigned to one and only one reactorEach space must be assigned to one and only one reactor X11 + X12 + X13 + X14 = 1 X21 + X22 + X23 + X24 = 1 X31 + X32 + X33 + X34 = 1 X41 + X42 + X43 + X44 = 1 Each reactor must be assigned to one and only one spaceEach reactor must be assigned to one and only one space X11 + X21 + X31 + X41 = 1 X12 + X22 + X32 + X42 = 1 X13 + X23 + X33 + X43 = 1 X14 + X24 + X34 + X44 = 1

37 Mixed Integer Programs 7:7 Plant Layout – An Assignment Problem (Cont’d)Plant Layout – An Assignment Problem (Cont’d) –Solve using LINGO –Optimal assignment policy Reactor R1 in space 2 Reactor R2 in space 1 Reactor R3 in space 4 Reactor R4 in space 3 –Minimum cost Cost = 11 + 13 + 14 + 11 = $49,000

38 Miscalleneous HomeworkHomework –Problems 1, 2, 3, 4 in handouts –Turn in at lecture on November 29 –Last homework assignment! Aspen Workshop 7Aspen Workshop 7 –Turn in by Wednesday December 1 Final ExamsFinal Exams –Aspen lab: Tuesday December 7 –Lecture part: Tuesday December 14


Download ppt "Mathematical Optimization Dr. Mario Richard Eden Department of Chemical Engineering Auburn University Lecture No. 7 November 1, 2004 CHEN 4460."

Similar presentations


Ads by Google