Load Flow Analysis – Power System Analysis (Matlab Programming)

5/5 - (1 vote)

Load Flow analysis in power system

Load flow is a simulation of an electrical power system that analyzes power distribution networks from the given line and bus data. It is the process of calculating the amount of power that will be drawn from a network. The basic principle behind load flow is that if we know the current demand on a particular bus, we can calculate how much power is being drawn from the system. This power is then distributed to all other buses in the network. Distribution power flow analysis includes voltage, current, power factor, real and reactive power losses, harmonics, etc.

In some applications, particularly in power system planning, distribution automation, and practical studies, it is crucial to solve the load flow problem efficiently so that the load flow solution can be repeatedly calculated for different situations.

power flow analysis is done to determine if there are any equipment problems or if the network is overloaded. If a problem is found, the analysis helps determine where the problem exists and how to fix it to enhance the quality of power supply to customers.

Electrical Power Systems Design and Analysis

In a power system, steady state stability refers to maintaining the system’s initial condition after a slight disturbance. In other words, the system tends to restore itself to the initial conditions quickly. Power systems are very complex, and many variables need to be taken into account when solving for the steady state operation of the power system.

In a distributed load flow analysis for the power grid, four quantities are classified as Real and Reactive Power, Voltage Magnitude and Phase Angle. In the distribution system or electrical power transmission, power flow analysis buses, and quantities are associated with each other. The buses are entitled Load bus, Generator bus, and reference slack bus.

clc;
clear all;
format short;
tic
m=load('loaddata33bus.m');
l=load('linedata33bus.m');

% m=load('loaddata69bus.m');
% l=load('linedata69bus.m');

br=length(l);
no=length(m);
f=0;
d=0;
MVAb=100;
KVb=12.66;
Zb=(KVb^2)/MVAb;
% Per unit Values
for i=1:br
    R(i,1)=(l(i,4))/Zb;
    X(i,1)=(l(i,5))/Zb;
end
for i=1:no
    P(i,1)=((m(i,2))/(1000*MVAb));
    Q(i,1)=((m(i,3))/(1000*MVAb));
end
R;
X;
P;
Q;
C=zeros(br,no);
for i=1:br
    a=l(i,2);
    b=l(i,3);
    for j=1:no
        if a==j
            C(i,j)=-1;
        end
        if b==j
            C(i,j)=1;
        end
    end
end
C;
e=1;
for i=1:no
    d=0;
    for j=1:br
        if C(j,i)==-1
            d=1;
        end
    end
    if d==0
        endnode(e,1)=i;
        e=e+1;
    end
end
endnode;
h=length(endnode);
for j=1:h
    e=2;
    
    f=endnode(j,1);
   % while (f~=1)
   for s=1:no
     if (f~=1)
       k=1;  
       for i=1:br
           if ((C(i,f)==1)&&(k==1))
                f=i;
                k=2;
           end
       end
       k=1;
       for i=1:no
           if ((C(f,i)==-1)&&(k==1));
                f=i;
                g(j,e)=i;
                e=e+1;
                k=3;
           end            
       end
     end
   end
end
for i=1:h
    g(i,1)=endnode(i,1);
end
g;
w=length(g(1,:));
for i=1:h
    j=1;
    for k=1:no 
        for t=1:w
            if g(i,t)==k
                g(i,t)=g(i,j);
                g(i,j)=k;
                j=j+1;
             end
         end
    end
end
g;
for k=1:br
    e=1;
    for i=1:h
        for j=1:w-1
            if (g(i,j)==k) 
                if g(i,j+1)~=0
                    adjb(k,e)=g(i,j+1);            
                    e=e+1;
                else
                    adjb(k,1)=0;
                end
             end
        end
    end
end
adjb;
for i=1:br-1
    for j=h:-1:1
        for k=j:-1:2
            if adjb(i,j)==adjb(i,k-1)
                adjb(i,j)=0;
            end
        end
    end
end
adjb;
x=length(adjb(:,1));
ab=length(adjb(1,:));
for i=1:x
    for j=1:ab
        if adjb(i,j)==0 && j~=ab
            if adjb(i,j+1)~=0
                adjb(i,j)=adjb(i,j+1);
                adjb(i,j+1)=0;
            end
        end
        if adjb(i,j)~=0
            adjb(i,j)=adjb(i,j)-1;
        end
    end
end
adjb;
for i=1:x-1
    for j=1:ab
        adjcb(i,j)=adjb(i+1,j);
    end
end
b=length(adjcb);

% voltage current program

for i=1:no
    vb(i,1)=0.99;
end
for s=1:10
for i=1:no
    nlc(i,1)=conj(complex(P(i,1),Q(i,1)))/(vb(i,1));
end
nlc;
for i=1:br
    Ibr(i,1)=nlc(i+1,1);
end
Ibr;
xy=length(adjcb(1,:));
for i=br-1:-1:1
    for k=1:xy
        if adjcb(i,k)~=0
            u=adjcb(i,k);
            %Ibr(i,1)=nlc(i+1,1)+Ibr(k,1);
            Ibr(i,1)=Ibr(i,1)+Ibr(u,1);
        end
    end      
end
Ibr;
for i=2:no
      g=0;
      for a=1:b 
          if xy>1
            if adjcb(a,2)==i-1 
                u=adjcb(a,1);
                vb(i,1)=((vb(u,1))-((Ibr(i-1,1))*(complex((R(i-1,1)),X(i-1,1)))));
                g=1;
            end
            if adjcb(a,3)==i-1 
                u=adjcb(a,1);
                vb(i,1)=((vb(u,1))-((Ibr(i-1,1))*(complex((R(i-1,1)),X(i-1,1)))));
                g=1;
            end
          end
        end
        if g==0
            vb(i,1)=((vb(i-1,1))-((Ibr(i-1,1))*(complex((R(i-1,1)),X(i-1,1)))));
        end
end
s=s+1;
end
nlc;
Ibr;
vb;
vbp=[abs(vb) angle(vb)*180/pi];


for i=1:no
vbp(i,1)=abs(vb(i));
vbp(i,2)=angle(vb(i))*(180/pi)
end


toc;
for i=1:no
    va(i,2:3)=vbp(i,1:2);
end
for i=1:no
    va(i,1)=i;
end
va;


Ibrp=[abs(Ibr) angle(Ibr)*180/pi];
PL(1,1)=0;
QL(1,1)=0;

% losses
for f=1:br
    Pl(f,1)=(Ibrp(f,1)^2)*R(f,1);
    Ql(f,1)=X(f,1)*(Ibrp(f,1)^2);
    PL(1,1)=PL(1,1)+Pl(f,1);
    QL(1,1)=QL(1,1)+Ql(f,1);
end

Plosskw=(Pl)*100000;
Qlosskw=(Ql)*100000;
PL=(PL)*100000;
QL=(QL)*100000;


voltage = vbp(:,1);
angle = vbp(:,2)*(pi/180);
plot(m(:,1),abs(voltage));
% hold on

% Plosskw
sum(Plosskw );
sum(Qlosskw);

%
Plosskw(33,1)=PL;
Qlosskw(33,1)=QL;

sprintf('Power-Loss=%d KW, Power-Loss=%d KVAr' ,PL,QL')     
Sr=(1:33)';

plot(voltage)

    %% EXCEL FOR DG
T =table(Sr,Plosskw,Qlosskw,angle,voltage);        
T(:,1:5);
excel_file = 'NO_DG_IEEE33.xlsx';
writetable(T,excel_file,'Sheet',1,'Range','H1');

load flow analysis of radial distribution system matlab code

Bus Bar in Power System

When we look at our power grid system, we see it as one extensive bus network. The power grid uses buses that connect multiple lines, components like generators, and loads. Four parameters are associated with different types of buses in power flow studies like

Voltage magnitude

Voltage phase angle

Reactive power

Active power

Buses in the load flow study of the distribution system or other networks are classified as generation buses, load buses, or slack buses.

Power Distribution Terminal Bus Bar

1) A generation bus (P-V bus) is a name for the generator station in a power grid. If you have solar panels on your roof, you could run a photovoltaic bus, the generator station in the network. The generator bus is known to have unknown variables. They are the phase angle θ of the voltage and the reactive power Q. The bus voltage is always defined with the other buses that share this bus.

load flow analysis project report

2) The buses without generators are referred to as load bus or (P-Q bus) that integrates reactive and active power into the bus system. Here magnitude of the voltage V and phase angle θ is unknown. It would be best if you used the load flow equation to find both these quantities. The real and reactive power is known based on the line and load data. 

3) The significance of the slack bus in load flow analysis is that it does not carry any load and is known as a utility bus. The magnitude and phase of the voltage are fixed while real P and reactive power Q are unknown. The main advantage of a generator bus is that it provides active control, meaning that the bus can be used entirely by itself. Once the power loss is known, it is possible to create a distribution network to compensate for it.

“PV Bus” is the bus that supports the voltage and real power.

“PQ Bus” is the bus that needs real and reactive power.

“Reference Bus” is the bus that supports real and reactive power.

PV_Bus (Generation Bus).

PQ_Bus (Load Bus).

Slack_bus (Utility Bus).

matlab code for load flow analysis in radial distribution system

Load Flow Analysis using Forward Backward Sweep Method

Three techniques are used to calculate load flow, with two being the most common. Gauss Seidel, Newton Raphson, and Fast Decoupled methods are used to solve linear systems.

matlab program for load flow analysis

Newton-Raphson & Gauss-Seidel are standard algorithms best for high voltage systems and complex non-linear problems. However, this method is more straightforward than the newton-raphson and gauss seidel method for power flow analysis having simpler implementation, good convergence speed, good accuracy, and low memory requirement. 

load flow analysis notes

Unbalanced Load Flow Analysis

The need for optimizing power systems through efficient and reliable techniques has increased due to the increasing complexity of power distribution systems. Load flow studies should also be able to handle various system configurations accurately and quickly, so they are the most crucial power system analysis tool.

When using a radial system to supply power, you will often notice that the distribution systems are unbalanced due to single-phase, two-phase, or three-phase loads. So, in this case, you need to look at the load-flow solution and consider how they would be impacted if there were unbalanced.

The balanced load-flow approach cannot directly apply to an unbalanced network. Three-phase power flow analysis is an alternative to the single-phase method of analyzing unbalanced systems. However, it cannot develop by extending the single-phase balanced methods.

A three-phase load-flow method must be used to analyze power distribution problems. This will allow you to study the effects of fundamental connections like phase shifts and transformation ratios for each phase at different nodes and how they affect your power system. The balanced models are not useful anymore for un-transposed lines and cables.

Load Flow and Short Circuit Analysis

If a current-carrying conductor or a part of the circuit gets in contact with another wire, other parts of the circuit, or even the ground, it causes a short circuit. That is why short circuit study and analysis are important because the current flow in an excessive amount through the path of low resistance, then the system will become unstable, known as a power surge.

This may damage the power source by producing heat and fires, which is why fuses glow. So it is essential to check whether the power system is protected against short circuits, and what type of protective device should be used, as per its requirement, to counteract short circuit currents.

The extra heat effect weakens electrical wiring, insulation, and other components and can also damage. Overcurrent protection devices (OCPD) detect an overload current and then automatically disconnect the load in order to prevent damage to the load. Through the short circuit test, aka the short circuit analysis, you can find out the magnitude of the short circuit current to stop it.

What are the benefits of short circuit analysis?

Provides information on how to determine the level and type of protective equipment required for the specific use of each device and helps to avoid unplanned outages and downtime. It makes you comply with NEC and provides information required for NFPA.

Power system analysis of short circuit load flow and harmonics

With the Harmonic Load Flow Analysis, you can analyze harmonic current and voltage in your system, determine current characteristics and diagnose any faults affecting the objective function’s voltage and current constraints.

Electrical Load Flow Analysis Software:

ETAP

PowerWorld Simulator

DIgSILENT Power Factory

PSCAD

ETAP load flow analysis

The best load-flow software on the market is ETAP Load Flow Software. It is the industry-leading solution for performing voltage drop calculations and power flow analysis. It is user-friendly and a powerful calculation engine with efficient and reliable outcomes.

Power World Simulator

Load flow analysis using this software package designed to perform operations related to voltage power system on a time frame of up to several days. 

What is SKM used for?

SKM Power Tools is a simulation program used by power utilities to simulate real events that occur in power systems. It provides a graphical user interface that allows users to quickly and accurately visualize the behavior of large electric power networks.

 Interested to Learn More:

Read relevant articles to improve your understanding. Visit the below link for additional information including details about project design and simulation.

 load flow analysis using Matlab Simulink

IEEE 33 bus distribution feeder & IEEE 14 Bus System

Particle swarm optimization Matlab Code

Local Distribution System instead of IEEE Distribution Test Feeder

Solar and Wind distributed generation

The End.

276 thoughts on “Load Flow Analysis – Power System Analysis (Matlab Programming)”

  1. Here is Mr Benjamin contact Email details,lfdsloans@outlook.com. / lfdsloans@lemeridianfds.com Or Whatsapp +1 989-394-3740 that helped me with loan of 90,000.00 Euros to startup my business and I'm very grateful,It was really hard on me here trying to make a way as a single mother things hasn't be easy with me but with the help of Le_Meridian put smile on my face as i watch my business growing stronger and expanding as well.I know you may surprise why me putting things like this here but i really have to express my gratitude so anyone seeking for financial help or going through hardship with there business or want to startup business project can see to this and have hope of getting out of the hardship..Thank You.

  2. Hello Sir!
    Am now preparing my PhD proposal in Highway Designing. Am interested to apply PSO in MATLAB for cost optimization.
    Can you please send me this code to at least start going through for the load ahead……
    Thank you in advance
    (nickruvumana@gmail.com)

  3. A big thanks to Dr Oselumen i never believe that there still exist a real death spell caster after all this years of disappointment from the enormous spammers on the Internet who go about scamming people, until i was opportune to meet Dr Oselumen a real spell caster, through a close friend called Jennifer who Dr oselumen had helped before, when i contacted him with his email via droselumen@gmail.com i explain how my ex have been giving me problem in my marriage, she never allowed me a moment of peace, and i need to end it by killing her, and i don't want to make use of assassin because it will be risky so i needed to do it in a spiritual way that's why i decided to contact him, he assured me not to worry as i have contacted the right person at the right time, i co-operated with him and in less than a week my ex was dead, she slept and never woke up all thanks to Dr Oselumen indeed he's really a humble man. you can contact dr oselumen for any death spell, such as to kill your superior in the office and take his or her place, death spell to kill your father and inherit his wealth ,death spell to kill anyone who have scammed you in the past ,spell for increase in salaries, spell for promotion at the office, spell to get your ex lover back, if things is not working well in your life then you need to contact him now via Email droselumen@gmail.com call or add him on whatsapp +2348054265852.

  4. HOW I GO MY DESIRED LOAN AMOUNT FROM A RELIABLE AND TRUSTED LOAN COMPANY LAST WEEK. Email for immediate response: drbenjaminfinance@gmail.com Call/Text: +1(415)630-7138 Whatsapp +19292227023

    Hello everyone, My name is Mr.Justin Riley Johnson, I am from Texas, United State, am here to testify of how i got my loan from BENJAMIN LOAN INVESTMENTS FINANCE(drbenjaminfinance@gmail.com) after i applied Two times from various loan lenders who claimed to be lenders right here this forum,i thought their lending where real and i applied but they never gave me loan until a friend of mine introduce me to {Dr.Benjamin Scarlet Owen} the C.E.O of BENJAMIN LOAN INVESTMENTS FINANCE who promised to help me with a loan of my desire and he really did as he promised without any form of delay, I never thought there are still reliable loan lenders until i met {Dr.Benjamin Scarlet Owen}, who really helped me with my loan and changed my life for the better. I don't know if you are in need of an urgent loan also, So feel free to contact Dr.Benjamin Scarlet Owen on his email address: drbenjaminfinance@gmail.com BENJAMIN LOAN INVESTMENTS FINANCE holds all of the information about how to obtain money quickly and painlessly via Whatsapp +19292227023 Email: drbenjaminfinance@gmail.com and consider all your financial problems tackled and solved. Share this to help a soul right now, Thanks..

  5. DO YOU NEED AN URGENT LOAN???
    INSTANT AFFORDABLE PERSONAL/BUSINESS/HOME/INVESTMENT LOAN OFFER WITHOUT COST/STRESS CONTACT US TODAY VIA Whatsapp +19292227023 Email drbenjaminfinance@gmail.com

    Hello, Do you need an urgent loan to support your business or in any purpose? we are certified and legitimate and international licensed loan Company. We offer loans to Business firms, companies and individuals at an affordable interest rate of 2% , It might be a short or long term loan or even if you have poor credit, we shall process your loan as soon as we receive your application. we are an independent financial institution. We have built up an excellent reputation over the years in providing various types of loans to thousands of our customers. We Offer guaranteed loan services of any amount to people all over the globe, we offer easy Personal loans,Commercial/business loan, Car Loan Leasing/equipment finance, Debt consolidation loan, Home loan, ETC with either a good or bad credit history. If you are in need of a loan do contact us via Whatsapp +19292227023 Email drbenjaminfinance@gmail.com
    ®Capital Managements Inc™ 2021.
    Share this to help a soul right now, Thanks

  6. HELLO, I am Rebecca Michaelson by name living in Europe. Here is a good news for those interested. There is away you can earn money without stress contact (THOMAS FREDDIE) for a blank [ATM CARD] today and be among the lucky once who are benefiting from this cards. This PROGRAMMED blank ATM card is capable of hacking into any ATM machine anywhere in the world. I got my master card from a good Hacker on the internet, with this ATM Card I am able to collect $5000 dollars every day via contacts:
    +1 (985)-465-8370 {thomasunlimitedhackers@gmail.com}
    I was very poor but this card have made me rich and happy, If you want to get this opportunity to become rich and establish your business then apply for this Master card, I am so happy about this because i got mine last week and I have used it to get $240,000.00 dollars from THOMAS FREDDIE UNLIMITED Hackers is giving out the card just to help the poor and needy and they ALSO OFFER FINANCIAL ASSISTANCE. get yours from THOMAS FREDDIE UNLIMITED HACKERS today. Kindly contact them by Email thomasunlimitedhackers@gmail.com

    Thank You and God bless

  7. My name is Mr. Klaus Dieter, I work for the French financial institution Crédit Mutuel with the partnership of the bank BNP Paribas, we offer you offers at an interest rate of 3% per year, to start with new projects:
    – You have unpaid debt.
    – Buying a new house.
    – buy a new car.
    – Buying a new apartment or property.
    Get personal loans, business loans.
    If you would like loans for setting up your business and project, do not hesitate to send us an email:
    bnpfinanzenhilfe@gmail.com

    Whatsapp: +4917694954827

  8. My name is Mr. Klaus Dieter, I work for the French financial institution Crédit Mutuel with the partnership of the bank BNP Paribas, we offer you offers at an interest rate of 3% per year, to start with new projects:
    – You have unpaid debt.
    – Buying a new house.
    – buy a new car.
    – Buying a new apartment or property.
    Get personal loans, business loans.
    If you would like loans for setting up your business and project, do not hesitate to send us an email:
    bnpfinanzenhilfe@gmail.com

    Whatsapp: +4917694954827

  9. I was searching for loan to sort out my bills& debts, then i saw comments about Blank ATM Credit Card that can be hacked to withdraw money from any ATM machines around you . I doubted thus but decided to give it a try by contacting (smithhackingcompanyltd@gmail.com} they responded with their guidelines on how the card works. I was assured that the card can withdraw $5,000 instant per day & was credited with$50,000,000.00 so i requested for one & paid the delivery fee to obtain the card, after 24 hours later, i was shock to see the UPS agent in my resident with a parcel{card} i signed and went back inside and confirmed the card work's after the agent left. This is no doubts because i have the card & has made used of the card. This hackers are USA based hackers set out to help people with financial freedom!! Contact these email if you wants to get rich with this Via: smithhackingcompanyltd@gmail.com or WhatsApp +1(360)6370612

  10. I would like to thank Lapo Micro Finance for giving me a loan. I was deceived several times trying to get a loan until I came across Lapo Micro Finance who provided me with a loan worth $ 23,000 to care for my sick child. If you need a real lender today contact Lapo .Contact email: lapofunding960@gmail.com
    Whatsapp +447883183014

  11. Hey, is exactly 1year my lover came back to me, I’m letting you know how i got my ex back because this Christmas holiday everyone need their love ones around them not just your love ones but your lover, a year ago i was heartbroken and i knew i could not spend the holiday alone that is when i was looking for how i can make my lover come back to me so that we can make things right, to cut the long story short on a faithful day i came across the details i will be dropping on the internet, someone talking about how she got her ex back so i took this details I’m dropping via email:
    drosasu25@gmail.com
    Website https://drosasusolutionhome.com
    WhatsApp +2347064365391
    And I contacted him and I told him that I want my lover to come back to me, today I’m with my lover. Thank you Dr. Osasu TEMPLE for the help. also has other cure for HIV AIDS, DIABETES,HEPATITIS B,CANCER,HEART DISEASE,MIGRAINES,COLD SORE

  12. hello sir,
    I watched your video regarding load flow analysis in youtube and thats what brings me to comment here. please share code for load flow analysis and also if you have harmonic load flow analysis code please sent. I find difficulty in representation of spectra of harmonic current and also code.

    waiting for your response

Leave a Comment

Your email address will not be published. Required fields are marked *