【優(yōu)化調度】基于粒子群算法求解水電廠優(yōu)化調度購電最小問題含Matlab源碼
?1 簡介
以洪家渡水電站為例,探討了粒子群算法在水電站中長期優(yōu)化調度的應用方法及效果。實例計算結果表明,該算法可以求解復雜約束條件的非線性水庫優(yōu)化調度,精度高、收斂速度快,為解決水電站中長期優(yōu)化調度問題提供了一種有效的方法。
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 ? %%每個參數(shù)進行進化
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粒子群算法工具箱求解水電站優(yōu)化調度問題[J]. 中國農村水利水電, 2009(1):3.
博主簡介:擅長智能優(yōu)化算法、神經網絡預測、信號處理、元胞自動機、圖像處理、路徑規(guī)劃、無人機等多種領域的Matlab仿真,相關matlab代碼問題可私信交流。
部分理論引用網絡文獻,若有侵權聯(lián)系博主刪除。