标题: 关于GAMS的问题,小弟询问咯??请大侠释义………… [打印本页] 作者: 随墨枫飞 时间: 2013-5-30 13:16 标题: 关于GAMS的问题,小弟询问咯??请大侠释义………… 非常感谢亲!!请各位一定帮帮忙!!学期作业啊!!! 9 T. m- k( P; u, I, |我把程序贴在这,/ l9 K7 u) O: e6 z/ O' [
$Title A Investment Problem $ [2 {" R: M$ {& [" [% u0 j9 _$ontext6 P5 q9 W9 A. H' O7 p* N( v$ P+ _
this problem finds a optimized investment that meets6 ]5 v" |" h6 N
requirements in the city5 e, u8 V0 @. U% }
$offtext 2 r6 ]1 u m" A1 g% t# }+ U* YSets" E) `3 `7 n; ~4 k; o( f
i power plants /plant-1, plant-2, plant-3, plant-4/ v+ _* q- A6 J- R3 U
j operating mode /mode-1, mode-2, mode-3/;5 T* Y6 j% Q: H+ A- x0 ^
Parameters* L: N2 d: X4 @+ W# r
c(i) the unit installed capacity of power plant i in cases2 e% S& I' M" P+ }
/plant-1 10 * [" g& J" d: }$ _6 ` plant-2 7% d* T2 p* L" j, U+ X% m
plant-3 16, I6 X# B/ l( _8 [6 C2 n8 F' N
plant-4 6/5 Q/ t7 ]& a! c8 v; l
d(j) the electricity demand for power plant i in cases . j. {3 n! ?6 B. I% } /mode-1 3 T4 R4 a8 d2 K9 D A0 q/ {! ^
mode-2 3 ) k, m# P# f) E4 ?. V. @/ k mode-3 2/;/ [4 f. n6 ]' l
Table f(i,j) the unit operating cost of each power plant 7 y; j- y2 M2 { mode-1 mode-2 mode-3 $ E" f7 T+ v% ]& m- v5 F7 N% i plant-1 0.4 0.24 0.04 ( u8 K+ s2 Z6 x* w3 L plant-2 0.45 0.27 0.045+ h8 L/ w2 h: d9 R/ o
plant-3 0.32 0.192 0.032% w; R0 | @) R8 A) R' v$ K
plant-4 0.55 0.33 0.055;; f1 b3 w7 N r3 ]2 L0 c+ X" a
Scalar m the minimum total installed capacity of the four power plant /12/ 9 v; z( K8 ^3 b; s" R b the minimum tatal investment budget of the four power plant /120/;- z- [1 k/ b: @5 f
Variables 0 S+ M6 T7 f, t' i4 C8 D4 a x(i) the installed capacity of the i power plant in cases + \, E- W& I" F' q y(i,j) the operating lever of the i power plant under the j operating mode / c @. R8 U5 M7 U2 i z the total cost of the four power plant; ; @* S" y7 s! U2 yPositive Variable x;& {* ^3 h; [8 J( c8 {9 U
Equations $ `) R; d T6 w cost define objective function * ~0 T/ ~- j2 x' Z( c |0 }7 V. f [ capacity1(i) observe total capacity linmit at plant i + S1 x* Q3 h, q/ y; O) ^5 |0 t# g& ~) L budget(i) observe total investment budget limit at plant i : E* \! g# J) ]0 [- Q; n7 P/ ~6 W k capacity2(i) observe installed capacity for each power plant: |- Y7 K0 h0 |0 V: A Z
demand(i) satisfy the electricity demand under each operating mode; ( M9 M/ x' x3 g! mcost.. z =e= sum(i,c(i)*x(i))+sum((i,j),f(i,j)*y(i,j));$ U$ J: A# a' @3 E6 o- q
capacity1(i).. sum(i,x(i)) =g= m;! F- V4 t4 S* Q' V
budget(i).. sum(i,c(i)*x(i)) =l= b;" `2 K1 h& `( p3 o+ g
capacity2(j).. sum(j,y(i,j)) =l= x(i);8 J# o0 v& j$ [, q" O6 r8 y* i
demand(i).. sum(i,y(i,j)) =g= d(j); 9 s8 l" w" H1 e' p M, HModel investment /all/; " `+ N6 l% U5 u1 a7 E" hSolve investment using lp minimizing z; ( [" g; R( M$ B! c* k8 z) U! u) H- l. wDisplay y.l, y.m; 7 A( o/ s- D: |. Q6 c6 R / _! G) y, q9 } b+ L+ o( {6 K" ~& F: Y运行出错的,但是不知道怎么解决,请亲给处理一下哦!!!