非常感谢亲!!请各位一定帮帮忙!!学期作业啊!!!% H) C% Y8 Z2 F* W8 E
我把程序贴在这,5 P6 e: Z, \0 L" L1 D& l$ r
$Title A Investment Problem+ g7 M: J6 U" ~7 n* _! }
$ontext% H2 r2 X+ ~$ v4 a' C
this problem finds a optimized investment that meets. r3 P3 V* Q% ^ T
requirements in the city & w/ f- D5 | G$offtext4 ~, y3 [" z: I6 L& S2 J
Sets 9 j. O7 ~; f/ z i power plants /plant-1, plant-2, plant-3, plant-4/$ y6 N" K* u6 K
j operating mode /mode-1, mode-2, mode-3/; T+ D, E) F. H# ?4 \. @
Parameters& A% x% h0 v# }! I" c* P7 D, `
c(i) the unit installed capacity of power plant i in cases . ?! F: |5 {. [+ x: }0 p /plant-1 10 $ m+ L3 m6 n- c! {/ y plant-2 7 ( Y' P) J( u ]0 b plant-3 160 [3 M1 U' ^, t d3 t( P/ ]
plant-4 6/ $ o z. F7 x5 Q* F+ C5 f d(j) the electricity demand for power plant i in cases ' L& @- H2 V7 @- O, D& w+ S3 F6 D /mode-1 3) ~: q8 b) O+ {: ^: t0 f3 L7 K
mode-2 30 ]5 g. q+ e r' O6 y
mode-3 2/;6 `* Y: W4 _; j* U& g: A# t
Table f(i,j) the unit operating cost of each power plant) ^! Z/ V1 G9 |
mode-1 mode-2 mode-3 [9 p8 d% f- P( N plant-1 0.4 0.24 0.049 C8 v& w$ m2 V% J4 w+ q- t
plant-2 0.45 0.27 0.045 U2 E4 X# f- j6 t; b plant-3 0.32 0.192 0.032 1 V* J' s$ c/ Y3 l+ u2 D plant-4 0.55 0.33 0.055; 2 a3 r& u$ {( X% m/ gScalar m the minimum total installed capacity of the four power plant /12/& U& k( x0 k1 Y9 A X
b the minimum tatal investment budget of the four power plant /120/;: f2 i4 T3 X; p C6 k
Variables ' G5 O8 g4 ]& A3 s7 |6 c x(i) the installed capacity of the i power plant in cases: C* ^7 m0 N( R7 l- L- V: z
y(i,j) the operating lever of the i power plant under the j operating mode1 ~$ T* o" }4 B! }+ @5 _4 B
z the total cost of the four power plant; # k, {* s, A5 d+ z6 F. Q4 UPositive Variable x; % A! _/ `8 [/ T, Y: h8 gEquations 4 p" w( E* T5 {% l$ K cost define objective function " H; Y' e5 @+ f" ` capacity1(i) observe total capacity linmit at plant i* f D& n" C. m6 Z: y8 n4 ^# V
budget(i) observe total investment budget limit at plant i ! ?3 L. c; P0 k$ S capacity2(i) observe installed capacity for each power plant : b, |. J4 ]9 J! {& a demand(i) satisfy the electricity demand under each operating mode; / b0 F1 K+ G/ V* W% `1 ccost.. z =e= sum(i,c(i)*x(i))+sum((i,j),f(i,j)*y(i,j));7 K) ]( f+ s4 y! q
capacity1(i).. sum(i,x(i)) =g= m; ; F* T$ P7 G. ?0 Z. v4 vbudget(i).. sum(i,c(i)*x(i)) =l= b;/ a' j0 ~* ^: C) C0 [) ~" V# O' C m/ V9 f
capacity2(j).. sum(j,y(i,j)) =l= x(i); % g( N" G4 l/ e) }8 |% Bdemand(i).. sum(i,y(i,j)) =g= d(j);- m. H7 w9 [) F, A, y( c
Model investment /all/; - A: I3 H/ K* ISolve investment using lp minimizing z; # R8 n5 ~& V% X: ^# ?& L% BDisplay y.l, y.m;% o: Z) \& v1 G8 T+ Y! b
S, o: c( d2 F
运行出错的,但是不知道怎么解决,请亲给处理一下哦!!!