Assignment1_solutions

# Assignment1_solutions - bounds on production into the...

This preview shows pages 1–4. Sign up to view the full content.

Example 2 After reading pages 2-11 in the book we can see that most of the work is already done and our only task is to ”feed” the production model with appropriate data. This can be done for example in notepad. So which data do we need? First we need to give names to our variables. Let’s call them ”Regular”, ”Plus” and ”Ultra”. As we can see in example in page 10 of the book, this can be done by typing set p:= Regular Plus Ultra; Then we need to assign values to parameters a , c and u . Again following example from the book we start by writing the names of the variables into the ﬁrst column, the amount produced per hour into the second column, the proﬁt from gallon (in dollars or cents) into the third column and the upper

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

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.

Unformatted text preview: bounds on production into the fourth column : param: a c u:= Regular 10000 10 120000 Plus 9000 11 120000 Ultra 8500 12 120000; The last parameter is b which we deﬁne by writing param: b=24; because we have 24 hours every day. Now we can save our data ﬁle as smog.dat and run AMPL . As in example we ﬁrst declare which ﬁle contains the model and which contains data. Then we just tell AMPL to solve the problem. sw: ampl ampl: model prod.mod; ampl: data smog.dat; ampl: solve; MINOS 5.5: optimal solution found. 2 iterations, objective 2428235.294 Now the last thing is to display optimal values of X: ampl: display X; X [*] := Plus 0 Regular 98823.5 Ultra 120000 ; and we are done. 1...
View Full Document

{[ snackBarMessage ]}

### Page1 / 4

Assignment1_solutions - bounds on production into the...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online