资源简介
电力负荷预测是电力系统规划的重要组成部分,也是电力系统经济运行的基础,其对电力系统规划和运行都极其重要。根据历史电网负荷数据,用深度置信网络预测未来负荷大小,是很好的学习资料,特别适合刚入门人员。
代码片段和文件信息
load data
ldata = data.SYSLoad;
LData = ldata(:)‘;
[LdataPS] = mapminmax(LData01);%归一化
ori_X = zeros(8000048);
for j = 1:80000
for i = 1:48
ori_X(ji) = Ldata(j+i-1);
end
end
ori_Y = zeros(800001);
for i = 1:80000
ori_Y(i) = Ldata(48+6+i);
end
index = randperm(80000);
train_index = index(1:2);
X = ori_X(train_index:);
Y = ori_Y(train_index);
test_X = ori_X(test_index:);
test_nor_Y = ori_Y(test_index);%归一化
test_Y = mapminmax(‘reverse‘test_nor_YPS);
%train dbn
dbn.sizes = [24 12];
opts.numepochs = 50;
opts.batchsize = 100;
opts.momentum = 0;
opts.alpha = 1;
dbn = dbnsetup_bp(dbn ori_X opts);
dbn = dbntrain(dbn ori_X opts);
%unfold dbn to nn
nn = dbnunfoldtonn(dbn 1);
nn.activation_function = ‘sigm‘;
%train nn
opts.numepochs = 5000;
opts.batchsize = 100;
nn = nntrain(nn X Y opts);
[er bad ybar] = nntest(nn test_X test_nor_Y);
reverseForecastResult = mapminmax(‘reverse‘ybarPS);
%未归一化数值计算mape
mape = sum(abs(test_Y-reverseForecastResult)./test_Y)/2000;
%归一化数值计算rmse
rmse = sqrt(sum((ybar - test_nor_Y).^2) / 2000);
disp(‘dbn‘)
figure; %创建一个绘图窗口
plot(test_nor_Y);
hold on
plot(ybar);
legend(‘Actual wind speed‘‘Forecast wind speed‘);
ylabel({‘Wind Speed (m/s)‘});
xlabel({‘Number of day‘});
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 886166 2016-10-18 17:58 classification.pdf
文件 1377 2019-11-12 15:20 ddbn.m
文件 191390 2016-10-21 11:47 ranzato-06.pdf
- 上一篇:OFDM完整仿真过程与教程.zip
- 下一篇:PAD&N-S图.zip
评论
共有 条评论