16
Solving LP Problems in a Solving LP Problems in a Spreadsheet Spreadsheet A company sells two models of hot tubs: the Aqua-Spa and the Hydro-Lux. The company purchases prefabricated fiberglass hot tub shells and installs a common water pump and the appropriate amount of tubing into each hot tub. Every Aqua-Spa produced can be sold to generate a profit of $350, and each Hydro-Lux produced can be sold to generate a profit of $300. Every Aqua-Spar requires 9 hours of labor and 12 feet of tubing; every Hydro -Lux requires 6 hours of labor and 16 feet of tubing.

Solving LP Problems in a Spreadsheet

Embed Size (px)

DESCRIPTION

Solving LP Problems in a Spreadsheet. A company sells two models of hot tubs: the Aqua-Spa and the Hydro-Lux. - PowerPoint PPT Presentation

Citation preview

Page 1: Solving LP Problems in a Spreadsheet

Solving LP Problems in a Solving LP Problems in a SpreadsheetSpreadsheet

A company sells two models of hot tubs: the Aqua-Spa and the Hydro-Lux.

The company purchases prefabricated fiberglass hot tub shells and installs a common water pump and the appropriate amount of tubing into each hot tub. Every Aqua-Spa produced can be sold to generate a profit of $350, and each Hydro-Lux produced can be sold to generate a profit of $300.

Every Aqua-Spar requires 9 hours of labor and 12 feet of tubing; every Hydro -Lux requires 6 hours of labor and 16 feet of tubing.

Page 2: Solving LP Problems in a Spreadsheet

The company expects to have 200 pumps, 1,566 hours of labor, and 2,800 feet of tubing available during the next production cycle.

The problem is to determine the optimal number of Aqua-Spas and Hydro-Luxes to produce in order to maximize profits.

Page 3: Solving LP Problems in a Spreadsheet

MAX: 350X1+ 300X2 } profitSubject to: 1X1 + 1X2 < 200 } pump constraint 9X1 + 6X2 < 1,566 } labor constraint 12X1 + 16X2 < 2,800 } tubing constraint 1X1 > 0 simple lower bounds 1X2 > 0 for the decision variables

Page 4: Solving LP Problems in a Spreadsheet

Implementing an LP Model in a Implementing an LP Model in a SpreadsheetSpreadsheet

1. Organize the data for the model on the spreadsheet. First, the goal is to organize the data so their purpose and

meaning are as clear as possible. Descriptive labels should be placed in the spreadsheet to

clearly identify the various data elements. 2. Reserve separate cells in the spreadsheet to represent each

decision variable in the algebraic model. This is often helpful in setting up formulas for the objective

function and constraints. When possible, it is also a good idea to keep the cells

representing decision variables in the same area of the spreadsheet.

Page 5: Solving LP Problems in a Spreadsheet

3. Create a formula in a cell in the spreadsheet that corresponds to the objective function in the algebraic model.

The spreadsheet formula corresponding to the objective function is created by referring to the data cells where the objective function coefficients have been entered (or calculated) and to the corresponding cells representing the decision variables.

4. For each constraint in the algebraic model, create a formula in a cell in the spreadsheet that corresponds to the left-hand-side (LHS) of the constraint.

The formula corresponding to the LHS of each constraint is created by referring to the data cells where the coefficients for these constraints have been entered (or calculated) and to the appropriate decision variable cells.

Page 6: Solving LP Problems in a Spreadsheet

Decision Variables: X1 X2

Spreadsheet Cells: B4 C4

Algebraic Objective: 350 X1+300 X2

Formula in cell E5: =B5*B4+C5*C4

Page 7: Solving LP Problems in a Spreadsheet

LHS formula for the pump constraint: 1 X1 + 1 X2

Formula in cell D8: =B8*B4+C8*C4

LHS formula for the labor constraint: 9 X1 + 6 X2

Formula in cell D9: =B9*B4+C9*C4

LHS formula for the tubing constraint: 12 X1 + 16 X2

Formula in cell D10: =B10*B4+C10*C4

Summary of relationship between the LHS formulas Summary of relationship between the LHS formulas of the constraints and their spreadsheet representationsof the constraints and their spreadsheet representations

Page 8: Solving LP Problems in a Spreadsheet

Blue Ridge Hot Tubs

Aqua-SpasHydro-LuxesNumber to make: Total Profit:

Unit Profits: $350 $300 #VALUE!

Constraints: Used AvailablePumps Req'd 1 1 0 200Labor Req'd 9 6 0 1566Tubing Req'd 12 16 0 2800

Page 9: Solving LP Problems in a Spreadsheet

Representing the Bounds on the Representing the Bounds on the Decision VariablesDecision Variables

How Solver Views the ModelHow Solver Views the Model 1. Target cell--the cell in the spreadsheet that

represents the objective function in the model (and whether its value should be maximized or minimized)

2. Changing cells--the cells in the spreadsheet that represent the decision variables in the model

3. Constraint cells--the cells in the spreadsheet that represent the LHS formulas of the constraints in the model (and any upper and lower bounds that apply to these formulas)

Page 10: Solving LP Problems in a Spreadsheet

Summary of Solver terminologySummary of Solver terminology

Terms used to describeLP models algebraically

Corresponding termsused by Solver to describespreadsheet LP models

objective function target cell

decision variables changing cells

LHS formulas ofconstraints

constraint cells

Page 11: Solving LP Problems in a Spreadsheet

Using SolverUsing Solver

After implementing an LP model in a spreadsheet, we still need to solve the model.

To do this we must first indicate to Solver which cells in the spreadsheet represent the objective function (or target cell), the decision variables (or changing cells), and the constraints (or constraint cells).

Page 12: Solving LP Problems in a Spreadsheet

Defining the Target CellDefining the Target Cell

In the Solver Parameters dialog box, specify the location of the cell that represents the objective function by entering it in the Set Target Cell box

Page 13: Solving LP Problems in a Spreadsheet

Defining the Changing CellsDefining the Changing Cells

If the decision variables were not in a contiguous range, we would have to list the individual decision variable cells separated by commas in the By Changing Cells box.

Whenever possible, it is best to use contiguous cells to represent the decision variables.

Page 14: Solving LP Problems in a Spreadsheet

Defining the Constraint CellsDefining the Constraint Cells

To define the constraint cells, click the Add button in the solver parameters box, then complete the Add Constraint dialog box.

In the Add Constraint dialog box, click the Add button again to define additional constraints. Click the OK button when you have finished defining constraints.

It is a good idea to keep constraints of a given type grouped in contiguous cells so you can select them at the same time.

Page 15: Solving LP Problems in a Spreadsheet

Defining the Nonnegativity Defining the Nonnegativity ConditionsConditions

To do this, we simply add another set of constraints to the model

Page 16: Solving LP Problems in a Spreadsheet

Solving the ModelSolving the Model

Click the Solve button in the Solver Parameters dialog box to solve the problem.

When Solver finds the optimal solution, it displays the Solver Results dialog box.