资源简介
基于改进粒子群算法的配电故障定位,基于改进粒子群算法的配电故障定位基于改进粒子群算法的配电故障定位,基于改进粒子群算法的配电故障定位
代码片段和文件信息
function Y = FaultLocation(Xbranch)
% 配电网故障定位
if nargin<1
X = [1 1 1 1 1 1 1 1 0 0 0 ...
0 0 1 0 0 0 1 0 0 1 0 ...
0 0 0 1 1 1 1 0 0 1];
mpc = case33bw();
branch = mpc.branch(mpc.branch(:11)==11:2);
end
clc
pop_size = 30;
max_iter = 100;
c1 = 0.5;
c2 = 0.5;
level_count = 10;
branch_count = length(X);
[poppv] = init(pop_sizeX);
fitv = zeros(pop_size1);
for m = 1:pop_size
fitv(m:) = fitfun(Xpop(m:)branch);
end
for t = 1:max_iter
w = (0.9-0.5)/max_iter*t+0.5;
[~p_] = sort(fitv);
level = reshape(p_[pop_size/level_countlevel_count]);
level = level‘;
for m = 2:level_count
for n = 1:pop_size/level_count
nowp = level(mn);
teachor1 = level(randi(m-1)randi(pop_size/level_count));
teachor2 = level(randi(m-1)randi(pop_size/level_count));
vt = w*pv(nowp:)+c1*rand(1branch_count).*(pop(teachor1:)-pop(nowp:))...
+c2*rand(1branch_count).*(pop(teachor2:)-pop(nowp:));
pt = pop(nowp:)+vt;
pop(nowp:) = pt>=0.5;
pv(nowp:) = vt;
fitv(nowp) = fitfun(Xpop(nowp:)branch);
end
end
for n = 1:pop_size/level_count
nowp = level(1n);
pt = (pop(nowp:)+rand())>0.5 ;
if fitfun(Xptbranch)
- 上一篇:三相桥式整流
- 下一篇:simuli
nk仿真伺服系统三环控制
评论
共有 条评论