Professional Documents
Culture Documents
AMPL Assignment
AMPL Assignment
AMPL ASSIGNMENT
Name of Student
Name of Course
Course Instructor
Date
AMPL ASSIGNMENT
Decision Variables
Let,
The above are the decision variables for the LP optimization problem because we need to
choose an optimal felling program at which the net discounted revenue is maximized for the next
decade. All the above variables are measured in acres.
Objective Function
Maximize Revenue = X1 (287 + 215 +228 + 292) + X2 (207 + 135 + 148 + 212 + 148) + X3
(157 + 85 + 98 + 162 + 112) + X4 (487 + 415 + 317) + X5 (337 + 265 + 264) + X6 (87 + 15 +
61)
Constraints
All the constraints for the above LP model are shown below:
The first constraint shows that the total treated area for all the five crops should not
exceed 5000 acres. The second constraint shows that the total area for the newly planted conifer
plus the untreated area of the old conifers must not exceed 3845 acres. Constraint 3 shows that
the total volume for the felled hardwood should not exceed 2.44 million h. ft. The fourth
constraint shows that the total volume for felled conifer and the mixed high forest should not
exceed 4.16 million h. ft. Finally, the last constraint shows that minimum 50 acres of crops
should be planted with hardwood.
Non-negativity:
The non-negativity constraints show that the values of all the decision variables can be 0
or greater than zero but not less than 0.
X1 + X2 + X3 + X4 + X5 + X6 >= 0
AMPL Codes
First, create a symbolic link to the AMPL interactive solver by typing the following command on
any of the Sun workstation:
ln -s /afs/engin.umich.edu/group/engin/priv/ioe/ampl/ampl_interactive ampl
Three additional solvers are also available which are OSL, MINOS and ALPO. The command
lines below would create the symbolic link to the various solvers:
ln -s /afs/engin.umich.edu/group/engin/priv/ioe/ampl/solvers_SunOS/osl osl
ln -s /afs/engin.umich.edu/group/engin/priv/ioe/ampl/solvers_SunOS/minos minos
ln -s /afs/engin.umich.edu/group/engin/priv/ioe/ampl/solvers_SunOS/alpo alpo
The LP formulation for the forestry problem has been created above. Now the codes for the
model and the data file are as follows:
set X1;
set X2;
set X3;
set X4;
set X5;
set X6;
param avail {X1,X2,X3,X4,X5,X6} >= 0;
set Treatment := M1 M2 M3 M4 M5 ;
set Acres := X1 X2 X3 X4 X5 X6 ;
param avail := X1 2754 X2 850 X3 855 X4 1598 X5 405 X6 1761;
param portion : A1 A2 A3 A4 A5 A6 :=
M1 287 215 228 292 204
M2 207 135 148 212 148
M3 157 85 98 162 112
M4 487 415 0 0 371
M5 337 265 0 0 264
M6 87 15 0 0 61;
param revenue :=
subject to:
max_revenue :
sum {i in ACRES, j in TREATMENT} Felling[i,j] <= quota;
subject to
max_acre_revenue {i in ACRES, j in TREATMENT}:
Felling [i,j] <= Available[i,j];
subject to demand {i in ACRES}:
Solutions
draw% ampl
ampl: model HW5Forestry.model;
ampl: data HW5Forestry.data;
ampl: solve;
CPLEX 6.0: optimal solution; objective 899075.666
1 iterations (0 in phase I)
ampl: display Acres;
Acres [*] :=
X1 1575
X2 700
X3 550
X4 230.33
X5 400
X6 1050
;
ampl: quit;