非常感谢亲!!请各位一定帮帮忙!!学期作业啊!!!5 b$ H/ B+ V. L9 ~3 _3 L2 `! J
我把程序贴在这, ( z- e2 |( k4 b$ J' M: _9 \$Title A Investment Problem& G& I, g+ O/ C0 N d8 M/ @: `' J
$ontext7 u$ [2 F! B9 L+ _4 a
this problem finds a optimized investment that meets9 G( x: ]! n C. b
requirements in the city 3 s5 F" Z a) z1 f" f) p7 g& s$offtext. T% u0 i z, E. ^( X
Sets ' O; P3 a8 t+ y4 M7 U i power plants /plant-1, plant-2, plant-3, plant-4/2 b; k. g, k0 E' b3 R) H
j operating mode /mode-1, mode-2, mode-3/; , s9 b, j7 m0 MParameters5 X+ v: Y5 `. g; K9 J% i7 z( [
c(i) the unit installed capacity of power plant i in cases , g, m* ]2 Z% O" w, W) l7 T: R /plant-1 10 1 q% q1 n# S+ W" o' D) t! i4 ` plant-2 7: s8 U9 r* e; V; @
plant-3 16( f6 F1 m6 i7 a" m- u
plant-4 6/ 1 j7 t' `# n0 P! J d(j) the electricity demand for power plant i in cases, ~1 G( ]# s; @5 R+ h+ {5 D' l4 }
/mode-1 31 f/ ?- f2 \$ _6 b. ?
mode-2 3 8 I n8 A# S/ Y F3 L4 ~' ~ mode-3 2/; ) x0 |6 R. Q0 tTable f(i,j) the unit operating cost of each power plant2 b( W' {: |# r" [0 i/ X" I D7 D
mode-1 mode-2 mode-3) B8 b9 p- f0 b1 y' a
plant-1 0.4 0.24 0.04 + x4 V) I8 Q' {' H- o7 H plant-2 0.45 0.27 0.0454 q+ q0 x" d u$ J
plant-3 0.32 0.192 0.032 5 @ e4 m9 l3 Z' J, V: @8 |7 m plant-4 0.55 0.33 0.055; 3 s/ D! h8 s& v( \* L$ Z( U* ~Scalar m the minimum total installed capacity of the four power plant /12/0 ~0 K1 K$ q" f" Z/ F+ C
b the minimum tatal investment budget of the four power plant /120/; ) Y* n' S+ T' JVariables) a+ D+ R- X: Z. }
x(i) the installed capacity of the i power plant in cases$ ?2 c5 M V) f# c6 Y* s0 Q
y(i,j) the operating lever of the i power plant under the j operating mode! y' P9 [" ]2 W
z the total cost of the four power plant; 4 B% V$ T. V3 Q$ _3 t: IPositive Variable x; $ e# g+ l+ c) e9 }7 oEquations$ s6 T# R$ m- F4 U
cost define objective function ; M2 o6 Q" i5 m& c2 d. C( s1 ?4 E capacity1(i) observe total capacity linmit at plant i # K1 ]: M) ]5 V S( q: \ k# B budget(i) observe total investment budget limit at plant i0 ?5 l$ W7 ^: w) q) l
capacity2(i) observe installed capacity for each power plant 7 b. T- U/ V) j- p3 G Q demand(i) satisfy the electricity demand under each operating mode;, b! M- r* d# e7 ^ n. E4 H
cost.. z =e= sum(i,c(i)*x(i))+sum((i,j),f(i,j)*y(i,j));: k: ~& e( ]4 w v
capacity1(i).. sum(i,x(i)) =g= m;. t2 h4 o# C$ R u3 P0 r. c
budget(i).. sum(i,c(i)*x(i)) =l= b; ) w2 U+ d9 S) ]" [: Pcapacity2(j).. sum(j,y(i,j)) =l= x(i);- A/ I( P) w7 i' v
demand(i).. sum(i,y(i,j)) =g= d(j);; S5 V9 F' e4 N/ ^$ t' `+ f* m
Model investment /all/;9 i4 C2 ~9 t$ \% V* Z/ A7 |
Solve investment using lp minimizing z; ?( Q C9 k2 L& z9 T1 vDisplay y.l, y.m;; L$ Y& Q* p' F