CHE 536 ENGINEERING OPTIMIZATION COURSE POLICIES AND OUTLINE

  • Slides: 33
Download presentation
CHE 536 ENGINEERING OPTIMIZATION COURSE POLICIES AND OUTLINE Prof. Shi-Shang Jang Chemical Engineering Department

CHE 536 ENGINEERING OPTIMIZATION COURSE POLICIES AND OUTLINE Prof. Shi-Shang Jang Chemical Engineering Department National Tsing-Hua University Hsinchu Feb. 2011

Instructor: Prof. Shi-Shang Jang Class Meeting: Every Thursday, 2: 00 -5: 00 Classroom: Rm#221,

Instructor: Prof. Shi-Shang Jang Class Meeting: Every Thursday, 2: 00 -5: 00 Classroom: Rm#221, Chem. Engng. Buldg. Textbook : P. Venkataraman, Applied Optimization with MATLAB Programming. Wiley-Interscience, 2001 l References: l l l l Reklaitis, Ravindran and Ragsdell, Engineering Optimization, Methods and Applications, . Wiley, 1983. Vanderplaats, G. N. , Numerical Optimization Techniques for Engineering Design with Applications, Mc. Graw-Hill International , 1993. Optimization of Chemical Processes, 2 nd Ed. , Edgar, Himmelblau and Lasdon, Mc. Graw-Hill, Boston, 2001 Course Objective: l l l To learn problem formulation of optimization. To realize the algorithms of numerical methods of optimization. To know the applications of numerical optimization.

Policies l Homework Policy: Biweekly (computer programming) homework, due at next week class meeting.

Policies l Homework Policy: Biweekly (computer programming) homework, due at next week class meeting. No late homework will be accepted. l Grading Policy: Homework : 30%, Midterm Exam: 35%, Term project: 35% l Lecture Notes: http: //pie. che. nthu. edu. tw/

Course Outline l l l l l Course Orientation Introduction and Single Variable Optimization

Course Outline l l l l l Course Orientation Introduction and Single Variable Optimization Unconstrained Optimization Linear Programming Theoretical Concepts of Nonlinear Programming Midterm Exam Generalized Reduced Gradient Approach Successive Quadratic Programming Final Project Presentation 2/24 3/3, 3/10 3/17, 3/24 3/31, 4/7 4/14, 4/21 4/28 5/5, 12, 19 5/26, 6/2 6/9

Chapter 1. INTRODUCTION Why optimized? Improve the process to realize maximum system potential; n

Chapter 1. INTRODUCTION Why optimized? Improve the process to realize maximum system potential; n Attain improved designs; maximize profits; reduce cost of productions. n

Essential features of optimization problem An objective function is defined which needs to be

Essential features of optimization problem An objective function is defined which needs to be either maximized or minimized. The objective function may be technical or economic. Examples of economic objective are profits, costs of production etc. . Technical objective may be the yield from the reactor that needs to be maximized, minimum size of an equipment etc. . Technical objectives are ultimately related to economics. l Underdetermined system: If all the design variables are fixed. There is no optimization. Thus one or more variables is relaxed and the system becomes an underdetermined system which has at least in principle infinite number of solutions. l

Essential features of optimization problem- Continued Competing influences: In most of the optimization problems,

Essential features of optimization problem- Continued Competing influences: In most of the optimization problems, there would be some set of variables which has opposite influence on the objective function. Such competing influences require some balancing and hence result in typical optimization problems. l Restrictions: Usually the optimization is done keeping certain restrictions or constraints. Thus, the amount of row material may be fixed or there may be other design restrictions. Hence in most problems the absolute minimum or maximum is not needed but a restricted optimum i. e. the best possible in the given condition l

Problem Statements Given a design vector An objective function f(x) A set of equality

Problem Statements Given a design vector An objective function f(x) A set of equality constraints g(x)=0 A set of inequality constraints, h(x) 0 The general problem formulation:

Examples- An Inspector Problem (Linear Programming): l Assume that it is desired to hire

Examples- An Inspector Problem (Linear Programming): l Assume that it is desired to hire some inspectors for monitoring a production line. A total amount of 1800 species of products are manufactured every day (8 working hours), while two grades of inspectors can be found. Maximum, 8 grade A inspector and 10 grade B inspector are available from the job market. Grade A inspectors can check 25 species/hour, with an accuracy of 98 percent. Grade B inspectors can check 15 species/hour, with an accuracy of 95 percent. The wage of a grade A inspector is $4. 00/hour, and the wage of a grade B inspector is $3. 00/hour. What is the optimum policy for hiring the inspectors?

Problem Formulation l l l l Assume that the x 1 grade A inspectors

Problem Formulation l l l l Assume that the x 1 grade A inspectors x 2 grade B inspects are hired, then total cost to be minimized 4 8 x 1 +3 8 x 2 +25 8 0. 02 2 x 1 +15 8 0. 05 2 x 2 =40 x 1 +36 x 2 manufacturing constraint 25 8 x 1 +15 8 x 2 1, 800 200 x 1 +120 x 2 1, 800 no. of inspectors available: 0 x 1 8 0 x 2 10

The Graphical Solution

The Graphical Solution

Example – optimal pipe diameter l In a chemical plant, the cost of pipes,

Example – optimal pipe diameter l In a chemical plant, the cost of pipes, their fittings, and pumping are important investment cost. Consider a design of a pipeline L feet long that should carry fluid at the rate of Q gpm. The selection of economic pipe diameter D(in. ) is based on minimizing the annual cost of pipe, pump, and pumping. Suppose the annual cost of a pipeline with a standard carbon steel pipe and a motordriven centrifugal pump can be expressed as: Formulate the appropriate single-variable optimization problem for designing a pipe of length 1000 ft with a fluid rate of 20 gpm. The diameter of the pipe should be between 0. 25 to 6 in.

The MATLAB Code for Process Design Example l l l cost l d=linspace(0. 25,

The MATLAB Code for Process Design Example l l l cost l d=linspace(0. 25, 6); l=1000; q=20; for i=1: 100 hp=4. 4 e 8*(l*q^3)/d(i)^5 + 1. 92 e-9*(l*q^2. 68) /(d(i)^4. 68); f(i)=0. 45*l+0. 245*l*d( i)^1. 5+3. 25*hp^0. 5+6 1. 6*hp^0. 925+102; end diameter

Examples- A Chemical Reactor Design Problem Material Balances: Energy Balances:

Examples- A Chemical Reactor Design Problem Material Balances: Energy Balances:

Examples- A Chemical Reactor Design Problem - Continued l Problem: Assume that C 0,

Examples- A Chemical Reactor Design Problem - Continued l Problem: Assume that C 0, TJ, tf can be designed, it is our objective to find good settings such that CB(tf) can be maximized

Special Types of NLP problems l Unconstrained optimization l l In here, neither equality

Special Types of NLP problems l Unconstrained optimization l l In here, neither equality nor inequality constraint exists Linear Programming (LP) l In here, all the objective function and constraints are linear functions to x.

Special Types of NLP problems Continued l Quadratic Programming (QP) In here, only the

Special Types of NLP problems Continued l Quadratic Programming (QP) In here, only the objective function is quadratic, but the constraints are linear

Special Types of NLP problems Continued l Optimization with respect to a continuous variable

Special Types of NLP problems Continued l Optimization with respect to a continuous variable (Calculus of Variation) Find x(t) such that is minimized

Special Types of NLP problems Continued l Dynamic Programming (DP) Here, xi represents the

Special Types of NLP problems Continued l Dynamic Programming (DP) Here, xi represents the state of the system in the ith stage and ui is some decision variable, i. e. some decision taken at the ith stage. The values of xi and ui determine uniquely xi+1: Here, it is assumed that x 0 is known, when the state of the system changes from xi to xi+1, there is an improvement or degradation in an objective function as cost or profit. Let this be J=f(xi, ui, i) , then the cumulative profit over N stages is:

Special Types of NLP problems Continued As x 0 is fixed the magnitude of

Special Types of NLP problems Continued As x 0 is fixed the magnitude of the cumulative profit is determined only by the various decisions taken ui (i=0 to N-1). Hence Jc is to be optimized with respect to ui. Now, constraints may be imposed on xi and ui. This constitutes a dynamic programming (DP) l Integer Programming (IP): l Some of the variables are constrained to take integer values.

The Iterative Optimization Procedure – A Basic Idea l Optimization is basically performed in

The Iterative Optimization Procedure – A Basic Idea l Optimization is basically performed in a fashion of iterative optimization. We give an initial point x 0, and a direction s, and then perform the following line search: where * is the optimal point for the objective function and satisfies all the constraints. Then we start from x 1 and find the other direction s’, and perform a new line search until the optimum is reached.

Terminology l Contour plot

Terminology l Contour plot

Terminology - Continued l Global optimum v. s. Local optimum

Terminology - Continued l Global optimum v. s. Local optimum

Terminology - Continued l Convex v. s. Concave functions l l A function (x)

Terminology - Continued l Convex v. s. Concave functions l l A function (x) is called convex over the domain R if for all x 1, x 2 R, and 0< <1, then If the inequality holds, the function is called strictly convex. A concave function is a function that cannot have a value smaller than that obtained by a linear approximation.

Terminology - Continued l Unimodal function l l If the function increases up to

Terminology - Continued l Unimodal function l l If the function increases up to a maximum then decreases for all other values, it is called a unimodal function Gradient and Hessian of a function l l Gradient of a function f(x) is defined by a column vector of the first partial derivatives of f(x) with respect to each variables x 1 to xn evaluated at some x Hessian matrix of f(x) is defined as the symmetric square matrix of second partial derivatives

Terminology - Continued l Feasible l l l Regions. Region of search. The region

Terminology - Continued l Feasible l l l Regions. Region of search. The region bounded by the inequality and equality constraints. Convex region of search (not convex function): l A convex region is one region such that a line joining any two points lying in the region.

Appendix – Mesh and Contour l 3 -dimensional plot and contour plot are important

Appendix – Mesh and Contour l 3 -dimensional plot and contour plot are important to demonstrate the optimality of a function l Internal functions of MATLAB: mesh(x, y, z) and meshgrid are useful in this case

Function Mesh. Grid l To Produce two arrays containing duplicates of its inputs so

Function Mesh. Grid l To Produce two arrays containing duplicates of its inputs so that all combinations of its inputs are considered. xtest=1: 5; ytest=6: 9; [xx, yy]=meshgrid(xtest, ytest) xx = 1 2 3 4 5 yy = 6 6 6 7 7 7 8 8 8 9 9 9

Mesh plot of function z=x^2+y^2 l l l for i=1: 100 for j=1: 100

Mesh plot of function z=x^2+y^2 l l l for i=1: 100 for j=1: 100 z(i, j)=xx(i, j)^2+yy(i, j)^ 2; end mesh(xx, yy, z)

Contour plot of function z=x^2+y^2 l contour(xx, yy, z)

Contour plot of function z=x^2+y^2 l contour(xx, yy, z)

Himmelblau’s Function l l function y=himmel(x 1, x 2) y=(x 1*x 1+x 2 -11)^2+(x

Himmelblau’s Function l l function y=himmel(x 1, x 2) y=(x 1*x 1+x 2 -11)^2+(x 1+x 2*x 2 -7)^2; l l l l x 1=linspace(-5, 5, 21); x 2=linspace(-5, 5, 21); for i=1: 21 for j=1: 21 zz(i, j)=himmel(x 1(i), x 2(j)); end; mesh(x 1, x 2, zz);

3 -dimensional Plot

3 -dimensional Plot

Contour Plot contour(x 1, x 2, zz)

Contour Plot contour(x 1, x 2, zz)