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联络功率');

实现效果

下载链接

相关推荐
搞科研的小刘选手21 小时前
【中山大学主办】第六届计算机科学与区块链国际学术会议(CCSB 2026)
分布式·神经网络·计算机视觉·区块链·计算机科学·共识算法·自然语言
小饼干在学嘎瓦1 天前
本地缓存和分布式缓存如何选择?
分布式·缓存
XLYcmy1 天前
全链路验证测试系统:一个针对智能代理(Agent)系统全链路能力的自动化验证脚本
分布式·python·http·网络安全·ai·llm·agent
IT猿手1 天前
多目标优化算法:多目标蛇优化算法(Multiple Objective Snake Optimizer,MOSO)(提供MATLAB代码)
开发语言·算法·matlab·动态路径规划·光伏模型参数估计
Evand J1 天前
【代码介绍】RSSI定位程序,N个锚点、三维空间,使用CKF对轨迹进行滤波,MATLAB代码
matlab·滤波·定位·三维
phltxy1 天前
HAProxy安装与RabbitMQ负载均衡配置
分布式·rabbitmq·负载均衡
加成BUFF1 天前
《机器人学》MATLAB 机器人工具箱 应用指南二
matlab·机器人·机器人工具箱
jiayong231 天前
Kafka 高吞吐消息链路常见面试问题及详细解答
分布式·面试·kafka
吃好睡好便好1 天前
矩阵的左乘和右乘
人工智能·学习·线性代数·算法·matlab·矩阵
卷毛迷你猪1 天前
快速实验篇(A2-2)数据清洗规则修正与多语言实现验证
hadoop·分布式