EXP-2 Load Flow Solution Using Gauss Seidal Method
EXP-2 Load Flow Solution Using Gauss Seidal Method
Aim:
To write the MATLAB coding to find the voltage value of various buses in a power system
by using Gauss Seidal algorithm.
Apparatus Required:
Theory:
The gauss-seidel method is an iterative algorithm for solving a set of non linear load flow
equations. The process of computing all the bus voltages is called one itera-tion .the iterative process
is then repeated till the bus voltage converges with in prescribed accuracy. the converges of bus
voltage is quite sensitive to the initial values assumed. Based on practical experiences it is easier to
get a set of initial voltages very close to final solution. To compute the (k+1)th iteration value of the
bus –p voltage, the (k+1)th iteration values of voltages are used for all buses less than p and kth
iteration values of voltages are used for all buses greater than or equal to p.
It is important to note that the slack bus is a reference bus and so its voltage will not change
.therefore in each iteration the slack bus voltage is not modified. For generator bus, the reactive power
is not refer specified .thee in order to calculate the phase of bus voltage of a generator bus. The non-
linear load flow equation is given by
Algorithm:
Step 1: Assume a flat voltage profile 1+j0bfor all buses except the slack bus
Step 3: Set iteration count, k=0 and assumed voltage profile of the buses are denoted as
0 0 0
Vi , V ,.........V
2 n
Step 5: Check for slack bus, If it is a slack bus go to step 12 otherwise continue
Step 6: Check for generator bus, if it is generator bus go to next step else go to step 9
P 1 n
Q k 1
p , cal 1 Im g V p
k
Y pq V q
k 1
Y pq V q
k
q 1 q p
The calculated reactive power may be within specified limit or it may violate the limits.
If the calculated reactive power is within the specified limit, then consider the bus as generator bus
If the calculated reactive power violates the specified limit then treat the bus as load bus
k
since the bus is treated as load bus U p need not be replaced by V p
spec
go to step 9
Step 8: For generator bus the phase voltage of the bus can be calculated as
1 Pp jQ p p 1 n
1
V pktemp Y V k 1
Y V k
Y pp V pk *
q 1
pq q
q p 1
pq q
Im part ofV p , temp
k 1
pk 1 tan 1 k 1
realpart of V p , temp
V pk 1 V p spec
pk 1
k 1
Step 9: For load bus, V p is calculated as
1 Pp jQ p p 1 n
V pk 1 Y V k 1
Y V k
Y pp V pk *
q 1
pq q
q p 1
pq q
V pk,acc
1
V pk V pk 1 V pk
then V pk 1 V pk 1 , acc
V pk 1 V pk 1 V pk
Step 12: Repeat steps 5 to 11 until all the bus voltages have been calculated. For this, increment the
bus count by 1 until the bus count is n.
Step 13: Find the largest amoung V1k 1 , V2k 1 ..........Vnk 1 Let this be Vmax . If Vmax . is less
than , then move to the next step, else increment the iteration count and go to step 4
Step 14: Calculate the line flow and slack bus power using the bus voltages.
Program:
clear all;
clc;
n=input('num of buses');
alpha=input('enter the acceleration factor alpha');
for i=1:n
for j=1:n
fprintf('enter the admittance between %d & %d',i,j);
y(i,j)=input('=');
end
end
Y(n,n)=0;
for i=1:n
for j=1:n
if i==j
for k=1:n
Y(i,j)=Y(i,j)+y(i,k);
end
else
Y(i,j)=-y(i,j);
end
end
end
for i=1:n
Bus=i
a(i)=input('enter the slackbus:0,loadbus=1,gen.bus=-1');
v(i)=input('enter the voltage');
th(i)=input('enter the theta value');
p(i)=input('enter the real power');
q(i)=input('enter the reactive power');
if a(i)==-1
d(i)=v(i);
ql(i)=input('enter the lower limit');
qu(i)=input('enter the upper limit');
end
end
for m=1:5
iter=m
for i=1:n
v(i)=v(i)*complex(cos(th(i)),sin(th(i)));
vl(i)=v(i);
end
for i=1:n
if a(i)==-1
b=0;
c=0;
for j=1:i-1
b=b+Y(i,j)*v(j);
end
for j=1:n
c=c+Y(i,j)+v(j);
end
q(i)=-imag(v(i)*(b+c));
if q(i)<ql(i)
q(i)=ql(i);
a(i)=1;
elseif q(i)>qu(i)
q(i)=qu(i);
a(i)=1;
end
fprintf('reactive power value of bus %d is %d',i,q(i))
end
end
for i=2:n
b=0;
c=0;
for j=1:i-1
b=b+Y(i,j)*v(j);
end
for j=i+1:n
c=c+Y(i,j)*v(j);
end
v(i)=((complex(p(i),-q(i))/v(i)-b-c))/Y(i,i);
if a(i)==-1
v(i)=d(i)*complex(cos(th(i)),sin(th(i)));
end
v(i)=vl(i)+alpha*(v(i)-vl(i));
th(i)=angle(v(i));
end
for i=1:n
if a(i)==-1
v(i)=d(i);
else
v(i)=abs(v(i));
end
end
v
th*180/pi
end
Result: