You are on page 1of 5

Yashodhan Jaltare,111805050

PSA LAB 9.
Aim: Development of a generalized program for Load Flow Analysis using Gauss Seidal
Iterative method.

Theory: Given in manual.

Attachments:

MATLAB Code:

%% Gauss Seidel Load Flow analysis


clear all; clc
ch = input('Enter the IEEE system to analyze.: (6 or 9): '); % choose
between 6 or 9
while ch ~= 6 && ch ~= 9
fprintf('Invalid Input, try again\n');
ch = input('Enter the IEEE system to analyze.: (6 or 9): ');
end
switch ch
case 6
data6; disp('IEEE 6 bus system')
case 9
data9; disp('IEEE 9 bus system')
end
nbuses=length(bus(:,1));
V=bus(:,2); Vprev=V; % Initial bus voltages
The=bus(:,3); % Initial bus angles
P=bus(:,4)-bus(:,6);
Q=bus(:,5)-bus(:,7);
[Y] = Y_admi(line,bus,nbuses); % function to get the admittance matrix
tolerance=1;
iteration=0;
st=clock;
while (tolerance > 1e-8)
for k=2:nbuses
PYV=0;
for i=1:nbuses
if k ~= i
PYV = PYV + Y(k,i)* V(i); % Vk * Yik
end
% Estimate Qi at each iteration for the PV buses
V(k) = (1/Y(k,k))*((P(k)-j*Q(k))/conj(V(k))-PYV); % Compute bus
voltages
if bus(k,10) == 2 % For PV buses, the voltage magnitude remains
same, but the angle changes
V(k)=abs(Vprev(k))*(cos(angle(V(k)))+j*sin(angle(V(k))));
end
end
iteration=iteration+1; % Increment iteration count
tolerance = max(abs(abs(V) - abs(Vprev)));
Vprev=V;
end
ste=clock;
I=Y*V;
% Power at each node
S=V.*conj(I); % Complex power
for k=1:nbuses
if bus(k,10)==1
% Real and reactive generation at the Slack bus
Pgen(k)=real(S(k));
Qgen(k)=imag(S(k));
end
if bus(k,10)==2
% Real and reactive generation at the PV buses
Pgen(k)=real(S(k))+bus(k,6);
Qgen(k)=imag(S(k))+bus(k,7);
end
if bus(k,10)==3
Pgen(k)=0;
Qgen(k)=0;
end
end
% calculate the line flows and power losses
FromNode=line(:,1);
ToNode=line(:,2);
nbranch=length(line); % number of branches
% Define complex power flows
Ss = V(FromNode).*conj((V(FromNode) - V(ToNode)).*y ...
+ V(FromNode).*suceptancia(:,1)); % complex flow of the sending buses
Sr = V(ToNode).*conj((V(ToNode) - V(FromNode)).*y ...
+ V(ToNode).*suceptancia(:,2)); % complex low of the receiving buses

% Define active and reactive power flows


Pij=real(Ss);
Qij=imag(Ss);
Pji=real(Sr);
Qji=imag(Sr);
% Active power lossess
P_loss=sum(Pij+Pji);
% Reactive power lossess
Q_loss=sum(Qij+Qji);
disp(' Gauss Seidel Load-Flow Study')
disp(date)
fprintf('Number of iterations : %g \n', iteration)
fprintf('Solution time : %g sec.\n',etime(ste,st))
fprintf('Total real power losses : %g.\n',P_loss)
fprintf('Total reactive power losses: %g.\n\n',Q_loss)

l=1:1:length(line);
xy=[l' FromNode ToNode Pij Qij];
yx=[l' ToNode FromNode Pji Qji];
disp(xy)
disp(yx)
Flowchart for the Gauss-Seidal analysis:

Results:

Gauss Seidel Load-Flow Study


Power Flow Calculations

Number of iterations : 54
Solution time : 0.021262 sec.
Total real power losses : 0.084471.
Total reactive power losses: -0.0118696.

Generation Load
Bus Volts Angle Real Reactive Real Reactive
1.0000 1.0500 0 1.0845 0.2312 0 0
2.0000 1.0500 -3.7251 0.5000 0.8686 0 0
3.0000 1.0700 -4.3343 0.6000 0.9883 0 0
4.0000 0.9864 -4.1790 0 0 0.7000 0.7000
5.0000 0.9797 -5.2243 0 0 0.7000 0.7000
6.0000 1.0014 -5.9709 0 0 0.7000 0.7000

Line Flows
#Line From Bus To Bus Real Reactive
1.0000 1.0000 2.0000 0.2912 -0.1450
2.0000 1.0000 4.0000 0.4370 0.2273
3.0000 1.0000 5.0000 0.3563 0.1489
4.0000 2.0000 3.0000 0.0298 -0.1063
5.0000 2.0000 4.0000 0.3328 0.4960
6.0000 2.0000 5.0000 0.1549 0.1847
7.0000 2.0000 6.0000 0.2643 0.1527
8.0000 3.0000 5.0000 0.1933 0.2688
9.0000 3.0000 6.0000 0.4362 0.6450
10.0000 4.0000 5.0000 0.0421 -0.0234
11.0000 5.0000 6.0000 0.0171 -0.0909

1.0000 2.0000 1.0000 -0.2819 0.1416


2.0000 4.0000 1.0000 -0.4257 -0.2031
3.0000 5.0000 1.0000 -0.3451 -0.1378
4.0000 3.0000 2.0000 -0.0294 0.0746
5.0000 4.0000 2.0000 -0.3164 -0.4735
6.0000 5.0000 2.0000 -0.1493 -0.1884
7.0000 6.0000 2.0000 -0.2581 -0.1613
8.0000 5.0000 3.0000 -0.1810 -0.2684
9.0000 6.0000 3.0000 -0.4255 -0.6021
10.0000 5.0000 4.0000 -0.0417 -0.0145
11.0000 6.0000 5.0000 -0.0165 0.0634

>>

Conclusion:

Load flow studies are essential for determining the operation of the excitation system. Load
flow studies give us the bus voltage magnitude and phase angle of the voltage at each bus and
power flow on the transmission lines and on the buses.

We can solve the non-linear equations with simple technique. With the help of Gauss-Seidel
method we can get the accurate results through iterations. We can solve the load flow
equations with the MATLAB coding because it is very fast and we can get real and reactive
power and voltage magnitude through some steps.

It can be seen that the algorithm converges in the least number of iterations when λ is 1.4 and
the maximum number of iterations are required when λ is 2. In fact the algorithm will start to
diverge if larger values of acceleration factor are chosen.

You might also like