+ All Categories
Home > Documents > OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Date post: 15-Jan-2016
Category:
View: 228 times
Download: 3 times
Share this document with a friend
62
OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier
Transcript
Page 1: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

OPTIMIZATION

ENGR 351 Numerical MethodsInstructor: Dr. L.R. Chevalier

Page 2: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

x

f(x)

Recall, when determining the root, we were seeking x where f(x) = 0

f(x) = 0

Page 3: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

x

f(x)

With optimization, however we are seeking f '(x) = 0

f '(x) = 0

f '(x) = 0

Page 4: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

x

f(x)

The maximum occurs when f "(x)<0

f '(x) = 0f "(x) < 0

Page 5: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

x

f(x)

The minimum occurs when f "(x)>0

f '(x) = 0f "(x)> 0

Page 6: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Optimization

In some techniques, we determine the optima by solving the root problem f '(x) =0

If f ’(x) is not available analytically, we may use a finite difference approximation to estimate the derivative

Page 7: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Examples of Optimization Problems

Design structures for minimum cost Design water resource project to

mitigate flood damage while yielding maximum hydropower

Design pump and heat transfer equipment for maximum efficiency

Inventory control Optimize planning and scheduling

Page 8: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Methods Presented

One-dimensional Unconstrained Optimization Golden Search Method

Constrained Optimization Graphically Using Excel

Page 9: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Specific Study Objectives

Understand why and where optimization occurs in engineering problem solving

Understand the major elements of the general optimization problem: objective function, decision variables, and constraints

Page 10: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Be able to distinguish between linear and nonlinear optimization, and between constrained and unconstrained problems

Be able to define the golden ratio and understand how it makes 1-D optimization efficient

Be able to solve a 2-D linear programming problem graphically

Specific Study Objectives

Page 11: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Mathematical Background

An optimization or mathematical programming problem is generally stated as:

find x which minimizes or maximizes f(x) subject to

di(x) ai i = 1,2,……mei(x) = bi i=1,2,……p

Page 12: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Mathematical Background

find x which minimizes or maximizes f(x) subject to

di(x) ai i = 1,2,……mei(x) = bi i=1,2,……p

x is the design vector (n-dimensions)f(x) is the objective function

Page 13: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Mathematical Background

find x which minimizes or maximizes f(x) subject to

di(x) ai i = 1,2,……mei(x) = bi i=1,2,……p

di(x) are inequality constraintsei(x) are equality constraints

Page 14: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

If f(x) and the constraints are linear, we have linear programming

If f(x) is quadratic, and the constraints are linear, we have quadratic programming

If f(x) in not linear or quadratic, and/or the constraints are nonlinear, we have nonlinear programming

Mathematical Background

Page 15: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Mathematical Background

find x which minimizes or maximizes f(x) subject to

di(x) ai i = 1,2,……mei(x) = bi i=1,2,……p

Without these, we have unconstrained optimization

Page 16: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Mathematical Background

find x which minimizes or maximizes f(x) subject to

di(x) ai i = 1,2,……mei(x) = bi i=1,2,……p

With them, we have constrained optimization

Page 17: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

1-D Unconstrained Optimization

f(x)

x

global maximum

global minimumlocal minimum

local maximum

Here we see a multimodal case…however we want the global max or min!

Page 18: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

1-D Unconstrained Optimization

We will consider the Golden Section Search method which is based on the Golden Ratio

......61803.02

15

Page 19: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Golden Ratio and Fibonacci Numbers

O.61803

1

This proportion was considered aesthetically pleasing by the Greeks

The Parthenon5th century BC

Page 20: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Golden Ratio and Fibonacci Numbers

The Golden Ratio is related to an important mathematical series known as the Fibonacci numbers

0,1,1,2,3,5,8,13,21,34…..

Each number after the first two represents the sum of the preceding two. Note the ratio of consecutive numbers

Page 21: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Golden Ratio and Fibonacci Numbers

0,1,1,2,3,5,8,13,21,34…..

0/1=01/1=11/2=0.52/3=0.6673/5==0.65/8=0.6258/13=0.615

Continue and the ratio approaches the golden ratio!

Page 22: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

01 0.000001 1.000002 0.500003 0.666675 0.600008 0.6250013 0.6153821 0.6190534 0.6176555 0.6181889 0.61798144 0.61806233 0.61803

......61803.02

15

Golden Ratio and Fibonacci Numbers

Page 23: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

1-D Unconstrained Optimization: The Golden-Section Search

f(x)

x

Pick two points,xu and xl

xl xu

lo = xu-xl

Page 24: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

1-D Unconstrained Optimization: The Golden-Section Search

f(x)

xxl xu

lo = xu-xl

We will now need a two new points based on the constraints l0 = l1 + l2 l1/l0 = l2/l1

Page 25: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

1-D Unconstrained Optimization: The Golden-Section Search

f(x)

xxl xu

lo = xu-xl

Substitutingl1/(l1+l2) = l2/l1

If the reciprocal is taken, and R = l2/l11+R = 1/RR2 + R - 1 = 0

Page 26: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

1-D Unconstrained Optimization: The Golden-Section Search

f(x)

xxl xu

lo = xu-xl

R2 + R - 1 = 0

This can be solved for the positive root

61803.02

15

2

1411

Page 27: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

1-D Unconstrained Optimization: The Golden-Section Search

f(x)

xxl xu

lo = xu-xl

dxx

dxx

xxd

u

l

lu

2

1

2

15

Evaluate the function at these points. Two results can occur.

Page 28: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

f(x)

x

xl xu

1-D Unconstrained Optimization: The Golden-Section Search

x1d

dx2

Page 29: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

f(x)

x

xl xu

1-D Unconstrained Optimization: The Golden-Section Search

x1d

dx2

Here, f(x1) > f(x2)

Page 30: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

f(x)

x

xl xu

1-D Unconstrained Optimization: The Golden-Section Search

x1d

dx2

Eliminate the domain to the left of x2

Page 31: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

f(x)

x

xl xu

1-D Unconstrained Optimization: The Golden-Section Search

x1d

dx2

x2 becomes xl for the next round

Page 32: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

f(x)

x

xl xu

1-D Unconstrained Optimization: The Golden-Section Search

x1d

dx2

If f(x1)<f(x2), eliminate points to the right of x1

Page 33: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

f(x)

x

xl xu

1-D Unconstrained Optimization: The Golden-Section Search

x1d

dx2

Back to the first case, here the new xl is x2

Page 34: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

f(x)

x

xl xu

1-D Unconstrained Optimization: The Golden-Section Search

old x1=x2

xl

Because of the Golden Ratio, the previous x1 becomes the current x2

d

Page 35: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

f(x)

x

xu

1-D Unconstrained Optimization: The Golden-Section Search

x2

xld

lul xxxx

2

151

Page 36: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

f(x)

x

xu

1-D Unconstrained Optimization: The Golden-Section Search

x2

xld

Repeat this algorithm until f(x) stabilizes

Page 37: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

1-D Unconstrained Optimization: The Golden-Section Search

Let’s review the spreadsheet fileopt-a.xls

xl f(xl) x2 f(x2) x1 f(x1) xu f(xu) d

0.0000 0.0000 1.5279 1.7647 2.4721 0.6300 4.0000 -3.1136 2.47210.0000 0.0000 0.9443 1.5310 1.5279 1.7647 2.4721 0.6300 1.52790.9443 1.5310 1.5279 1.7647 1.8885 1.5432 2.4721 0.6300 0.94430.9443 1.5310 1.3050 1.7595 1.5279 1.7647 1.8885 1.5432 0.58361.3050 1.7595 1.5279 1.7647 1.6656 1.7136 1.8885 1.5432 0.36071.3050 1.7595 1.4427 1.7755 1.5279 1.7647 1.6656 1.7136 0.2229

10sin2

2xx Find the maximum of

Page 38: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

ExamplePerform three iterations of the golden section search to maximizef(x) = -1.5x6 - 2x4 +12x

using the initial guessesxl=0 and xu =2

0

2

4

6

8

10

0.0 0.5 1.0 1.5

x

f(x)

Page 39: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Solutionxl f(xl) x2 f(x2) x1 f(x1) xu f(xu) d

0.0000 0.0000 0.7639 8.1879 1.2361 4.8142 2.0000 -104.0000 1.23610.0000 0.0000 0.4721 5.5496 0.7639 8.1879 1.2361 4.8142 0.76390.4721 5.5496 0.7639 8.1879 0.9443 8.6778 1.2361 4.8142 0.4721

Reference opt-a.xls

Page 40: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Use of Solver

If SOLVER is not under Tools, you’ll have to add it Use <TOOLS - ADD INS> command Choose SOLVER ADD-IN If not available as an option, you will

need to install it from the original MS Office CD

Reference opt-a.xls

Page 41: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Constrained Optimization

Linear programming (LP) is an optimization approach that deals with meeting a desired objective

- maximizing profit- minimizing cost

Both the objective function and the constraints are linear in this case

Page 42: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Constrained Optimization

Objective function

Maximize Z = c1x1 +c2x2 +…..cnxn

orMinimize Z = c1x1 +c2x2 +…..cnxn

where ci = payoff of each unit of the jth activity xi = magnitude of the jth activity

Page 43: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Constrained OptimizationObjective function

Maximize Z = c1x1 +c2x2 +…..cnxn

orMinimize Z = c1x1 +c2x2 +…..cnxn

where ci = payoff of each unit of the jth activity xi = magnitude of the jth activity

Hence, Z is the total payoff due to the total number of activities, n

Page 44: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Constrained Optimization

The constraints can be represented by:

ai1x1 +bi2x2+…..ainxn bi

where aij = amount of the ith resource that is consumed for each unit of the jth activity

bi = amount of the ith resource available

Page 45: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Constrained Optimization

Finally, we add the constraint that all activities must have a positive value

xi 0

Page 46: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Setting up the general problem

Similar to Problem 15.1 p. 377

Gas processing plant that receives a fixed amount of raw gas each week

Capable of processing two grades of heating gas (regular and premium)

High demand for the product (I.e. guaranteed to sell)

Each grade yields a different profit

Page 47: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Each grade has different production time and on-site storage constraints

Facility is only open 120hrs/weekUsing the factors in the table on

the next page, develop a linear programming formulation to maximize profits for this operation.

Setting up the general problem

Page 48: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Parameters

Note: a metric ton, or tonne, is equal to 1000 kg)

Resource Regular Premium Resource Availability

120

Storage 9 6Profit (/tonne) 150 175

77

10 8

Product

Raw Gas

(m3/tonne)Production Time (hr/tonne)

7 11

Page 49: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Parameters

Let x1 = amount of regular and x2 = amount of premium

Resource Regular Premium Resource Availability

120

Storage 9 6Profit (/tonne) 150 175

77

10 8

Product

Raw Gas

(m3/tonne)Production Time (hr/tonne)

7 11

Page 50: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Objective Function

Total Profit = 150 x1 + 175 x2

Maximize Z = 150 x1 + 175 x2

Resource Regular Premium Resource Availability

120

Storage 9 6Profit (/tonne) 150 175

77

10 8

Product

Raw Gas

(m3/tonne)Production Time (hr/tonne)

7 11

Page 51: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Objective Function

Total Profit = 150 x1 + 175 x2

Maximize Z = 150 x1 + 175 x2Objectivefunction

Resource Regular Premium Resource Availability

120

Storage 9 6Profit (/tonne) 150 175

77

10 8

Product

Raw Gas

(m3/tonne)Production Time (hr/tonne)

7 11

Page 52: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Constraints

7x1 + 11x2 77 (material constraint)10x1 + 8x2 120 (time constraint)x1 9 (storage constraint)x2 6 (storage constraint)x1,x2 0 (positivity constraint)

Resource Regular Premium Resource Availability

120

Storage 9 6Profit (/tonne) 150 175

77

10 8

Product

Raw Gas

(m3/tonne)Production Time (hr/tonne)

7 11

Page 53: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

0

2

4

6

8

10

12

14

0 5 10 15

x1

x 2

Graphical Solution

Page 54: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Graphical Solution

Now we need to add the objective function to the plot. Start with

Z = 0 (0=150x1 + 175x2)

and

Z = 500 (500=150x1 + 175x2)

Page 55: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

-4

-2

0

2

4

6

8

10

12

14

-5 0 5 10 15

x1

x 2

Z=1550

Still in feasible regionx1 8x2 2

Graphical Solution

Page 56: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Excel Solution: Using Solver

Page 57: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Solver Parameters

Note: See Example 15.3 p. 388

Page 58: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Solver Solution

Recall graphical solutionx1 8x2 2

Page 59: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Example

Develop the equations (objective function and constraints) needed to optimize the problem on the next slide.

Page 60: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

ExampleA construction site requires a minimum of 10,000 yd3 of sand and gravel mixture. The mixture must contain no less than 5000 yd3 of sand and no more than 6000 yd3 of gravel. The material may be obtained from two sites

1 5 30 702 7 60 40

Delivery Cost

($/yd3)

% Sand % GravelSite

Page 61: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Excel Solution

C 0.00 Objective Functionx1 0.00x2 0.00

Constraintsx1 + x2 0.00 >= 10,0000.3x1 +0.6x2 0.00 >= 50000.7x1+0.4x2 0.00 <= 6000x1 0.00 >= 0x2 0.00 >= 0

Page 62: OPTIMIZATION ENGR 351 Numerical Methods Instructor: Dr. L.R. Chevalier.

Excel SolutionC 63333.33 Objective Functionx1 3333.33x2 6666.67

Constraintsx1 + x2 10000.00 >= 10,0000.3x1 +0.6x2 5000.00 >= 50000.7x1+0.4x2 5000.00 <= 6000x1 3333.33 >= 0x2 6666.67 >= 0


Recommended