ampl1 - Advanced Optimization AmplPart1 Zeliha Akca What is...

Info icon This preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Advanced Optimization Ampl-Part1 Zeliha Akca
Image of page 1

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

View Full Document Right Arrow Icon
What is Ampl? A modeling language that helps us to develop and apply  mathematical programming models. Can solve linear, nonlinear, integer, mixed integer models.  Can write any piece of code that you can write in C, C++ in  ampl:        - can create loops, generate random numbers,       - check logical conditions, fill arrays, … You may call  ampl  from C, C++, VBA, etc. 
Image of page 2
Downloading and Installing Ampl: Go to  www.ampl.com Click  Download   the Student Edition From  Ampl Quick starts  number 2:  Download  amplcml.zip  to wherever you want to work. Extract the zip file.  You will get a folder named  amplcml  . You will see example files under MODEL folder. Also, you may need to look at frequently asked questions in  www.ampl.com . Very helpful while writing the code. 
Image of page 3

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

View Full Document Right Arrow Icon
Our very first Ampl program: Defining the Model:   To define Variables       var  name_of_variable ;      var x1;        var x2; To define Objective      maximize (or minimize)  obj_name :  objective-function;      maximize  profit: 2*x1+x2;       minimize  cost: x1+3*x2; To define Constraints      subject to  name_of_constraint :  constraint_function;      subject to  capacity: x1+x2<=30;     
Image of page 4
Example: Steel Production A mill can produce two semi-finished products: bands and coils. The band production rate is 200 tons/hour, while coil production  rate is 140 tons/hour.  The company obtains $25 per ton band, and $30 per ton coil.  Also, there is a maximum level for each item to be produced.  Bands can be produced up to 6,000 tons and coils up to 4,000  tons.  If 40 hours of production is available then, how many tons of  bands and how many tons of coils must be produced to  maximize the profits?
Image of page 5

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

View Full Document Right Arrow Icon
Model: Steel production 1. Decision variables: XB: Tons of bands to be produced XC: Tons of coils to be produced 2. Objective Function: Maximize 25XB + 30XC 3. Constraints: Production limits           Quantity limit:            XB   6000            XC   4000           Hour limit:            (1/200)XB+(1/140)XC    40 Non-negativity       XB   0       XC   0
Image of page 6
Our model: Maximize 25XB+30XC Subject to (1/200)XB+(1/140)XC<=40  XB<=6000 XC<=4000 XB>=0 XC>=0    Ampl format:      var  XB;        var  XC;      maximize  profit:25*XB+30*XC;       subject to  hour_limit:                        (1/200)*XB+(1/140)*XC<=40;        subject to  prod_limit_ bands: XB<=6000;       subject to  prod_limit_coils: XC<=4000;        subject to  nonneg_bands: XB>=0;       
Image of page 7

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

View Full Document Right Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern