View License

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

» Watch video

Highlights from
backward forward sweep method for radial distribution system

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

4.8
4.8 | 6 ratings Rate this file 94 Downloads (last 30 days) File Size: 2.77 KB File ID: #40300 Version: 1.1

backward forward sweep method for radial distribution system

by

 

13 Feb 2013 (Updated )

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

| Watch this File

File Information
Description

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.

Acknowledgements

Back Forward Sweep Algorithm For Radial Distribution Systems and Backward Forward Sweep Method For Radial Distribution System inspired this file.

Required Products MATLAB
MATLAB release MATLAB 7.7 (R2008b)
MATLAB Search Path
/
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (26)
09 Nov 2016 SAILADA ROHITKUMAR

hello sir what is the role of iteration in this method

Comment only
28 Oct 2016 MADDULA RAMANAREDDY

hello sir may know the reference papers for this loadflow method

Comment only
24 Oct 2016 Benhamida Farid

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.

Comment only
26 Aug 2016 yared tassew

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

Comment only
25 Aug 2016 yared tassew

%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)

Comment only
25 Aug 2016 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

Comment only
22 Aug 2016 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?

Comment only
27 Jul 2016 Saran Satsangi

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

Comment only
30 Mar 2016 yared tassew

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.

Comment only
30 Mar 2016 Oktoviano Gandhi

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!

18 Dec 2015 yared tassew

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

Comment only
18 Dec 2015 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,:);)))

Comment only
15 Oct 2015 yared tassew

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

Comment only
30 Sep 2015 Ramaseshan Rajasekaran

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

Comment only
13 Jul 2015 Divya

Divya (view profile)

Can the bibc matrix logic be adjusted accordingly?

24 Jun 2015 Divya

Divya (view profile)

Can you say how?

Comment only
24 Jun 2015 yared tassew

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.

Comment only
24 Jun 2015 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?

23 Jun 2015 Divya

Divya (view profile)

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

Comment only
25 Nov 2014 yared tassew

hey Guzman I also include the BCBV matrix in this post
http://www.mathworks.com/matlabcentral/fileexchange/40412-backward-forward-sweep-method-for-radial-distribution-system/content//backward_forward_sweep.m

Comment only
24 Nov 2014 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.

24 Nov 2014 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?

Comment only
16 Nov 2014 HAMID REZA  
23 Sep 2014 JAYA PRAKASH

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

Comment only
27 May 2014 Hosein

Hosein (view profile)

 
19 Feb 2013 yared tassew

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

Comment only
Updates
20 Nov 2014 1.1

hi

25 Aug 2016 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

26 Aug 2016 1.1

This one is the most robust one.

26 Aug 2016 1.1

This one is the most robust one

Contact us