非常感谢亲!!请各位一定帮帮忙!!学期作业啊!!!5 y. [! E- J7 u4 Y3 D, c
我把程序贴在这, 4 B- r/ q) _8 s$Title A Investment Problem( h4 Y3 z P) z( M S \- d
$ontext : w' s4 C+ `1 v2 X4 \4 g0 L( zthis problem finds a optimized investment that meets 8 v# l4 l7 ?; N8 H* |. h5 prequirements in the city % a% `5 z3 f8 D$ i2 [+ l1 R$offtext - f# F! M7 P# ?5 F) A6 }Sets9 ]( Q: F+ M! A' E; N
i power plants /plant-1, plant-2, plant-3, plant-4/& y3 ~& k2 `% S4 ^* t- n
j operating mode /mode-1, mode-2, mode-3/;4 ]% z% ?& n n4 b5 s, z4 k& G
Parameters9 W" j6 n2 S4 a; m3 J$ ~. O7 W
c(i) the unit installed capacity of power plant i in cases3 A- [% ~$ u6 d
/plant-1 103 x7 w5 g1 j0 i( o; T( w0 b
plant-2 7% ?- K% h5 _" f9 [- s7 B& t1 z" w
plant-3 16 6 v* G* F: [: k$ S/ e5 ?0 ?9 `. H plant-4 6/# m8 N( p4 |- G. V$ r
d(j) the electricity demand for power plant i in cases 4 c- V7 ~7 U5 z2 H8 x |( m1 L /mode-1 36 D! `6 c: r& i" v: a2 E9 r' c
mode-2 32 Q3 {: v! {) c' L4 y7 y' H! x
mode-3 2/; 6 z. E; P8 Q) ^) Q4 y1 m& W/ v; F) T- G% ITable f(i,j) the unit operating cost of each power plant/ r/ u% g0 B8 J/ i" O0 K
mode-1 mode-2 mode-34 w% Y8 {8 f+ n6 l+ E1 v
plant-1 0.4 0.24 0.04' w! `, }" V. s9 N- g4 X8 p
plant-2 0.45 0.27 0.045 2 l; w1 \: Q0 ~+ K plant-3 0.32 0.192 0.0329 B& ^3 N6 A" {! J/ {' d9 i7 b! D ]
plant-4 0.55 0.33 0.055; " K. Q* o0 u; Z% S5 G( nScalar m the minimum total installed capacity of the four power plant /12/9 K6 g b2 O8 _) Q6 A) ?
b the minimum tatal investment budget of the four power plant /120/;7 R# H9 l' S. j! m1 X6 }/ t+ _
Variables ' u0 f+ l. F, u" E8 E, G x(i) the installed capacity of the i power plant in cases4 g2 ?# z5 `8 P0 p
y(i,j) the operating lever of the i power plant under the j operating mode6 K) l C3 e# `# n
z the total cost of the four power plant; 9 o) v R. F& S: t. y8 F; z; N! ~Positive Variable x;6 Y( o; l( q+ G7 e' a, Y
Equations ( d5 {5 ?- N! ? J cost define objective function, K! N: |" M# L k0 D1 L
capacity1(i) observe total capacity linmit at plant i 9 w9 ?+ k" r$ @6 L* I2 \ budget(i) observe total investment budget limit at plant i - S7 q" P- I) J! } capacity2(i) observe installed capacity for each power plant 6 d9 @, k* Q; {) q1 O+ ?. R demand(i) satisfy the electricity demand under each operating mode; ( c) G% L% l$ v' v g8 i6 [cost.. z =e= sum(i,c(i)*x(i))+sum((i,j),f(i,j)*y(i,j)); 7 T+ T6 a1 X$ u$ R/ Fcapacity1(i).. sum(i,x(i)) =g= m;* n! D. K( k2 Y/ s1 b
budget(i).. sum(i,c(i)*x(i)) =l= b;0 v$ V6 t5 t& t3 V7 w
capacity2(j).. sum(j,y(i,j)) =l= x(i);, V! k K ] ]4 [2 ^+ \1 p
demand(i).. sum(i,y(i,j)) =g= d(j);' X8 ~0 h% u/ z7 y6 u- {, p; N
Model investment /all/; % V7 ~* y$ n! B. PSolve investment using lp minimizing z; 7 h2 a( n% V5 F( U: LDisplay y.l, y.m; |/ O2 Z/ D: m5 e4 w ( P T$ }: v2 E0 r+ I9 E+ w6 ~- f运行出错的,但是不知道怎么解决,请亲给处理一下哦!!!