Assignment1_solutions - bounds on production into the...

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

View Full Document Right Arrow Icon
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 first column, the amount produced per hour into the second column, the profit from gallon (in dollars or cents) into the third column and the upper
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3

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

View Full DocumentRight Arrow Icon
Background image of page 4
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 dene 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

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 Right Arrow Icon
Ask a homework question - tutors are online