各位坛子里前辈,小弟在国外读书,选秀了GAMS这门课,老师交代了作业,用GAMS做了,出现了一些问题,望各位前辈指教下
题目:
PROBLEMA 8
Una empresa fabrica dos productos que vende en el mercado a los precios de Px = 30 , Py = 50 .
Su función de costes totales es C(x,y)= x²/2 – x + y² -4y + xy , siendo x,y las unidades producidas de cada producto . Hállese el máximo beneficio obtenido fabricando 30 unidades.
Modelo
Max 31x + 54y - x²/2 – y² - xy
s.a x + y = 30
意思是:一个公司生产2种产品,市场售价分别是Px=30, Py=50 。总的成本公式是C(x,y)= x²/2 – x + y² -4y + xy ,x,y 代表二种产品的数量。利润最高的时候是一共生产30个单位。
我写出来的GAMS是这样:
$ontext
Programa No Lineal Restricciones de Iguldad
Problema 8
Max 31x+54y-(x**2)/2-y**2
s.a x+y=30
$offtext
variables
x,y,b;
x.l=30;
y.l=30;
equations
benefi,produ;
benefi..b=E= 31*x+54*y-(x**2)/2-y**2;
produ..p=E= x+y=30;
model PNLRI8/benefi,produ/;
solve PNLRI8 using nlp maximizing b;
运行后有二个错误不知道怎么解决:
错误提示是:GAMS Rev 121 Windows NT/95/98 12/27/09 09:17:19 PAGE 1
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
C o m p i l a t i o n
Programa No Lineal Restricciones de Iguldad
Problema 8
Max 31x+54y-(x**2)/2-y**2
s.a x+y=30
8
9 variables
10 x,y,b;
11 x.l=30;
12 y.l=30;
13
14
15 equations
16 benefi,produ;
17
18 benefi..b=E= 31*x+54*y-(x**2)/2-y**2;
19 produ..p=E= x+y=30;
**** $140
20
21
22
23 model PNLRI8/benefi,produ/;
24
25 solve PNLRI8 using nlp maximizing b;
**** $257
26
27
28
GAMS Rev 121 Windows NT/95/98 12/27/09 09:17:19 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
140 Unknown symbol
257 Solve statement not checked because of previous errors
**** 2 ERROR(S) 0 WARNING(S)
COMPILATION TIME = 0.000 SECONDS 0.7 Mb WIN200-121
USER: GAMS Development Corporation, Washington, DC G871201:0000XX-XXX
Free Demo, 202-342-0180, sales@gams.com, www.gams.com DC9999
**** FILE SUMMARY
INPUT E:\TRABAJOS DE MOST\PROBLEMA 8.GMS
OUTPUT C:\WINDOWS\GAMSDIR\PROBLEMA 8.LST
**** USER ERROR(S) ENCOUNTERED
请知道的兄弟姐妹帮忙看看,不胜感谢