部分代码
for i=1:T
st=st+[D_DGk(i)*min_P_DG<=P_DGk(i)<=D_DGk(i)*max_P_DG];
end
for i=2:T
indicator=D_DGk(i)-D_DGk(i-1);
range=i:min(T,i+T_up-1);
st =st+[D_DGk(range)>=indicator];
end
for i=2:T
indicator=D_DGk(i-1)-D_DGk(i);
range=i:min(T,i+T_up-1);
st = st+[D_DGk(range)<=1-indicator];
end
for i=1:T
st=st+[X_DGup(i)>=0];
st=st+[X_DGdown(i)>=0];
end
for i=2:T
st=st+[X_DGup(i)>=c_DG_up*(D_DGk(i)-D_DGk(i-1))];
st=st+[X_DGdown(i)>=c_DG_down*(D_DGk(i-1)-D_DGk(i))];
end
st=st+[X_DGup(1)>=c_DG_up*(D_DGk(1)-D_DGk0(1))];
st=st+[X_DGdown(1)>=c_DG_down*(D_DGk0(1)-D_DGk(1))];
for i = 1:24
st =st+[u_k(i)>=0 ];
st=st+[v_k(i)>=0];
st =st+[u_k(i)<=500 ];
st=st+[v_k(i)<=500];
st =st+[u_k(1)==0 ];
st =st+[v_k(1)==0 ];
end
for i = 1:T
st =st+[min_E_b<=E_bk(i)];
st=st+[ E_bk(i)<=max_E_b ];
end