Metadata
Title
Functions of GAMSCHK and Examples – Bruce McCarl
Category
general
UUID
c456d0cdaa0b41b5baf11b6753b5fb84
Source URL
https://agecoresearch.tamu.edu/mccarl/gams-related-information/functions-of-gams...
Parent URL
https://agecoresearch.tamu.edu/mccarl/
Crawl Time
2026-03-16T03:54:54+00:00
Rendered Raw Markdown

Functions of GAMSCHK and Examples – Bruce McCarl

Source: https://agecoresearch.tamu.edu/mccarl/gams-related-information/functions-of-gamschk-and-examples/ Parent: https://agecoresearch.tamu.edu/mccarl/

\ Top of Document\

Ask for a display of a variable or equation and you receive\ \ —-## VAR MAKECHAIR\

MAKECHAIR(PLANT2,FUNCTIONAL,NORMAL)

OBJT 15.000
RESOURCEQ(PLANT2,SMLLATHE) 0.80000
RESOURCEQ(PLANT2,LRGLATHE) 0.50000
TRNCHAIREQ(PLANT2,FUNCTIONAL) -1.0000
UPPER BOUND 5000.0
or
—-## EQU LINKTABLE
## LINKTABLE(FANCY)
MAKETABLE(PLANT1,FANCY) -1.0000
TRANSPORT(PLANT3,TABLES,FANCY) -1.0000
SELL(PLANT1,DINSETS,FANCY) 1.0000
=L= 0.00000E+00

Top of Document\ \ Ask about the characteristics of selected variables and equations and you get\ \ \

Is Tot Pos Neg Nln Minimum Maximum
—-### Requested Variables Non Cof Cof Cof Cof Absolute Absolute
SELL(PLANT1,TABLES, 0 2 1 1 0 1.000 1.000
FUNCTIONAL)
Is Tot Pos Neg Nln Minimum Maximum
—-### Requested Equations Non Cof Cof Cof Cof Absolute Absolute
RESOURCEQ(PLANT1,LABOR) 0 3 3 0 0 1.000 5.000

Top of Document\ \ Request a report of the characteristics of equation and variable blocks and you get\ \

Variable Sign Numb Numb Pos Neg Non Maximum Minimum
Block Res Vars Nonl Coef Coef Coef Absolute Absolute
MAKECHAIR >=0 12 0 60 12 0 1.700 .2000
MAKETABLE >=0 6 0 16 4 0 5.000 1.000
Equation Type Numb Numb Pos Neg Non Pos Neg Maximum Minimum
Block Res Eqns Nonl Coef Coef Coef RHS RHS Absolute Absolute
OBJT =E= 1 0 23 10 0 0 0 1100. 5.000
RESOURCEQ =L= 12 0 60 0 0 11 0 5.000 .2000

Top of Document\ \ Examine a GAMS model to see whether any variables and equations contain specification errors and you get messages like the following\ \ —-### Analysis of Variables ( nonlinear terms at current point)\ \ **** Warning These variables will equal zero because they have a zero lower bound an undesirable object function coefficient all 0 or – coefficients in the =G= rows all 0 or + coefficients in the =L= rows and no coefficients in the =E= rows\ \ ## MAKETABLE(PLANT2,FUNCTIONAL)\ MAKETABLE(PLANT2,FANCY)\ \ —-### Analysis of Equations ( nonlinear terms at current point)\ \ **** Warning This =L= constraint causes all variables in it to have a zero solution value since the nonnegative variables present have only 0 or + coefficients the nonpositive variables present have only 0 or – coefficients the unrestricted variables have only zero coefficients and the rhs is zero.\ \ ## RESOURCEQ(PLANT2,TOP)\ \

Top of Document\ \ You can generate a schematic of the structure of the variable and equation blocks and you get something like\ \

M M T N
A A R E
K K A T
E E N I
C T S N
H A P S C
A B O E O
I L R L M
R E T L E
OBJT + + + +
RESOURCEQ + +
LINKTABLE +
LINKCHAIR +
TRNCHAIREQ + +
TRNTABLEEQ + +
Variable Typ + + + + u

Top of Document\ \ Ask for a block picture and you can examine the number of coefficients in the intersections of variable and equation blocks

M M T N
A A R E
K K A T
E E N I
C T S N
H A P S C
A B O E O R
I L R L M H
R E T L E S
OBJT 12+ 4+ 6+ 1+ E 0
10-
RESOURCEQ 48+ 12+ L 11+
LINKTABLE 4+ L 0
2- 2-
LINKCHAIR 2+ L 0
4-
TRNCHAIREQ 4+ 4+ L 0
12-
TRNTABLEEQ 2+ 2+ L 0
2-
Coeff Cnts 60+ 16+ 12+ 12+ 1+ 11+
12- 4- 6- 10- 32-
# of Vars 12 6 6 10 1
Variable Typ >=0 >=0 >=0 >=0 <0>

Top of Document\ \ Ask for a block picture and you can look at the scaling characteristics of the variable and equation blocks

M M T N
A A R E
K K A T
E E N I
C T S N
H A P S C
A B O E O
I L R L M
R E T L E
OBJT Max 26.6 100 20 1100 1
Min 15 80 5 82 1
RESOURCEQ Max 1.7 5 0 0 0
Min 0.2 1 0 0 0
LINKTABLE Max 0 1 1 1 0
Min 0 1 1 1 0
LINKCHAIR Max 0 0 1 6 0
Min 0 0 1 4 0
TRNCHAIREQ Max 1 0 1 1 0
Min 1 0 1 1 0
TRNTABLEEQ Max 0 1 1 1 0
Min 0 1 1 1 0
Total Var Max 26.6 100 20 1100 1
Min 0.2 1 1 1 1

Top of Document\ \ You can generate a schematic for small GAMS models or portions of larger models depicting the location of coefficients by sign and magnitude as follows

R
T T T T T T H
R R R R R R S
A A A A A A
N N N N N N C
S S S S S S O
P P P P P P E
O O O O O O F
R R R R R R F
T T T T T T S
1 2 3 4 5 6
————
OBJT 1 D E E D D 6 = 0
LINKTABLE 1 3 <0
LINKTABLE 2 3 <0
LINKCHAIR 1 3 3 <0
LINKCHAIR 2 3 3 <0
TRNCHAIREQ 1 C <0
————
LOWER BND 0 0 0 0 0 0
UPPER BND + + + + + +
————
POSITIVE 3 0 3 0 3 0
COLUMN CTS 0 3 0 3 0 2
NEGATIVE 1 0 1 0 1 0
COLUMN CTS 0 1 0 1 0 2

Top of Document\ \ Ask to reconstruct the reduced costs after a model solution and you get\ \

—-### BUDGETING VARIABLES
—-## VAR MAKECHAIR
## MAKECHAIR(PLANT2,FANCY,NORMAL)
SOLUTION VALUE
UPPER BOUND
EQN
OBJT
RESOURCEQ(PLANT2,SMLLATHE)
RESOURCEQ(PLANT2,LRGLATHE)
RESOURCEQ(PLANT2,LABOR)
TRNCHAIREQ(PLANT2,FANCY)
TRUE REDUCED COST

Top of Document\ \ Ask to reconstruct the activity within equations after a model solution and you get\ \

—-### ROW SUMMING EQUATIONS
—-## EQU RESOURCEQ
## RESOURCEQ(PLANT2,SMLLATHE)
VAR
MAKECHAIR(PLANT2,FUNCTIONAL,
NORMAL)
MAKECHAIR(PLANT2,FANCY,NORMAL)
MAKECHAIR(PLANT2,FANCY,MAXLRG)
=L=
RHS COEFF
SLACK EQUALS
SHADOW PRICE

Top of Document\ \ Ask the program to find variables or equations which could be causing unbounded or infeasible models and you get\ \ —-### THESE VARIABLES ARE POTENTIALLY UNBOUNDED\ \ To find the cause of unboundedness bound them or the objective function variable at a large value. Then solve and manually or through GAMSCHK find large levels for variables in solution\ \ SELL(PLANT1,TABLES,FUNCTIONAL)\ \ \ —-### THESE EQUATIONS ARE POTENTIALLY INFEASIBLE\ \ RESOUREQ(PLANT1,LABOR)\ \ Top of Document\