【发布时间】:2021-12-08 03:15:45
【问题描述】:
我有一个想要回答的问题,我写出了每个要求,但我很难在 GAM 中实现它。我对 GAMS 很陌生,不确定每个变量的去向。我哪里错了? enter image description hereenter image description here
Sets
i pump capacity
j pump rate / 1-10 / ;
Parameters
a(i) capacity of plant i in cases
b(j) pump capacity
;
Table d(i,j)
PUMP MAXIMUM (GAL/MIN) COST ($/GAL/MIN) FROM WELL
1 1100 0.05 1
2 1100 0.05 2
3 1100 0.05 3
4 1500 0.07 1
5 1500 0.07 2
6 1500 0.07 3
7 2500 0.13 1
8 2500 0.13 2
9 2500 0.13 3
10 2500 0.13 3
;
Variables
x(i,j)
z ;
Positive variables x ;
Equations
cost
supply(i)
demand(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 ;
【问题讨论】:
标签: gams-math