GAMS Anwendung Nutzeroberfläche eigene Programme Modellierungs- System GAMS AMPL ILOG Studio … Solver CPLEX, CONOPT, MINOS, COIN, BARON,...

Slides:



Advertisements
Similar presentations
Solving LP Problems in a Spreadsheet
Advertisements

BU Decision Models Integer_LP1 Integer Optimization Summer 2013.
What is GAMS?. While they are not NLP solvers, per se, attention should be given to modeling languages like: GAMS- AIMMS-
1 1 Slides by John Loucks St. Edward’s University Modifications by A. Asef-Vaziri.
Chapter 5 LP formulations. LP formulations of four basic problem Resource allocation problem Transportation problem Feed mix problem Joint products problem.
Computational Methods for Management and Economics Carla Gomes Module 8b The transportation simplex method.
Chemical Engineering Optimization Models with GAMS
Linear Programming Using the Excel Solver
1 Lecture 12 Resource Allocation Part II (involving Continuous Variable (Linear Programming, continued) Samuel Labi and Fred Moavenzadeh Massachusetts.
GAMS/GAMSIDE AGEC 641 Lab, Fall 2011 Mario Andres Fernandez Based on material written by Gillig and McCarl and improved upon by previous lab instructors.
Example 5.3 More General Logistics Models | 5.2 | 5.4 | 5.5 | 5.6 | 5.7 | 5.8 | 5.9 | 5.10 | 5.10a a Background Information.
QM B Linear Programming
Transportation Problems Dr. Ron Tibben-Lembke. Transportation Problems Linear programming is good at solving problems with zillions of options, and finding.
3 Components for a Spreadsheet Linear Programming Problem There is one cell which can be identified as the Target or Set Cell, the single objective of.
Example 15.3 Supplying Power at Midwest Electric Logistics Model.
Example 15.4 Distributing Tomato Products at the RedBrand Company
Chapter 3 Introduction to Optimization Modeling
456/556 Introduction to Operations Research Optimization with the Excel 2007 Solver.
Transportation Model Lecture 16 Dr. Arshad Zaheer
Chapter 19 Linear Programming McGraw-Hill/Irwin
GAMS General Algebraic Modeling System Presentation No.2 Instructor: Dr. Abbas Seifi Prepares by: Masoud Barah Applied OR Modeling Course.
A GAMS TUTORIAL. WHAT IS GAMS ? General Algebraic Modeling System Modeling linear, nonlinear and mixed integer optimization problems Useful with large,
Data Structures & AlgorithmsIT 0501 Algorithm Analysis I.
Chapter 19: Solver Re-Visited Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
Numeric Processing Chapter 6, Exploring the Digital Domain.
How to get started with GAMS MS&E 348 – Lecture 1/20/04.
Linear Programming McGraw-Hill/Irwin Copyright © 2012 by The McGraw-Hill Companies, Inc. All rights reserved.
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
Michal Koháni Departement of Transportation Networks Faculty of Management Science and Informatics University of Zilina, Slovakia Høgskolen i Molde, September.
Transportation and Assignment Problems
Chapter 19: The Solver Re-Visited Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
3 Characteristics of an Optimization Problem General descriptionKPiller Illustration Decisions that must be made; represented by decision variables How.
RESEARCH ASSISTANTS Mazyar Ghadirinejad & Farhood Rismanchian.
1 System Planning 2013 Lecture 7: Optimization Appendix A Contents: –General about optimization –Formulating optimization problems –Linear Programming.
Introduction to GAMS: Formulation of a general problem Prof. Boyan Bonev Ivanov, Ph.D. Institute of Chemical Engineering-BAS.
IT Applications for Decision Making. Operations Research Initiated in England during the world war II Make scientifically based decisions regarding the.
McGraw-Hill/Irwin Copyright © 2009 by The McGraw-Hill Companies, Inc. All Rights Reserved. Supplement 6 Linear Programming.
Part:2.  Keywords are words with special meaning in JavaScript  Keyword var ◦ Used to declare the names of variables ◦ A variable is a location in the.
3 Components for a Spreadsheet Optimization Problem  There is one cell which can be identified as the Target or Set Cell, the single objective of the.
Linear Programming and Applications
Integer Programming Definition of Integer Programming If requiring integer values is the only way in which a problem deviates from.
Michal Koháni Department of Transportation Networks Faculty of Management Science and Informatics University of Zilina, Slovakia XPRESS – IVE Seminary.
Fortran: Control Structures Session Three ICoCSIS.
Introduction to Integer Programming Integer programming models Thursday, April 4 Handouts: Lecture Notes.
Warm Up Write down objective and homework in agenda Lay out homework (None) Homework (Recursive worksheet) Get a Calculator!!!
Business Mathematics MTH-367 Lecture 14. Last Lecture Summary: Finished Sec and Sec.10.3 Alternative Optimal Solutions No Feasible Solution and.
Linear Programming McGraw-Hill/Irwin Copyright © 2012 by The McGraw-Hill Companies, Inc. All rights reserved.
Excel’s Solver Use Excel’s Solver as a tool to assist the decision maker in identifying the optimal solution for a business decision. Business decisions.
The Transportation and Assignment Problems
Solver Feature Excel’s KY San Jose State University Engineering 10.
A Multiperiod Production Problem
Solver Feature Excel’s KY San Jose State University Engineering 10.
Transportation Problems
Lecture 5 Good modeling Chengcheng Fei 2017 Fall
Solver & Optimization Problems
Excel Solver IE 469 Spring 2017.
Linear Programming Dr. T. T. Kachwala.
Excel Solver IE 469 Spring 2018.
Wyndor Example; Enter data
1) C program development 2) Selection structure
A Mathematical Programming Language
Excel Solver IE 469 Fall 2018.
A QUICK START TO OPL IBM ILOG OPL V6.3 > Starting Kit >
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
Modeling and Solving LP Problems in a Spreadsheet
Excel Solver IE 469 Spring 2019.
Lecture 2 General Problem
Presentation transcript:

GAMS Anwendung Nutzeroberfläche eigene Programme Modellierungs- System GAMS AMPL ILOG Studio … Solver CPLEX, CONOPT, MINOS, COIN, BARON,...

Style 1Style 2 DATA Declarations and Definitions (set, parameter) MODEL Declarations (set, parameter, variable, equation) Assignments Displays Definitions (equation, model) MODEL Declarations (variable, equation) DATA Definitions (set, parameter) Definitions (equation, model) Assignments Displays SOLUTION Solve SOLUTION Solve Display

A GAMS Example This toy problem is presented only to illustrate how GAMS lets you model in a natural way. GAMS can handle much larger and highly complex problems. Only a few of the basic features of GAMS can be highlighted here. Algebraic Description Here is a standard algebraic description of the problem, which is to minimize the cost of shipping goods from 2 plants to 3 markets, subject to supply and demand constraints.

Algebraic Description - 2

Distances Markets PlantsNew YorkChicagoTopekaSupply Seattle San Diego Demand Algebraic Description - 3

Algebraic Description - 4

The GAMS Model The same model modeled in GAMS. The use of concise algebraic descriptions makes the model highly compact, with a logical structure. Internal documentation, such as explanation of parameters and units of measurement, makes the model easy to read.

SETS I canning plants / SEATTLE, SAN-DIEGO / J markets / NEW-YORK, CHICAGO, TOPEKA / ; PARAMETERS A(I) capacity of plant i in cases / SEATTLE 350 SAN-DIEGO 600 / B(J) demand at market j in cases / NEW-YORK 325 CHICAGO 300 TOPEKA 275 / ; TABLE D(I,J) distance in thousands of miles NEW-YORK CHICAGO TOPEKA SEATTLE SAN-DIEGO ; SCALAR F freight in dollars per case per thousand miles /90/ ; PARAMETER C(I,J) transport cost in thousands of dollars per case ; C(I,J) = F * D(I,J) / 1000 ; VARIABLES X(I,J) shipment quantities in cases Z total transportation costs in thousands of dollars ; POSITIVE VARIABLE X ; EQUATIONS COST define objective function SUPPLY(I) observe supply limit at plant i DEMAND(J) satisfy demand at market j ; COST.. Z =E= SUM((I,J), C(I,J)*X(I,J)) ; SUPPLY(I).. SUM(J, X(I,J)) =L= A(I) ; DEMAND(J).. SUM(I, X(I,J)) =G= B(J) ; MODEL TRANSPORT /ALL/ ; SOLVE TRANSPORT USING LP MINIMIZING Z ; DISPLAY X.l, X.m ;

Sets SETS I canning plants / SEATTLE, SAN-DIEGO / J markets / NEW-YORK, CHICAGO, TOPEKA / ; GAMS lets you specify indices in a straightforward way: declare and name the set (here, I and J), and enumerate their elements.

Parameters PARAMETERS A(I) capacity of plant i in cases / SEATTLE 350 SAN-DIEGO 600 / B(J) demand at market j in cases / NEW-YORK 325 CHICAGO 300 TOPEKA 275 / ; Here data are entered as indexed parameters A(I) and B(J), and values simply are listed. GAMS lets you place explanatory text (shown in lower case) throughout your model, as you develop it. Your comments are automatically incorporated into the output report, at the appropriate places.

Table TABLE D(I,J) distance in thousands of miles NEW-YORK CHICAGO TOPEKA SEATTLE SAN-DIEGO ; Data can also be entered in convenient table form. GAMS lets you input data in their basic form - transformations are specified algebraically.

Scalar SCALAR F freight in dollars per case per thousand miles /90/ ; A constant simply can be declared as a SCALAR, and its value specified.

Data manipulation PARAMETER C(I,J) transport cost in thousands of dollars per case; C(I,J) = F * D(I,J) / 1000 ; When data values are to be calculated, you first declare the parameter (i.e. give it a symbol and, optionally, index it), then give its algebraic formulation. GAMS will automatically make the calculations.

Variables VARIABLES X(I,J) shipment quantities in cases Z total transportation costs in thousands of dollars ; POSITIVE VARIABLE X ; Decision variables are expressed algebraically, with their indices specified. From this general form, GAMS generates each instance of the variable in the domain. Variables are specified as to type: FREE, POSITIVE, NEGATIVE, BINARY, or INTEGER. The default is FREE. The objective variable (z, here) is simply declared without an index.

Equations EQUATIONS COST define objective function SUPPLY(I) observe supply limit at plant i DEMAND(J) satisfy demand at market j ; COST.. Z =E= SUM((I,J), C(I,J)*X(I,J)) ; SUPPLY(I).. SUM(J, X(I,J)) =L= A(I) ; DEMAND(J).. SUM(I, X(I,J)) =G= B(J) ; Objective function and constraint equations are first declared by giving them names. Then their general algebraic formulae are described. GAMS now has enough information (from data entered above and from the algebraic relationships specified in the equations) to automatically generate each individual constraint statement - as you can see in the output report below. An extensive set of tools enables you to model any expression that can be stated algebraically: arithmetic, indexing, functions and exception-handling log (e.g. if-then-else and such-that constructs). =E= indicates 'equal to' =L= indicates 'less than or equal to' =G= indicates 'greater than or equal to'

Model Statement MODEL TRANSPORT /ALL/ ; The model is given a unique name (here, TRANSPORT), and the modeler specifies which equations should be included in this particular formulation. In this case we specified ALL which indicates that all equations are part of the model. This would be equivalent to MODEL TRANSPORT /COST, SUPPLY, DEMAND/. This equation selection enables you to formulate different models within a single GAMS input file, based on the same or different given data.

Solve Statement SOLVE TRANSPORT USING LP MINIMIZING Z ; The solve statement (1)tells GAMS which model to solve, (2)selects the solver to use (in this case an LP solver), (3)indicaties the direction of the optimization, either MINIMIZING or MAXIMIZING, and (4)specifies the objective variable.

Solve Messages MODEL STATISTICS BLOCKS OF EQUATIONS 3 SINGLE EQUATIONS 6 BLOCKS OF VARIABLES 2 SINGLE VARIABLES 7 NON ZERO ELEMENTS 19 GENERATION TIME = SECONDS EXECUTION TIME = SECONDS S O L V E S U M M A R Y MODEL TRANSPORT OBJECTIVE Z TYPE LP DIRECTION MINIMIZE SOLVER BDMLP FROM LINE 47 **** SOLVER STATUS 1 NORMAL COMPLETION **** MODEL STATUS 1 OPTIMAL **** OBJECTIVE VALUE RESOURCE USAGE, LIMIT ITERATION COUNT, LIMIT

Output Display x.l, x.m ; VARIABLE x.L shipment quantities in cases new-york chicago topeka seattle san-diego VARIABLE x.M shipment quantities in cases chicago topeka seattle san-diego 0.009