ORIE 3300/5300
ASSIGNMENT 1 SOLUTION
Fall 2008
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 file.
Let’s start with the set of products. We have three products here, three types of wine (Little red, Big
red and AD white). So the first line of the data file will be:
set P := Lred Bred ADwhite;
Now we have to specify, for each type of wine, three parameters: profit (2,3 and 4), maximum daily
production (500, 400 and 200) and production rate (100, 90 and 70 bottles per hour). We can follow
the original production data file to get
param:
a
c
u
:=
Lred
100
2
500
Bred
90
3
400
ADwhite
70
4
200;
The last parameter we have to define is the number of hours available for production:
param b := 8;
After saving the data file, we can run AMPL, read the model and data file, solve the problem and
display the results:
ampl: model prod.mod; data plonk.dat; solve;
MINOS 5.5: optimal solution found.
3 iterations, objective 2139.68254
ampl: display X;
X [*] :=
ADwhite
200
Bred
400
Lred
69.8413
So, the winery should produce 200 bottles of AD White, 400 bottles of Big Red and 69.84 bottles of
Little Red wine, for a total daily profit of $2139.6.
Now, for Friday, the problem is little bit different  there are only 6 hours available. We can change
parameter
b
to 6 by typing
ampl:
let b:=6;
and after solving the problem again we get the solution
ampl: display X;
X [*] :=
ADwhite
200
Bred
282.857
Lred
0
1
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
In this case, the winery only has time to produce 200 bottles of AD White and 287.85 bottles of Big
Red wine.
Extra Credit
If we think about the problem, we see that AD White wine is the most profitable, then the Big Red
wine and finally the Little Red wine. During the 8hour shift, we manage to satisfy all the demand
for AD White and Big Red, but on Friday, we do not. So, suppose we can actually store some wine
for next day (and, suppose there are zero storage costs). Then, we can produce some Big Red wine on
Thursday (instead of producing the less profitable Little Red wine), and store it for sale on Friday. To
This is the end of the preview.
Sign up
to
access the rest of the document.
 Fall '08
 TODD
 Optimization, optimal solution, feasible region, Big Red, AD White

Click to edit the document details