67
Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization Problems with Excel Solver for Microsoft Excel 2000

Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Embed Size (px)

Citation preview

Page 1: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Solving Linear

Optimization Problems

with Excel Solver

for Microsoft Excel 2000

Page 2: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

A Linear Optimization Problema diet problem

Julia wonders if she can keep the amount of fat in her diet down and still get all the protein (45 g), carbohydrate (256 g), and calories (1,980 kcal) that she needs every day by eating fast food only. For other nutrients, such as vitamins, iron, and calcium, she will depend on pills.

She chooses her favorite fast foods: hamburger and french fries. The nutritive values per serving are given below.

How many servings of hamburger and fries would Julia need to eat to satisfy her daily diet requirements?

396220Calories (kcal)

3232Carbohydrate (g)

315Protein (g)

1810Fat (g)

FriesHamburger

Page 3: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Formulate the Problemas a Linear Programming problem

constraintsconstraints

that minimizes the total amount of fat

subject to the following minimum diet requirements

HB = the number of servings of hamburger FF = the number of servings of french fries

15 HB + 3 FF 45 Protein constraint

Julia is looking for

objective functionobjective function

10 HB + 18 FF

decision variablesdecision variables

nonnegativity constraints

nonnegativity constraints

32 HB + 32 FF 256 Carbohydrate constraint 220 HB + 396 FF 1980 Calories constraint

Of course HB 0 and FF 0

Page 4: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverstart with a blank sheet

Page 5: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter labels

Enter row labels in cells A2:A6

Enter row labels in cells A2:A6

Page 6: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter labels

Enter column labels in cells

B1:F1

Enter column labels in cells

B1:F1

Page 7: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter labels

Enter inequalities in

cells E4:E6

Enter inequalities in

cells E4:E6

Page 8: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter labels

NOTE: These labels are not essential for the use of

Solver

NOTE: These labels are not essential for the use of

Solver

Page 9: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter constants

Enter coefficients of objective

function in cells B3:C3

Enter coefficients of objective

function in cells B3:C3

Remember…

10 HB + 18 FF Fat

Page 10: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter constants

Enter coefficients of left side of

constraints in cells B4:C6

Enter coefficients of left side of

constraints in cells B4:C6

15 HB + 3 FF 45 Protein

32 HB + 32 FF 256 Carbohydrate

220 HB + 396 FF 1980 Calories

Remember…

Page 11: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter constants

Enter right sides of

constraints in cells F4:F6

Enter right sides of

constraints in cells F4:F6

15 HB + 3 FF 45 Protein

32 HB + 32 FF 256 Carbohydrate

220 HB + 396 FF 1980 Calories

Remember…

Page 12: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solvername decision variables cells

Highlight cells B1:C2

Highlight cells B1:C2

Page 13: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solvername decision variables cells

Click on InsertClick on Insert

Page 14: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solvername decision variables cells

Click on NameClick on Name

Page 15: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solvername decision variables cells

Click on CreateClick on Create

Page 16: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solvername decision variables cells

Page 17: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solvername decision variables cells

Make sure the Top row

(containing the names HB and

FF) box is checked

Make sure the Top row

(containing the names HB and

FF) box is checked

Page 18: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solvername decision variables cells

Click on OKClick on OK

Page 19: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solvername decision variables cells

Cell C2 is named FF and is currently

blank

Cell C2 is named FF and is currently

blank

Cell B2 is named HB and is currently

blank

Cell B2 is named HB and is currently

blank

Page 20: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter formula for objective function

Remember…

10 HB + 18 FF Fat

NOTE: Objective function formula in cell D3

NOTE: Objective function formula in cell D3

Click on cell D3

Click on cell D3

Page 21: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter formula for objective function

Type in =Type in =

Remember…

10 HB + 18 FF Fat

NOTE: Objective function formula in cell D3

NOTE: Objective function formula in cell D3

Page 22: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter formula for objective function

Click on cell B3

Click on cell B3

Remember…

10 HB + 18 FF Fat

NOTE: Objective function formula in cell D3

NOTE: Objective function formula in cell D3

Page 23: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter formula for objective function

Type in *Type in *

Remember…

10 HB + 18 FF Fat

NOTE: Objective function formula in cell D3

NOTE: Objective function formula in cell D3

Page 24: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter formula for objective function

Click on cell B2

Click on cell B2

Remember…

10 HB + 18 FF Fat

NOTE: Objective function formula in cell D3

NOTE: Objective function formula in cell D3

Page 25: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter formula for objective function

Type in +Type in +

Remember…

10 HB + 18 FF Fat

NOTE: Objective function formula in cell D3

NOTE: Objective function formula in cell D3

Page 26: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter formula for objective function

Click on cell C3

Click on cell C3

Remember…

10 HB + 18 FF Fat

NOTE: Objective function formula in cell D3

NOTE: Objective function formula in cell D3

Page 27: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter formula for objective function

Type in *Type in *

Remember…

10 HB + 18 FF Fat

NOTE: Objective function formula in cell D3

NOTE: Objective function formula in cell D3

Page 28: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter formula for objective function

Click on cell C2

Click on cell C2

Remember…

10 HB + 18 FF Fat

NOTE: Objective function formula in cell D3

NOTE: Objective function formula in cell D3

Page 29: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter formula for objective function

Press EnterPress Enter

Remember…

10 HB + 18 FF Fat

NOTE: Objective function formula in cell D3

NOTE: Objective function formula in cell D3

Page 30: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter formula for objective function

Click on cell D3 to check formula

Click on cell D3 to check formula

Remember…

10 HB + 18 FF Fat

NOTE: This step is not essential for the use of

Solver

NOTE: This step is not essential for the use of

Solver

Page 31: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Remember…

10 HB + 18 FF Fat

NOTE: The formula is equivalent to

=B3*$B$2+C3*$C$2 . Blanks in cells HB and FF (cells B2

and C2) are considered zeros

NOTE: The formula is equivalent to

=B3*$B$2+C3*$C$2 . Blanks in cells HB and FF (cells B2

and C2) are considered zeros

Preparing the Worksheet for Solverenter formula for objective function

Current value of formula

entered in cell D3

Current value of formula

entered in cell D3

Formula entered in cell

D3

Formula entered in cell

D3

Page 32: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter formulas for constraints

15 HB + 3 FF 45 Protein

32 HB + 32 FF 256 Carbohydrate

220 HB + 396 FF 1980 Calories

Remember…

NOTE: Formulas for the left sides of the constraints in

cells D4:D6

NOTE: Formulas for the left sides of the constraints in

cells D4:D6

Page 33: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter formulas for constraints

Click on cell D3 and grab the fill handle ++

on the lower right corner

Click on cell D3 and grab the fill handle ++

on the lower right corner

15 HB + 3 FF 45 Protein

32 HB + 32 FF 256 Carbohydrate

220 HB + 396 FF 1980 Calories

Remember…

NOTE: Formulas for the left sides of the constraints in

cells D4:D6

NOTE: Formulas for the left sides of the constraints in

cells D4:D6

Page 34: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter formulas for constraints

Drag the fill handle ++ down to

cell D6

Drag the fill handle ++ down to

cell D6

NOTE: The formula in cell D3 will be copied down to

cell D6

NOTE: The formula in cell D3 will be copied down to

cell D6

15 HB + 3 FF 45 Protein

32 HB + 32 FF 256 Carbohydrate

220 HB + 396 FF 1980 Calories

Remember…

NOTE: Formulas for the left sides of the constraints in

cells D4:D6

NOTE: Formulas for the left sides of the constraints in

cells D4:D6

Page 35: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter formulas for constraints

15 HB + 3 FF 45 Protein

32 HB + 32 FF 256 Carbohydrate

220 HB + 396 FF 1980 Calories

Remember…

NOTE: Formulas for the left sides of the constraints in

cells D4:D6

NOTE: Formulas for the left sides of the constraints in

cells D4:D6

Page 36: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter formulas for constraints

15 HB + 3 FF 45 Protein

32 HB + 32 FF 256 Carbohydrate

220 HB + 396 FF 1980 Calories

Remember…

Click on cell D4 to check formulaClick on cell D4

to check formula

NOTE: This step is not essential for the use of

Solver

NOTE: This step is not essential for the use of

Solver

Page 37: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter formulas for constraints

15 HB + 3 FF 45 Protein

32 HB + 32 FF 256 Carbohydrate

220 HB + 396 FF 1980 Calories

Remember…

Current value of formula entered

in cell D4

Current value of formula entered

in cell D4

Formula entered in cell

D4 (Protein)

Formula entered in cell

D4 (Protein)

NOTE: The rows for column B and C were copied as relative references while HB and FF

remained fixed

NOTE: The rows for column B and C were copied as relative references while HB and FF

remained fixed

Page 38: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

15 HB + 3 FF 45 Protein

32 HB + 32 FF 256 Carbohydrate

220 HB + 396 FF 1980 Calories

Remember…

Preparing the Worksheet for Solverenter formulas for constraints

Click on cell D5 to check formulaClick on cell D5

to check formula

NOTE: This step is not essential for the use of

Solver

NOTE: This step is not essential for the use of

Solver

Page 39: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter formulas for constraints

15 HB + 3 FF 45 Protein

32 HB + 32 FF 256 Carbohydrate

220 HB + 396 FF 1980 Calories

Remember…

Current value of formula entered in

cell D5

Current value of formula entered in

cell D5

Formula entered in cell D5

(Carbohydrate)

Formula entered in cell D5

(Carbohydrate)

Page 40: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

15 HB + 3 FF 45 Protein

32 HB + 32 FF 256 Carbohydrate

220 HB + 396 FF 1980 Calories

Remember…

Preparing the Worksheet for Solverenter formulas for constraints

Click on cell D6 to check formulaClick on cell D6

to check formula

NOTE: This step is not essential for the use of

Solver

NOTE: This step is not essential for the use of

Solver

Page 41: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter formulas for constraints

15 HB + 3 FF 45 Protein

32 HB + 32 FF 256 Carbohydrate

220 HB + 396 FF 1980 Calories

Remember…

Current value of formula entered

in cell D6

Current value of formula entered

in cell D6

Formula entered in cell D6 (Calories)

Formula entered in cell D6 (Calories)

Page 42: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Preparing the Worksheet for Solverenter formulas for constraints

NOTE: These cells will be colored to indicate that they are essential for

Solver

NOTE: These cells will be colored to indicate that they are essential for

Solver

Objective function

formula in cell D3

Objective function

formula in cell D3

Decision variable

values in cells B2:C2

Decision variable

values in cells B2:C2

Page 43: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solverinvoke Solver

Click on ToolsClick on Tools

Page 44: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solverinvoke Solver

Click on SolverClick on Solver

Page 45: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solverinvoke Solver

Page 46: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solvercomplete the Solver Parameters dialog box

Click on cell D3Click on cell D3

NOTE: The cell displayed in the Set Target Cell: box must contain the

objective function formula (cell D3)

NOTE: The cell displayed in the Set Target Cell: box must contain the

objective function formula (cell D3)

Page 47: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solvercomplete the Solver Parameters dialog box

Check the

Min: circle

Check the

Min: circle

Page 48: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solvercomplete the Solver Parameters dialog box

Click on the By

Changing Cells: box

Click on the By

Changing Cells: box

Page 49: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solvercomplete the Solver Parameters dialog box

NOTE: The By Changing Cells: box

must display the decision variable cells

(cells B2:C2)

NOTE: The By Changing Cells: box

must display the decision variable cells

(cells B2:C2)

Highlight cells B2:C2Highlight

cells B2:C2

Page 50: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solvercomplete the Solver Parameters dialog box

NOTE: The Subject to the Constraints: box

must contain the constraints on the decision variables

NOTE: The Subject to the Constraints: box

must contain the constraints on the decision variables

Click on Add

Click on Add

Page 51: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solvercomplete the Solver Parameters dialog box

Click on the Cell

Reference: box

Click on the Cell

Reference: box

Page 52: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solvercomplete the Solver Parameters dialog box

Highlight cells D4:D6

Highlight cells D4:D6

Page 53: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solvercomplete the Solver Parameters dialog box

Click on to select

constraint types

Click on to select

constraint types

Page 54: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solvercomplete the Solver Parameters dialog box

Click on >=Click on >=

Page 55: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solvercomplete the Solver Parameters dialog box

Click on the Constraint:

box

Click on the Constraint:

box

Page 56: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solvercomplete the Solver Parameters dialog box

Highlight cells F4:F6

Highlight cells F4:F6

Page 57: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solvercomplete the Solver Parameters dialog box

Click on OKClick on OK

NOTE: Different type constraints must be entered

separately

NOTE: Different type constraints must be entered

separately

Page 58: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solverset the Options

Click on OptionsClick on Options

Page 59: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solverset the Options

Check the Assume Linear

Model and the Assume Non-Negative boxes

Check the Assume Linear

Model and the Assume Non-Negative boxes

NOTE: The formula (in the Target Cell D3) is

linear on the non-negative variables (HB in

B2 and FF in C2)

NOTE: The formula (in the Target Cell D3) is

linear on the non-negative variables (HB in

B2 and FF in C2)

Page 60: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solverset the Options

Accept the remaining default options by clicking

on OK

Accept the remaining default options by clicking

on OK

Page 61: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solverexecute Solver

Click on Solve

Click on Solve

Page 62: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solverread solution

NOTE: Solver uses a method known as

SIMPLEX

NOTE: Solver uses a method known as

SIMPLEX

This solution contains Protein: 105 g Carbohydrate: 256 g Calories: 1980 kcal satisfying the constraints

This solution contains Protein: 105 g Carbohydrate: 256 g Calories: 1980 kcal satisfying the constraints

Solver finds a solution HB = 6.75 servings of Hamburger FF = 1.25 servings of French fries with minimum fat content of 90 g

Solver finds a solution HB = 6.75 servings of Hamburger FF = 1.25 servings of French fries with minimum fat content of 90 g

Page 63: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solverobtain the Answer Report

Click on AnswerClick on Answer

Page 64: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solverend execution

Click on OKClick on OK

Page 65: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solverview the Answer Report

Click on the Answer

Report tab

Click on the Answer

Report tab

Page 66: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solverread the Answer Report

NOTE: Resize window for a complete view of the spreadsheet portion

NOTE: Resize window for a complete view of the spreadsheet portion

Page 67: Copyright © 2000, Denise Sakai Troxell. All rights reserved. (updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.) Solving Linear Optimization

Copyright © 2000, Denise Sakai Troxell. All rights reserved.(updated from © Joe Aieta and Denise Sakai Troxell – Summer 1999.)

Using Solverread the Answer Report

Solver finds a solution HB = 6.75 servings of Hamburger FF = 1.25 servings of French fries with minimum fat content of 90 g

Solver finds a solution HB = 6.75 servings of Hamburger FF = 1.25 servings of French fries with minimum fat content of 90 g

This solution contains Protein: 105 g Carbohydrate: 256 g Calories: 1980 kcal satisfying the constraints

This solution contains Protein: 105 g Carbohydrate: 256 g Calories: 1980 kcal satisfying the constraints