User's Guide

### Table of Contents

This documentation guides GAMS User through several topics in GAMS system.

# Installation and Licensing

This part leads step by step through the installation process on three main platforms and describes the GAMS licensing system:

- Installation Notes for Mac OS X
- Installation Notes for Unix
- Installation Notes for Windows
- Licensing

# Tutorials and Examples

This part describes step by step through several selected tutorials and a small number of examples.

- A GAMS Tutorial by Richard E. Rosenthal
- Quick Start Tutorial
- Good Coding Practices
- Fixing Compilation Errors
- Finding and Fixing Execution Errors and Performance Problems
- Comparative Analyses with GAMS
- Good NLP Formulations
- Data Exchange with Other Applications
- Executing GAMS from other Environments

There are also tutorials and examples of the Application Programming Interfaces

- .NET Tutorial and Examples
- C++ Tutorial and Examples
- Java Tutorial and Examples
- Python Tutorial and Examples

# GAMS Language and Environment

This part introduces the components of the GAMS language in an ordered way, interspersed with detailed examples that are often drawn from the model library.

- Introduction - an introductory to GAMS User's Guide.
- GAMS Programs - The structure of the GAMS language and its components
- Set Definition - The declaration and initialization of sets, subsets, and domain checking.
- Dynamic Sets - The membership assignment, the usage of dollar controls, and set operations.
- Sets as Sequences: Ordered Sets - Special features used to deal with a set as if it were a sequence.
- Data Manipulations with Parameters - The declaration and assignment of GAMS parameters.
- Data Entry: Parameters, Scalars and Tables - Three basic forms of GAMS data types : Parameters, Scalars and Tables.
- Variables - The declaration and attributes of GAMS variables.
- Equations - The definition and declaration of GAMS equations.
- Model and Solve Statements Model - The specificiation of a GAMS model and how to solve it.
- Conditional Expressions, Assignments and Equations - The conditional assignments, expressions and equations in GAMS.
- The Display Statement - The syntax, control, and label order in display.
- Programming Flow Control Features - The GAMS programing flow control features : loop, if-elseif, while, and for statements.
- The Option Statement - The list and detailed description of options.
- System Attributes - The system attributes
- The Grid and Multi-Threading Solve Facility - The basic concepts and Grid Features.
- Special Features for Mathematical Programs - Special features in GAMS that do not translate across solvers, or are specific to certain model types.

The following discusses the execution of GAMS, the use of special features, and other miscellaneous topics.

- GAMS Output - The control of GAMS compilation output, execution output, output produced by a solve statement, and error reporting.
- The GAMS Call and Command Line Parameters - The list and detailed description of GAMS command line parameters.
- Dollar Control Options - The list and detailed description of dollar control options.
- The Put Writing Facility - The put writing facility of the GAMS language.
- Solver Usage - Controlling solvers.
- The Save and Restart Feature - The GAMS save and restart feature and the work file.
- Embedded Code Facility - The Embedded Code Facility (e.g. how to embed Python code into GAMS).
- Extrinsic Functions - The extrinsic function library and comparison with external equations.
- External Equations - A facility for connecting code written in different programming languages to equations and variables in a GAMS model.
- GAMS Return Codes - The structure of error codes, the return codes of the GAMS compiler and execution system, and the driver return codes.
- GAMS Data eXchange (GDX) - GAMS Data eXchange (GDX) facilities and utilities for Binary Data Exchange.
- Extended Mathematical Programming (EMP) - Extended Mathematical Programming (EMP).
- Accessing Model Libraries - Introduction of GAMS Model Library.
- Mathematical Programming System for General Equilibrium analysis (MPSGE) - A mathematical programming system for general equilibrium analysis which operates as a subsystem within GAMS.
- Introduction to MPSGE
- MPSGE Models in GAMS
- Demand Theory and General Equilibrium: An Intermediate Level Introduction to MPSGE
- Constant Elasticity of Substitution Functions: Some Hints and Useful Formulae
- A Library of Small Examples for Self-Study
- Comparing the Performance of Flexible Functional Forms
- General Equilibrium with Public Goods
- Kevin O'Rourke: CGE and Economic History
- Linking Implan Social Accounts to MPSGE
- A partial list of publications based on MPSGE
- The MPSGE guide is also available as PDF

# Glossary

An alphabetically list of GAMS terms is available in the Glossary.