www.pudn.com > IEEE33DG.rar > fbm.m, change:2015-04-17,size:2770b


function fff=fbm(xmin) 
b=32;   %支路数,开断开关数 
n=33;   %节点数 
LL=5;   %联络开关数 
Z=[1 0 1 0.0922+i*0.047 0.1000+i*0.0600 
   2 1 2 0.4930+i*0.2511 0.0900+i*0.0400 
   3 2 3 0.3660+i*0.1864 0.1200+i*0.0800 
   4 3 4 0.3811+i*0.1941 0.0600+i*0.0300 
   5 4 5 0.8190+i*0.7070 0.0600+i*0.0200 
   6 5 6 0.1872+i*0.6188 0.2000+i*0.1000 
   7 6 7 0.7114+i*0.2351 0.2000+i*0.1000 
   8 7 8 1.0300+i*0.7400 0.0600+i*0.0200 
   9 8 9 1.0440+i*0.7400 0.0600+i*0.0200 
   10 9 10 0.1966+i*0.0650 0.0450+i*0.0300 
   11 10 11 0.3744+i*0.1238 0.0600+i*0.0350 
   12 11 12 1.4680+i*1.1550 0.0600+i*0.0350 
   13 12 13 0.5416+i*0.7129 0.1200+i*0.0800 
   14 13 14 0.5910+i*0.5260 0.0600+i*0.0100 
   15 14 15 0.7463+i*0.5450 0.0600+i*0.0200 
   16 15 16 1.2890+i*1.7210 0.0600+i*0.0200 
   17 16 17 0.3720+i*0.5740 0.0900+i*0.0400 
   18 1 18 0.1640+i*0.1565 0.0900+i*0.0400 
   19 18 19 1.5042+i*1.3554 0.0900+i*0.0400 
   20 19 20 0.4095+i*0.4784 0.0900+i*0.0400 
   21 20 21 0.7089+i*0.9373 0.0900+i*0.0400 
   22 2 22 0.4512+i*0.3083 0.0900+i*0.0500 
   23 22 23 0.8980+i*0.7091 0.4200+i*0.2000 
   24 23 24 0.8960+i*0.7011 0.4200+i*0.2000 
   25 5 25 0.2030+i*0.1034 0.0600+i*0.0250 
   26 25 26 0.2842+i*0.1447 0.0600+i*0.0250 
   27 26 27 1.0590+i*0.9337 0.0600+i*0.0200 
   28 27 28 0.8042+i*0.7006 0.1200+i*0.0700 
   29 28 29 0.5075+i*0.2585 0.2000+i*0.6000 
   30 29 30 0.9744+i*0.9630 0.1500+i*0.0700 
   31 30 31 0.3105+i*0.3619 0.2100+i*0.1000 
   32 31 32 0.3410+i*0.5362 0.0600+i*0.0400]; 
   C=[33 7  20 2.0+i*2.0       0             %联络开关矩阵C 
      34 8  14 2.0+i*2.0       0 
      35 11 21 2.0+i*2.0       0 
      36 17 32 0.5+i*0.5       0 
      37 24 28 0.5+i*0.5       0           ]; 
%  定义节点到母节点路径矩阵A 
A=zeros(b);                   %对矩阵A进行初始化 
for i1=1:b 
    A(i1,1)=i1;                 %将路径矩阵A的第一列储存为支路号 
end              
    for j=1:b                 %利用Z矩阵中的首末节点列向量进行路径搜索 
        n=j; 
        k=2; 
        while(j~=0)            %一直搜寻到母节点0结束 
        for m=1:b 
        if(Z(m,3)==j)          %在末节点定位j 
            A(n,k)=Z(m,2);      
            j=Z(m,2);          %将首节点赋给j,然后再在末节点定位j 
            k=k+1; 
        end 
        end 
        end 
    end 
    %遍历A矩阵形成单回路矩阵H 
    for i2=1:LL 
        jd=max(intersect(A(C(i2,2),:),A(C(i2,3),:)));  %取回路交叉点jd,保证是单回路 
        h=1; 
        while(A(C(i2,2),h)~=jd) 
            H(i2,h)=A(C(i2,2),h); 
            h=h+1; 
        end 
        h1=1; 
        while(A(C(i2,3),h1)~=jd) 
            H(i2,h)=A(C(i2,3),h1); 
            h=h+1; 
            h1=h1+1; 
        end 
        H(i2,h)=C(i2,1); 
    end 
    for i3=1:LL 
        a(1,i3)=H(i3,xmin(1,i3)); 
    end 
    fff=a;