OpenSolver Installation
OpenSolver Installation
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
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
Installing OpenSolver on
Windows
4
Installing OpenSolver
• 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
5
Installing OpenSolver
• 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
6
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
Windows – Installing OpenSolver
• Extract all files from the opensolver.zip file once
the file is in your “Documents”
8
Installing OpenSolver
• Now in the extracted OpenSolver folder, double click on
the OpenSolver.xlam file
9
Installing OpenSolver
• After clicking OpenSolver.xlam, a window will
automatically pop-up in Excel, click “Enable Macros”
10
Windows - Installing OpenSolver
• You can now find OpenSolver in your “Data” tab in Excel
on the top right side of your spreadsheet
11
Avoid Reloading OpenSolver Every Time
12
Installing OpenSolver on Mac
*Note: OpenSolver will only work on a Mac with
Excel 2011 NOT Excel 2015
13
Installing OpenSolver
• 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
14
Installing OpenSolver
• 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
15
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
Installing OpenSolver
• Now, with your designated Excel file already open, double
click on the OpenSolver.xlam file
17
Installing OpenSolver
• After clicking OpenSolver.xlam, a window will
automatically pop-up in Excel, click “Enable Macros”
18
Installing OpenSolver
• You can now find OpenSolver in the Excel menu bar on the
top of the Excel window
19
Avoid Reloading OpenSolver Every Time
20
Using OpenSolver – Coffee
Blend Example
21
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
Using OpenSolver – Coffee Blend Example
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
23
Using OpenSolver – Coffee Blend Example
Formulation:
• Decision Variables:
x1 = the amount of bean 1 you use in your blend
x2 = the amount of bean 2 you use in your blend
x3 = the amount of bean 3 you use in your blend
x4= the amount of bean 4 you use in your blend
• Objective Function:
min 2.5x1 + 2x2 + 4x3 + 3.5x4
• Constraints:
2x1 + 4x2 + x3 + 3x4 >= 40 (You must provide enough caffeine)
3x1 +2x2 + 6x3 + 4x4 >= 60 (The blend must provide plenty of taste)
x1 >= 1, x2 >= 1, x3 >= 1, x4 >= 1 (Must use at least one unit of every bean)
24
Using OpenSolver – Coffee Blend Example
25
Using OpenSolver – Coffee Blend Example
26
Using OpenSolver – Coffee Blend Example
27
Using OpenSolver – Coffee Blend Example
• 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.
28
Using OpenSolver – Coffee Blend Example
29
Using OpenSolver – Coffee Blend Example
30
Using OpenSolver – Coffee Blend Example
31
Using OpenSolver – Coffee Blend Example
• 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.5x1 + 2x2 + 4x3 + 3.5x4
– 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)
32
Using OpenSolver – Coffee Blend Example
• Fill out the cell with the objective function, making sure to
reference the cells used for the decision variables and
parameters:
33
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
Using OpenSolver – Coffee Blend Example
• 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
35
Using OpenSolver – Coffee Blend Example
• Fill out the OpenSolver window for the objective cell and
decision variable cells by inputting the reference ranges in the
corresponding spot in OpenSolver:
36
Using OpenSolver – Coffee Blend Example
• Next fill out the constraint section of OpenSolver by using the add constraint section:
37
Using OpenSolver – Coffee Blend Example
38