非常感谢亲!!请各位一定帮帮忙!!学期作业啊!!!- Q/ t& w1 E8 l& x6 P1 R
我把程序贴在这,+ L% P+ B' Q( i5 j, t) {
$Title A Investment Problem ; a+ j1 c( V2 J/ Q: Y/ F$ontext1 R8 J. c5 u1 C3 y' t! `
this problem finds a optimized investment that meets- G# d; D8 Q N& H" j. k
requirements in the city6 T" k- q$ T9 a& U8 _1 E; }
$offtext) S+ f0 N. j) g) p0 ]( y8 N( H. ^% X
Sets3 M! M: U. w6 I' V; v$ @
i power plants /plant-1, plant-2, plant-3, plant-4/ 3 I6 d! }3 {: `" A* E j operating mode /mode-1, mode-2, mode-3/; 6 r% Z S6 e" f0 V6 BParameters * b' |$ m* E: d9 O3 T' s c(i) the unit installed capacity of power plant i in cases+ {4 z+ J* q2 h/ {) D8 i
/plant-1 10 , \" r( K2 u- g% z! z$ ?2 |( p plant-2 7* G8 _* R3 V7 f. Y, D& V* k6 Z6 r
plant-3 16/ w- ~# ?0 r9 J
plant-4 6/8 E" l$ l) _: Z3 R( {: n
d(j) the electricity demand for power plant i in cases, }- f6 E7 y- l* _
/mode-1 3 ! n1 T# \3 x! q mode-2 35 e) S$ l$ `7 e. u, f: S
mode-3 2/; " \( r' j5 X4 q* u' V: b/ @$ WTable f(i,j) the unit operating cost of each power plant, j( |7 N$ y" l9 Q
mode-1 mode-2 mode-3 2 D2 t7 g1 N: W& i1 V4 B' T7 g plant-1 0.4 0.24 0.04 0 \& p4 j2 g. b& x+ t* V plant-2 0.45 0.27 0.045 1 [$ H n! k& Q, X/ ^" ~9 s' u+ C plant-3 0.32 0.192 0.032* i- a0 ]# _& Q
plant-4 0.55 0.33 0.055; " z) w( @& m% U! B6 vScalar m the minimum total installed capacity of the four power plant /12/+ F( @; ^! C/ S5 E; n* n9 I ^% B
b the minimum tatal investment budget of the four power plant /120/;% o7 ?# u" Q P9 X- {
Variables " |7 c* f* p( i) T6 N; N x(i) the installed capacity of the i power plant in cases % a; f% ~: S# _) ^4 F2 {7 i% d y(i,j) the operating lever of the i power plant under the j operating mode& P; I' t. k9 `( {3 Z$ u5 Q* _ f
z the total cost of the four power plant;% V+ i y2 u& J9 V" U5 L% A
Positive Variable x;) `8 C% ~2 I5 W# O% ^
Equations + s( \) g+ A) J9 A1 _- Z- I cost define objective function- w/ ^3 `8 G* M) v4 A) B1 ^9 _) P
capacity1(i) observe total capacity linmit at plant i * h8 J; W5 P! ]5 q budget(i) observe total investment budget limit at plant i , f" a; H F0 j capacity2(i) observe installed capacity for each power plant R& H5 Q: W6 i
demand(i) satisfy the electricity demand under each operating mode; $ u; n2 U ~& b0 t# `; T9 Scost.. z =e= sum(i,c(i)*x(i))+sum((i,j),f(i,j)*y(i,j));1 a6 i( N1 }% y- B7 b
capacity1(i).. sum(i,x(i)) =g= m;3 F, W% d/ F3 q% {, ]# t( M
budget(i).. sum(i,c(i)*x(i)) =l= b;' X+ |' Q2 @8 [2 q' g5 X! G* K
capacity2(j).. sum(j,y(i,j)) =l= x(i);8 I. B% }& b7 t$ C! P9 O/ J8 [, T" J
demand(i).. sum(i,y(i,j)) =g= d(j);, X( a- x$ |: [. q9 a
Model investment /all/; ( G5 H' h2 }, ]1 r( f9 Y* M( eSolve investment using lp minimizing z;$ V' T1 `9 Y O- {7 u- k5 E `
Display y.l, y.m; 1 Z# R# B) ]; l# F ; J8 `5 q2 ^* K; e- H6 {4 I运行出错的,但是不知道怎么解决,请亲给处理一下哦!!!