非常感谢亲!!请各位一定帮帮忙!!学期作业啊!!!) u; Z) x4 e, @# d. S) d! l
我把程序贴在这, $ b( }5 j" z9 {- V, I5 W5 S1 J" q7 I" L f$Title A Investment Problem1 f* n) N" G) O% a8 G; F) a" G
$ontext ; D& L0 o/ G# n- j" Cthis problem finds a optimized investment that meets- }( ?% I0 q. n% d, J
requirements in the city: C& X, J* H( S6 A
$offtext . J* E' ]6 M6 ~$ U& k* A5 C" gSets/ w- ?( j, [$ G. F7 ]: s' @
i power plants /plant-1, plant-2, plant-3, plant-4/( o% x' Z- n+ Y v x+ Q- A+ G
j operating mode /mode-1, mode-2, mode-3/; 7 o* l- |; j, s" G& F8 Z7 JParameters% p' i d, q& g+ X& I k2 M( @
c(i) the unit installed capacity of power plant i in cases3 e; l( z, h$ U& ]$ P
/plant-1 108 L" J. e0 e& {* H9 I( {
plant-2 7 9 B! s* J5 @* k4 k plant-3 16 c1 k- i2 C7 k: |9 J' r1 g
plant-4 6/) }" h' }5 [" M. i; q- {
d(j) the electricity demand for power plant i in cases 9 {) b; O5 [3 [% c /mode-1 3 ( q" j- t8 W2 a8 W' X( ?4 O) V& g mode-2 3- `8 {4 S( C3 F( d1 D4 m( I7 K4 S
mode-3 2/;# f" S7 Q5 M7 \8 b
Table f(i,j) the unit operating cost of each power plant, e; ]1 @/ K' B8 ] i7 N
mode-1 mode-2 mode-3 * l1 X+ i1 {( n; w( U$ g" ] plant-1 0.4 0.24 0.04 5 T, b3 l" M+ W8 V: Z4 V0 b4 ` plant-2 0.45 0.27 0.045) Z W6 b, A1 ~, D
plant-3 0.32 0.192 0.032# R$ N9 K; A. r9 W6 l- B
plant-4 0.55 0.33 0.055;" o. G5 P' l) V( m. T8 J" {
Scalar m the minimum total installed capacity of the four power plant /12/ 0 C- _% R' D: ?' j# I. |4 c9 U b the minimum tatal investment budget of the four power plant /120/;2 \' f8 P8 I* e7 F
Variables ! ^- @% I6 h" G9 p$ ]% E x(i) the installed capacity of the i power plant in cases# x0 B- w- `$ U: _. }
y(i,j) the operating lever of the i power plant under the j operating mode , g" O6 _6 B/ K: c( ]! \ z the total cost of the four power plant;9 ^" S2 E+ z& N& X. F& M" y8 n
Positive Variable x; 4 W x" \2 v7 ?) N3 UEquations * `5 _# v$ {* h# ?- V cost define objective function; @5 z6 O' r: V8 Z k
capacity1(i) observe total capacity linmit at plant i% ^5 J! \( o5 y# S; X
budget(i) observe total investment budget limit at plant i # z/ d7 E3 Q; L3 V capacity2(i) observe installed capacity for each power plant& u7 X" g* L4 P* }
demand(i) satisfy the electricity demand under each operating mode;6 I6 I" F( Q& m) u0 ~" J2 {
cost.. z =e= sum(i,c(i)*x(i))+sum((i,j),f(i,j)*y(i,j));; P N7 g2 I3 {8 w. i4 x
capacity1(i).. sum(i,x(i)) =g= m; & T* b8 ] J+ x$ Y: `( Nbudget(i).. sum(i,c(i)*x(i)) =l= b;% Z# j( Z" d! {% g0 t7 J
capacity2(j).. sum(j,y(i,j)) =l= x(i); . d& q% ~" V" @" Wdemand(i).. sum(i,y(i,j)) =g= d(j); , @! h$ a s( O! T: XModel investment /all/;% U T( W3 T3 m6 }; [, N& B" K
Solve investment using lp minimizing z;! M' N+ B A! b
Display y.l, y.m;% _5 _5 N6 [* o