非常感谢亲!!请各位一定帮帮忙!!学期作业啊!!! 6 ?0 m& `; d8 o! k我把程序贴在这,) C) B K. G! a* r) c/ C/ O& G' d3 c
$Title A Investment Problem 4 L( k1 q2 } w& U+ k0 U$ontext+ b* Z- D/ F# Z' }" ]
this problem finds a optimized investment that meets, v/ k6 T# i6 v- t' G' \ E# ~' x
requirements in the city 8 ^6 A7 n+ u O; d* ]# I, O' ^$offtext " w* g- `+ k7 `% nSets1 t3 ~& G1 ~; ~
i power plants /plant-1, plant-2, plant-3, plant-4/- U- D7 ^4 ^9 R$ ?0 a& I$ s
j operating mode /mode-1, mode-2, mode-3/; 0 Z! @+ E5 m# U3 S; n8 IParameters 6 \: \. B4 }2 T" q c(i) the unit installed capacity of power plant i in cases ' M' c8 b2 v1 n$ T6 i /plant-1 10 4 a2 T$ U/ A" U Z9 R0 n plant-2 7 7 j, a: n5 Y( d- i plant-3 16 $ |4 F$ i* B9 v) I. g6 }3 X plant-4 6/ 3 D/ I8 M7 y ]: y) f d(j) the electricity demand for power plant i in cases- ]% p Y# ~: Y* F. {/ X
/mode-1 38 ^# n$ |# k3 D6 j" g
mode-2 31 l& K: r5 G" J) K3 d) c4 W
mode-3 2/;- ^ R* U+ C- a" R+ g; P6 J! i
Table f(i,j) the unit operating cost of each power plant 2 \3 I0 q$ n3 Y3 a0 l1 o+ d7 ]: a mode-1 mode-2 mode-3( ^! H" Q5 X% D/ j( o3 d
plant-1 0.4 0.24 0.04 " H* Q h$ u0 i# g9 _ plant-2 0.45 0.27 0.045 + T: t ~1 M7 X5 d4 q: R plant-3 0.32 0.192 0.032 4 [- d5 w% d d: o; W7 | plant-4 0.55 0.33 0.055;- f' U3 L7 I8 I5 s. u4 M& H6 J. m
Scalar m the minimum total installed capacity of the four power plant /12/6 ]3 H5 ?; Q$ x. W' u9 K
b the minimum tatal investment budget of the four power plant /120/; f/ }0 a u d1 I7 SVariables & r( J! L" g& G x(i) the installed capacity of the i power plant in cases 4 p# k6 M0 `7 o4 e/ P) m1 L g& L y(i,j) the operating lever of the i power plant under the j operating mode 9 v/ o- h5 O* I z the total cost of the four power plant; 2 [7 L( {+ Y) Z6 [( e. ePositive Variable x; ) P4 Y+ B1 _- ]- u! y' ^Equations7 u' `$ r P' v0 s: I7 G% F" p7 x
cost define objective function. @- C v: Q- W; [% G
capacity1(i) observe total capacity linmit at plant i . y, q6 u+ a2 u+ q ]9 s( d; F$ U budget(i) observe total investment budget limit at plant i( {% i2 g5 }& c
capacity2(i) observe installed capacity for each power plant7 ^0 _/ m @ g& d
demand(i) satisfy the electricity demand under each operating mode;3 a- `: y. \4 i. h3 u5 q
cost.. z =e= sum(i,c(i)*x(i))+sum((i,j),f(i,j)*y(i,j)); " N4 L8 o" @7 _2 r' V& ^- xcapacity1(i).. sum(i,x(i)) =g= m;. m( R8 B8 O- o5 Q- e7 @6 s
budget(i).. sum(i,c(i)*x(i)) =l= b; # u& w% W/ m9 H0 e% d* M/ h1 acapacity2(j).. sum(j,y(i,j)) =l= x(i);2 F$ T/ r0 V. r7 E R
demand(i).. sum(i,y(i,j)) =g= d(j); & l6 E6 G9 f, uModel investment /all/; ; E6 E' R5 h% n$ y3 uSolve investment using lp minimizing z; : [+ [6 b/ k/ C/ hDisplay y.l, y.m;: _; F' i8 z! T) Z3 m% Z1 t
9 T. i$ _4 h4 ?( L+ j: \) k/ I
运行出错的,但是不知道怎么解决,请亲给处理一下哦!!!