Lin Prog With Excel

Embed Size (px)

Citation preview

  • 8/8/2019 Lin Prog With Excel

    1/12

    Linear Programming: Using the Excel Solver

    Outline:

    The product mix example

    The outdoor furniture corporation manufactures two products: benches andPicnic tables for use in yards and parks. The firm has two main resources: itsCarpenters (labor) and a supply of redwood for use in the furniture. During the Nextproduction period, 1200 hours of manpower are available under a union Agreement. Thefirm also has a stock of 5000 pounds of quality redwood. Each Bench that outdoor

    furniture produces requires 4 labor hours and 10 pounds of Redwood; each picnic tabletakes 7 labor hours and 35 pounds of redwood. Completed benches yield a profit of $9each, and tables a profit of $20 each.

    We formulated the following linear program to solve this problem:Decision Variables:Objective Function:Constraints:

    We will now solve this LP using the Excel Solver.

    1.1 Getting Started

    To begin using Excel, double-click on the Excel icon. Once Excel has loaded, enter theinputdata and construct relationships among data elements in a readable, easy tounderstand way.When building this foundation for your model, think ahead about theoptimization model youwill be developing. Make sure there is a cell in your spreadsheetfor each of the following:

    the quantity you wish to maximize or minimize

    every decision variable every quantity that you might want to constrain

    If you dont have any particular initial values you want to enter for your decisionvariables, you can start by just entering a value of 0 in each decision variable cell.

  • 8/8/2019 Lin Prog With Excel

    2/12

    The cell below Total and the cells below LHS in the spreadsheet are defined by usingthe SUMPRODUCT function in the manner seen below.

    If you are not familiar with sum product, you can use = B3*B5+C3*C5 instead ofsum product(B3:C3,B5:C5), and so on. See example below. Both serve the samepurpose.

  • 8/8/2019 Lin Prog With Excel

    3/12

    1.2 Constructing an Optimization Model Using SolverOnce you are satisfied with the basic spreadsheet model you have built, you are ready tobuild an optimization model using Solver. To begin using Solver,

    click on Tools and select Solver.

    A gray dialogue box will appear. You will build the constrained optimization modelusing this dialogue box.

  • 8/8/2019 Lin Prog With Excel

    4/12

    1.2 Selecting the Cell to Optimize

    To select the cell you wish to optimize, look at the Set Cell window within the dialoguebox. Erase (or simply drag the cursor over) everything that is in that window. Then, either

    type the address of the cell you wish to optimize, or click on the cell you wish to optimize. Choose either Max or Min depending on whether the objective is tomaximize or

    minimize the target cell.

  • 8/8/2019 Lin Prog With Excel

    5/12

  • 8/8/2019 Lin Prog With Excel

    6/12

    If you wish to use the dragging method, but the decision variables to not all lie in aconnected rectangle in the spreadsheet you can drag them in one group at a time:

    drag the cursor across one group of decision variables,put a comma after that group in the By Changing Cells window, drag the cursor across the next group of decision variables,etc....

    1.5 Defining Constraints

    To begin entering constraints, click on the Add button to the right of the constraintswindow. A new dialogue box will appear. The cursor will be in the Cell Referencewindow within this dialogue box.

    Type the cell address that contains the quantity you want to constrain, or

    click on the cell that contains the quantity you want to constrain.

    Again, if the dialogue box is in the way, you can move it by dragging the bar at the top ofthe box. The default inequality that first appears for a constraint is

  • 8/8/2019 Lin Prog With Excel

    7/12

    click on the arrow beside the

  • 8/8/2019 Lin Prog With Excel

    8/12

    If you want to constrain a column (or row) of cells by using another column (or row) ofcells as the constraining values, you can input this whole collection of constraints at thesame time.

    When in the Cell Reference window, drag across the column (or row) of cells you

    want to constrain. Then, in the Constraint window, drag across the column (or row) of cells that you

    want to use as the constraining values.

    If, in the process of building you optimization model, you discover that your spreadsheetis missing some pieces (e.g., you want to constrain some quantity, but you did not includea cell for that quantity in your spreadsheet),

    click on the Close button in the Solver dialogue box. Make the necessary changes in your spreadsheet.

    Select Solver from the Tools menu to return to Solver.

    You will not lose any part of your optimization model.

  • 8/8/2019 Lin Prog With Excel

    9/12

    1.7 Solving the Optimization Model

    Once you are satisfied with the optimization model you have input, click on the

    Optionsbutton in the Solver dialogue box. If you are solving a linear program,

    Click on the Assume Linear Model box - make sure a check appears in this box. Click on the OK button to return to the original dialogue box.

    Now, to solve the problem, click on the Solve button.

  • 8/8/2019 Lin Prog With Excel

    10/12

  • 8/8/2019 Lin Prog With Excel

    11/12

    .

    1.9 Saving and Printing Files

    To save a file, simply

    click on File, and select Save As if this is the first time you saved the file, or Save if you have saved

    it before and you want to save the new version under the same name.

    Be sure to save your file on the correct disk and the correct directory. For assistance withthis, see a consultant.If you created any sensitivity analysis reports, Excel will automatically bundle yourspreadsheet with these reports.

    To print your spreadsheet, simply make sure the spreadsheet is on the screen, then click on File, and select Print.

  • 8/8/2019 Lin Prog With Excel

    12/12

    If you want to make changes in the way the file will print (e.g., print is sideways on thepage (landscape), etc.), select Page Setup instead. Make the appropriate changes, thenselect Print. Again, see a consultant if you need additional help.

    To print your sensitivity report, simply make sure the report is on the screen and repeatthe above steps.