Intro Class 3

38
ME F344/MF F344 ENGINEERING OPTIMIZATION Rajesh P Mishra, 1228A [email protected]

description

optimization

Transcript of Intro Class 3

Page 1: Intro Class 3

ME F344/MF F344 ENGINEERING OPTIMIZATION

Rajesh P Mishra,

1228A

[email protected]

Page 2: Intro Class 3

Mute ur call Plz add Engineering Optimization group of facebook (Rajesh Mishra)

Page 3: Intro Class 3

3

Phases of an OR Study

Definition of the problem

Construction of the model

Solution of the model

Validation of the model

Implementation of the solution

Linear programming

Dynamic programming

Network programming

Integer programming

Nonlinear programming

Page 4: Intro Class 3

Example: Product Mix Decision

• DJJ Enterprises makes automotive parts, Camshafts & Gears

• Unit Profit: Camshafts $25/unit, Gears $18/unit

• Resources needed: Steel, Labor, Machine Time. In total, 5000 lbs steel available, 1500 hours labor, and 1000 hours machine time.

• Camshafts need 5 lbs steel, 1 hour labor, 3 hours machine time.

• Gears need 8 lbs steel, 4 hours labor, 2 hours machine time.

• How many camshafts & gears to make in order to maximize profit?

Page 5: Intro Class 3

Understanding the Problem

• Text-Based Formulation – Decision Variables:

Number of camshafts to make, number of gears to make

– Objective Function: Maximize profit

– Constraints: Don’t exceed amounts available of steel, labor, and machine time.

Page 6: Intro Class 3

Algebraic Formulation • Decision Variables

– C = number of camshafts to make

– G = number of gears to make

• Objective Function – Maximize 25C + 18G (profit in $)

• Constraints – 5C + 8G <= 5000 (steel in lbs)

– 1C + 4G <= 1500 (labor in hours)

– 3C + 2G <= 1000 (machine time in hours)

– C >= 0, G >= 0 (non-negativity)

Page 7: Intro Class 3

Important Concepts • Linear Program: The objective function and constraint

are linear functions of the decision variables. Therefore, this is a Linear Program.

• Feasibility – Feasible Solution. A solution is feasible for an LP if all

constraints are satisfied.

– Infeasible Solution. A solution is infeasible if one or more constraints is violated.

– Check the solutions C=75, G=200; and C=300, G=200 for feasibility.

• Optimal Solution. The optimal solution is the feasible solution with the largest (for a max problem) objective value (smallest for a min problem).

Page 8: Intro Class 3

Solving Linear Programming Problems • Trial and error: possible for very small problems;

virtually impossible for large problems.

• Graphical approach: It is possible to solve a 2-variable problem graphically to find the optimal solution (not shown).

• Simplex Method. This is a mathematical approach developed by George Dantzig. Can solve small problems by hand.

• Computer Software. Most optimization software actually uses the Simplex Method to solve the problems. Excel’s Solver Add-In is an example of such software.

• Solver can solve LPs of up to 200 variables. Enhanced versions of Solver are available from Frontline Systems (http://www.solver.com).

Page 9: Intro Class 3
Page 10: Intro Class 3
Page 11: Intro Class 3
Page 12: Intro Class 3
Page 13: Intro Class 3

Wild West produces two types of hats. Type I

hat requires twice as much labor as a Type II.

If all the available labor time is dedicated to

Type II alone, the company can produce a total

of 400 Type II hats in a day. The respective

market limits for the two types of hats are 150

and 200 hats per day. The profit is $8 per Type

I hat and $5 per Type II hat. Formulate the

problem as an LPP so as to maximize the

profit.

Page 14: Intro Class 3

Solution: Assume that Wild West produces x1 Type I hats and x2 Type II hats per day.

8 x1 + 5 x2

Labour Time spent is (2 x1 + x2) c minutes

Per day Profit got =

Assume the time spent in producing one type II hat is c minutes.

Page 15: Intro Class 3

The objective is to find x1, x2 so as to

maximise the profit z = 8 x1 + 5 x2

satisfying the constraints:

(2 x1 + x2 ) c ≤ 400 c

x1 ≤ 150

x2 ≤ 200

x1, x2 ≥ 0, integers

Page 16: Intro Class 3

That is: The objective is to find x1, x2 so

as to maximise the profit z = 8 x1 + 5 x2

satisfying the constraints:

2 x1 + x2 ≤ 400

x1 ≤ 150

x2 ≤ 200

x1, x2 ≥ 0, integers

Page 17: Intro Class 3

Trim Loss problem: A company has to manufacture the circular tops of cans. Two sizes, one of diameter 10 cm and the other of diameter 20 cm are required. They are to be cut from metal sheets of dimensions 20 cm by 50 cm. The requirement of smaller size is 20,000 and of larger size is 15,000. The problem is : how to cut the tops from the metal sheets so that the number of sheets used is a minimum. Formulate the problem as a LPP.

Page 18: Intro Class 3

A sheet can be cut into one of the following three patterns:

Pattern I

Pattern II

Pattern III

10

20

20

10

10

10

20

10

Page 19: Intro Class 3

Pattern I: cut into 10 pieces of size 10 by 10 so as to make 10 tops of size 1

Pattern II: cut into 2 pieces of size 20 by 20 and 2 pieces of size 10 by 10 so as to make

2 tops of size 2 and 2 tops of size 1

Pattern III: cut into 1 piece of size 20 by 20 and 6 pieces of size 10 by 10 so as to make 1 top of size 2 and 6 tops of size 1

Page 20: Intro Class 3

So assume that x1 sheets are cut according to pattern I, x2 according to pattern II, x3 according to pattern III

The problem is to

Minimize z = x1 + x2 + x3

Subject to 10 x1 + 2 x2 + 6 x3 ≥ 20,000

2 x2 + x3 ≥ 15,000

x1, x2, x3 ≥ 0, integers

Page 21: Intro Class 3

A Post Office requires different number of full-time employees on different days of the week. The number of employees required on each day is given in the table below. Union rules say that each full-time employee must receive two days off after working for five consecutive days. The Post Office wants to meet its requirements using only full-time employees. Formulate the above problem as a LPP so as to minimize the number of full-time employees hired.

Page 22: Intro Class 3

Requirements of full-time employees day-wise

Day No. of full-time

employees required

1 - Monday 10

2 - Tuesday 6

3 - Wednesday 8

4 - Thursday 12

5 - Friday 7

6 - Saturday 9

7 - Sunday 4

Page 23: Intro Class 3

Solution: Let xi be the number of full-time employees employed at the beginning of day i (i = 1, 2, …, 7). Thus our problem is to find xi so as to

Page 24: Intro Class 3

Minimize

1 2 3 4 5 6 7z x x x x x x x

Subject to

1 4 5 6 7 10 (Mon)x x x x x

1 2 5 6 7 6 (Tue)x x x x x

1 2 3 6 7 8 (Wed)x x x x x

1 2 3 4 7 12 (Thu)x x x x x

1 2 3 4 5 7 (Fri)x x x x x

2 3 4 5 6 9 (Sat)x x x x x

3 4 5 6 7 4 (Sun)x x x x x

xi 0. integers

Page 25: Intro Class 3

BITS wants to host a Seminar for five days. For the delegates there is an arrangement of dinner every day. The requirement of napkins during the 5 days is as follows:

Day 1 2 3 4 5

Napkins

Needed

80 50 100 80 150

Page 26: Intro Class 3

Institute does not have any napkins in the beginning. After 5 days, the Institute has no more use of napkins. A new napkin costs Rs. 2.00. The washing charges for a used one are Rs. 0.50. A napkin given for washing after dinner is returned the third day before dinner. The Institute decides to accumulate the used napkins and send them for washing just in time to be used when they return. How shall the Institute meet the requirements so that the total cost is minimized ? Formulate as a LPP.

Page 27: Intro Class 3

Solution Let xj be the number of napkins purchased on day j, j=1,2,..,5

Let yj be the number of napkins given for washing after dinner on day j, j=1,2,3

Thus we must have

Also we have y1 ≤ 80, y2 ≤ (80 – y1) + 50

y3 ≤ (80 – y1) + (50 – y2) + 100

x1 = 80, x2 = 50, x3 + y1 = 100, x4 + y2 = 80 x5 + y3 = 150

Page 28: Intro Class 3

Thus we have to Minimize z = 2(x1+x2+x3+x4+x5)+0.5(y1+y2+y3)

Subject to

x1 = 80, x2 = 50, x3 +y1 =100,

x4 + y2 = 80, x5 + y3 = 150,

y1 ≤ 80, y1+y2 ≤ 130, y1+y2+y3 ≤ 230,

all variables ≥ 0, integers

Page 29: Intro Class 3

Formulating Transportation Problems

Powerco has three electric power plants that supply the electric needs of four cities.

•The associated supply of each plant and demand of each city is given in the table 1.

•The cost of sending 1 million kwh of electricity from a plant to a city depends on the distance the electricity must travel.

Page 30: Intro Class 3

Transportation tableau

A transportation problem is specified by the supply, the demand, and the shipping costs. So the relevant data can be summarized in a transportation tableau. The transportation tableau implicitly expresses the supply and demand constraints and the shipping cost between each demand and supply point.

Page 31: Intro Class 3

Table 1. Shipping costs, Supply, and Demand for Powerco Example

From To

City 1 City 2 City 3 City 4 Supply

(Million kwh)

Plant 1 $8 $6 $10 $9 35

Plant 2 $9 $12 $13 $7 50

Plant 3 $14 $9 $16 $5 40

Demand

(Million kwh)

45 20 30 30

Transportation Tableau

Page 32: Intro Class 3

Solution

1. Decision Variable:

Since we have to determine how much electricity is sent from each plant to each city;

Xij = Amount of electricity produced at plant i and sent to city j

X14 = Amount of electricity produced at plant 1 and sent to city 4

Page 33: Intro Class 3

2. Objective function

Since we want to minimize the total cost of shipping from plants to cities;

Minimize Z = 8X11+6X12+10X13+9X14

+9X21+12X22+13X23+7X24

+14X31+9X32+16X33+5X34

Page 34: Intro Class 3

3. Supply Constraints

Since each supply point has a limited production capacity;

X11+X12+X13+X14 <= 35

X21+X22+X23+X24 <= 50

X31+X32+X33+X34 <= 40

Page 35: Intro Class 3

4. Demand Constraints

Since each supply point has a limited production capacity;

X11+X21+X31 >= 45

X12+X22+X32 >= 20

X13+X23+X33 >= 30

X14+X24+X34 >= 30

Page 36: Intro Class 3

5. Sign Constraints

Since a negative amount of electricity can not be shipped all Xij’s must be non negative;

Xij >= 0 (i= 1,2,3; j= 1,2,3,4)

Page 37: Intro Class 3

LP Formulation of Powerco’s Problem

Min Z = 8X11+6X12+10X13+9X14+9X21+12X22+13X23+7X24

+14X31+9X32+16X33+5X34

S.T.: X11+X12+X13+X14 <= 35 (Supply Constraints)

X21+X22+X23+X24 <= 50

X31+X32+X33+X34 <= 40

X11+X21+X31 >= 45 (Demand Constraints)

X12+X22+X32 >= 20

X13+X23+X33 >= 30

X14+X24+X34 >= 30

Xij >= 0 (i= 1,2,3; j= 1,2,3,4)

Page 38: Intro Class 3

Questions/Queries?