非常感谢亲!!请各位一定帮帮忙!!学期作业啊!!! w* J! D6 _7 j
我把程序贴在这, o! F( {: t, {3 x$Title A Investment Problem9 C9 F3 }( l; E
$ontext & c3 G( ]; w) b @1 X/ [6 Mthis problem finds a optimized investment that meets B3 g! E; ~: t+ F* v: b M
requirements in the city : M% R8 [& v9 D; P7 l4 N$offtext: c, Y1 v: S7 g" }
Sets M4 j5 y& @( M) p i power plants /plant-1, plant-2, plant-3, plant-4/& j9 ?& x- N& p) e/ k' M ]
j operating mode /mode-1, mode-2, mode-3/; 1 y+ _ z, w y8 A: r4 e! W9 X4 IParameters* v. `" {0 ]# ~: L, m9 v
c(i) the unit installed capacity of power plant i in cases 2 p8 P3 k! F* t2 P/ q /plant-1 108 a* q% k5 L9 S/ N
plant-2 7 ' s# Q$ K l. @0 H plant-3 16' D+ K$ G5 S9 ]9 t I+ Y- ^/ }
plant-4 6/ - d) j1 f, H3 K: x5 ?; ` d(j) the electricity demand for power plant i in cases ; b" K4 s. P& N /mode-1 3! i$ v. M. B) g6 {: p4 w7 R) o
mode-2 34 D$ a+ ^6 q' R( X
mode-3 2/; & G! b4 R3 x @/ ATable f(i,j) the unit operating cost of each power plant 6 V$ I# e0 ]: O) V4 T+ } mode-1 mode-2 mode-3 : d6 s. c' L/ W plant-1 0.4 0.24 0.04 ; N, s# X) L* A- g* `" {+ i plant-2 0.45 0.27 0.0450 G! O! |& E# Z, ?8 Q' L" M: ?
plant-3 0.32 0.192 0.0324 S5 m- p5 p) w# b6 {- r
plant-4 0.55 0.33 0.055;5 Z! } n4 @, U3 z
Scalar m the minimum total installed capacity of the four power plant /12/ / N2 }. c* P5 v b the minimum tatal investment budget of the four power plant /120/; , L; _: C2 M0 h8 `0 [ YVariables6 b: T& x! v8 j9 O! O9 [
x(i) the installed capacity of the i power plant in cases # Z3 z8 _: t X, B y(i,j) the operating lever of the i power plant under the j operating mode) m; e3 ^% G- E( v* [: a. F
z the total cost of the four power plant;) c+ y/ q) ]. n6 p9 v& B1 W+ d
Positive Variable x;* i0 \6 I" z0 A1 ] B n. k
Equations# P) ]0 f+ L# e9 Y2 a; W: }& N
cost define objective function 9 Y @ Q7 `/ e9 `; b( z5 a9 v# W capacity1(i) observe total capacity linmit at plant i ) M1 I( Y1 W7 v4 r! g g+ G budget(i) observe total investment budget limit at plant i) h. `- J- B- G' b
capacity2(i) observe installed capacity for each power plant9 F, k- K: w( z' [+ k
demand(i) satisfy the electricity demand under each operating mode; ( ?) j5 f1 n- f- Z3 ?$ J$ f" {cost.. z =e= sum(i,c(i)*x(i))+sum((i,j),f(i,j)*y(i,j)); n+ J" L( v& S# Vcapacity1(i).. sum(i,x(i)) =g= m;! }- x! ^2 v. l0 |# {+ v, F. j! I
budget(i).. sum(i,c(i)*x(i)) =l= b;4 ~8 e: F0 g' p
capacity2(j).. sum(j,y(i,j)) =l= x(i); 7 R( M G" u, b( d7 N- K# Bdemand(i).. sum(i,y(i,j)) =g= d(j);. \! s% h6 d. X
Model investment /all/;; O7 ?+ w, l- j& W6 o
Solve investment using lp minimizing z;6 p! y5 `3 J, M) F4 p7 c
Display y.l, y.m;/ G1 I( o) Q1 R+ ]% j/ P