Lecture 7 GAMS Check Chengcheng Fei 2017 Fall

Slides:



Advertisements
Similar presentations
The simplex algorithm The simplex algorithm is the classical method for solving linear programs. Its running time is not polynomial in the worst case.
Advertisements

Lecture 4 Structure plan Program design process Program design process Basic elements of code: Basic elements of code: –Input (assignment of variables)
What is GAMS?. While they are not NLP solvers, per se, attention should be given to modeling languages like: GAMS- AIMMS-
Advanced GAMS 1. Good Modeling Practices 2. Fixing Misbehaving Models 3. Linking GAMS 4. Advanced GAMS Syntax.
Alford Academy Business Education and Computing1 Advanced Higher Computing Based on Heriot-Watt University Scholar Materials File Handling.
© 2007 Pearson Education Chapter 14: Solving and Analyzing Optimization Models.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming The software development method algorithms.
Good modeling practices AGEC 641 Lab, Fall 2011 Mario Andres Fernandez Based on material written by Gillig and McCarl. Improved upon by many previous lab.
GAMSCHK and GAMS Documentation AGEC 641 Lab, Fall 2011 Mario Andres Fernandez Based on material written by Gillig and McCarl; Improved upon by many previous.
Comparative Analysis Multiple Submissions vs. Loops AGEC 641 Lab, Fall 2010 Mario Andres Fernandez Based on material written by Gillig and McCarl; Improved.
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.
Examining a model for Flaws AGEC 641 Lab, Fall 2011 Mario Andres Fernandez Based on material written by Gillig and McCarl. Improved upon by many previous.
Power of GAMS AGEC 641 Lab, Fall 2011 Mario Andres Fernandez Based on material written by Gillig and McCarl. Improved upon by many previous lab instructors.
Computational Methods for Management and Economics Carla Gomes Module 4 Displaying and Solving LP Models on a Spreadsheet.
Solver & Optimization Problems n An optimization problem is a problem in which we wish to determine the best values for decision variables that will maximize.
Stevenson and Ozgur First Edition Introduction to Management Science with Spreadsheets McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies,
Graphical Solutions Plot all constraints including nonnegativity ones
What is GAMS?.
Chapter Seven Advanced Shell Programming. 2 Lesson A Developing a Fully Featured Program.
1 Documenting Your Project. 2 Documenting your Project Insert Banner Comments in your code Comment - coding statement used by humans not the compiler.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Managerial Decision Making and Problem Solving
CDAE Class 17 Oct. 23 Last class: Result of Quiz 4 3. Linear programming and applications Today: 3. Linear programming and applications Review for.
QMB 4701 MANAGERIAL OPERATIONS ANALYSIS
Covenant College November 27, Laura Broussard, Ph.D. Professor COS 131: Computing for Engineers Chapter 5: Functions.
© The McGraw-Hill Companies, 2006 Chapter 3 Iteration.
Outline Announcements: –HW I key online this afternoon –HW II due Friday –Sign up to discuss projects Debugging Testging for correctness.
Chapter 2 Build Your First Project A Step-by-Step Approach 2 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta Eaton.
1 Project 12: Cars from File. This is an extension of Project 11, Car Class You may use the posted solution for Project 11 as a starting point for this.
Getting started with Simulink An introductory tutorial.
DEVRY CIS 170 C I L AB 1 OF 7 G ETTING S TARTED Check this A+ tutorial guideline at
LINGO TUTORIAL.
EMGT 6412/MATH 6665 Mathematical Programming Spring 2016
Lecture 5 Good modeling Chengcheng Fei 2017 Fall
Testing Tutorial 7.
WORKSHOP 1 CUSTOM TIRE SUBROUTINE
Chap 10. Sensitivity Analysis
Standard form and Point-slope form of linear equations
IENG 212 LAB 1 Research Assıstant: Kehınde Adewale ADESINA
2008/09/22: Lecture 6 CMSC 104, Section 0101 John Y. Park
Linear Equations: Using the Properties Together
Solver & Optimization Problems
Lecture 4 Power of GAMS Chengcheng Fei 2017 Fall
C++ Basic Syntax – Homework Exercises
3.01 Apply Controls Associated With Visual Studio Form
L9Matrix and linear equation
Lecture 9 Report writing
3.01 Apply Controls Associated With Visual Studio Form
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Section 1.2 Linear Equations and Rational Equations
Chapter 4 Linear Programming: The Simplex Method
Wyndor Example; Enter data
Chapter 3 The DATA DIVISION.
Lecture 8 Exam model flaws
Lecture 6 Conditionals, Subsets and Tuples in GAMS
1. Open Visual Studio 2008.
Using WinQSB to solve Linear Programming Models
Section 1.2 Linear Equations and Rational Equations
Linear Algebra Lecture 3.
Lecture 4 Structure plan
Solving Equations Containing Decimals
Lecture 10 Comparative analysis
Policy evaluation options
Running a Java Program using Blue Jay.
Multi-Step Equations.
Lecture 2 General Problem
Solving Equations with Fractions
Warm- Up: Solve by Substitution
IENG 212 LAB 1 Research Assıstant: Kehınde Adewale ADESINA
Presentation transcript:

Lecture 7 GAMS Check Chengcheng Fei 2017 Fall Based on material written by Gillig and McCarl; Improved upon by many previous lab instructors; Special thanks to Zidong Mark Wang.

An side note: project file *.gpr file: the GAMS project file. The project location determines where all saved files are placed (to place files elsewhere use the save as dialogue) and where GAMS looks for files when executing. The project saves file names and program options associated with the effort in a file called projectname.gpr. It is a good idea to define a new project every time you wish to change the file storage directory.

GAMSCHK GAMSCHK is a system for verifying model structure and solutions to see if all is correct. It is designed to aid in PRE and POST solution model analysis and help fix improperly working models. PRE solution: To verify the model structure before worrying too much about the answer. POST solution: To enlist the solvers help in an exercise to find the causes of unrealistic solutions, unbounded or infeasible problems.

PRE Solution PRE- solution procedures can be used to List selected equations and/or variables (DISPLAYCR) Generate schematics on equations/variables blocks (BLOCKPIC) List characteristics of equations/variables blocks (BLOCKLIST) Find obvious specification errors (ANALYSIS) Generate schematics on location of coefficients by sign and magnitude on individual equation/variable basis (PICTURE) List characteristics of equations/variables (MATCHIT)

Post Solution Reconstructing reduced cost and equation activity (POSTOPT) Helping resolve problems with unbounded or infeasible models (NONOPT) On a post solution basis, POSTOPT is used to check for Non-Sensical solutions by observing a faulty attribute of the solution in terms of Allocation (variable and equation levels, e.g. Variable.L, Equation.L) Valuation (variable and equation marginals e.g. Variable.M, Equation.M)

Steps to run GAMSCHK Step 1: Insert a command line OPTION LP = GAMSCHK OPTION NLP = GAMSCHK OPTION MIP = GAMSCHK Right before the solve

Step 2: Create a new file with extension Step 2: Create a new file with extension *.gck that has the same corresponding name as the program file. exgamschk.gms  exgamschk.gck

To create a new file, go to the FILE menu and use the NEW option To create a new file, go to the FILE menu and use the NEW option. You will then get a file called untitled with an empty screen then save as exgamschk.gck Make sure *gms and * gck files are saved within the same folder

STEP 3: select procedures and provide inputs in the *.gck le. If the *.GCK file cannot be found, then it is assumed that the BLOCKPIC procedure is selected. Procedure Name Item Selection input

Input rules If a particular equation is not specified, then display all equations If a variable or equation name is entered without any following parentheses, then all cases for that variable or equation are selected. If all elements from sets are selected, wild cards can be used If a wild card is used to select items (e.g. Tr*), GAMS will select anything starting Tr

DISPLAYCR DISPLAYCR produces output much like LIMROW and LIMCOL, but DISPLAYCR allows one to select specific items. Display variable names and associated coefficients in equations Display equations and associated coefficients with variables

BLOCKPIC BLOCKPIC is used to find GAMS coding errors in a model structure by looking at a whole summary of the model. Scaling can also be investigated.

BLOCKPIC

BLOCKPIC

BLOCKPIC

PICTURE PICTURE permits investigation and verification of the structure of equations and variables. Look at interrelationships between items how coefficients for a variable appear across equations? What variables appear in an equation? How some variables balance against other variables in equations? How signs are distributed? Look at magnitude, sign and location of coefficients Avoid immense output from using LIMROW/LIMCOL or DISPLAYCR

PICTURE coefficient code

PICTURE magnitude, sign & location

PICTURE dictionary

ANALYSIS ANALYSIS is used to analyze the structure of all variables and equations. Information from ANALYSIS is used to dene if individual variables or equations in the model have specification errors which lead to redundancy, zero variable values, infeasibility, unboundedness, or obvious constraint redundancy in linear programs. Z is unbounded. Eq. (1) is infeasible.

POSTOPT and NONOPT POSTOPT reconstructs the reduced cost and equation activity. It is used to investigate a misbehaving model yielding an unrealistic, infeasible, or unbounded solution. NONOPT is used to help find the potential set associated with infeasibility problems. Since both are used to exam model flaws, they will be introduced in detail in the next section: examine model flaws.

Questions?