数学建模社区-数学中国

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

作者: 随墨枫飞    时间: 2013-5-30 13:16
标题: 关于GAMS的问题,小弟询问咯??请大侠释义…………
非常感谢亲!!请各位一定帮帮忙!!学期作业啊!!!
1 G# c& K! J* b6 c2 O( I我把程序贴在这,
# f; P, N# r4 q& E( D$Title A Investment Problem
3 G$ h/ u1 a4 p, O4 i; Q$ontext8 f- y8 R+ o( r  s+ W- F$ Z8 W
this problem finds a optimized investment that meets, v5 [  _* A0 ~- Y2 W" S
requirements in the city
2 }4 H' H4 q9 Q, i0 U: w6 U$offtext
, c5 i  ?7 R  x( ?Sets
: n: e. p) N( K& X& ^    i  power plants  /plant-1, plant-2, plant-3, plant-4/
- a6 s% l. ~5 |4 C    j  operating mode  /mode-1, mode-2, mode-3/;
! S* Z8 v- O, H# U' O$ U+ }4 B) Q, aParameters+ K2 S% s1 B/ q; t: ^
    c(i)  the unit installed capacity of power plant i in cases3 p0 v7 ~* E6 z! o
       /plant-1  10
4 c+ G, i+ m6 _* c& [" F        plant-2  7
6 z3 d. P* J, U        plant-3  16- a; _  |  u" v) V
        plant-4  6/1 L* e2 Z; r! j8 x
    d(j)  the electricity demand for power plant i in cases
# m1 }& J$ G( ]3 T+ i+ E+ `       /mode-1  3% q, f' k1 W# g+ x' ~7 q2 I
        mode-2  3
2 Y1 W1 w2 ^: R/ L        mode-3  2/;
. {5 \+ h5 b- P9 cTable f(i,j) the unit operating cost of each power plant
& n- t4 O' g: X$ }, I                 mode-1   mode-2   mode-3
# [8 S5 g. a1 Y9 V8 t6 x& \. B5 l' c        plant-1   0.4      0.24     0.04
7 Q' d* m! `# n        plant-2   0.45     0.27     0.045
, `. l# h& `( y7 y( T. S        plant-3   0.32     0.192    0.032& r- d7 R5 }/ M
        plant-4   0.55     0.33     0.055;- ^, o4 z; p( X! w
Scalar m the minimum total installed capacity of the four power plant /12/3 _. S  V/ p- r" D) O# K3 ^
       b the minimum tatal investment budget of the four power plant /120/;- [1 r5 B- z, A& x, {9 G
Variables5 l) p  g1 z7 v" g
       x(i) the installed capacity of the i power plant in cases" j1 E: o# f5 L' d5 ^
       y(i,j) the operating lever of the i power plant under the j operating mode
; C+ I. }" X* u3 B+ J4 ]5 h       z the total cost of the four power plant;
8 G3 a+ _+ r' k1 ^Positive Variable x;
$ [8 [% x- f2 i, Z- ]' m* ]Equations' ~0 E8 X. n5 ?+ W! [
       cost           define objective function
0 [. Y" j8 A: L" e! x0 a5 L( M6 O       capacity1(i)   observe total capacity linmit at plant i
- h6 R! s4 ~; G- @% o       budget(i)      observe total investment budget limit at plant i6 p; E0 }+ {1 o8 n
       capacity2(i)   observe installed capacity for each power plant" S/ O: W% x- S+ F
       demand(i)      satisfy the electricity demand under each operating mode;
  j  s2 f5 }, Z* p0 D' X6 {3 fcost..            z =e= sum(i,c(i)*x(i))+sum((i,j),f(i,j)*y(i,j));
. X2 i7 @' D, |" t: Y8 Y! Ycapacity1(i)..    sum(i,x(i)) =g= m;/ H7 k9 Q0 ?( `8 D6 G
budget(i)..       sum(i,c(i)*x(i)) =l= b;$ K5 W* y/ U& j: V
capacity2(j)..    sum(j,y(i,j)) =l= x(i);3 E, ], I8 b* T: L& d
demand(i)..       sum(i,y(i,j)) =g= d(j);- A1 B# B; ?" V
Model investment /all/;3 u& I" g) a& i
Solve investment using lp minimizing z;; h* [6 M5 d. U& x' O( V$ [  P( \
Display y.l, y.m;1 }0 s5 y) e  A9 K
0 h5 x* O  T3 P  U
运行出错的,但是不知道怎么解决,请亲给处理一下哦!!!




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