非常感谢亲!!请各位一定帮帮忙!!学期作业啊!!! % }) N* l8 F& y/ }3 v我把程序贴在这,# j- ?3 i4 T- Q, g
$Title A Investment Problem3 Z! l7 w2 L% P2 c1 R3 h5 R
$ontext 1 `" X! U: k- i. Z( F% |9 ythis problem finds a optimized investment that meets # A: [! ]$ r. {8 {requirements in the city 1 n, |. L1 x h, N5 D0 p$offtext ' W+ j3 k3 t) S( g0 fSets . J- ]* ?* o( D* \ i power plants /plant-1, plant-2, plant-3, plant-4/ + X' d2 V: d2 {+ Q7 D8 z j operating mode /mode-1, mode-2, mode-3/; $ b/ x' m! Q4 j6 N- fParameters3 S5 w% `9 b3 b2 i
c(i) the unit installed capacity of power plant i in cases $ J/ S& Q! \1 C. s& K /plant-1 10' ?$ z/ C8 D0 }
plant-2 7# |7 {! O5 W& m: A1 c( P! l
plant-3 16) Q& P4 P! \- V& e
plant-4 6/7 P# c& u% f a: b# V8 s
d(j) the electricity demand for power plant i in cases $ O4 X! M9 _, L- I# B# v. b* y /mode-1 31 Y9 H: p$ u8 i `5 y5 ~
mode-2 3% t1 d4 z5 q! L# p& @; k3 t/ y! S
mode-3 2/;" l; d- C/ H9 S6 M+ B+ l
Table f(i,j) the unit operating cost of each power plant ; `8 `! Y, y7 x& D U mode-1 mode-2 mode-3+ o3 u% {6 t) @" Q0 F( m! ?) y2 C
plant-1 0.4 0.24 0.04 4 n$ a& B1 M6 x% L2 C! E plant-2 0.45 0.27 0.045( K' P6 @7 U0 ~1 C; t# _
plant-3 0.32 0.192 0.032# C" u x6 ~9 h/ w# D9 [! g. J
plant-4 0.55 0.33 0.055; ! {" x4 u, u B! Q2 l" lScalar m the minimum total installed capacity of the four power plant /12/& c: g! W/ h) ~: a
b the minimum tatal investment budget of the four power plant /120/; $ Q4 |% G7 A! G, ~* N* ?Variables2 U9 } U5 g) \3 Q
x(i) the installed capacity of the i power plant in cases 1 M6 ], f1 g3 f: o/ ` y(i,j) the operating lever of the i power plant under the j operating mode 6 m6 b) P5 C' i) y* b' N z the total cost of the four power plant; ' Z& r) o* A0 D: k( mPositive Variable x;. I( i2 b0 `* p& Q4 p
Equations/ M; K! g4 b d5 V" I: |
cost define objective function ( ~8 y/ H- [8 Y; A9 \+ ~+ R, _ capacity1(i) observe total capacity linmit at plant i 1 `# y) k0 R5 H# `. r3 H! b budget(i) observe total investment budget limit at plant i ! M" u/ j0 p! R& Y. l; G( [ capacity2(i) observe installed capacity for each power plant - [/ {2 u$ Y) D2 n: _ demand(i) satisfy the electricity demand under each operating mode; u) e1 v4 S3 c6 H, V! p5 Y
cost.. z =e= sum(i,c(i)*x(i))+sum((i,j),f(i,j)*y(i,j));' `, V% V4 n7 T/ ^9 Z
capacity1(i).. sum(i,x(i)) =g= m;, r% i- A2 V- Y6 `/ R0 Z5 D
budget(i).. sum(i,c(i)*x(i)) =l= b; W a' s. S1 F6 Q) b
capacity2(j).. sum(j,y(i,j)) =l= x(i);: j: w3 i. E/ m' @% \# ^0 H
demand(i).. sum(i,y(i,j)) =g= d(j);9 P- ?2 X1 F$ `) M& n
Model investment /all/;7 _+ {* A# H4 l( v
Solve investment using lp minimizing z;9 y& k; Z% S$ V3 X8 r( f
Display y.l, y.m;: F9 Q5 j1 h( a9 i0 R) |+ r