File Exchange

image thumbnail

backward forward sweep method for radial distribution system

version 1.1 (2.77 KB) by

this is matlab code that is designed for distribution load flow using backward forwad sweep method

4.83333
7 Ratings

60 Downloads

Updated

View License

this is matlab code that is designed for distribution load flow using backward forwad sweep method using BIBC matrix method. it also include code that adjust your line data in to standard form if you accidentally interchange the sending and receiving end node.

Comments and Ratings (31)

sir pls send the details to pvsolanki29@gmail.com

dear yared tassew,
actually we're working on project, - power flow analysis in electrical power system so in which we're doing analysis on unbalance radial distribution system. so sir can u help us in forward backward method actually we're new learner in matlab coding so is there any source from where i can understand the code with notation.?

zoe

zoe (view profile)

K Vijetha

think you for uploading the file.
can you send reference paper for this program or procedure for this method.
i am taking a simple radial system with high R/X ratio (40). send details to vijetha258@gmail.com. please help me

think you ... where is equation which write this code or where is the refreance paper for this loadfiow ... and have you optimal sizing and location to reduce power losses in radial distribution system my email
al_mohnds2006@yahoo.com

hello sir what is the role of iteration in this method

hello sir may know the reference papers for this loadflow method

Hello Dear yared tassew
The data for branches are in pu as well as for load.
In cases of the load are in kw and kva, what kind of change will we made in code to obtain results.

yared tassew

yared tassew (view profile)

Dear coo boo, download the latest update
it is more robust. you can also choose any bus as a central bus.
Thanks

yared tassew

yared tassew (view profile)

%USE THIS ONE
clear all;

LD =[ 1.0000 1.0000 2.0000 0.1380 0.1380
2.0000 1.0000 3.0000 0.0960 0.0960
3.0000 2.0000 4.0000 0.1980 0.1980
4.0000 5.0000 3.0000 0.1200 0.1200
5.0000 4.0000 7.0000 0.1200 0.1200
6.0000 6.0000 5.0000 0.1380 0.1380
7.0000 7.0000 8.0000 0.1980 0.1980
8.0000 8.0000 9.0000 0.1560 0.1560];
BD =[ 1.0000 0 0
2.0000 0.0067 0.0032
3.0000 0.0044 0.0022
4.0000 0 0
5.0000 0 0
6.0000 0.0200 0.0097
7.0000 0.0111 0.0054
8.0000 0 0
9.0000 0 0];
F=LD(:,2:3);
M=max(LD(:,2:3));
N=max(M);
f=[1:N]';
for i=1:N
    g=find(F(:,:)==i);
    h(i)=length(g);
end
k(:,1)=f;
k(:,2)=h';

  cent= input('central bus ');
% this section of the code is to adjust line data to the standard
  NLD=zeros(N,size(LD,2));
c=find(LD(:,2:3)==cent);
NLD=LD(c,:)
LD(c,:)=[];
t=find(k(:,1)==cent);
k(t,2)=k(t,2)-length(c);
j=length(c);
i=1;
while sum(k(:,2))>0
    c=[];
    b=[];
    t=[];
    [c e]=find(LD(:,2:3)==NLD(i,3));
    
    
    if size(c,2)~=0
        b=LD(c,:);
        LD(c,:)=[];
        t=find(k(:,1)==NLD(i,3));
        k(t,2)=k(t,2)-(size(c,1)+1)
        NLD(i,3)
        d=find(b(:,3)==NLD(i,3));
        b(d,2:3)=[b(d,3),b(d,2)];
        NLD(j+1:j+size(c,1),:)=b;
        j=j+size(c,1);
    elseif size(c,2)==0 && k(NLD(i,3),2)>0
            k(NLD(i,3),2)=k(NLD(i,3),2)-1
            NLD(i,3)
    end
    i=i+1;
end
LD=sortrows(NLD,3);
% end the data is represented in standard format

%code for bus-injection to branch-current matrix
bibc=zeros(size(LD,1),size(LD,1));
for i=1:size(LD,1)
   
  
    if LD(i,2)==1
      bibc(LD(i,3)-1,LD(i,3)-1)=1;
    else
       bibc(:,LD(i,3)-1)=bibc(:,LD(i,2)-1);
       bibc(LD(i,3)-1,LD(i,3)-1)=1;
    end
end
S=complex(BD(:,2),BD(:,3));% complex power
Vo=ones(size(LD,1),1);% initial bus votage% 10 change to specific data value
S(1)=[];
VB=Vo;
iteration=input('number of iteration : ');

for i=1:iteration
     %backward sweep
    I=conj(S./VB);% injected current
    Z=complex(LD(:,4),LD(:,5));%branch impedance
    ZD=diag(Z);%makeing it diagonal
    IB=bibc*I; %branch current
   
    %forward sweep
    TRX=bibc'*ZD*bibc;
    VB=Vo-TRX*I;
end

Vbus=[1;VB]
display(Vbus)
display(IB)

Coo Boo

Dear yared

I have tested your code "backward forward sweep method for radial distribution system" with the following inputs:
LD =[ 1.0000 1.0000 2.0000 0.1380 0.1380
    2.0000 1.0000 3.0000 0.0960 0.0960
    3.0000 2.0000 4.0000 0.1980 0.1980
    4.0000 5.0000 3.0000 0.1200 0.1200
    5.0000 4.0000 7.0000 0.1200 0.1200
    6.0000 6.0000 5.0000 0.1380 0.1380
    7.0000 7.0000 8.0000 0.1980 0.1980
    8.0000 8.0000 9.0000 0.1560 0.1560];
BD =[ 1.0000 0 0
    2.0000 0.0067 0.0032
    3.0000 0.0044 0.0022
    4.0000 0 0
    5.0000 0 0
    6.0000 0.0200 0.0097
    7.0000 0.0111 0.0054
    8.0000 0 0
    9.0000 0 0];

But this error message appeared:
Attempted to access NLD(9,3); index out of bounds because size(NLD)=[8,5].
Error in LoadFlow (line 78)
            [c e]=find(LD(:,2:3)==NLD(i,3));

can you help me to correct it?

Thanks

UJJAL SUR

Dear yarad,
I see that this program can only be implemented over balanced radial distribution system, where as most of the IEEE test cases are unbalanced in nature. Can you give some idea ,how it can be implemented over unbalanced system too?

All, those are looking for robust distribution load flow (matlab code) may download from https://www.researchgate.net/publication/305618060_MATLAB_Code_for_Distribution_System_Load_flow_using_Forward-Backward_Sweep_Method

yared tassew

yared tassew (view profile)

hello,
dear Oktoviano Gandhi the positive complex and negative complex related to the voltage angle not the power loss. You can just calculate the power loss by multiplying the line current square with the line resistance.
thank you.

Dear Yared Tassew,

Thanks for the code, it helped me a lot. However, when I tested on 33-bus radial system, some node voltages have positive complex component while others have negative complex component. This causes positive and negative power losses across the branches. Do you have any idea on what is wrong? Thanks!

yared tassew

yared tassew (view profile)

Dear Mohamed,
send me the data and i will check it

Mohamed Ali

Dear Yared,
What is that mean the central bus?
If I choose 9 bus IEEE radial dist. system,
and select central bus as 1, it gives me error

(((Index exceeds matrix dimensions.
Error in radial9busieee (line 41)
NLD=LD(c,:);)))

yared tassew

yared tassew (view profile)

dear ramseshan rajaskaran,
is the IEEE 118 bus system radial distribution system? if it is it will work fine.

Dear yared tassew,

How can i execute your code on a IEEE 118 bus test system

when the code is executed, i get Index error

Please help

Divya

Divya (view profile)

Can the bibc matrix logic be adjusted accordingly?

Divya

Divya (view profile)

Can you say how?

yared tassew

yared tassew (view profile)

hello divya if you choose any bus as a central bus you have to check still the system is radial.

that is why it is showing error the system is not radial when you choose a different bus. So make sure the system is still radial when you choose a different bus.

Divya

Divya (view profile)

When other buses like 2 or 3 are selected as central bus the program is giving error.Can this program be used for having central bus other than first bus?

Divya

Divya (view profile)

For central bus other than first bus the code is showing error.

Guzman

Guzman (view profile)

The error was mine! Your code is correct. Simply you defined the BCBV from the BIBC matrix through the impedance matrix. It is perfect. I'm sorry.

Guzman

Guzman (view profile)

I've been reviewing your code, and I think that you might have an error at the forward sweep. Note that your matrix TRX is probably meant to find the voltage deviations at each iteration. If so, you should not be using the BIC matrix, but the branch-current to bus-voltage (BCBV) matrix, which seems to be missing in your code. Am I right?

HAMID REZA

JAYA PRAKASH

plz add some files(information related to backward forward sweep method and B.I.B.C) related to theory of above method.

Hosein

Hosein (view profile)

yared tassew

yared tassew (view profile)

guys im doing some improvement on this code i will post it soon. which includes the bcbv matrix which make it easier

 

Updates

1.1

This one is the most robust one

1.1

This one is the most robust one.

1.1

There is a little bit of robustness added to it. And more update will come on being able to choose any bus to be a central bus. but if any one need it soon email me. Thanks

1.1

hi

MATLAB Release
MATLAB 7.7 (R2008b)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video