1 简介 以洪家渡水电站为例,探讨了粒子群算法在水电站中长期优化调度的应用方法及效果。实例计算结果表明,该算法可以求解复杂约束条件的非线性水库优化调度,精度高、收敛速度快
1 简介
以洪家渡水电站为例,探讨了粒子群算法在水电站中长期优化调度的应用方法及效果。实例计算结果表明,该算法可以求解复杂约束条件的非线性水库优化调度,精度高、收敛速度快,为解决水电站中长期优化调度问题提供了一种有效的方法。
2 部分代码
function pop=renew(pop,PBEST,GBEST)global popsize
global dimsize
% global QCmin
% global QCmax
% global KTmin
% global KTmax
% global PGmin;
% PGmin=[0.2 0.15 0.1 0.1 0.12];
% global PGmax;
% PGmax=[0.8 0.5 0.35 0.3 0.4];
global PGmin
PGmin=[0.2 0.15 0.1 0.1 0.12];
global PGmax
PGmax=[1.0 0.8 0.55 0.8 0.6];
global c1
global c2
global wcmax
global wcmin
global generation
global maxgeneration
xmin=PGmin;
xmax=PGmax;
speedmin=(PGmin-PGmax)*0.1;
speedmax=(PGmax-PGmin)*0.2;
for t=1:popsize %%%每个粒子逐个进化
for dimIndex =1:dimsize %%每个参数进行进化
w=wcmax-(wcmax-wcmin)*(generation/maxgeneration);
sub1=PBEST(t,dimIndex)-pop(t,dimIndex);
sub2=GBEST(1,dimIndex)-pop(t,dimIndex);
tempV =w*pop(t,dimsize+dimIndex)+c1*unifrnd(0,1)*sub1 + c2*unifrnd(0, 1)*sub2; %%速度进化
if tempV>speedmax(dimIndex)
pop(t,dimsize+dimIndex)=speedmax(dimIndex);
elseif tempV<speedmin(dimIndex)
pop(t,dimsize+dimIndex)=speedmin(dimIndex);
else
pop(t,dimsize+dimIndex)=tempV;
end
tempV;
tempposition = pop(t,dimIndex) + pop(t,dimsize+dimIndex); %%位置进化
if tempposition>xmax(dimIndex)
pop(t,dimIndex) = xmax(dimIndex);
elseif tempposition<xmin(dimIndex)
pop(t,dimIndex)=xmin(dimIndex);
else
pop(t,dimIndex)=tempposition;
end
end
end
pop;
3 仿真结果
4 参考文献
[1]芮钧, 陈守伦. MATLAB粒子群算法工具箱求解水电站优化调度问题[J]. 中国农村水利水电, 2009(1):3.