This is all my code, I have checked it many times, Thank you very much for check it again!
set n /
$include NodeSet.inc
/;
set i /
$include GenSet.inc
/;
set j /
$include WindGenSet.inc
/;
set k /
$include LineSet.inc
/;
set l /
$include LoadSet.inc
/;
set t /
t1t24
/;
set c /
c1c5
/;
parameter KG(n, i) /
$include KG.inc
/;
parameter KWG(n, j) /
$include KWG.inc
/;
parameter KD(l, n) /
$include KD.inc
/;
parameter KL(k, n) /
$include KL.inc
/;
parameter KLT(k,n) /
$include KLT.inc
/;
parameter pMax(i) /
$include GenPMax.inc
/;
parameter pMin(i) /
$include GenPMin.inc
/;
parameter a(i) /
$include A.inc
/;
parameter injecto(j,t,c) /
$include inject.inc
/;
parameter X(k) /
$include X.inc
/;
parameter LMax(k) /
$include LMax.inc
/;
parameter LMin(k) /
$include LMin.inc
/;
parameter PrMIN(t) /
$include PrMIN.inc
/;
parameter PrMAX(t) /
$include PrMAX.inc
/;
parameter SU(i) /
$include SU.inc
/;
parameter SD(i) /
$include SD.inc
/;
parameter D(l,t) /
$include D.inc
/;
parameter p_0(i)
/1 100
2 200
3 100/ ;
parameter p0(i,t) ;
parameter inject(j,t);
parameter hdeta(i) /
$include hdeta.inc
/;
parameter ldeta(i) /
$include ldeta.inc
/;
parameter MaxdetaP(i)
/1 20
2 20
3 30/;
parameter MindetaP(i)
/1 -20
2 -20
3 -30/;
parameter pf(i,t,c);
variable p(i,t), Theta(n,t), f(k,t);
variable r(i,t);
Theta.fx(‘1’,t) = 0;
variable z;
equations Cost, FlowEQ(n,t), LinePowerFlow(k,t);
equations MaxFlowO(k,t), MinFlowO(k,t);
equations Start(i,t),Stop(i,t),Start0(i,t),Stop0(i,t);
equations PPMAX(i,t), PPMIN(i,t);
equations PPRMIN(t), PPRMAX(i,t);
equations pcmax(i,t), pcmin(i,t);
Cost… z =e= sum( (i,t) , a(i) * p(i,t) );
FlowEQ(n,t)… sum(i, KG(n, i) * p(i,t)) + sum(j, KWG(n,j) * inject(j,t)) =e= sum(k, KLT(k, n) * f(k,t)) + sum(l, KD(l,n) * D(l,t));
LinePowerFlow(k,t)… f(k,t) =e= X(k) * sum(n, KLT(k, n) * Theta(n,t));
PPMAX(i,t)… p(i,t) =l= pMax(i);
PPMIN(i,t)… p(i,t) =g= pMin(i);
MaxFlowO(k,t)… f(k,t) =l= LMax(k);
MinFlowO(k,t)… f(k,t) =g= LMin(k);
PPRMAX(i,t)… p(i,t)+ r(i,t) =l= pMax(i);
PPRMIN(t)… sum (i,r(i,t)) =g= PrMIN(t);
pcmax(i,t)…p(i,t) - p0(i,t) =l= MaxdetaP(i);
pcmin(i,t)…p(i,t) - p0(i,t) =g= MindetaP(i);
Start(i,t)(ord(t)>1).. p(i,t) - p(i,t-1) =l= SU(i);
Start0(i,t)(ord(t)=1)… p(i,t) - p_0(i) =l= SU(i);
Stop(i,t)(ord(t)>1).. p(i,t-1) - p(i,t) =l= SD(i);
Stop0(i,t)(ord(t)=1)… p_0(i) - p(i,t) =l= SD(i);
Model GenUnitCom /all/ ;
option lp=cplex;
option LimRow=1000;
loop
(
c,
inject(j,t) = injecto(j,t,c);
Solve GenUnitCom using lp minimizing z;
p0(i,t) = p.l(i,t);
pf(i,t,c) = p.l(i,t);
);
display Theta.l;
$title BMatrix(n, n)$Linen(k, n, n) = 1 / LineX(k);