QQ登录

只需要一步,快速开始

 注册地址  找回密码
查看: 2912|回复: 0
打印 上一主题 下一主题

关于GAMS的问题,小弟询问咯??请大侠释义…………

[复制链接]
字体大小: 正常 放大

3

主题

3

听众

26

积分

升级  22.11%

  • TA的每日心情
    奋斗
    2014-9-20 16:56
  • 签到天数: 8 天

    [LV.3]偶尔看看II

    群组2013全国研究生数学建

    跳转到指定楼层
    1#
    发表于 2013-5-30 13:16 |只看该作者 |倒序浏览
    |招呼Ta 关注Ta
    非常感谢亲!!请各位一定帮帮忙!!学期作业啊!!!* S% O. x$ P; f
    我把程序贴在这,
    4 F3 [. L, Q. W$Title A Investment Problem8 C' L* J3 q7 t) [# i
    $ontext
    , d8 t+ ^. f3 @, z5 H  othis problem finds a optimized investment that meets
    ; L; b$ x& G3 Q3 L4 N8 e& F6 k% K3 irequirements in the city/ e7 n1 x) g1 G! K
    $offtext" ^# V4 M9 T  H  Z$ x
    Sets
    2 `* Z7 P7 Y2 x8 ~    i  power plants  /plant-1, plant-2, plant-3, plant-4/9 z* g5 U3 c% V$ l7 Z
        j  operating mode  /mode-1, mode-2, mode-3/;7 W" J- M0 R: K+ m$ q8 N. G) Q* b/ C
    Parameters
    9 T- ?9 Z; h5 S- h- ?' G    c(i)  the unit installed capacity of power plant i in cases2 U* {$ ^# K5 R/ k0 a" c
           /plant-1  10
    & y( Y+ A8 {& H/ p        plant-2  7
    5 n2 e+ V) J0 Y" \1 [$ t  k; Q2 m        plant-3  16
    - w+ l6 K! l6 o        plant-4  6/" s/ s9 E! |, Y3 S& Q5 Z. j% n. B
        d(j)  the electricity demand for power plant i in cases
    ; m% {7 s& d0 b- U5 S6 y4 e6 E       /mode-1  3
    9 ]+ F  A2 e: b& b' C+ |0 T        mode-2  3
    . P5 ]& X9 e# w. q        mode-3  2/;) x! {$ x+ }  y( B8 ]
    Table f(i,j) the unit operating cost of each power plant
    * s3 r5 j/ d$ [. k9 \' n" w                 mode-1   mode-2   mode-3
    2 k: h0 L$ j1 r( U/ {( w/ [) J# n        plant-1   0.4      0.24     0.04
    : [! a/ U& ]6 v        plant-2   0.45     0.27     0.045
    & T( e" v, T! B) b* v% b' x3 g3 y        plant-3   0.32     0.192    0.032
    & N. ~( _! F9 n1 J5 c" w) |" t( y        plant-4   0.55     0.33     0.055;
    5 `8 I" c% E* a) MScalar m the minimum total installed capacity of the four power plant /12/9 l. x" r8 u. B3 a( u, Q( ?
           b the minimum tatal investment budget of the four power plant /120/;
      l% r7 w9 M7 eVariables
    ; I3 w; \# Z/ {: w- B0 g       x(i) the installed capacity of the i power plant in cases( B3 V! r* k! |6 m7 H
           y(i,j) the operating lever of the i power plant under the j operating mode1 K% U# n  s  X
           z the total cost of the four power plant;1 ^% C0 y" L& ?( e, b
    Positive Variable x;
    ; j. W! m5 h: FEquations" K* c3 v8 O- |! T$ Z7 T7 H
           cost           define objective function
    - `# ], c1 y- c) l, ?0 ?       capacity1(i)   observe total capacity linmit at plant i
    + o4 h" p+ C0 h( q7 m       budget(i)      observe total investment budget limit at plant i
    5 }5 b0 f9 D+ z0 X4 @% I2 K0 _       capacity2(i)   observe installed capacity for each power plant* f- \$ |( r. U' b: @+ a  R
           demand(i)      satisfy the electricity demand under each operating mode;
    ; R: M9 l* Y; a0 bcost..            z =e= sum(i,c(i)*x(i))+sum((i,j),f(i,j)*y(i,j));
    ( [9 O6 L* a% o' \; @8 _capacity1(i)..    sum(i,x(i)) =g= m;9 f' z4 ~5 N8 |8 b4 s
    budget(i)..       sum(i,c(i)*x(i)) =l= b;
    ! K" X5 c( }' A; ucapacity2(j)..    sum(j,y(i,j)) =l= x(i);
    . n: I( S6 }8 I- Jdemand(i)..       sum(i,y(i,j)) =g= d(j);% s& W7 H9 H! T  b! j6 Q. ?6 o
    Model investment /all/;
    % L" X* A3 S0 D7 @' S) N8 CSolve investment using lp minimizing z;* g' l2 [7 \% j1 [3 H. z/ S
    Display y.l, y.m;
    * s# T- G4 o; a$ `0 Z, |( Q, V0 h; {# i: N# g
    运行出错的,但是不知道怎么解决,请亲给处理一下哦!!!
    zan
    转播转播0 分享淘帖0 分享分享0 收藏收藏0 支持支持0 反对反对0 微信微信
    您需要登录后才可以回帖 登录 | 注册地址

    qq
    收缩
    • 电话咨询

    • 04714969085
    fastpost

    关于我们| 联系我们| 诚征英才| 对外合作| 产品服务| QQ

    手机版|Archiver| |繁體中文 手机客户端  

    蒙公网安备 15010502000194号

    Powered by Discuz! X2.5   © 2001-2013 数学建模网-数学中国 ( 蒙ICP备14002410号-3 蒙BBS备-0002号 )     论坛法律顾问:王兆丰

    GMT+8, 2026-4-20 01:08 , Processed in 0.295393 second(s), 51 queries .

    回顶部