【微电网优化】基于粒子群算法实现抽水蓄能电站优化调度研究附matlab代码

✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。

🍎个人主页:Matlab科研工作室

🍊个人信条:格物致知。

更多Matlab仿真内容点击👇

智能优化算法       神经网络预测       雷达通信       无线传感器        电力系统

信号处理              图像处理               路径规划       元胞自动机        无人机 

⛄ 内容介绍

微网中的分布式电源大多利用可再生能源发电,能源清洁,符合国家可持续发展的战略要求.当前很多分布式电源发电技术已十分成熟,并且正在逐步地商业化,例如风电,微型燃气轮机,小水电,燃料电池,光伏发电等等.随着微网技术的发展与成熟,微网的调度以及经济运行也日益受到人们的关注. 本文综合考虑了多种分布式电源,研究了它们的发电原理,出力特性以及环境效益,建立了各种电源的出力模型.在传统调度方法的基础上,考虑了抽水蓄能电站优化调度模型.

⛄ 部分代码

function [f,fun,fun1,fun2,six,two,g,g1,h]= jieguo(x)

%% 准备工作 

parameter; %输入所有的数据 

%% 各个决策变量的含义 

Pfl = x(1:24);      % 火电1

Pf2 = x(25:48);  % 火电2

Pf3 = x(49:72); % 火电3

Pf4 = x(73:96); % 火电4

Pf5 = x(97:120);% 火电5

Pf6 = x(121:144);% 火电6

%% 

%水电1

Pc1=x(145:168);

% for t=1:24

% if Pc1(t)<0

%     Pc1(t)=fix(Pc1(t))*50;

% end

% end

%% 峰:9/10/11/12/13/19/20/21

%% 谷:23/24/1/2/3/4/5

for t=1:24

    if t>=9&&t<=13

        if Pc1(t)<0

            Pc1(t)=0;

        end

    elseif t>=19&&t<=21

        if Pc1(t)<0

            Pc1(t)=0;

        end

    elseif t>=1&&t<=5

        if Pc1(t)>0

            Pc1(t)=0;

        end

        

     elseif t>=23&&t<=24 

        if Pc1(t)>0

            Pc1(t)=0;

        end

        

%      elseif t>=6&&t<=8

%            Pc1(t)=0;

%      elseif t>=14&&t<=18

%            Pc1(t)=0;

%      elseif t==22

%            Pc1(t)=0;

    end

end

six=[Pfl' Pf2' Pf3' Pf4' Pf5' Pf6'] ;

two=[Pc1' ];

%% 书写约束

% ******************* 等式约束****************************

h=[];

 chou=zeros(1,24);

 for t=1:24

    chou(t)=Pc1(t);

 end

for t=1:24 % (1) 电能平衡约束

if chou(t)>0

        h = [h, Pfl(t)+Pf2(t)+Pf3(t)+Pf4(t)+Pf5(t)+Pf6(t)+sum(P_shui(:))+chou(t)*0.9 - P_load(t)]; %=0

else

           h = [h, Pfl(t)+Pf2(t)+Pf3(t)+Pf4(t)+Pf5(t)+Pf6(t)+sum(P_shui(:))+chou(t)/eta - P_load(t)]; %=0 

end

end

%% 抽蓄初始相等

 h = [h, sum(chou)]; %=0 

% ******************* 不等式约束 ***************************

g=[];

%% (1) 火电爬坡约束

for t=2:24 % (1) 火电爬坡约束1,1-23

    if Pfl(t)>0&&Pfl(t-1)>0

    g=[g, Pfl(t)-Pfl(t-1)-delta_fire(1)] ; % <=0    

    g=[g, -( Pfl(t)-Pfl(t-1)+delta_fire(1) ) ] ; % <=0 

    end

end

for t=2:24 % (1) 火电爬坡约束2,24-46

    if Pf2(t)>0&&Pf2(t-1)>0

    g=[g, Pf2(t)-Pf2(t-1)-delta_fire(2)] ; % <=0    

    g=[g, -( Pf2(t)-Pf2(t-1)+delta_fire(2) ) ] ; % <=0    

    end

end

for t=2:24 % (1) 火电爬坡约束3,47-69

    if Pf3(t)>0&&Pf3(t-1)>0

    g=[g, Pf3(t)-Pf3(t-1)-delta_fire(3)] ; % <=0    

    g=[g, -( Pf3(t)-Pf3(t-1)+delta_fire(3) ) ] ; % <=0    

    end

end

for t=2:24 % (1) 火电爬坡约束4,70-92

    if Pf4(t)>0&&Pf4(t-1)>0

    g=[g, Pf4(t)-Pf4(t-1)-delta_fire(4)] ; % <=0    

    g=[g, -( Pf4(t)-Pf4(t-1)+delta_fire(4) ) ] ; % <=0    

    end

end

for t=2:24 % (1) 火电爬坡约束5,93-115

    if Pf5(t)>0&&Pf5(t-1)>0

    g=[g, Pf5(t)-Pf5(t-1)-delta_fire(5)] ; % <=0    

    g=[g, -( Pf5(t)-Pf5(t-1)+delta_fire(5) ) ] ; % <=0    

    end

end

for t=2:24 % (1) 火电爬坡约束6,116-138

    if Pf6(t)>0&&Pf6(t-1)>0

    g=[g, Pf6(t)-Pf6(t-1)-delta_fire(6)] ; % <=0    

    g=[g, -( Pf6(t)-Pf6(t-1)+delta_fire(6) ) ] ; % <=0   

    end

end

%% 出力上下限约束

for t=1:24

        g=[g, Pfl(t)-P_maxfire(1)] ; % <=0    ,139-162

end

for t=1:24

        g=[g, Pf2(t)-P_maxfire(2)] ; % <=0    ,163-186

end

for t=1:24

        g=[g, Pf3(t)-P_maxfire(3)] ; % <=0    ,187-210

%     g=[g, -( Pf3(t)-P_minfire(3) ) ] ; % <=0  

end

for t=1:24

        g=[g, Pf4(t)-P_maxfire(4)] ; % <=0    ,211-234

end

for t=1:24

        g=[g, Pf5(t)-P_maxfire(5)] ; % <=0    ,235-258

end

for t=1:24

        g=[g, Pf6(t)-P_maxfire(6)] ; % <=0    ,259-282

end

%% 备用约束, 283-306

for t=1:24

     g=[g, -(sum(P_maxfire)-Pfl(t)-Pf2(t)-Pf3(t)-Pf4(t)-Pf5(t)-Pf6(t)-sum(P_maxfire)*bei)];

end

%% 抽蓄约束

g1=[];

for t=1:24

   g1=[g1,V_0-sum(chou(1:t))-V_max];

   g1=[g1,-(V_0-sum(chou(1:t))-V_min)];

end

%  for t=1:24

%  if Pc1(t)>0

%       g1=[g1,300*0.1 - Pc1(t)];

%  end

%  end

%% 书写目标函数

fun =0; 

%% 火电

for t=1:24

    if Pfl(t)>=P_maxfire(1)*0.5

    fun = fun + Pfl(t)*price_feng(1);%基础

    else

         fun = fun + (Pfl(t)-P_maxfire(1)*0.5)*price_bu(1)+P_maxfire(1)*0.5*price_feng(1);%深度

    end

end

for t=1:24

    if Pf2(t)>=P_maxfire(2)*0.5

    fun = fun + Pf2(t)*price_feng(2);%基础

    else

         fun = fun + (Pf2(t)-P_maxfire(2)*0.5)*price_bu(2)+P_maxfire(2)*0.5*price_feng(2);%深度

    end

end

for t=1:24

    if Pf3(t)>=P_maxfire(3)*0.5

    fun = fun + Pf3(t)*price_feng(3);%基础

    else

         fun = fun + (Pf3(t)-P_maxfire(3)*0.5)*price_bu(3)+P_maxfire(3)*0.5*price_feng(3);%深度

    end

end

for t=1:24

    if Pf4(t)>=P_maxfire(4)*0.5

    fun = fun + Pf4(t)*price_feng(4);%基础

    else

         fun = fun + (Pf4(t)-P_maxfire(4)*0.5)*price_bu(4)+P_maxfire(4)*0.5*price_feng(4);%深度

    end

end

for t=1:24

    if Pf5(t)>=P_maxfire(5)*0.5

    fun = fun + Pf5(t)*price_feng(5);%基础

    else

         fun = fun + (Pf5(t)-P_maxfire(5)*0.5)*price_bu(5)+P_maxfire(5)*0.5*price_feng(5);%深度

    end

end

for t=1:24

    if Pf6(t)>=P_maxfire(6)*0.5

    fun = fun + Pf6(t)*price_feng(6);%基础

    else

         fun = fun + (Pf6(t)-P_maxfire(6)*0.5)*price_bu(6)+P_maxfire(6)*0.5*price_feng(6);%深度

    end

end

%% 水电

fun1 =0; 

for t=1:24

    fun1 = fun1+sum(P_shui.*Price_shui);

end

%% 抽蓄

fun2 =0; 

for t=1:24

    if Pc1(t)<0

    fun2 = fun2-chou(t)*Price_chou;

   

    end

end

f=fun+fun1+fun2;

end

⛄ 运行结果

⛄ 参考文献

[1] 程宇旭. 基于改进粒子群算法的微电网能量优化调度研究及实现[D]. 中南大学, 2014.

[2] 段程煜. 基于粒子群算法的微电网优化调度研究[D]. 华北电力大学, 2014.

[3] 王乾. 基于改进粒子群算法的微电网日前优化调度研究[J]. 数字通信世界, 2021(6):2.

[4] 王丽明. 基于粒子群算法的孤岛微电网优化调度研究[J]. 电工技术, 2020(4):3.

[5] Liu Yuan, 刘远, Wang Lingyun,等. 基于改进粒子群算法的微电网能量优化调度[C]// 中国电工技术学会. 中国电工技术学会, 2015.

⛳️ 代码获取关注我

❤️部分理论引用网络文献,若有侵权联系博主删除

❤️ 关注我领取海量matlab电子书和数学建模资料

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值