Tải bản đầy đủ - 0 (trang)

Tải bản đầy đủ - 0trang

146

Entrepreneurship for Engineers

Figure 7.1

Microsoft Excel 2003 with Solver.

Figure 7.2

Solver add-in process for Microsoft Excel 2007.

147

7.1 Linear Programming

Let us use a simple production schedule problem to explain the solving procedure in detail.

MMI Example—Part I

Micro Motors Inc. (MMI) produces multilayer actuators (MLAs) and ultrasonic motors (USMs)

every month. Table 7.1 summarizes the necessary data for producing MLAs and USMs. Though

USMs generate a larger gross proﬁt per unit with a smaller amount of raw materials per unit than

MLAs, USMs require a working period ﬁve times longer than MLAs. MMI has two major constraints: (1) labor—total 500 h/month maximum (= 3 engineers × 40 h/week × 4.17 weeks/month),

and (2) raw materials available—total 300 g/month maximum. MMI would like to determine the

optimum production quantities (unit number) X for MLAs and Y for USMs in order to maximize

the gross proﬁt.

Part I seeks the solutions for nonnegative continuous numbers of X and Y .

7.1.1 Mathematical Modeling

The production quantities (unit number) X for MLAs and Y for USMs are called decision variables .

The total gross proﬁt is provided by the sum of MLA proﬁt \$25X and USM proﬁt \$100Y :

25X + 100Y

which MMI would like to m aximize. This is called objective function. Two major physical constraints at MMI are expressed with functional constraints, ≤, ≥, or =:

Labor: 5X + 25Y ≤ 500

Raw materials: 5X + 2Y ≤ 300

Now we have the following constrained mathematical model for this problem:

MAXIMIZE:

SU

25X + 100Y (T otal proﬁt)

5X + 25Y ≤ 500

BJECT TO:

(Labor)

5X + 2Y ≤ 300 (Raw materials)

X, Y ≥ 0

(Nonnegativity)

(The condition that “X and Y are integers” is not added in Part I.)

Table 7.1 Production Data for Multilayer Actuators (MLAs) and Ultrasonic Motors

(USMs)

Gross

Proﬁt/Unit

Required

Labor/Unit

Gross

Proﬁt/Labor

Required

Material/Unit

MLA

\$25

5h

\$5/h

5g

USM

\$100

25 h

\$4/h

2g

Product

148 ◾

Entrepreneurship for Engineers

7.1.2 Graphical Solution

Two constraints can be transformed as

⎛ 1⎞

Y ≤ − ⎜ ⎟ X + 20

⎝ 5⎠

and

Y ≤ −2.5X + 150

Taking into account X and Y nonnegative, the constraints exhibit a quadrilateral region shown in

gray in Figure 7.3. The coordinates for four corner points are obtained as (0,0), (0,20), (60,0), and

M .The red-star point M can be obtained from the equation

⎛ 1⎞

Y = − ⎜ ⎟ X + 20 = −2.5X + 150

⎝ 5⎠

as (56.52, 8.696). This point of the feasible region is called the extreme point, which is the intersection

of the limit on labor time and the limit for materials quantity.

Equating the total proﬁt to K (where 25X + 100Y = K ), we obtain

⎛ 1⎞

K

Y = −⎜ ⎟ X +

100

⎝ 4⎠

160

140

USM Quantity Y

120

100

Labor

80

Materials

60

40

K > 2283

20

0

Figure 7.3

K = 2283

K < 2283

0

20

M

40

60

80

MLA Quantity X

100

Graphical solution of the production schedule problem.

120

149

By scanning this line upward and downward, we obtain the maximum K value. When K > 2283,

this line will not overlap with the quadrilateral region, while for K < 2283, the line overlaps with the

quadrilateral area. As you can clearly see, the K value becomes the maximum when this line crosses

the star point M (56.52, 8.696), that is, the extreme point. Now we can obtain the maximum proﬁt

\$2283 for the MLA production of 56.52 units and the USM quantity of 8.696 units.

We will now trace the same solution by using the Solver function of the Excel spreadsheet. Solver

is an option found in the Tools menu. If you do not see Solver listed, you must check the Solver

We will start from Figure 7.4, which shows how to assign the cells. To use Solver, I recommend

you designate cells to contain the following:

◾ Values of the decision variables (changing cells)—cells C5 and D5

◾ Value of the objective function (target cell)—cell E7

◾ Total value of the left-hand side of the constraints—cells E9 and E10

Also familiarize yourself with Excel’s SUM and SUMPRODUCT functions for this setting. Cell

E7 is total proﬁt, which is provided by the sum of MLA and USM proﬁts. It should be equal to

SUMPRODUCT(C5:D5,C7:D7), which means that this cell is computed by

(C5 × C7 + D5 × D7)

As you may recognize, if this cell E7 is copied to E9, the row numbers are automatically shifted to

(C7 × C9 + D7 × D9)

Figure 7.4

Microsoft Excel 2007 with Solver for an MMI production schedule.

150 ◾

Entrepreneurship for Engineers

Because we sh ould n ot sh ift t he ro w number 5, w hich i s t he va riable u nit number ( X a nd Y )

row, we must ﬁ x the row number. For this purpose, we will use the “\$” symbol. Thus, instead of

SUMPRODUCT(C5:D5,C7:D7), we type here:

SUMPRODUCT(\$C\$5:\$D\$5,C7:D7)

The F4 f unction key at t he top of the keyboard is easy to u se for this exchange. Highlight only

the ﬁrst array (C5:D5) of the formula in the formula bar and press the F4 key; then you can insert

dollar signs.

Next, c opy E7 i nto E 9 a nd E10, so t hat yo u o btain t he n umbers 3 0 a nd 7 i n t hese c ells,

because the initial unit numbers in C5 and D5 are tentatively 1 for both.

We now click Solver in the Tools menu. This gives the dialog box shown in Figure 7.1. Note

that the dialog box is the same for both Excel 2003 and 2007.

Step 1: Set Target Cell. This is t he cell for t he objective f unction. With t he cursor in t he Set

Target Cell box, click on cell E7.

Step 2: E qual To. Problem t ype (maximization or minimization) is set. L eave t he button for

Max highlighted. (When you need to compute the minimum, choose “Min.”)

Step 3: Changing Cells. Changing cells are the cells that contain the decision variables. With the

cursor in the By Changing Cells box, highlight cells C5 and D5.

Step 4: Subject to the Constraints. To introduce the constraints, click the Add button in Subject

to t he Constraints. You will get t he Add Constraint dialog box shown in Figure 7.5. The

constraint options include ≤, =, ≥, i nt, a nd bin. The last t wo options re strict a c ell to b e

integer-valued or binary (0 or 1), respectively. With t he cursor in t he Cell Reference box,

highlight cells in E9 and E10. Click the direction as ≤ in this case. With the cursor in the

Constraint box, highlight cells G9 and G10. Click Add, if we have more constraints. If

ﬁnished, click OK.

Step 5: Options. Click Options to open the dialog box shown in Figure 7.6. It is important to

check both Assume Linear Model and Assume Non-Negative. Click OK.

Step 6: Solve. Figure 7.7 shows the completed Solver dialog box for the MMI product schedule.

To solve for the optimal solution, click Solve.

Step 7: Rep orts. O nce a n optimal solution i s found, t he S olver R esults d ialog b ox shows u p

(Figure 7.8). At the same time, Figure 7.4 is automatically changed to Figure 7.9. You can

ﬁnd that the solutions (quantity X = 56.52, quantity Y = 8.696, and the maximum proﬁt

\$2283) are exactly the same in the calculation error range.

Two further reports are available: Answer Report and Sensitivity Report. Highlight one of them

and click OK. Note that these t wo reports are created on separate spreadsheets. No new dialog

boxes show up.

Answer Report: Click on the Answer Report tab at the bottom of the spreadsheet to access the

window shown in Figure 7.10. The A nswer Report includes three parts: Target Cell, Adjustable

Cells, and Constraints.

Target Cell provides the optimal value of the objective function in the Final Value column,

with the initial input (\$125 in our trial). Similarly, the optimum values for the decision variables

are shown in the Final Value column of the Adjustable Cells section. In the Constraints section,

the Cell Value gives the total values of the left side of the constraints. The information entered in

the Constraint dialog box of Solver appears in the Formula column. The Slack column shows the

amount of slack for each constraint. Note that if the slack is 0, the word “Binding” is printed in

the Status column; “Not Binding” is printed when the slack is positive.

Figure 7.5

Adding the Constraint dialog box in Solver.

Figure 7.6

Solver Options dialog box.

Figure 7.7

Solver Parameters dialog box.

Figure 7.8

Solver Results dialog box.

151

152 ◾

Entrepreneurship for Engineers

Figure 7.9

Figure 7.10

Computed results for the optimal production schedule.

Sensitivity R eport: The S ensitivity R eport ( Figure 7.11) e xhibits i mportant i nformation c oncerning the eﬀects of changes to either an objective function coeﬃcient or a constraint value.

In the A djustable Cells, sensitivity analysis of an objectiv e function coeﬃ cient answers the

question, “K eeping all other factors the same, ho w much can an objectiv e function coeﬃ cient

change without changing the optimal solution (that is, without changing the production quantities

of X and Y )?” For example, the O bjective Coeﬃ cient for ML A (proﬁt per unit) is initially \$25.

Without changing the extr eme point position, ho w much can w e change this number? I n other

Figure 7.11

153

Sensitivity report.

words, how much can we swing the slope of the objective function curve in Figure 7.3? The answer

is provided by Allowable Increase and Allowable Decrease. The MLA proﬁt can be changed fr om

\$20 (= 25 − 5) to \$250 ( = 25 + 225). This range is called range of optimality . Similarly, the gross

proﬁt for USM can be changed from \$10 (= 100 − 90) to \$125 (100 + 25). Note that the value of

the objective function (total proﬁt) will, of course, change, according to the unit proﬁt change.

Shadow price is a useful number fr om a practical operation vie wpoint. The shadow for a constraint is the change to the objectiv e function v alue per unit incr ease to its constraint v alue. For

example, MMI set the maximum labor (wor king time) as 500 h. I f MMI asks the r esearcher to

work one more hour (up to 501 h), ho w much will total proﬁt increase (a sort of “what-if ” question)? The answer can be found in the S hadow Price column as \$3.91. I f this amount (additional

proﬁt) is higher than the additionally required cost (such as an extra portion of the overwork payment, after subtracting the regular salary rate, utility, etc.), MMI should move in this direction.

The range of feasibility is the range of v alues for a constraint v alue in which the shado w

prices for the constraints r emain unchanged. The range is pr ovided by Allowable Increase and

Allowable Decrease. In the labor constraint in MMI, the range will be from 300 h (= 500 − 200)

to 3750 h (= 500 + 3250), while in the materials constraint, fr om 40 g (= 300 − 260) to 500 g

(= 300 + 200).

7.1.4 Integer Model

MMI Example—Part II

As described in Part I, MMI produces MLAs and USMs every month. Table 7.1 summarized the

necessary data for producing MLAs and USMs. Though USMs generate a larger gross proﬁt per

unit, with a smaller amount of raw materials per unit than MLAs, USMs require a working period

ﬁve times longer than MLAs. MMI has two major constraints: (1) labor—total 500 h/month maximum (= 3 engineers × 40 h/week × 4.17 weeks/month), and (2) raw materials available—total

300 g/month maximum. MMI would like to determine the optimum production quantities (unit

number) X for MLAs and Y for USMs in order to maximize the gross proﬁt.

Part II seeks the solutions for nonnegative integer numbers of X and Y .

154 ◾

Entrepreneurship for Engineers

Figure 7.12

Solver Options dialog box (integer analysis).

Solution—Part II

In Part I, we found that one solution (quantity X = 56.52, quantity Y = 8.696, and the maximum

proﬁt \$2283) is the optimal solution. However, the product unit should be an integer, since we

cannot sell 0.696 unit of USM, in practice.

If we initially consider the graphical solution ﬁrst, the integer optimum solution should

exist around the MLA production of 56.52 units and the USM quantity of 8.696 units. Let us take

into account the following positions: (X,Y) = (56,8), (57,8), (58,8), (59,8); (53,9), (54,9), (55,9), and

(56,9). Only (56,8), (53,9), (54,9), and (55,9) pass the criteria: labor 5 X + 25 Y ≤ 500, and raw materials 5X + 2Y ≤ 300. Thus, it is obvious the maximum proﬁt can be obtained for the position (55,9).

Let us now solve the same question on Excel Solver by adding the integer constraint to the decision

variables (quantities X and Y). We will add one more condition to “Subject to the Constraints”:

\$C\$5:\$D\$5 = integer

as shown in Figure 7.12 (ﬁnd the difference from Figure 7.7). The solution can easily be found

(Figure 7.13). The Answer Report is shown in Figure 7.14, where the optimum production

schedule—55 units MLA, 9 units USM, and total proﬁt \$2275—is the same as we analyzed

graphically. Note that there is Slack in Materials Constraint (7 g material remained), leading to a

“Not Binding” note in the Status column. Also note that there is a slight decrease in the total proﬁt

(\$2275) in comparison with the proﬁt obtained from the continuous parameter model.

It is important to know that the Excel Solver does not generate sensitivity analysis for the integer

analysis. Thus, I strongly recommend you use the continuous parameter analysis in parallel to the

integer analysis in order to obtain the sensitivity analysis.

7.1.5 Binary Model

MMI Example—Part III

MMI produces MLAs and USMs every month. Table 7.1 summarizes the necessary data for

producing MLAs and USMs. MMI has two major constraints: (1) labor—total 500 h/month

Figure 7.13

Computed results for the optimal production schedule (integer analysis).

Figure 7.14

◾ 155

maximum (= 3 engineers × 40 h/week × 4.17 weeks/month), and (2) raw materials available—

total 300 g/month maximum. MMI would like to determine the optimum production quantities

(unit number) X for MLAs and Y for USMs in order to maximize the gross proﬁt.

Part III seeks the solution for choosing only one product, either MLAs or USMs.

Appropriate u se of binary va riables c an help u s i n e xpressing c omparative relationships. To

illustrate, su ppose Z1 , Z2, a nd Z3 a re b inary va riables rep resenting w hether e ach o f t hree p roduction lines should be set ( Zi = 1) or not set ( Zi = 0). The following relationships can then be

expressed by these variables:

◾ At least two production lines must be set: Z1 + Z2 + Z3 ≥ 2

◾ If line 1 is set, line 2 must not be set: Z1 + Z2 ≤ 1

◾ If line 1 is set, line 2 must be set: Z1 − Z2 ≤ 0

156 ◾

Entrepreneurship for Engineers

◾ One but not both of lines 1 and 2 must be set: Z1 + Z2 = 1

◾ Both or neither of lines 1 and 2 must be set: Z1 − Z2 = 0

◾ Total line construction budget cannot exceed \$K, and the setting costs for lines 1, 2, and 3

are \$A ,\$B, and \$C, respectively: AZ1 + BZ2 + CZ3 ≤ K

Binary variables can also be used to indicate restrictions in certain conditional situations. Suppose

X denotes the production amount in MLA line ( X ≥ 0). If the MLA line is set, there is no other

restriction on the value of X, but if it is not set, X must be 0. This relation can be expressed by

X ≤ M Z1

In this equation, M denotes an extremely large number such as 1020 (or 1E + 20) that does not

restrict the value of X if Z1 = 1. Because M is large, X ≤ M will not restrict the number of MLA

products. But if the MLA line is not set (Z1 = 0), the constraint becomes X ≤ 0, leading to X = 0;

that is, no product is made in the MLA line. In summary, the binary parameters can be used to

set On/Oﬀ or used for the selection of projects.

Solution—Part III

Now, we will apply the binary variables to the MMI production schedule. Because MMI production line space is limited, Barb Shay decided to set only one production line; that is, either

MLAs or USMs, not both. The problem is which to set—MLA or USM lines? We introduce

here Z1 and Z 2 for On/Off parameters for the MLA and USM production lines (C5 and D5,

respectively; see Figure 7.15). Then, introducing an extremely large number M (1E+20) in G5,

the products MZ1 and MZ 2 are prepared in H5 and I5 cells. Subject to the Constraints in the

Solver Parameter dialog box is set as in Figure 7.16. Three different points from Figure 7.12 are

as follows: (1) \$C\$5 and \$D\$5 are binary parameters; (2) \$C\$5 and \$D\$5 are equal to or smaller

than M × X and M × Y, respectively; and, most importantly, (3) Z1 + Z 2 = 1; that is, one but not

both production lines must be set. The results are shown in Figure 7.15 and its Answer Report

is in Figure 7.17. The computation “chose” the USM production (rather than the MLA production), if MMI needs to set only one production line. Twenty units of USMs generate the total

gross proﬁt of \$2000.

Figure 7.15

Computed results for the optimal production schedule (binary model).