0% found this document useful (0 votes)
8 views

OpenSolver Installation

Uploaded by

Leonhard Euler
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

OpenSolver Installation

Uploaded by

Leonhard Euler
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 38

OpenSolver Introduction

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

• In the Data tab, Click OpenSolver – About OpenSolver…


• In the Pop-up window, check the box “Load OpenSolver
when Excel Starts”

12
Installing OpenSolver on Mac
*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

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

• Click OpenSolver – OpenSolver – About OpenSolver…


• In the Pop-up window, check the box “Load OpenSover
when Excel Starts” and click OK

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

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:
Types of Caffeine Taste Cost ($/unit)
Beans:
Bean One 2 3 $2.50
Bean Two 4 2 $2.00
Bean Three 1 6 $4.00
Bean Four 3 4 $3.50

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

• 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

25
Using OpenSolver – Coffee Blend Example

• 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)

26
Using OpenSolver – Coffee Blend Example

• 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

• 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

• In the Excel spreadsheet fill out cells with the


given parameters for the beans:

29
Using OpenSolver – Coffee Blend Example

• 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

30
Using OpenSolver – Coffee Blend Example

• 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

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:

• 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 here

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:

• 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

• 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.

38

You might also like