Вы находитесь на странице: 1из 5

Lab Session 6

Load Flow Analysis of a power system using Gauss Seidel method in MATLAB

This exercise concerns the development of a MATLAB program to solve power flow
problems using Gauss Seidel Method.

Calculate voltages at bus 2 and 3. Determine the line flows and line losses and the slack bus
real and reactive power. Line impedances are marked in per unit on a 100 MVA base. Use an
accuracy factor of 0.00001.

Your report should consist of:

1. Brief introductory comments on your solution.


2. A flow chart or other program description.
3. Description of any special features.
4. Description of the output.

Construct a power flow diagram and show the direction of line flows.
MATLAB Code:
function Y=ybus(nbranch,ref)
clc %clear command window
if ref==0||ref==1
if ref==1 %if reference bus present
nbref=input('no of branches connected to the reference = ');
disp('enter line data')
for p=1:nbref
disp('from refernce bus :')
tb=input('to bus no. :');
tb=tb+1;
r=input('resistance of line =');
x=input('reactance of line =');
z = r + i*x; % Z matrix...
y = 1./z; % To get inverse of each element...
Ldata(p,:)=[1 tb r x y];
end
else
nbref=0;
end
for p=1+nbref:nbranch
fb=input('from bus no. :');
tb=input('to bus no. :');
r=input('resistance of line =');
x=input('reactance of line =');
if ref==1
fb=fb+1;
tb=tb+1;
end
z = r + i*x; % Z matrix...
y = 1./z; % To get inverse of each element...
Ldata(p,:)=[fb tb r x y];
end
fb = Ldata(:,1); % From bus number...
tb = Ldata(:,2); % To bus number...
r = Ldata(:,3); % Resistance, R...
x = Ldata(:,4); % Reactance, X...
y = Ldata(:,5);
nbus = max(max(fb),max(tb)); % no. of buses...
Y = zeros(nbus,nbus); % Initialise YBus...

% Formation of the Off Diagonal Elements...


for k=1:nbranch
Y(fb(k),tb(k)) = Y(fb(k),tb(k))-y(k);
Y(tb(k),fb(k)) = Y(fb(k),tb(k));
end

% Formation of Diagonal Elements....


for m =1:nbus
for n =1:nbranch
if fb(n) == m
Y(m,m) = Y(m,m) + y(n);
elseif tb(n) == m
Y(m,m) = Y(m,m) + y(n);
end
end
end
if ref==1
Y(1,:)=[]; %if reference bus exist delete row 1
Y(:,1)=[]; %if reference bus exist delete column 1
end
else
display('reference nodes cannot be more than 1')
end
n=0;
V1=1.05;
V2o=1;
V3o=1;
P2=-4;
Q2=-3.2i;
while(1)
V2n=[1/Y(2,2)]*[(P2-Q2/V2o)-(V1*Y(2,1))-(V3o*Y(2,3))]
P3=-3;
Q3=-2.7i;
V3n=[1/Y(3,3)]*[(P3-Q3/V3o)-(V1*Y(3,1))-(V2n*Y(3,2))]
n=n+1;
if abs(V2n-V2o)<=0.00001 && abs(V3n-V3o)<=0.00001
break;
else
V2o=V2n
V3o=V3n
end
end
no_of_iterations=n
I12=(V1-V2n)/(0.0108+0.0333i)
I21=-I12
I13=(V1-V3n)/(0.0147+0.0125i)
I31=-I13
I23=(V2n-V3n)/(0.0235+0.05i)
I32=-I23
S12=V1*conj(I12)*100
S21=V2n*conj(I21)*100
S13=V1*conj(I13)*100
S31=V3n*conj(I31)*100
S23=V2n*conj(I23)*100
S32=V3n*conj(I32)*100
S1=V1*(V1*Y(1,1)+V2n*Y(1,2)+V3n*Y(1,3))*100
Ploss12=abs(abs(real(S12))-abs(real(S21)))
Qloss12=abs(abs(imag(S12))-abs(imag(S21)))
Ploss13=abs(abs(real(S13))-abs(real(S31)))
Qloss13=abs(abs(imag(S13))-abs(imag(S31)))
Ploss23=abs(abs(real(S23))-abs(real(S32)))
Qloss23=abs(abs(imag(S23))-abs(imag(S32)))
Description:

First of all, we found out the Y-bus of the given power system. Then we found
voltages i.e V2 and V3 at load buses. The currents from node 1 to2, 2 to 3 and 1 to 3 was
found. After that, we found powers flow from each node. Then we found losses took place
due to power flow. The code also shows the number of iterations performed to satisfy the
given accuracy factor.

MATLAB Results:
Power Flow Diagram:

Summary:

Load flow analysis is performed to calculate the voltage magnitude and their respective phase
angles at different locations. It can also be used to find line flows and line losses. VAR
generation and consumption can also be calculated. In this exercise the desired voltages are
calculated after performing 7 iterations.

Вам также может понравиться