非常感谢亲!!请各位一定帮帮忙!!学期作业啊!!! ! O/ J) o; H$ |& b我把程序贴在这, ' S9 k; P9 D% {7 u3 x- _$Title A Investment Problem. T3 k& @7 d4 Y- `9 V4 }
$ontext! U* r5 j L# k" i. e# t
this problem finds a optimized investment that meets: o" v7 q q( I, ^
requirements in the city $ L' a4 L% B/ s% M( Y& P! D8 Y$offtext ! P8 R9 [& @! ?, b/ @- l6 bSets0 s3 y+ s8 R9 r: P* o9 m% F& m
i power plants /plant-1, plant-2, plant-3, plant-4/ 1 a# N: z3 m9 s! b) \# z* h j operating mode /mode-1, mode-2, mode-3/;. `: `+ i! d$ ]* K/ x
Parameters ; C& r5 [8 t, u8 Z c(i) the unit installed capacity of power plant i in cases. o: W) j2 Y) p( H+ P! M& d
/plant-1 10, v$ j8 k/ d' l
plant-2 7 - d; C z$ K0 j2 e" @ plant-3 16 8 W# [0 E/ M4 |8 {. ~7 b4 I3 A plant-4 6/ % ?4 h% M! h# D1 w d(j) the electricity demand for power plant i in cases 1 E7 |" H+ a0 D- s+ M( D /mode-1 32 ~; c/ Q+ j; n- F9 Z. {% W( o6 V
mode-2 33 T/ n6 v3 w) q
mode-3 2/; 0 [* U- n& i- M& |3 {( C$ dTable f(i,j) the unit operating cost of each power plant4 D5 _& j) X# K( T( i8 M
mode-1 mode-2 mode-3 8 d8 g5 O7 J# `7 i plant-1 0.4 0.24 0.04 ( ]* V3 D( Y2 g/ ~ plant-2 0.45 0.27 0.0453 l. k9 ^4 _% ?( g+ C- }
plant-3 0.32 0.192 0.032 7 F# V! r3 K' b6 M/ e plant-4 0.55 0.33 0.055;0 |1 w, X- T; D
Scalar m the minimum total installed capacity of the four power plant /12/' F2 j: d! L4 l0 \
b the minimum tatal investment budget of the four power plant /120/; ) h. s) R4 j+ pVariables! D+ o' B, _) F4 {, j3 K9 S
x(i) the installed capacity of the i power plant in cases- w8 v& s$ } j; J, E! d1 L
y(i,j) the operating lever of the i power plant under the j operating mode 2 |$ D% z/ R+ k. v z the total cost of the four power plant;! @! @3 V* I5 E/ b" G
Positive Variable x; 5 S5 x( ^6 J3 DEquations ' q8 c" l' \5 E5 ?% Y cost define objective function+ C, n/ j0 L" X, F4 o
capacity1(i) observe total capacity linmit at plant i $ g1 ?1 E/ u% R/ i0 k, J* B$ g budget(i) observe total investment budget limit at plant i- g4 b4 W" H5 k; G, T9 T
capacity2(i) observe installed capacity for each power plant( Z' }: @6 D$ S7 F
demand(i) satisfy the electricity demand under each operating mode; : N' f8 L2 m: F) l+ N7 ncost.. z =e= sum(i,c(i)*x(i))+sum((i,j),f(i,j)*y(i,j));. x; l0 L$ B: O7 A/ L8 n( V
capacity1(i).. sum(i,x(i)) =g= m;1 `# @/ [( X8 k! N
budget(i).. sum(i,c(i)*x(i)) =l= b;4 Y3 o* G* a* I- J1 S: ~+ y3 ^
capacity2(j).. sum(j,y(i,j)) =l= x(i); 0 z/ Q7 U- W3 i* b' k' E+ _demand(i).. sum(i,y(i,j)) =g= d(j); I3 D" w3 U# wModel investment /all/;0 a2 R" L" c7 n) E' k
Solve investment using lp minimizing z;; w4 y2 t0 E, W, q& @7 k. ^
Display y.l, y.m; ! N. v- X& |% b" B$ |( q: {3 C7 `+ U2 s
运行出错的,但是不知道怎么解决,请亲给处理一下哦!!!