非常感谢亲!!请各位一定帮帮忙!!学期作业啊!!! O/ \. h3 y. [; t我把程序贴在这, 3 \% a: [& z3 z- J$Title A Investment Problem* j+ e0 s6 f6 r* }: u- W
$ontext 5 I8 K- @) z8 g0 _ m N0 A5 _/ uthis problem finds a optimized investment that meets4 c; x: h7 t x3 b( n8 L
requirements in the city 7 P+ d' c1 c$ P X1 w2 m6 G$offtext . E/ g( `. C$ HSets 8 x+ Z1 O0 Z/ [; b$ d. F+ i m i power plants /plant-1, plant-2, plant-3, plant-4/ - E+ R2 v8 k3 b K j operating mode /mode-1, mode-2, mode-3/;: Z8 K. F3 V) f& }3 z- \
Parameters1 _( C7 E g: R7 l, F1 G8 M
c(i) the unit installed capacity of power plant i in cases; ~3 K# b O1 z0 C, A& N |
/plant-1 105 T, T) | f! L A/ T
plant-2 7 / c, u3 c }0 @4 i. H plant-3 16 / e' L) C, W4 f. `( R plant-4 6/ ( w" u. N5 A7 R! N% Q0 w& v3 N d(j) the electricity demand for power plant i in cases # m6 B) v7 v) K9 t6 {5 Y6 H0 D% V, ] /mode-1 3 # Z3 D, F8 ^% x- [0 _ mode-2 3! C( e. J9 I5 m5 H
mode-3 2/;7 M& R" D3 O" m$ f6 c
Table f(i,j) the unit operating cost of each power plant3 I4 `/ c' R% G& g& R
mode-1 mode-2 mode-3- o w) Z, q* R$ \: p/ d
plant-1 0.4 0.24 0.04$ X" o, _( R5 L# S8 w# N" U
plant-2 0.45 0.27 0.045 1 U# V; z" X- a! s/ J' [ plant-3 0.32 0.192 0.032 8 Y T- l# r9 |: T) A0 G f! X plant-4 0.55 0.33 0.055;) R- S- d1 B, M; y1 b
Scalar m the minimum total installed capacity of the four power plant /12/ 4 L: k2 J: r2 @7 L) {: v b the minimum tatal investment budget of the four power plant /120/; m, A- e/ X- k/ w" Y9 k
Variables 0 z |: ^; {0 o$ w: `. V9 a x(i) the installed capacity of the i power plant in cases5 F5 _! B. @0 E8 {
y(i,j) the operating lever of the i power plant under the j operating mode5 v5 ]; J! C c, N9 u
z the total cost of the four power plant; ! H1 m3 y* {- m, W8 o3 rPositive Variable x; 0 X9 U p6 `. ^: S6 ^- ^& E% sEquations 9 c5 V0 F/ |7 ?, t7 b ~- a cost define objective function . o$ V9 H O# @; a5 i8 s+ o capacity1(i) observe total capacity linmit at plant i : f" k! M& d( _, \: l0 Z budget(i) observe total investment budget limit at plant i9 t/ X0 g7 Q9 l$ I% V1 `% J u
capacity2(i) observe installed capacity for each power plant& r; g- M9 o8 F# e' z' `3 K
demand(i) satisfy the electricity demand under each operating mode;9 S9 A3 x$ }4 y) l# r* A
cost.. z =e= sum(i,c(i)*x(i))+sum((i,j),f(i,j)*y(i,j)); 5 J- \0 k& q- t* Q5 h( Q! vcapacity1(i).. sum(i,x(i)) =g= m;: P$ l$ e4 M& o! F, W
budget(i).. sum(i,c(i)*x(i)) =l= b;1 u/ L4 Q1 S; b, Q& N* u
capacity2(j).. sum(j,y(i,j)) =l= x(i); 2 [ M7 P) Y2 @ U2 Qdemand(i).. sum(i,y(i,j)) =g= d(j); V7 o+ W: N4 w- ^. o3 ?2 T# TModel investment /all/;* _: ~6 X* F1 A2 k; ]+ t/ @* @
Solve investment using lp minimizing z; 2 v/ b7 v- S1 C, v0 dDisplay y.l, y.m;# p% _) Z7 w8 O+ i) G M