<<

Optimization Methods in Engineering Design

Prof. Kamran Iqbal, PhD, PE Professor of Systems Engineering College of Engineering and Information Technology University of Arkansas at Little Rock [email protected]

Course Objectives

• Learn basic optimization methods and how they are applied in engineering design • Use MATLAB to solve optimum engineering design problems – problems – problems – Mixed integer programing problems

Course Prerequisites

• Prior knowledge of these areas will be assumed of the participants: – – Multivariable calculus – Scientific reasoning – Basic programming – MATLAB Course Materials

• Arora, Introduction to Optimum Design, 3e, Elsevier, (https://www.researchgate.net/publication/273120102_Introductio n_to_Optimum_design) • Parkinson, Optimization Methods for Engineering Design, Brigham Young University (http://apmonitor.com/me575/index.php/Main/BookChapters) • Iqbal, Fundamental Engineering Optimization Methods, BookBoon (https://bookboon.com/en/fundamental-engineering-optimization- methods-ebook)

Engineering Design

• Engineering design is an iterative process • Design choices are limited due to resource constraints • Design optimization aims to obtain the ‘best solution’ to the problem under constraints. Optimum Engineering Design

Conventional design Optimum Engineering Design

• The optimum engineering design involves: – Formulation of mathematical optimization problem – Solving the problem using analytical or iterative methods Soda Can Design

Problem: Design a soda can of 125 푚푙 capacity for mass production. It is desired to minimize the material cost. For simplicity, assume that same material is used for the cylindrical can as well as the two ends. For esthetic reasons, the height to diameter ratio should be at least 2.

https://images.google.com/ Insulated Spherical Tank Design

Problem: Design an insulated spherical tank of radius 푅, i.e., choose the insulation layer thickness 푡 to minimize the life-cycle costs (over 10 years) of the tank.

https://images.google.com/ A Transportation Problem

Problem: Goods are to be shipped from 푚 supply points with capacities: 푠1, 푠2, … , 푠푚, to 푛 distribution points with demands: 푑1, 푑2, … , 푑푛. Given the transportation costs 푐푖푗 between nodes pairs 푖 and 푗, find the optimum shipping quantities, 푥푖푗, to minimize the total shipment cost.

https://images.google.com/ Open-Box Problem

Problem: What is the largest volume for an open box that can be constructed from a sheet of paper by cutting out squares at the corners and folding the sides?

https://images.google.com/ Shortest Distance to a Curve

Find the shortest distance from a given point (푥0, 푦0) to the curve: 푦 = 푓 푥 .

https://images.google.com/ Data-Fitting Problem

Problem: Given a set of 푁 data points 푥푖, 푦푖 , 푖 = 1, … , 푁, fit a polynomial of degree 푚 such that the mean square error is minimized.

https://images.google.com/ A Manufacturing problem

Problem: A manufacturer produces two products: tables and chairs. A table requires 10 kg of material, 5 units of labor, and earns $7.50 in profit. A chair requires 5 kg of material, 12 units of labor, and earns $5 in profit. A total of 60 kg of material and 80 units of labor are available. Find the best production mix to maximize total profit.

https://images.google.com/ An Investment Problem

Problem: Given the stock prices 푝푖 and the anticipated rates of return 푟푖 associated with a group of investments, choose a mix of securities to invest a sum of $1M in order to maximize return on investment.

https://images.google.com/ A Classification Problem

푛 Problem: Given a set of data points: 풙푖 ∈ ℝ , 푖 = 1, … , 푛, with two classification labels: 푦푖 ∈ 1, −1 , find the equation of a hyperplane separating data into classes with maximum inter-class distance.

https://images.google.com/ Mathematical Formulation

Open-Box Problem

What is the largest volume for an open box that can be constructed from a given sheet of paper (8.5”x11”) by cutting out squares at the corners and folding the sides?

Formulation: Let 푥 represent the side of the squares to be cut; then, the unconstrained optimization problem is formulated as:

max 푓 = 푥(8.5 − 2푥)(11 − 2푥) 푥

Data-Fitting Problem

Given a set of 푁 data points 푥푖, 푦푖 , 푖 = 1, … , 푁, fit a polynomial of degree 푚 to the data such that the mean square error is minimized. Formulation: Assume a polynomial of the form: 푦 = 푎 + 푎 푥 + ⋯ + 푚 0 1 푎푚푥 ; then, the unconstrained optimization problem is defined as:

푁 1 푚 2 min 푓 = 2 푦푖 − 푎0 − 푎1푥푖 − ⋯ − 푎푚푥푖 푎0,…,푎푚 푖=1

Shortest Distance to a Curve

Find the shortest distance from a given point (푥0, 푦0) to the curve: 푦 = 푓 푥 . Formulation: We want to minimize the Euclidian distance from the give point to the curve, i.e.,

1 2 2 min 푓 = 푥 − 푥0 + 푦 − 푦0 푥,푦 2 Subject to: 푦 = 푓(푥)

Note, this is a constrained problem Transportation Problem

Goods are to be shipped from 푚 supply points with capacities: 푠1, 푠2, … , 푠푚, to 푛 distribution points with demands: 푑1, 푑2, … , 푑푛. Given the transportation costs 푐푖푗 between node pairs 푖 and 푗, find the optimum shipment schedule, 푥푖푗, to minimize the total shipment cost.

Formulation: let 푥푖푗denote the shipment from node 푖 to node 푗; then, the optimization problem is formulated as:

Objective: min 푓 = 푖,푗 푐푖푗푥푖푗 푥푖푗

Subject to: 푗 푥푖푗 = 푠푖, for 푖 = 1, … , 푚;

푖 푥푖푗 = 푑푗, for 푖 = 1, … , 푛; 푥푖푗 ≥ 0

Note, this is a linear programming problem. Manufacturing problem

A manufacturer produces two products: tables and chairs. A table requires 10 kg of material, 5 units of labor, and earns $7.50 in profit. A chair requires 5 kg of material, 12 units of labor, and earns $5 in profit. A total of 60 kg of material and 80 units of labor are available. Find the best production mix to maximize total profit. 푇 Formulation: Let 푥 = [푥1, 푥2] represent the quantities of tables and chairs to be manufactured. Then,

max 푓 = 7.5푥1 + 5푥2 푥1,푥2 Subject to: 10푥1 + 5푥2 ≤ 60, 5푥1 + 12푥2 ≤ 80; 푥1, 푥2 ∈ ℤ

Note, this is an integer linear programming problem An Investment Problem

Given the stock prices 푝푖 and the anticipated rates of return 푟푖 associated with a group of investments, choose a mix of securities to invest a sum of $1M in order to maximize return on investment.

Formulation: Let 푥푖 denote the amount of investment 푖 that is selected; then, the investment problem is formulated as: 푛 max 푓 = 푖=1 푟푖푥푖푝푖 푥푖 푛 Subject to: 푖=1 푥푖푝푖 ≤ 1푀, 푥푖 ∈ {0,1}

Note, this is a binary integer linear programming problem A Classification problem

푛 Given a set of data points: 풙푖 ∈ ℝ , 푖 = 1, … , 푁, with two classification labels: 푦푖 ∈ 1, −1 , find the equation of a hyperplane separating data into classes with maximum inter-class distance. Formulation: For simplicity, we assume that data points lie in a plane, 2 푇 i.e., 풙푖 ∈ ℝ . Consider a hyperplane: 풘 풙 − 푏 = 0, where 풘 is weight 푇 푇 vector, such that 풘 풙푖 − 푏 ≥ 1 for points labeled as 1, and 풘 풙푖 − 푏 ≤ −1 for points labeled as −1. Then, the optimization problem is formulated as: max 1 풘 2 풘,푏 2 푇 Subject to: 푦푖 풘 풙푖 − 푏 ≥ 1; 푖 = 1, … , 푁 Soda Can Design

Design a soda can of 125 푚푙 capacity for mass production. It is desired to minimize the material cost. For simplicity, assume that same material is used for the cylindrical can as well as the two ends. For esthetic reasons, the height to diameter ratio should be at least 2.

Mathematical formulation: Design variables: height (ℎ), diameter (푑) 1 Objective: 푚푖푛 푓 = 휋푑2 + 휋푑ℎ (surface area) ℎ,푑 2 1 Constraints: g : 휋푑2ℎ = 125 (volume) 1 4 푔2: ℎ ≥ 2푑 (height)

Insulated Spherical Tank Design

Choose the insulation layer thickness 푡 to minimize the life-cycle costs (over 10 years) of a spherical tank of radius 푅. Mathematical formulation:

Life cycle costs: 푐2퐴푡 + 푐3퐺 + 푐4퐺 ∗ 푝푤푓 – Surface area: 퐴 = 4휋푅2 [푚2] 퐴 – Annual heat gain: 퐺 = 365 × 24 × Δ푇 × 퐶1푡 – Thermal resistivity per unit thickness: 퐶1 3 – Equipment insulation cost: 푐2 $/푚

– Equipment refrigeration cost: 푐3 $/푊ℎ

– Annual operating cost: 푐4 $/푊ℎ 퐴 1 – Present worth factor: 푝푤푓(10, 0.1) = 1 − 푖 1+푖 푛

Classification of Optimization problems

• Nonlinear programming (NP) problems – Objective and constraints are nonlinear • Convex optimization problems – is a , objective function and inequality constraints are convex, and equality constraints are linear • Linear programming (LP) problems – Objective function and constraints are linear • Mixed (MIP) problems – Some of the design variables take on values over a finite set • Binary integer programming problems – The design variables take on values over 0,1 The General Optimization Problem

• Let 풙 = 푥1, 푥2, … , 푥푛 denote the vector of design variables; then the general optimization problem is mathematically defined as: Objective: min 푓 풙 , 풙 ∈ ℝ푛 풙 Subject to:

푔푖 풙 ≤ 0, 푖 = 1, … , 푙 (inequality constraints) ℎ푖 풙 = 0, 푖 = 푙 + 1, … , 푚 (equality constraints)

푥푗 ∈ 풮, 푗 = 1, … , 푘 (discrete variables) 퐿 푈 푥푗 ≤ 푥푗 ≤ 푥푗 , 푗 = 푘 + 1, … , 푛 (continuous variables)

The feasible region

• Let 풙 = 푥1, 푥2, … , 푥푛 denote the vector of design variables. Consider the optimization problem: Objective: min 푓 풙 , 풙 ∈ ℝ푛 풙

푔푖 풙 ≤ 0, 푖 = 1, … , 푙; Subject to ℎ푖 풙 = 0, 푖 = 푙 + 1, … , 푚; 퐿 푈 푥푗 ≤ 푥푗 ≤ 푥푗 , 푗 = 1, … , 푛

• The set Ω = 푥: ℎ푖 풙 = 0, 푔푗 풙 ≤ 0, 푥푖퐿 ≤ 푥푖 ≤ 푥푖푈 is termed as the feasible region for the problem.

Convex Optimization Problems

• Consider a general optimization problem: min 푓(풙) 풙 푔푖 풙 ≤ 0푖, 푖 = 1, … , 푙 Subject to ℎ푖 풙 = 0, 푖 = 푙 + 1, … , 푚 퐿 푈 푥푗 ∈ 푥푗 , 푥푗 , 푗 = 1, … , 푛

• The feasible region is defined by: 푆 = {풙: 푔푖 풙 ≤ 0, ℎ푗 풙 = 0}.

• The feasible region is a convex set if the functions: 푔푖 풙 , 푖 = 1, … , 푙, are convex and the functions: ℎ푖 풙 , 푖 = 푙 + 1, … , 푚 are linear. • If, in addition, 푓(풙) is a , then the optimization problem is convex. Convex Optimization Problems

• Convex sets and convex functions: – A set is convex if a line joining any two point lies in the set, e.g. a regular polygon, a circle, a half space, a line, etc. – A function is convex (downward) if it lies above its tangent line at every point, or if it lies below its chord line between any two 2 2 points, e.g., 푓 푥1, 푥2 = 푥1 + 푥2 Convex Optimization Problems

• A convex optimization problem is characterized by the existence of a single global optimum. • Establishing convexity property is important in iteratively solving optimization problems

Convex Optimization Problems

• Examples of convex optimization problems: – Linear programming problems – problems with linear equality constraints – Unconstrained problems if the feasible region is convex • NLP problems are generally nonconvex Optimality

• A point 풙∗ is a local minimum of 푓(풙) if 푓 풙∗ ≤ 푓(풙) in the neighborhood of 풙∗ • A point 풙∗ is a global minimum of 푓(풙) if 푓 풙∗ ≤ 푓(풙) for all feasible 풙

Optimality Criteria for Single-Variable Functions

• The stationary points of a function 푓(푥) are characterized by: 푑푓(푥) = 0. 푑푥 – The stationary points include the maxima, the minima, and the points of inflexion • The curvature condition is used to determine the type of solution: 푑2푓(푥∗) – Minimum: > 0 푑푥2 푑2푓(푥∗) – Maximum: < 0 푑푥2 푑2푓(푥∗) – Point of inflexion = 0 푑푥2

Example: Open box problem

What is the largest volume for an open box that can be constructed from a given sheet of paper (8.5”x11”) by cutting out squares at the corners and folding the sides? Formulation: Let 푥 represent the side of the squares to be cut; then the optimization problem to maximize the volume is formulated as: max 푓 = 푥(8.5 − 2푥)(11 − 2푥) 푥 • First order condition: 푑푓(푥) = 0 → 푥∗ = 1.585, 4.915 푑푥 • Second order condition: 푑2푓(1.585) 푑2푓(4.915) = −39.95; = 39.95 푑푥2 푑푥2

Example: Open-box Problem

• MATLAB code f=@(x) x*(8.5-2*x)*(11-2*x) df=@(x) (8.5-2*x)*(11-2*x)-2*x*(11-2*x)-2*x*(8.5-2*x) ddf=@(x) -2*(19.5-4*x)-2*(19.5-4*x)+8*x fzero(df,1) ans = 1.585 fzero(df,5) ans = 4.915 f(1.585) ans = 66.148 f(4.915) ans = -7.648 ddf(1.585) ans = -39.95 ddf(4.915) ans = 39.95 Example: Open box problem

• Objective: max 푓 = 푥(8.5 − 2푥)(11 − 2푥) 푥 • MATLAB code: syms x real fx=x*(8.5-2*x)*(11-2*x); df=diff(fx); x=solve(df); vpa(x,4) df2=diff(df); eval(df2); vpa(ans,4) Design Example: Insulated Spherical Tank

Problem: minimize the life-cycle costs of a spherical tank of radius 푅

2 2 Life cycle costs: 푐2퐴푡 + 푐3퐺 + 푐4퐺 ∗ 푝푤푓; 퐴 = 4휋푅 [푚 ] 퐴 Annual heat gain: 퐺 = 365 × 24 × Δ푇 × 퐶1푡 Graphical solution: 푡∗ = 0.0678 푚 푓∗ = $15,367

Design Example: Insulated Spherical Tank

• MATLAB code =3; %radius [m] c1=10e3; %thermal resistivity [Cm/W] c2=1e3; %insulation cost/m3 c3=1; %installation cost/Whr c4=.01; %operating cost/Whr dT=5; %temp difference ir=.05; %interest rate n=10; %life in years f=@(t) c2*A*t+(c3+pwf*c4)*365*24*dT*A/(c1*t); %function df=@(t) c2*A-(c3+pwf*c4)*365*24*dT*A/(c1*t^2); %derivative fzero(df,.1) %find stationary point f(ans) %function value at optimum point fplot(f,[.01,.3]),xlabel('t'),ylabel('f(t)')