General Algebraic Modeling System (GAMS) [chapter]

Michael R. Bussieck, Alex Meeraus
2004 Applied Optimization  
The General Algebraic Modeling System (GAMS) is a programming language that provides a flexible framework for formulating and solving linear, nonlinear and mixed-integer optimization problems. Among other attributes, its syntax allows for declaring associations among variables, constants, and constraints in the form of sets. Through this syntax, input files are written compactly and similarly to the typical formulations of optimization problems. In addition, GAMS provides a wide array of
more » ... ide array of solvers to optimize a variety of problem formulations including linear programs (LPs), nonlinear programs (NLPs), mixed-integer linear programs (MILPs, but referred to as MIPs by GAMS), and mixed-integer nonlinear programs (MINLPs). Here, it is possible only to provide a limited overview of the capabilities of GAMS. Examples discussed in the text are presented to illustrate the structure of input files for an LP, an NLP, and an MIP. These input files can be copied from the CD-ROM that accompanies this book. It is recommended that the reader copy and run the GAMS input files, and observe the results. The files can be modified and rerun to observe how the optimal solutions change. As with many software applications, one of the best means for learning GAMS is through hands-on experience. In its simplest form, GAMS operates on a user-supplied input file (normally denoted with a .gms or .number extension to the filename), which encodes the mathematical formulation of the optimization problem being examined. Selection of the word processor for use in editing the input file is left to the discretion of the user. Note, however, that files should be saved in ASCII CD-G-2 or TEXT format. Thus, the Notepad word processor included in the Windows operating system is a good choice. GAMS is not likely to be able to run files saved in another format (e.g. that of .doc files in WORD) since the default save options of many word processors add formatting codes to the saved file. GAMS operates on a variety of platforms, with execution of the program initiated from the command prompt line. GAMS is run using the executable (GAMS) followed by the name of the input file at the command prompt, that is: GAMS filename.extension In the WINDOWS operating system, GAMS is run through the Run window, shown in Figure 1 , which is obtained by left clicking the Start window and then clicking Run. In this case, the executable (GAMS) and the input file (CASC.1) are located in the directory C:\GAMS. The output file, CASC.lst, is placed in the same directory as the GAMS executable, not the directory of the input file. GAMS operates on an input file in two stages:
doi:10.1007/978-1-4613-0215-5_8 fatcat:3bxhvupnljdfbla5zui7xbuv3u