资源简介
yalmip(matlab)解决UC问题范例1(补充).rar
代码片段和文件信息
Nunits = 3;
Horizon = 48;
Pmax = [100;50;25];
Pmin = [20;40;1];
Q = diag([.04 .01 .02]);
C = [10 20 20];
Pforecast = 100 + 50*sin((1:Horizon)*2*pi/24);
onoff = binvar(NunitsHorizon‘full‘);
P = sdpvar(NunitsHorizon‘full‘);
Constraints = [];
for k = 1:Horizon
Constraints = [Constraints onoff(:k).*Pmin <= P(:k) <= onoff(:k).*Pmax];
end
for k = 1:Horizon
Constraints = [Constraints sum(P(:k)) >= Pforecast(k)];
end
objective = 0;
for k = 1:Horizon
objective = objective + P(:k)‘*Q*P(:k) + C*P(:k);
end
ops = sdpsettings(‘verbose‘1‘debug‘1);
optimize(Constraintsobjectiveops)
stairs(value(P)‘);
legend(‘Unit 1‘‘Unit 2‘‘Unit 3‘);
minup = [6;30;1];
mindown = [3;6;3];
for k = 2:Horizon
for unit = 1:Nunits
% indicator will be 1 only when switched on
indicator = onoff(unitk)-onoff(unitk-1);
range = k:min(Horizonk+minup(unit)-1);
% Constraints will be redundant unless indicator = 1
Constraints = [Constraints onoff(unitrange) >= indicator];
end
end
for k = 2:Horizon
for unit = 1:Nunits
% indicator will be 1 only when switched off
indicator = onoff(unitk-1)-onoff(unitk);
range = k:min(Horizonk+mindown(unit)-1);
% Constraints will be redundant unless indicator = 1
Constraints = [Constraints onoff(unitrange) <= 1-indicator];
end
end
ops = sdpsettings(‘verbose‘2‘debug‘1);
optimize(Constraintsobjectiveops);
stairs(value(P)‘);
legend(‘Unit 1‘‘Unit 2‘‘Unit 3‘);
Unit3Levels = [0 1 6 10 12 20];
for k = 1:Horizon
Constraints = [Constraints ismember(P(3k)Unit3Levels)];
end
optimize(Constraintsobjective);
stairs(value(P)‘);
legend(‘Unit 1‘‘Unit 2‘‘Unit 3‘);
Nhist = max([minup;mindown]);
Pforecast = sdpvar(1Horizon);
HistoryOnOff = sdpvar(NunitsNhist‘full‘);
DemandSlack = sdpvar(1Horizon);
PreviusP = sdpvar(31);
DemandPenalty = 1000;
ChangePenalty = 1000;
Constraints = [];
objective = 0;
for k = 1:Horizon
Constraints = [Constraints onoff(:k).*Pmin <= P(:k) <= onoff(:k).*Pmax];
Constraints = [Constraints sum(P(:k))+DemandSlack(k) >= Pforecast(k)];
Constraints = [Constraints DemandSlack(k) >= 0];
objective = objective + P(:k)‘*Q*P(:k) + C*P(:k);
objective = objective + DemandPenalty*DemandSlack(k);
end
Constraints = [Constraints consequtiveON([HistoryOnOff onoff]minup)];
Constraints = [Constraints consequtiveON(1-[HistoryOnOff onoff]mindown)];
for k = 2:Horizon
objective = objective + ChangePenalty*norm(P(:k)-P(:k-1)1);
end
objective = objective + ChangePenalty*norm(P(:1)-PreviusP1);
Parameters = {HistoryOnOff Pforecast PreviusP};
Outputs = {Ponoff};
ops = sdpsettings(‘verbose‘2‘debug‘1);
Controller = optimizer(ConstraintsobjectiveopsParametersOutputs);
oldOnOff = repmat([1;1;0]1Nhist);
oldP = repmat([100;40;0]1Nhist);
for k = 1:500
% base-line forecast
forecast = 100;
% Daily fluctuation
forecast = forecast + 50*sin((k:k+Horizon-1)*2*p
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4285 2018-10-29 20:25 yalmip解决UC问题范例1(补充)\最终程序.m
文件 26449 2018-10-28 11:22 yalmip解决UC问题范例1(补充)\补充1-考虑将机组启停时间限制.docx
文件 1491 2018-10-28 11:08 yalmip解决UC问题范例1(补充)\补充1程序-考虑将机组启停时间限制.m
文件 27579 2018-10-29 19:54 yalmip解决UC问题范例1(补充)\补充2.docx
文件 17775 2018-10-29 20:29 yalmip解决UC问题范例1(补充)\补充3.docx
文件 29491 2018-10-27 17:08 yalmip解决UC问题范例1(补充)\附录-yalmip范例解析1.docx
目录 0 2018-10-29 20:29 yalmip解决UC问题范例1(补充)
----------- --------- ---------- ----- ----
107070 7
相关资源
- SAM_SSD.m
- 三个参与主体演化博弈matlab.docx
- LM.m
- 二维粒子群算法的matlab源程序.docx.z
- open_file.m
- ofdm1.m
- pure_pursuit_sim.m
- yucekongzhi.m
- Chineseflag.m
- MATLABR2016bMac破解版.txt
- aloha.m
- 基于NSGAII多目标优化Matlab代码.zip
- matlab仿真.rar
- matlabR2016b.zip
- TDOA算法matlab仿真代码.rar
- MATLABR2008控制系统动态仿真教程_例题
-
燃料电池汽车仿真电路设计SIMUli
n - 倒计时电路.ms14
- MatlabR2019a安装破解教程.zip
- maxfter.m
- case30.m
- MatlabR2019A.7z
- SVPWMconverter.mdl
- zw_MATLAB程序.zip
- Matlab调制库函数fskmod参数及源代码详
- MATLABR2018bWin64Crack.zip
- matlab2009a反复要求激活解决方案——亲
- DANDAOFANGZHEN.m
- 六自由度机器人避障问题的MATLAB仿真
- cosinebianhuan.m
评论
共有 条评论