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

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

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

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

View Full DocumentRight 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. 
Background 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. 
Background image of page 3

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

View Full DocumentRight 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;     
Background 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?
Background image of page 5

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

View Full DocumentRight 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
Background 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
Background image of page 7

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

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

This note was uploaded on 01/09/2012 for the course IE 521 taught by Professor Zelihaakça during the Fall '11 term at Fatih Üniversitesi.

Page1 / 30

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

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online