数学建模社区-数学中国

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

作者: 随墨枫飞    时间: 2013-5-30 13:16
标题: 关于GAMS的问题,小弟询问咯??请大侠释义…………
非常感谢亲!!请各位一定帮帮忙!!学期作业啊!!!' b" e: c; b9 x7 B
我把程序贴在这,# t$ n) k. l- C3 I: v3 \
$Title A Investment Problem1 V' ?% ^& W6 c  m5 S* ]
$ontext0 H" l6 e( a. m
this problem finds a optimized investment that meets% w( b2 z/ R5 o3 {1 W- ?
requirements in the city+ g1 w2 U' s+ W
$offtext4 t  g8 i- Z9 w
Sets, m* v" ]( t, Z& n
    i  power plants  /plant-1, plant-2, plant-3, plant-4/
7 ~0 O: N6 g9 o; K; c, n    j  operating mode  /mode-1, mode-2, mode-3/;4 z* A; i' U3 @; F: v
Parameters
, I' C/ P! W# |    c(i)  the unit installed capacity of power plant i in cases
) h2 w" f8 m6 m       /plant-1  10( t; u  I  q3 n5 G6 p$ m6 a* L
        plant-2  7
- L1 V2 G* }, R7 ?        plant-3  16  L- t. U# i$ E
        plant-4  6// D7 F  J) Q9 {% l5 g! c6 C
    d(j)  the electricity demand for power plant i in cases+ d+ |4 D5 z  N8 e
       /mode-1  3
# }# K+ r8 Z3 g2 U- M) U        mode-2  3
" `; @: [# T' S2 B        mode-3  2/;2 U' L$ {! v/ J3 V8 p
Table f(i,j) the unit operating cost of each power plant
. K- ~+ H( l: ^! s& X4 J: S                 mode-1   mode-2   mode-3& L1 X* ]/ K% n, U( e  P
        plant-1   0.4      0.24     0.04& ~* G( p' N+ C& L. p6 x! r0 Z
        plant-2   0.45     0.27     0.0458 _3 v: @$ ~! I+ j$ G. O
        plant-3   0.32     0.192    0.032% ]# A: r1 B, {4 c3 P5 g3 p6 x
        plant-4   0.55     0.33     0.055;/ r: P( Z3 w2 o& Z
Scalar m the minimum total installed capacity of the four power plant /12/+ `" R: V" P" y* j7 d, d; E% d
       b the minimum tatal investment budget of the four power plant /120/;
# S! k  u# u% x/ F+ P* }Variables/ c+ m0 |: `7 ?' u; B9 O
       x(i) the installed capacity of the i power plant in cases
0 E4 M/ [$ a  M! z       y(i,j) the operating lever of the i power plant under the j operating mode1 j7 h+ F5 v& t: X
       z the total cost of the four power plant;& [$ S4 E; r/ {6 j9 U  |% F
Positive Variable x;$ f! k/ d2 M1 z. f
Equations- w" v5 \/ B3 S' h
       cost           define objective function
" g6 X2 _$ I9 u4 f; Q5 _# E% n       capacity1(i)   observe total capacity linmit at plant i
9 L" F! V; Y5 w4 N       budget(i)      observe total investment budget limit at plant i8 s! n) B3 m; z
       capacity2(i)   observe installed capacity for each power plant9 K1 r( p# O0 F( U% z! Z- M# i
       demand(i)      satisfy the electricity demand under each operating mode;
* n% Y! `) O! A0 O, ucost..            z =e= sum(i,c(i)*x(i))+sum((i,j),f(i,j)*y(i,j));  I5 Q2 m; Z) ^
capacity1(i)..    sum(i,x(i)) =g= m;
- b* y4 B6 Z7 I$ r& A% Rbudget(i)..       sum(i,c(i)*x(i)) =l= b;  |; l3 v% f/ k& {  p: I  y% T8 H. ^
capacity2(j)..    sum(j,y(i,j)) =l= x(i);, K- I/ h! \" e! e: F2 f1 v, X6 r+ h6 f6 }
demand(i)..       sum(i,y(i,j)) =g= d(j);1 r& T5 M" ?# z2 f. L; R/ |2 w
Model investment /all/;
( V: i" U/ w! uSolve investment using lp minimizing z;
- O3 E3 l/ s4 k  d' ODisplay y.l, y.m;
& D1 N9 V0 P) U
* b" \2 W/ L% f9 `5 O* r运行出错的,但是不知道怎么解决,请亲给处理一下哦!!!




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