441 Section 201
Some sample inputs for LINDO and/or LINGO
|Online Course Material
Linear Programming has fairly wide applicability and so in a first course it is also nice to see some software that can assist you in solving quite large LP's.
The windows interface is quite friendly (you should have used the old packages!) and you will discover that everything runs extremely quickly. The sensitivity analysis is readily available and performs many of the standard computations. We get dual variables given to us. You will quickly discover that the value of the dual prices is not in providing some computational aid to solve some related LP's (which could be done with alarming speed from scratch by LINDO) but to provide some predictive power and aid analysis of the model.
New Forest problem (from Chvatal)
Slick Oil (written up by Robert Israel)
LINGO MODEL for Hiring/Firing Problem:
!xi=production in month i (not on overtime) so that the number of workers is xi/20;
!yi=overtime production in month i;
!zi=inventory carried forward from month i to month i+1;
!t_i=hiring/firing costs in month i;
months / JAN..DEC/: demand, x, y, z, t;
[objective] Min=@sum( months(j) : 20*y(j)+8*z(j)+t(j) );
@for(months(j) | j #GE# 2 : [balance] z(j-1)+20*x(j)+y(j)-z(j)=demand(j));
@for(months(j) : [overtime] y(j)<6*x(j) );
@for(months(j) | j #GE# 2: [maxhire] x(j)-x(j-1)<=40 );
@for(months(j) | j #GE# 2: [maxfire] x(j-1)-x(j)<=40 );
@for(months(j) | j #GE# 2: [hirecost] hirecst*x(j)-hirecst*x(j-1)-t(j)<=0 );
@for(months(j) | j #GE# 2: [firecost] firecst*x(j-1)-firecst*x(j)-t(j)<=0 );
@for(months(j) : @gin(x));
@for(months(j) : @gin(y));
demand = 5300 5100 4400 2800 4100 4800 6000 7100 7300 7800 7600 6400;
Various assignments and the course project will require the computer.
You have been given a course account on the PC system and a printing allotment of 35 pages.
You can always email files to your home account for printing or if need be you
can purchase extra page allotments (I'll check how to do this).
To sign on remember that the id is all in lower case but the password starts with a capital S not lower case s.
To run LINDO either select the shortcut icon for LINDO or select LINDO among the programs available from the START button. Here is a sample program to run:
Now you can copy this and enter this into the untitled window
that pops up when you start LINDO. Now select SOLVE from the menu at the top
of the LINDO screen to get the familiar optimal solution with c=20 and r=80. The reports
window will have the solution.
Now hunt around to try some of the other buttons such as WINDOW to return to the
untitled window with the formulation and REPORT to send a copy
of the formulation to the reports window. You might try printing
the reports window at this stage.
In assignment 2, you must edit the report window so that it contains the relevant
information (input and output) and you can, if you wish, enter comments. You should add your name at the top of a printout for easy retrieval from the printer.
Might as well save an great deal of your work.
You can always email files to a home computer for printing.