Presentation is loading. Please wait.

Presentation is loading. Please wait.

OpenSolver Introduction. Table of Contents About OpenSolver – Slide 3 Installing OpenSolver – Slide 4: For Windows OS – Slide 13: For Mac OS Using OpenSolver.

Similar presentations


Presentation on theme: "OpenSolver Introduction. Table of Contents About OpenSolver – Slide 3 Installing OpenSolver – Slide 4: For Windows OS – Slide 13: For Mac OS Using OpenSolver."— Presentation transcript:

1 OpenSolver Introduction

2 Table of Contents About OpenSolver – Slide 3 Installing OpenSolver – Slide 4: For Windows OS – Slide 13: For Mac OS Using OpenSolver (Coffee Blend Example) – Slide 22 2

3 About OpenSolver Free, open source software Excel VBA add-in that extends Excel’s built-in Solver with a more powerful Linear Programming solver Can solve optimization problems previously too large for original Solver Compatible with existing Solver models Opensolver.org 3

4 Installing OpenSolver on Windows 4

5 First, open an Excel spreadsheet Once your spreadsheet is open, go to opensolver.org – Download the latest version by clicking on the link shown below Installing OpenSolver 5

6 After clicking link, a new tab will open and the OpenSolver download will automatically start in 5 seconds – Once the download starts, you will see the opensolver.zip at the bottom of your screen – click this zip file when the download is complete Installing OpenSolver 6

7 Windows – Installing OpenSolver After clicking the opensolver.zip file, this window on the bottom left should pop up – In order to avoid downloading OpenSolver every time you use the spreadsheet, you should move this Opensolver.zip file to your documents – Click “Downloads” then click and drag OpenSolver.zip to your “Documents” folder 7

8 Windows – Installing OpenSolver Extract all files from the opensolver.zip file once the file is in your “Documents” 8

9 Now in the extracted OpenSolver folder, double click on the OpenSolver.xlam file Installing OpenSolver 9

10 After clicking OpenSolver.xlam, a window will automatically pop-up in Excel, click “Enable Macros” Installing OpenSolver 10

11 You can now find OpenSolver in your “Data” tab in Excel on the top right side of your spreadsheet Windows - Installing OpenSolver 11

12 In the Data tab, Click OpenSolver – About OpenSolver… In the Pop-up window, check the box “Load OpenSolver when Excel Starts” Avoid Reloading OpenSolver Every Time 12

13 Installing OpenSolver on Mac 13 *Note: OpenSolver will only work on a Mac with Excel 2011 NOT Excel 2015 To access OpenSolver from a Mac with Excel 2015 you will need to use VMWare Remote Access and then follow the “Installing OpenSolver on Windows” instructions

14 First, open an Excel spreadsheet Once your spreadsheet is open, go to opensolver.org – Download the latest version by clicking on the link shown below Installing OpenSolver 14

15 After clicking link, a new tab will open and the OpenSolver download will automatically start in 5 seconds – Once the download starts, you will see the opensolver.zip at the bottom of your screen – click this zip file when the download is complete Installing OpenSolver 15

16 Installing OpenSolver After clicking the opensolver.zip file, this window on the bottom left should pop up (and show your downloads) – To avoid downloading OpenSolver every time you use the spreadsheet, move this Opensolver.zip file to your documents – If the file doesn’t automatically unzip, right click on the opensolver.zip file – Open With – Archive Utility to unzip the file 16

17 Now, with your designated Excel file already open, double click on the OpenSolver.xlam file Installing OpenSolver 17

18 After clicking OpenSolver.xlam, a window will automatically pop-up in Excel, click “Enable Macros” Installing OpenSolver 18

19 You can now find OpenSolver in the Excel menu bar on the top of the Excel window Installing OpenSolver 19

20 Click OpenSolver – OpenSolver – About OpenSolver… In the Pop-up window, check the box “Load OpenSover when Excel Starts” and click OK Avoid Reloading OpenSolver Every Time 20

21 Using OpenSolver – Coffee Blend Example 21

22 Using OpenSolver Now that OpenSolver is downloaded to your computer you can begin to solve problems Open the CoffeeBlendTemplate_OpenSolverExample.xlsx file and use the following slides to fill out the spreadsheet to use OpenSolver 22

23 Using OpenSolver – Coffee Blend Example You are making a new blend of coffee to sell at your coffee shop. You can use beans of four different types to produce a blend that will minimize your total cost but you have several constraints you must follow to make an optimal blend: Constraints: You must provide enough caffeine (at least 40 units) The blend must provide plenty of taste (at least 60 units) Must use at least one unit of each bean Types of Beans: CaffeineTasteCost ($/unit) Bean One23$2.50 Bean Two42$2.00 Bean Three16$4.00 Bean Four34$3.50 23

24 Formulation: Decision Variables: x 1 = the amount of bean 1 you use in your blend x 2 = the amount of bean 2 you use in your blend x 3 = the amount of bean 3 you use in your blend x 4 = the amount of bean 4 you use in your blend Objective Function: min 2.5x 1 + 2x 2 + 4x 3 + 3.5x 4 Constraints: 2x 1 + 4x 2 + x 3 + 3x 4 >= 40 (You must provide enough caffeine) 3x 1 +2x 2 + 6x 3 + 4x 4 >= 60 (The blend must provide plenty of taste) x 1 >= 1, x 2 >= 1, x 3 >= 1, x 4 >= 1 (Must use at least one unit of every bean) Using OpenSolver – Coffee Blend Example 24

25 In OpenSolver there are several types of cells: – Inputted cells – Decision variable cells – Objective function cell – Constraint cells These cells will be input into OpenSolver in order to find a solution Using OpenSolver – Coffee Blend Example 25

26 Go to OpenSolver – Model – Model. The window will allow you to input the formulation in order to find a solution – These highlighted red boxes will allow you to select ranges from your Excel spreadsheet (a single cell or multiple cells) Using OpenSolver – Coffee Blend Example 26

27 In order to fill out the OpenSolver model, you must have cells in your Excel spreadsheet that you can reference which contain formulation details of decision variables and objective solution Exit OpenSolver model and begin filling out the template spreadsheet according to the following slides 27 Using OpenSolver – Coffee Blend Example

28 28 Input cells: – These are where the user puts parameters given in the problem that do not change. In this example they are the caffeine, taste and price of the coffee beans. These cells should be populated with values only and not formulas.

29 In the Excel spreadsheet fill out cells with the given parameters for the beans: Using OpenSolver – Coffee Blend Example 29

30 Using OpenSolver – Coffee Blend Example 30 Decision Variable Cells – These cells represent the decision variables in the formulation – You only need to designate cells for the decision variables and OpenSolver will populate those cells with an optimal solution (if an optimal solution exists) when it’s called

31 Notice the cells with spaces for the decision variables in the Excel spreadsheet. These cells should be left blank (no values or formulas) and OpenSolver will populate these with a solution when called Using OpenSolver – Coffee Blend Example 31

32 Objective Cell: – This is the cell that will correspond to the objective function from the formulation. – In this example the objective function is to minimize the total cost: min 2.5x 1 + 2x 2 + 4x 3 + 3.5x 4 – In order to put this into Excel properly, you should reference the cost parameters and decision variable cells in the Excel spreadsheet: = D9*B17+D10*B18+D11*B19+D12*B20 Or use an Excel formula: =SUMPRODUCT(B17:B20,D9:D12) Using OpenSolver – Coffee Blend Example 32

33 Fill out the cell with the objective function, making sure to reference the cells used for the decision variables and parameters: For example the formula in the objective function cell should be = D9*B17+D10*B18+D11*B19+D12*B20 or =SUMPRODUCT(B17:B20,D9:D12) For more on Excel functions click herehere Using OpenSolver – Coffee Blend Example 33

34 Using OpenSolver – Coffee Blend Example Constraint Cells – These are the cells used to designate the constraints of the formulation – Excel works best if the constraints are written out in the Excel document rather than simply inputted into OpenSolver. This also lets you more easily change the constraint bounds later if needed – The left-hand side of the constraint should contain a formula that refers to the parameter and decision variable cells (similar to the objective cell) – The right-hand side should be the value of the RHS of the constraint (not a formula) – You should designate the corresponding inequality in the middle to help keep track of the identity of the constraint – It is helpful to organize the constraints so that constraints with the same inequality are located next to each other. This will help with inputting the constraints into OpenSolver (see slide 37) 34

35 Fill out the cells corresponding to each constraint in the formulation, again making sure to reference the decision variable and/or parameter cells: The red outlined LHS should contain Excel formulas that reference the decision variable and parameter cells – E.g. Enough caffeine LHS cell: =SUMPRODUCT(B9:B12,B17:B20) or = B9*B17+B10*B18+B11*B19+B12*B20 –E.g. Bean 1 LHS cell: =B17 The blue outlined RHS should contain simply the values of the RHS of the constraint Using OpenSolver – Coffee Blend Example 35

36 Fill out the OpenSolver window for the objective cell and decision variable cells by inputting the reference ranges in the corresponding spot in OpenSolver: Using OpenSolver – Coffee Blend Example 36

37 Next fill out the constraint section of OpenSolver by using the add constraint section: You can input constraints one at a time or multiple constraints at once To add multiple constraints at one time they must have the same inequality. Highlight the multiple rows (see first constraint above as an example) for each side of the equation: – In the OpenSolver spot for the LHS of the constraint, highlight all LHS values – Give the inequality of the constraints. NOTE: All constraints must have the same inequality – In the spot for RHS of the constraint, highlight all RHS values. This box should be the same size as the highlighted region of the LHS of the constraint 37 Using OpenSolver – Coffee Blend Example

38 When finished click “Save Model” then OpenSolver – Solve OpenSolver should populate the decision variable fields with optimal values. If an optimal solution does not exist it will inform you that the problem is infeasible. If you wish to change anything about the constraints (i.e. add an integer constraint to the amount of beans), reopen OpenSolver – Model and click Add Constraint. Using OpenSolver – Coffee Blend Example 38


Download ppt "OpenSolver Introduction. Table of Contents About OpenSolver – Slide 3 Installing OpenSolver – Slide 4: For Windows OS – Slide 13: For Mac OS Using OpenSolver."

Similar presentations


Ads by Google