What is GAMS?. While they are not NLP solvers, per se, attention should be given to modeling languages like: GAMS- www.gams.com,www.gams.com AIMMS- www.aimms.com,www.aimms.com.

Slides:



Advertisements
Similar presentations
Linear Programming, 1 Max c 1 *X 1 +…+ c n *X n = z s.t. a 11 *X 1 +…+ a 1n *X n  b 1 … a m1 *X 1 +…+ a mn *X n  b m X 1, X n  0 Standard form.
Advertisements

Solving LP Models Improving Search Special Form of Improving Search
Linear Programming Problem
Lecture 3 Linear Programming: Tutorial Simplex Method
Linear Programming. Introduction: Linear Programming deals with the optimization (max. or min.) of a function of variables, known as ‘objective function’,
Use MATLAB to solve linear programs LI Xiao-lei. MATLAB format for linear programs MATLAB uses the following format for linear programs: min z = f T x.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved © 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or.
SOLVING LINEAR PROGRAMS USING EXCEL Dr. Ron Lembke.
Chemical Engineering Optimization Models with GAMS
Introduction to C Programming
© 2007 Pearson Education Chapter 14: Solving and Analyzing Optimization Models.
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.
Linear Programming and CPLEX Ting-Yuan Wang Advisor: Charlie C. Chen Department of Electrical and Computer Engineering University of Wisconsin-Madison.
Chapter 2: Introduction to Linear Programming
5.6 Maximization and Minimization with Mixed Problem Constraints
Computational Methods for Management and Economics Carla Gomes Module 4 Displaying and Solving LP Models on a Spreadsheet.
AMPL Presentation 1 By Raymond Kleinberg Outline AMPL - Ugh! - What is it good for? Basics Starting a Problem Running the Problem Example.
Chapter 3 An Introduction to Linear Programming
1 1 Slide © 2009 South-Western, a part of Cengage Learning Slides by John Loucks St. Edward’s University.
1 1 Slides by John Loucks St. Edward’s University Modifications by A. Asef-Vaziri.
LINEAR PROGRAMMING SIMPLEX METHOD.
START EXCEL BUILD OR RETRIEVE YOUR OPTIMIZATION MODEL SAVE YOUR WORKBOOK!! CHOOSE “Solver…” IN THE “Tools” MENU SPECIFY IN SOLVER DIALOG BOX: 1.CELL TO.
A GAMS TUTORIAL. WHAT IS GAMS ? General Algebraic Modeling System Modeling linear, nonlinear and mixed integer optimization problems Useful with large,
Mathematical Programming Cht. 2, 3, 4, 5, 9, 10.
1 1 Slide © 2005 Thomson/South-Western Slides Prepared by JOHN S. LOUCKS ST. EDWARD’S UNIVERSITY.
Linear Programming: Basic Concepts
GAMS Anwendung Nutzeroberfläche eigene Programme Modellierungs- System GAMS AMPL ILOG Studio … Solver CPLEX, CONOPT, MINOS, COIN, BARON,...
1 1 Slide Linear Programming (LP) Problem n A mathematical programming problem is one that seeks to maximize an objective function subject to constraints.
1 1 Slide © 2000 South-Western College Publishing/ITP Slides Prepared by JOHN LOUCKS.
Kerimcan OzcanMNGT 379 Operations Research1 Linear Programming: The Simplex Method Chapter 5.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
Chapter 7 Introduction to Linear Programming
1 1 Slide © 2005 Thomson/South-Western Chapter 2 Introduction to Linear Programming n Linear Programming Problem n Problem Formulation n A Maximization.
Chapter 7 Duality and Sensitivity in Linear Programming.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 2 Chapter 2 - Introduction to C Programming.
Getting Started with MATLAB 1. Fundamentals of MATLAB 2. Different Windows of MATLAB 1.
QMB 4701 MANAGERIAL OPERATIONS ANALYSIS
A model consisting of linear relationships representing a firm’s objective and resource constraints Linear Programming (LP) LP is a mathematical modeling.
1 1 Slide © 2001 South-Western College Publishing/Thomson Learning Anderson Sweeney Williams Anderson Sweeney Williams Slides Prepared by JOHN LOUCKS QUANTITATIVE.
Chapter 2 Introduction to Linear Programming n Linear Programming Problem n Problem Formulation n A Maximization Problem n Graphical Solution Procedure.
Notes on Linear Programming Uwe A. Schneider. Linear Programming, 1 Max c 1 *X 1 +…+ c n *X n = z s.t. a 11 *X 1 +…+ a 1n *X n  b 1 … a m1 *X 1 +…+ a.
1 1 Slide © 2005 Thomson/South-Western Linear Programming: The Simplex Method n An Overview of the Simplex Method n Standard Form n Tableau Form n Setting.
Chapter 4 Linear Programming: The Simplex Method
LINGO TUTORIAL. WHAT IS LINGO : LINGO is a software tool designed to efficiently build and solve linear, nonlinear, and integer optimization models. CREATING.
Kerimcan OzcanMNGT 379 Operations Research1 Linear Programming Chapter 2.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Slides by JOHN LOUCKS St. Edward’s University.
1 Introduction to Linear Programming Linear Programming Problem Linear Programming Problem Problem Formulation Problem Formulation A Simple Maximization.
Production systems LP and MILP models. Introduction  Linear programing (LP) is a base tool in optimization  George B. Dantzig developed the simplex.
1 Lecture 2 - Introduction to C Programming Outline 2.1Introduction 2.2A Simple C Program: Printing a Line of Text 2.3Another Simple C Program: Adding.
1 2 Linear Programming Chapter 3 3 Chapter Objectives –Requirements for a linear programming model. –Graphical representation of linear models. –Linear.
LINGO TUTORIAL.
Introduction to Optimization
An Introduction to Linear Programming
An Introduction to Linear Programming Pertemuan 4
Special Cases in simplex method applications
Chapter 2 An Introduction to Linear Programming
IENG 212 LAB 1 Research Assıstant: Kehınde Adewale ADESINA
Lecture 4 Power of GAMS Chengcheng Fei 2017 Fall
Ch 11 Resource Constraints and Linear Programming
Chapter 4 Linear Programming: The Simplex Method
Chapter 2 - Introduction to C Programming
Chap 9. General LP problems: Duality and Infeasibility
Chapter 3 The Simplex Method and Sensitivity Analysis
Using WinQSB to solve Linear Programming Models
Linear Programming Problem
Dr. Arslan Ornek DETERMINISTIC OPTIMIZATION MODELS
IENG 212 LAB 1 Research Assıstant: Kehınde Adewale ADESINA
Presentation transcript:

What is GAMS?

While they are not NLP solvers, per se, attention should be given to modeling languages like: GAMS- AIMMS- AMPL- MATLAB- See the Linear Programming FAQ for details on contacting the vendors of these and other modeling language products

What is GAMS?

perform a comparative static analysis Generalized Algebraic Modeling System (GAMS) a language for setting up and solving mathematical programming optimization models all-in-one package that allows one to specify the structure of an optimization model specify and calculate data that go into that model solve that model conduct report writing on a model What is GAMS?

Using GAMS ! Two approaches to using GAMS (1) Traditional method: use a text editor set up the model then use DOS (or UNIX) command line instructions to find errors in and run the model Integration Development Environmental (2) GAMS IDE alternative: A graphical interface to create, debug, edit and run GAMS files.

Formulation of a Simple Problem 3. Model statement STEPS: 1. Variable specifications 2. Equation specifications a. declaration b. algebraic structure specification 4. Solve statement

Variable specifications Equation declarations Algebraic structure specification Model statement Solve statement

Dissecting GAMS – Variable naming ! Variable Specification GAMS requires variables in each problem to be identified. In the example, we have variables Z, X1, X2, X3 Why new Z? => Because GAMS requires all models to be of a special form Max CX becomes Max Z s.t. Z = CX Variable Name can be up to 31 characters and can have xplanatory text

Dissecting GAMS – Variable naming Types of Variables: VARIABLE unrestricted variables POSITIVE VARIABLE restricted variables to be onnegative BINARY VARIABLE restricted variables to be 0 or 1 INTEGER VARIABLE restricted variables to be 0, 1, 2, …, 9999

Dissecting GAMS – Equation naming ! Equation Specifications consist of two parts. (1) Naming equations: GAMS requires the modeler name each equation, which is active in the model. In the example, the equations are named after the keyword EQUATIONS Explanatory Text The name for each equation can be anything up to 31 characters.

Dissecting GAMS – Equation naming (2) Specifying algebraic structure: : After naming equations, the exact algebraic structure of equations must be specified by using.. notation. This algebraic form involves use of a special syntax to tell the exact form of the equation that may actually be an inequality. =E= indicates an equality constraint =L= indicates a less than or equal to constraint =G= indicates a greater than or equal to constraint

Dissecting GAMS – Model specification Model Specification MODEL statement is used to identify models that will be solved. It involves 2 steps step 1: give name of the model (e.g. Example1) step 2: specify equations that will be included in the model in slashes / / MODEL Example1 /ALL/ ; including all equations MODEL Example1 /Equation1, Equation2/ ; Only Equation1 and Equation2

Dissecting GAMS – Solve specification Solve Specification SOLVE causes GAMS to apply a solver to the model named in the solve statement (Example1) using the data defined just before the solve statement. SOLVE Example1 USING LP MAXIMIZING Z ; LP MAX SOLVE Example1 USING LP MINIMIZATION Z ; LP MIN SOLVE Example1 USING NLP MAXIMIZING Z ; Non-linear programming SOLVE Example1 USING MIP MAXIMIZING Z ; Mixed integer programming

Dissecting GAMS – ; specification GAMS requires one to terminate each statement with a ;. ; is a very important part of the syntax their omission => syntax errors.

Dissecting GAMS – Finding errors

Solution Reports The report summary gives the total number of non- optimal, infeasible, unbounded cases encountered. Solution information can be output in several ways: 1. GAMS default standard solution output 2. Through added DISPLAY commands 3. Through added computed reports using values from solutions (we will discuss this later)

Solution Reports 1. Format of the default standard GAMS solution The single dot “.” represents a zero; INF represents infinity

GAMS Output Echo Prints or a copy of an input file 2, 3, 4, …, 20 are line numbers

GAMS Output Model Statistics Model Statistics give information on model size. The BLOCK counts refer to the number of named GAMS equations and variables. The SINGLE counts refers to individual rows and columns. The NON ZERO refers to the number of non-zero coefficients.

GAMS Output Status Reports SOLVE STATUS (a state of the program) => normal completion, iteration interrupted, resource interrupted, terminated by solver, evaluation error limit, unknown. MODEL STATUS (what solution looks like) => optimal, infeasible, unbounded, etc.

GAMS Output Solution Reports Variables => values under lower and upper refers to bounds Equations => values under lower and upper are from RHS and relational type of equations

GAMS Output Solution Reports This is a final section of the solution listing. It shows the counts rows or columns that have been marked NOPT, INFES, UNBND in the solution listing section.

GAMS Output File Summary This is a final section of the output. It gives the names of the input and output disk files. If work files (save or restart) have been used, they will be named here as well.

Hands On (handson1.gms) Learning Objectives: 1. Learn basic GAMS language elements 2. See how to find and fix errors Please write an algebraic model (a feeding problem) into GAMS Please save your work as handson1.gms since it will be used again later. Max 109X1+90X2+115X3 s.t. X1+X2+X3<100 6X1+4X2+8X3<500 X1>0 X2>0 X3>0

Max 109X1+90X2+115X3 s.t. X1+X2+X3<100 6X1+4X2+8X3<500 X1>0 X2>0 X3>0

References rig_laboratory/Distance_learning_systmeng/Distance_sys tmeng_LT.htm