Introduction To GAMS:: Formulation of A Simple Problem
Introduction To GAMS:: Formulation of A Simple Problem
Dhazn Gillig
&
Bruce A. McCarl
STEPS
1. Variable specifications
2. Equation specifications
a. declaration
b. algebraic structure specification
3. Model statement
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
Types of Variables:
This algebraic form involves use of a special syntax to tell the exact form of
the equation that may actually be an inequality.
! Model 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
; is a very important part of the syntax their omission => syntax errors.
Dissecting GAMS – Finding errors
??
Error Message
Solution Reports
2, 3, 4, … , 20 are
line numbers
GAMS Output
Model Statistics
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.
Download GAMS
Then
1. Fill out the form
You can download the current McCarl GAMS User Guide 2003
going to
Download McCarl GAMS User Guide 2003