非常感谢亲!!请各位一定帮帮忙!!学期作业啊!!! ! p5 E& F' f% `1 ~1 \/ x$ c# }我把程序贴在这,& I7 {: }" a& E
$Title A Investment Problem 2 O- P# n7 |* u# T: ?$ontext; e8 U/ e: i8 Y, e5 y
this problem finds a optimized investment that meets . W& z- x o% h @5 k# C! Vrequirements in the city% f% n4 ]4 x' R2 t2 Z. E
$offtext $ b0 `4 j0 |. c) a7 H: jSets, z5 S. K' v& n) q2 }' p
i power plants /plant-1, plant-2, plant-3, plant-4/ + s, Y0 `8 f2 f" X# C1 v' ] j operating mode /mode-1, mode-2, mode-3/; 8 e4 T$ M5 }2 n0 ~. z) yParameters 8 r" t* s+ |' @) y& D c(i) the unit installed capacity of power plant i in cases / a6 a0 Q6 Z) y! d, C) m /plant-1 10 0 x9 P6 o6 I. k, z0 n9 e( s$ i plant-2 7- @* J9 k/ z! L$ e1 T: e
plant-3 16 # C' K# ~& Q# d- }& p- G7 S5 ~2 } plant-4 6/- M# v/ t' a* [ L; U. `3 {( C( ^
d(j) the electricity demand for power plant i in cases$ s8 K& Q' b! F' r
/mode-1 3: f0 |/ X) Z) O+ E, o; N
mode-2 3 $ V$ n: }2 ?# ^ B; U mode-3 2/; 7 t0 o7 b+ B9 h% z8 ATable f(i,j) the unit operating cost of each power plant/ ]- ~' G5 q; N( T
mode-1 mode-2 mode-3$ {$ K. Y9 Y v/ _
plant-1 0.4 0.24 0.048 u" v$ E2 i5 x7 o# {2 _
plant-2 0.45 0.27 0.045 5 n4 w6 s- m3 K6 S plant-3 0.32 0.192 0.032 : n9 R" a* x5 Y plant-4 0.55 0.33 0.055; 5 N/ H4 g$ s2 i* C" U0 IScalar m the minimum total installed capacity of the four power plant /12/ # }( \: Q. b U3 T' ? b the minimum tatal investment budget of the four power plant /120/;, E0 V2 h% O- K+ G" \
Variables2 U2 l( Y) B! s! s/ F
x(i) the installed capacity of the i power plant in cases8 e) m( E+ q* k. a) Z% ~
y(i,j) the operating lever of the i power plant under the j operating mode, o6 |/ y; h$ H% R: h
z the total cost of the four power plant;8 ]* d$ H; h' u! c: L
Positive Variable x; 3 E$ I+ \/ Z3 F7 D C2 IEquations , s8 c) O2 a, ]- L5 _( }1 O cost define objective function( l- }0 ?- B9 }" C% @1 {' h2 T( l% w
capacity1(i) observe total capacity linmit at plant i 8 P+ R4 \0 w7 N" b* Q' g budget(i) observe total investment budget limit at plant i$ M4 z$ J9 O0 G, T$ ]
capacity2(i) observe installed capacity for each power plant : X7 L. _2 E* H! M$ }/ e demand(i) satisfy the electricity demand under each operating mode; $ _( A2 y- `1 s$ Z- Ecost.. z =e= sum(i,c(i)*x(i))+sum((i,j),f(i,j)*y(i,j)); : F( [5 B b4 S4 O% c! o6 C( Pcapacity1(i).. sum(i,x(i)) =g= m; & H3 t9 A7 u) o& e2 fbudget(i).. sum(i,c(i)*x(i)) =l= b; * ^( B0 E) a7 W: I- T) scapacity2(j).. sum(j,y(i,j)) =l= x(i);. k) W7 ]& ]' [" Y3 _4 \3 ^
demand(i).. sum(i,y(i,j)) =g= d(j); 3 k6 D1 L. h6 ~; OModel investment /all/; + `! N9 C$ Y" n8 Z+ @0 ]Solve investment using lp minimizing z; " V& Z |. f. I, k8 N ]Display y.l, y.m; + N2 o, t# x' X0 m W & @- G# o) y a运行出错的,但是不知道怎么解决,请亲给处理一下哦!!!