Matlab|基于目标级联法的微网群多主体分布式优化调度

目录

主要内容

[1.1 上层微网群模型](#1.1 上层微网群模型)

[1.2 下层微网模型](#1.2 下层微网模型)

部分程序

实现效果

下载链接


主要内容

本文复现《基于目标级联法的微网群多主体分布式优化调度》文献的目标级联部分,

建立微网群系统的两级递阶优化调度模型: 上层是微网群能量调度中心优化调度模型,下层是子微网优化调度模型,然后对所建递阶优化调度模型耦合性和分布性进行分析,采用一种新型的协同优化方法---------目标级联法,实现上下层模型的解耦独立优化,以3微网为算例进行验证,证明方法的可行性。

1.1 上层微网群模型

1.2 下层微网模型

部分程序

复制代码
%程序开发时间:2023年1月26日
%欢迎关注微信公众号:电力程序
%----------------------------
%%目标级联协调优化
gPMG = zeros(3,24);%微网群与微网间联络功率
gPpcc1 = zeros(1,24);%微网1与微网群联络功率,下同
gPpcc2 =zeros(1,24);
gPpcc3 = zeros(1,24);
parameterATC;
figure(1);
errorSet = [];
for k=1:8
[y1(k),gPpcc1,x_P_g1,x_P_ch1,x_P_dis1,x_P_w1,x_P_v1,x_c_ld1,Load1]=lower1(pho,gPMG,v,w);%下层微网1
[y2(k),gPpcc2,x_P_ch2,x_P_dis2,x_P_w2,x_P_v2,x_c_ld2,Load2]=lower2(pho,gPMG,v,w);%下层微网2
[y3(k),gPpcc3,x_P_g3,x_P_ch3,x_P_dis3,x_P_w3,x_P_v3,x_c_ld3,Load3]=lower3(pho,gPMG,v,w);%下层微网3
[y4(k),gPMG]=upperthree(pho,v,w,gPpcc1,gPpcc2,gPpcc3);%上层微网群
%%----得到结果----
gPMG=value(gPMG);
gPpcc1=value(gPpcc1);
gPpcc2=value(gPpcc2);
gPpcc3=value(gPpcc3);
gPMGc(:,k)=gPMG(:,10);%10时刻微网群连接变量数据储存
gPpcc1c(k)=gPpcc1(10);%10时刻微网1连接变量数据储存
gPpcc2c(k)=gPpcc2(10);%10时刻微网2连接变量数据储存
gPpcc3c(k)=gPpcc3(10);%10时刻微网3连接变量数据储存
  postError = norm(gPMG-[gPpcc1;gPpcc2;gPpcc3])
    disp(sprintf('postError=%f',postError));
        errorSet = [errorSet postError];
        %画图
    figure(1),plot(errorSet),pause(0.1)
    xlabel('迭代次数');
    ylabel('误差值');
    v=v+2*w*w*postError;
    w=beta*w;
    yalmip('clear');
end
%最终迭代后结果图
figure;
ldz=max(x_c_ld1,0);
ldf=min(x_c_ld1,0);
wwz=max(gPpcc1,0);
wwf=min(gPpcc1,0);
yyf=[-x_P_ch1;ldf;wwf]';
bar(yyf,'stack');
hold on
yyz=[-x_P_dis1;x_P_g1;x_P_w1;x_P_v1;ldz;wwz]';
bar(yyz,'stack');
plot(Load1,'r','LineWidth',1.5)
xlabel('时间/h');
ylabel('功率/MW');
title('微网1功率');
sy=legend('储能充电','负荷响应','接受微网群电功率','储能放电','发电','风电','光伏','负荷响应','供给其他微网','微网1负荷');
sy.NumColumns = 3;
ylim([-6 14]);
figure;
ldz=max(x_c_ld2,0);
ldf=min(x_c_ld2,0);
wwz=max(gPpcc2,0);
wwf=min(gPpcc2,0);
yyf=[-x_P_ch2;ldf;wwf]';
bar(yyf,'stack');
hold on
yyz=[-x_P_dis2;x_P_w2;x_P_v2;ldz;wwz]';
bar(yyz,'stack');
plot(Load2,'r','LineWidth',1.5)
xlabel('时间/h');
ylabel('功率/MW');
title('微网2功率');
sy=legend('储能充电','负荷响应','接受微网群电能','储能放电','风电','光伏','负荷响应','供给其他微网','微网2负荷');
sy.NumColumns = 3;
ylim([-2 8]);
figure;
ldz=max(x_c_ld3,0);
ldf=min(x_c_ld3,0);
wwz=max(gPpcc3,0);
wwf=min(gPpcc3,0);
yyf=[-x_P_ch3;ldf;wwf]';
bar(yyf,'stack');
hold on
yyz=[-x_P_dis3;x_P_g3;x_P_w3;x_P_v3;ldz;wwz]';
bar(yyz,'stack');
plot(Load3,'r','LineWidth',1.5)
xlabel('时间/h');
ylabel('功率/MW');
title('微网3功率');
sy=legend('储能充电','负荷响应','接受微网群电能','储能放电','发电','风电','光伏','负荷响应','供给其他微网','微网3负荷');
sy.NumColumns = 3;
ylim([-5 11]);
figure;
title_name = '微网群连接变量时段10趋同过程';
title(title_name);   %%关键
subplot(311)
plot(gPpcc1c,'o--','LineWidth',1.5)
hold on
plot(gPMGc(1,:),'r-o','LineWidth',1.5)
grid on
legend('下层连接变量值','上层连接变量值');
xlabel('迭代次数');
ylabel('子微网1联络功率');
subplot(312)
plot(gPpcc2c,'o--','LineWidth',1.5)
hold on
plot(gPMGc(2,:),'r-o','LineWidth',1.5)
grid on
xlabel('迭代次数');
ylabel('子微网2联络功率');
subplot(313)
plot(gPpcc3c,'o--','LineWidth',1.5)
hold on
plot(gPMGc(3,:),'r-o','LineWidth',1.5)
grid on
xlabel('迭代次数');
ylabel('子微网3联络功率');

实现效果

下载链接

相关推荐
Dylanioucn1 小时前
【分布式微服务云原生】掌握分布式缓存:Redis与Memcached的深入解析与实战指南
分布式·缓存·云原生
jk_1012 小时前
MATLAB中decomposition函数用法
开发语言·算法·matlab
weixin_453965004 小时前
[单master节点k8s部署]31.ceph分布式存储(二)
分布式·ceph·kubernetes
坎坎坷坷.5 小时前
分布式理论:拜占庭将军问题
分布式
不想当个技术宅5 小时前
【梯级水电站调度优化】基于自适应权值优化粒子群算法
matlab·粒子群算法·梯级水电站调度优化
蓝色洛特6 小时前
【Matlab元胞自动机】《高速公路人工—自动驾驶混行交通流临界特征研究》
matlab·自动驾驶·元胞自动机·交通仿真
quaer7 小时前
Open-Sora全面开源?
开发语言·算法·机器学习·matlab·矩阵
极客先躯11 小时前
高级java每日一道面试题-2024年10月3日-分布式篇-分布式系统中的容错策略都有哪些?
java·分布式·版本控制·共识算法·超时重试·心跳检测·容错策略
niu_sama11 小时前
仿RabbitMQ实现消息队列三种主题的调试及源码
分布式·rabbitmq
鸡c11 小时前
rabbitMq------客户端模块
分布式·rabbitmq·ruby