Optimization I (ORIE 3300/5300)
Assignment 1 Solution
Problem 2
After reading pages 111 from the AMPL book, you noticed that the wine problem is just a special
case of the production model, so we only need to construct the corresponding data ﬁle.
Let’s start with the set of products. We have three products, the three types of wine: little
red, Big Red, and AD White. So, the ﬁrst line of the data ﬁle will be:
set P := lred BRed ADWhite;
Now we have to specify, for each type of wine, three parameters: proﬁt (3, 4, and 5 dollars per
bottle), maximum daily production (400, 300, and 200 bottles) and production rate (90, 80, and
60 bottles per hour). We can follow the original production data ﬁle to get:
param:
a
c
u :=
lred
90
3
400
BRed
80
4
300
ADWhite 60
5
200;
The last parameter we have to deﬁne is the number of hours available for production:
param b := 8;
After saving the data ﬁle, we can run AMPL, read the model and data ﬁle, solve the problem
and display the results:
ampl: reset;
ampl: model prod.mod; data plonk.dat; solve; display X;
MINOS 5.5: optimal solution found.
3 iterations, objective 2447.5
X [*] :=
ADWhite
200
BRed
300
lred
82.5
;
So, the winery should produce 200 bottles of AD WHite, 300 bottles of Big Red, and 82.5
bottles of little red wine, for a total daily proﬁt of $2447.50.
Now, for Friday, the problem is a little bit diﬀerent; there are only 6 hours available. So, we
change the parameter
b
from 8 to 6. We can do this by modifying plonk.dat; alternatively, we
could leave plonk.dat unchanged, but type the following command:
ampl:
let b:= 6;
. Then,
we solve the modiﬁed problem and obtain a new solution:
ampl: let b:= 6;
ampl: solve;
MINOS 5.5: optimal solution found.
2 iterations, objective 1875
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 '08
 TODD
 Optimization, AD White

Click to edit the document details