# GAMS程序输入为什么得出的结论与书上不一样-经管之家官网！

>>

## TOP热门关键词

 坛友互助群 扫码加入各岗位、行业、专业交流群

Sets
i canning plants / seattle, san-diego /
j markets / new-york, chicago, topeka / ;
Parameters
a(i) capacity of plant i in cases
/ seattle 350
san-diego 600 /
b(j) demand at market j in cases
/ new-york325
chicago 300
topeka 275 / ;
Table d(i, j) distance in thousands of miles
new-york chicago topeka
seattle 2.5 1.7 1.8
san-diego 2.5 1.8 1.4 ;
Scalar f freight in dollars per case per thousand miles /90/ ;
Parameter c(i, j) transport cost in thousands of dollars per case ;
c(i, j) = f * d(i, j) / 1000 ;
Variables
x(i, j) shipment quantities in cases
z total transportation costs in thousands of dollars ;
Positive Variable x ;
Equations
cost define objective function
supply(i) observe supply limit at plant i
demand(j) satisfy demand at market j ;
cost.. z = e = sum((i, j), c(i, j)*x(i, j)) ;
supply(i).. sum(j, x(i, j)) = l = a(i) ;
demand(j).. sum(i, x(i, j)) = g = b(j) ;
Model transport /all/ ;
Solve transport using lp minimizing z ;
Display x. l, x. m ;

25 supply(i) observe supply limit at plant i
26 demand(j) satisfy demand at market j ;
27 cost.. z = e = sum((i, j), c(i, j)*x(i, j)) ;
**** \$140,37,409
28 supply(i).. sum(j, x(i, j)) = l = a(i) ;
**** \$140,37,409
29 demand(j).. sum(i, x(i, j)) = g = b(j) ;
**** \$140,37,409
30 Model transport /all/ ;
31 Solve transport using lp minimizing z ;
**** \$257
32 Display x. l, x. m ;
**** \$342,329,141,409,342
GAMS 24.2.3r46072 Released May 22, 2014 WEX-WEI x86_64/MS Windows 07/23/14 14:30:02 Page 2
G e n e r a l A l g e b r a i c M o d e l i n g S y s t e m
Error Messages
37'=l=' or '=e=' or '=g=' operator expected
140Unknown symbol
141Symbol neither initialized nor assigned
A wild shot: You may have spurious commas in the explanatory
text of a declaration. Check symbol reference list.
257Solve statement not checked because of previous errors
329Wrong suffix on variable reference - allowable are
l level (activity)
m marginal (reduced cost)
lo lower bound
up upper bound
scale variable scale
prior priority for MIP
slacklo,slackup,slack, slack values
infeas infeasibility
looking for a ';' or a key word to get started again
**** 15 ERROR(S) 0 WARNING(S)
COMPILATION TIME = 0.125 SECONDS 3 MB24.2.3 r46072 WEX-WEI
USER: GAMS Development Corporation, Washington, DC G871201/0000CA-ANY
Free Demo,202-342-0180,sales@gams.com,www.gams.com DC0000
**** FILE SUMMARY
Input C:\Users\1\Documents\gamsdir\projdir\Untitled_2.gms
Output C:\Users\1\Documents\gamsdir\projdir\Untitled_2.lst
**** USER ERROR(S) ENCOUNTERED

「经管之家」APP：经管人学习、答疑、交友，就上经管之家！

## 人气文章

#### 本文标题：GAMS程序输入为什么得出的结论与书上不一样

1.凡人大经济论坛-经管之家转载的文章,均出自其它媒体或其他官网介绍,目的在于传递更多的信息,并不代表本站赞同其观点和其真实性负责；
2.转载的文章仅代表原创作者观点,与本站无关。其原创性以及文中陈述文字和内容未经本站证实,本站对该文以及其中全部或者部分内容、文字的真实性、完整性、及时性，不作出任何保证或承若；
3.如本站转载稿涉及版权等问题,请作者及时联系本站,我们会及时处理。