Back forward sweep algorithm for radial distribution systems

by

 

Backward/ forward sweep algorithm for three-phase load-flow analysis of radial distribution systems.

BF.m
% S.Moradian B.Sc. ,EE, IUST
%      BusNo   RealPower(pu) ReactivePower(pu) bdata stands for bus data
 bdata=[  1         0             0
          2         0.01          0.005
          3         0             0
          4         0.01          0.01
          ];
%     Inbus  Outbus Resistance(pu) Reactance(pu) ldata stands for line data
ldata=[  1      2
         2      3
         3      4
         ];     
y=j*[-0.5 0.5 0 0;0.5 -0.7 0.2 0;0 0.2 -0.5 0.3;0 0 0.3 -0.3];
%Forward Backward Sweep algorithm for Radial Distribution System  
c = input('Enter the central bus no.: ');
   Iterations = input('Enter the no. of iterations : ');
   sizl=size(ldata);
   sizv=size(bdata);   
for j5=1:sizv(1,1)
    v(j5,1)=1;
end
index(sizv(1,1),2)=0;
index(c,1)=1;
for i1=1:Iterations
  index=zeros(sizv(1,1),2);
  index(c,1)=1;
    %forward sweep
    for i2=1:sizv(1,1)
            i(i2,1)=conj(complex(bdata(i2,2),bdata(i2,3))/v(i2,1));
            for j1=1:sizl(1,1)
                if ldata(j1,1)==i2
                    i(i2,1)=i(i2,1)-(v(i2,1)-v(ldata(j1,2),1))*y(i2,ldata(j1,2));
                end
            end
    end
    % backward sweep
    v(c,1)=1;
    for i3=1:sizv(1,1)
            for j2=1:sizl(1,1)
                if (ldata(j2,2)==i3)
                    v(ldata(j2,2),1)=v(ldata(j2,1),1)+i(ldata(j2,2),1)/y(ldata(j2,1),i3);                  
                    index(ldata(j2,2),1)=1;
                end
            end
        end
        index(i3,2)=1;
    end
display(v);
display(i);
%IF YOU RECIEVE WILD RESULTS CHECK YOUR ACTIVE AND REACTIVE POWER INPUTS
%THEY MAY EXCEED THE MAXIMUM AMOUNT FOR YOUR SYSTEM
     
                
               
            
        
        
        
        
    
    
    
        
            
        
        
    

Contact us