非常感谢亲!!请各位一定帮帮忙!!学期作业啊!!!/ }1 e) F/ O% M( X
我把程序贴在这,4 n5 ~' C. l7 b _6 Q
$Title A Investment Problem5 m5 ?1 y, J2 Z/ C d q/ s
$ontext . ^, m9 Q. n5 W( W; \! Othis problem finds a optimized investment that meets 6 z+ w' B- S) f2 L# X" arequirements in the city - _% I5 g# `$ E# h2 O$ g$offtext , g& J( f1 E7 @+ v8 G$ b: ZSets 6 t+ E9 j" E* i9 \& V i power plants /plant-1, plant-2, plant-3, plant-4/7 o% U9 {/ d. x% J: u1 E/ Z; K
j operating mode /mode-1, mode-2, mode-3/;% t! n1 U& x+ I1 ^ F& K2 ?
Parameters ' W% h4 {' q: M5 ~& @& H c(i) the unit installed capacity of power plant i in cases0 `7 L4 D% e5 Z2 A) b
/plant-1 10 " N1 E4 ~# N" f/ C+ E plant-2 7 : C! U, J0 O f* X; T; v) O, F plant-3 16 6 C& p( @4 P! k) R plant-4 6/ # H1 ~: K: Z4 C d(j) the electricity demand for power plant i in cases& ^6 P1 i% ]) n1 K3 S: F
/mode-1 36 V* g+ i/ M0 t2 s6 Y
mode-2 38 R5 [" S3 @* q
mode-3 2/; `6 R% R9 d, W: U
Table f(i,j) the unit operating cost of each power plant - M6 t! u& g9 P9 _; ^ m mode-1 mode-2 mode-3 0 U Y( v7 [, W4 ~ plant-1 0.4 0.24 0.04* a$ f- X+ ]+ y0 F( R) d; C7 q
plant-2 0.45 0.27 0.0450 q' |. K. X- S- y5 A, ^! s8 U
plant-3 0.32 0.192 0.032; d+ M4 `2 F3 M
plant-4 0.55 0.33 0.055; : N( R4 ]) R5 Z6 [7 wScalar m the minimum total installed capacity of the four power plant /12/ ( C" o5 W6 F9 x b the minimum tatal investment budget of the four power plant /120/; 6 l7 {& \& O2 b" ~Variables7 U, d. y5 a. Y
x(i) the installed capacity of the i power plant in cases, v Y9 _* w+ d- }
y(i,j) the operating lever of the i power plant under the j operating mode/ V$ c3 K; Y/ R' g0 j
z the total cost of the four power plant; / l! u' O2 N+ V: G6 m+ X4 BPositive Variable x;7 ?6 s/ o, m: C) V- h b8 C6 G
Equations 7 r% h) J% ^( i: r, I ~ cost define objective function4 I) `7 |% t0 x1 t
capacity1(i) observe total capacity linmit at plant i % N$ A, x2 G6 F$ t5 z0 J budget(i) observe total investment budget limit at plant i 3 b3 |/ J6 C: d8 S capacity2(i) observe installed capacity for each power plant4 i6 ]6 {. m& m9 V' T( n8 l6 K
demand(i) satisfy the electricity demand under each operating mode; 4 x$ p% O& B" z. [( Z Tcost.. z =e= sum(i,c(i)*x(i))+sum((i,j),f(i,j)*y(i,j)); ( r! `* z/ a. Tcapacity1(i).. sum(i,x(i)) =g= m;5 k; y6 ~* E0 k( F G3 _5 p Q
budget(i).. sum(i,c(i)*x(i)) =l= b; / H! l/ w) s" Jcapacity2(j).. sum(j,y(i,j)) =l= x(i); % i. X- ]( }' E; I- C" vdemand(i).. sum(i,y(i,j)) =g= d(j); * {" }* Y. @' u6 PModel investment /all/; + e7 t3 ~6 f4 u u: T; b% CSolve investment using lp minimizing z;! F& p- ?0 n# _+ [: s+ i
Display y.l, y.m;: K) x: }8 q. @& ?3 y0 d