Anda di halaman 1dari 3

Software used in this unit

We will solve LPs using two different sets of software: EXCELs Solver and LINDO.

EXCEL and its SOLVER add-in.

While SOLVER comes with the EXCEL package, it is not automatically loaded when you use
EXCEL unless you have previously asked that it always be included in the EXCEL that is loaded
into memory.

To check if SOLVER has already been included as an add-in in your EXCEL, click on Data in
the menu bar. If SOLVER has been previously added-in, you will see an Analysis grouping of
tools and in that group you will see SOLVER. If you do not see this, SOLVER has not yet been
added-in to your EXCEL.

If you need to add SOLVER to your EXCEL, click on the Office Button (at top left). Then click
Excel Options at the bottom of the new window. This will bring up another window with a
menu at the left. Click on Add-ins, which will bring up yet another window of items that can be
added-in to your EXCEL. You will see Solver. At the bottom of the window you will see a menu
box for the type of add-ins you are wanting to manage. Make sure it is showing Excel Add-ins.
Then click Go. A new window listing about 8 different add-ins will appear. Tick the box for
Solver Add-In. Leave the other boxes as they are, e.g. Analysis Tool Pack is probably already
ticked as an add-in. Then click OK. SOLVER should now appear in the Analysis grouping of
tools, and will be there every time you use EXCEL.

LINDO

LINDO is a commercially available package for linear programming and its extensions to
quadratic programming and integer programming. It comes in several forms, including an
EXCEL spreadsheet version, called Whats Best, and as a standalone program referred to as
Classic LINDO.

Small problem size (or demo) versions are available for free download from www.lindo.com.
These demo versions can handle problems of the size we encounter in this unit.

You should access the LINDO website and download and install Classic LINDO on your own
computer. If you are using a computer lab computer, you will be able to access LINDO from the
lab server. If it asks you for a Licence codeword/password/access key; you can type (or better,
copy from a text file and paste) or you can simply bypass the codeword by selecting Demo
version.

EXCEL spreadsheet macros for use with LINDO

As a standalone program, Classic LINDO will require you to provide the data for an LP problem
either interactively by typing in data in response to prompts or via a pre-prepared input data file.

While interactive entry may seem easy and appealing, it can be quite inefficient. Suppose for
example you want to re-solve the LP problem with some data items altered.. It would be very
inefficient if you had to re-enter the full set of data every time you re-solved the problem..
The efficient way to get data into LINDO is to prepare a text file of that data, and have LINDO
read the data from the file. if you want to re-solve with some date items changed, you simply edit
the data file, and re-run LINDO.

Classic LINDO expects the data in the input file to be arranged/laid-out in a particular format,
known as MPS (Mathematical programming system )formal. While it is not too difficult to create
the file of data by using a text editor (e.g. MS WORD, and saving as text), it is not as easy (at
least for small problems) as laying the problem data out on a spreadsheet. Accordingly, it is
convenient to lay the LP out on a spreadsheet and then use another computer program to read
that data and place it in a file organized in MPS format. In this unit, we shall use a Visual Basic
(VB is a computer programming language) programs for creating the MPS format file from the
spreadsheet.

We shall actually use several different Visual Basic program at various stages in the unit. All
these programs are housed (stored) in an EXCEL work book, named as VBforMP.xls (i.e. Visual
Basic for Mathematical Programming). A copy of this workbook had been sent to you by e-mail.
While you could edit/modify the spreadsheets in this workbook, you are advised not to do so.
Instead, simply view the VBforMP workbook as a convenient source of useful conversion
programs.

These Visual Basic programs are known as Macros. Macros can interact with the EXCEL
spreadsheet/workbook (and beyond to other parts of the computer software system and data) in a
variety of ways. To protect against malicious (malware) programs causing damage to ones data
and software, EXCEL and other MS programs such as MS WORD that interface with Visual
Basic) are usually set-up with Macros prohibited (i.e. not allowed), This is a high level of
security.

If you want to make use of Macros, you must change the security level from high to one that
allows Macros to be run in EXCEL, e.g. medium and low security in EXCEL 2003 and Enable
all macros in EXCEL 2007.

There are several ways you can change the security level. One way is first to add the Developer
(i.e. computer programmers tools) tab to the EXCEL ribbon. Click the MS Office Button, then
Excel Options, and then tick Show Developer tab. Under the Code grouping you will see
Macro security. There you can select the low security level. You may have to close and reopen
the workbook for this change in security to take effect.

If you have several workbooks open, the Macros in all those workbooks are available for use in
each of the individual workbooks. In particular, if you have the VBforMP workbook open and
you open a new workbook, the Macros in VBforMP will be available for use in the new
workbook.

The list of all Macros currently available for use can be seen by going to the Developer tab and
then Code grouping and clicking on Macros. Notice that macros from any open workbook other
than the active workbook (i.e. the one you are working on) will be listed with their name and the
name of the workbook in which they are housed. To run a macro, you select it and click Run.

You can also see the list of macros (and run a Macro) by going to the View tab and clicking on
Macros.
Do not forget to set you security level back to high (disable macros) when you are finished
working with macros.

The pdf file of Notes on using LINDO and spreadsheet macros

There is a separate pdf file with notes on LINDO and the conversion macros we use in this unit.
Several paragraphs in that document relate specifically to the Agricultural Economics
Computing lab at the University of Sydney, e.g. how to access LINDO, and where to obtain the
VBforMP workbook. These paragraphs are irrelevant to Hue students. Please ignore these
paragraphs.

Anda mungkin juga menyukai