非常感谢亲!!请各位一定帮帮忙!!学期作业啊!!!0 L& }& Y1 O9 P9 {( p
我把程序贴在这, - D/ N% N7 q6 Q$Title A Investment Problem- a( S! ]3 C9 o6 u" V5 A, W
$ontext * `: }8 A) N) C8 f6 Qthis problem finds a optimized investment that meets. C& E; t3 q8 s% ^: g' ]( p
requirements in the city 0 i4 w4 w- f% f$ Z; i# B1 ]- S$offtext ; J# [8 c1 L {$ e9 F7 SSets ; K1 Q* | i/ @9 V5 p; o i power plants /plant-1, plant-2, plant-3, plant-4/0 |& K! M6 k' h% G- g2 Q6 o3 ~
j operating mode /mode-1, mode-2, mode-3/;+ c: z$ o2 e" T9 k6 S; }2 E* M& ]
Parameters & W2 T& R9 y8 l, } c(i) the unit installed capacity of power plant i in cases 1 M% W5 x+ J4 i/ J3 g. Z/ k) Y /plant-1 10 8 @! ?, d9 d2 Y8 G5 E plant-2 7% l% |4 j* m5 ^3 Q/ t2 m" R+ h
plant-3 16! Z) @; W3 K2 u' E3 R
plant-4 6/ ]& \" Z$ W) h' H' {! J
d(j) the electricity demand for power plant i in cases! i) `+ S" W/ y3 `
/mode-1 3 8 `8 g/ ~3 f. N9 p' u n mode-2 3 4 ^7 ^7 W. k8 g mode-3 2/;0 u, f, P0 a" e! c3 |
Table f(i,j) the unit operating cost of each power plant! l" x1 [2 ?. N% Z3 F7 }
mode-1 mode-2 mode-38 L# p$ A) v r* n" |3 `% @2 a1 B
plant-1 0.4 0.24 0.04 ) F0 g4 G9 h1 a+ x! u* i plant-2 0.45 0.27 0.045# B: {$ B& f9 I- P9 v
plant-3 0.32 0.192 0.032. H- P) q3 g3 i! d* X% _4 k
plant-4 0.55 0.33 0.055; : z2 y( D7 q$ h: G. EScalar m the minimum total installed capacity of the four power plant /12/# f1 `6 f8 S! _, j+ u9 O% G) ^
b the minimum tatal investment budget of the four power plant /120/; 3 W0 V( \$ b3 W8 _7 X5 b( c9 ZVariables2 P: B2 N" t( _. x
x(i) the installed capacity of the i power plant in cases9 _. g( n( j# H$ b3 d
y(i,j) the operating lever of the i power plant under the j operating mode * ?* q0 D3 c) J. i3 H z the total cost of the four power plant;7 Z- \! O0 e; z6 z
Positive Variable x; * r6 Y& d/ _1 o/ m, k1 [Equations 3 m D# p ^( r9 i1 s% G) u cost define objective function q9 c( W, ^) a5 z6 p
capacity1(i) observe total capacity linmit at plant i " Z2 J0 E4 e" R) r budget(i) observe total investment budget limit at plant i P. C: H1 O: P$ N capacity2(i) observe installed capacity for each power plant+ Q2 I }: [$ O. e0 U' l/ N" l6 X3 O
demand(i) satisfy the electricity demand under each operating mode;8 u+ o) e) {$ G3 I
cost.. z =e= sum(i,c(i)*x(i))+sum((i,j),f(i,j)*y(i,j));. n& S; |. Q; u% T; F
capacity1(i).. sum(i,x(i)) =g= m; ! p- k$ A O: N0 I2 Y8 w9 S1 ]budget(i).. sum(i,c(i)*x(i)) =l= b; 2 o) C3 k2 t- N5 ]6 Rcapacity2(j).. sum(j,y(i,j)) =l= x(i); 8 ^% W" c2 v3 P: N( B" I7 odemand(i).. sum(i,y(i,j)) =g= d(j);# d5 S- N2 F/ o D8 ]6 g
Model investment /all/; . S5 {' Q2 V N, ISolve investment using lp minimizing z;6 P" b( E: K$ }" |. p9 A
Display y.l, y.m;1 d0 u u8 R# N% `/ V. O( |% |