数学建模社区-数学中国

标题: 关于GAMS的问题,小弟询问咯??请大侠释义………… [打印本页]

作者: 随墨枫飞    时间: 2013-5-30 13:16
标题: 关于GAMS的问题,小弟询问咯??请大侠释义…………
非常感谢亲!!请各位一定帮帮忙!!学期作业啊!!!
3 ~  y- l8 v5 b" r) V+ c% c, E我把程序贴在这,
( h. O2 h4 n, T- h1 V0 e$Title A Investment Problem0 E( B4 V3 }, f4 ]# J* m6 Z( N
$ontext! n- y# f! G% _) K
this problem finds a optimized investment that meets
/ T) c2 F( k  l# grequirements in the city
* [0 r# l  C) T2 c+ e( F- \$offtext
/ M8 W# h% b6 d( dSets
  u" _- W% F$ x1 l& G    i  power plants  /plant-1, plant-2, plant-3, plant-4/
/ |/ R1 _6 u3 h    j  operating mode  /mode-1, mode-2, mode-3/;4 f5 p! h; c& n2 K" d& o
Parameters' T+ J9 }/ I: g, Q
    c(i)  the unit installed capacity of power plant i in cases
- ]$ \5 v4 x& k: i3 q/ r5 C% y       /plant-1  10; ]6 |* {) T$ p! \8 j
        plant-2  7
; c) ?' o# i6 D1 t4 r        plant-3  16$ L; @$ a  L( |. E
        plant-4  6/8 a- |, F# I/ Y1 o( e
    d(j)  the electricity demand for power plant i in cases
* `7 V2 y" M/ c+ @       /mode-1  3
6 c& q6 x/ ?) s3 R$ _' a3 ^; _        mode-2  3
2 y) _& i. t' N8 f9 K, c; X        mode-3  2/;
# A  X, r9 a5 v. X) E6 U( vTable f(i,j) the unit operating cost of each power plant
$ Z& D* {" u6 B' G  G! p' O                 mode-1   mode-2   mode-3
5 G' ?' }" ^8 s, D        plant-1   0.4      0.24     0.04  l: @& I0 c4 S; I& s! _  s
        plant-2   0.45     0.27     0.045
0 h% O& S6 a% E9 S& W        plant-3   0.32     0.192    0.032, |5 |; A7 Z: V
        plant-4   0.55     0.33     0.055;2 K3 }( l9 r# x' r3 x
Scalar m the minimum total installed capacity of the four power plant /12/6 d$ n( E* y9 {$ `
       b the minimum tatal investment budget of the four power plant /120/;
' l. s( l+ O4 V. O1 ~; hVariables
5 ^9 ~3 h- U5 a7 n3 v6 O       x(i) the installed capacity of the i power plant in cases
9 {& U6 N4 A: l       y(i,j) the operating lever of the i power plant under the j operating mode% G  q& i6 `  Q
       z the total cost of the four power plant;4 o3 c- I1 b% j& Y7 x
Positive Variable x;( l4 h# i8 P/ v; R" \
Equations- u$ O* {, I- K
       cost           define objective function
3 p; \; v9 D4 R       capacity1(i)   observe total capacity linmit at plant i# s0 u; t  P( `5 a$ ?+ Q$ F2 i
       budget(i)      observe total investment budget limit at plant i
$ \5 i% A+ l/ T8 S) z       capacity2(i)   observe installed capacity for each power plant9 y5 P1 J2 W3 G+ T; e8 j
       demand(i)      satisfy the electricity demand under each operating mode;7 Q: F6 z- }7 @# [  l
cost..            z =e= sum(i,c(i)*x(i))+sum((i,j),f(i,j)*y(i,j));/ D, ?0 c; X3 F; q& Z7 L6 _' J
capacity1(i)..    sum(i,x(i)) =g= m;' \; [0 ?% k3 P7 |+ v9 [
budget(i)..       sum(i,c(i)*x(i)) =l= b;
0 [: f( p& D; F. a: xcapacity2(j)..    sum(j,y(i,j)) =l= x(i);
" f& u" k6 o. i  u9 d, ademand(i)..       sum(i,y(i,j)) =g= d(j);
- A; t( z3 f# N' n1 A. r- hModel investment /all/;- W, g7 [  U6 K3 E& L
Solve investment using lp minimizing z;
4 L* `8 L) C1 l& F9 SDisplay y.l, y.m;2 z, X9 \+ ?& e3 @7 n2 N0 @
- p3 P6 C1 i( _# G7 w. G. J
运行出错的,但是不知道怎么解决,请亲给处理一下哦!!!




欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) Powered by Discuz! X2.5