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

Power Systems Operations and Control

Load flow and Contingency analysis using a Screening Algorithm


Narwal Ajit S., Baradi Dinesh, Graduate Students, NC State University

Brief Report: A load flow study is
conducted on two systems, first being a 4-
bus system and the second being an 85 bus
system. The screening algorithm [1] used
was the following:
1) Calculate
The Y
bus
is the original system Y
bus
and V
o
is
the initial voltage condition given for the
system.
2) The I
0
inj
is considered to be constant for
the loads and the generators are replaced by
their Norton equivalent circuits and fresh
(for generators) current injections are
determined using
o
f g o
ginj g
s s
E V
I I
jX jX
= = +

3) Simulate contingency and new Y
bus
is
created, here the generator reactances are
included in the Y
bus
.
l l c n
bus bus
l l
y y
Y Y
y y

(
= +
(



4) Calculate new system voltages using
[ ]
c c
bus inj
Y V I =
5) The final step is the check the feasibility
of the new operating conditions
Criterion:
0.95 1.05 S
mx
i l l
V S < < <
MATLAB code:
The code used to carry out the study is such
that the same code can be used to run load
flow and carry out the contingency analysis
for a system containing any number of
buses. The only thing that the user needs to
ensure is that the file containing the system
data in standard IEEE format is
uncommented in the nascent lines of the
program.
The user, additionally, had been empowered
to create a contingency between any buses
desirable which increases the functionality
of the program.
Code:
clear all

% **********Uncomment ONE of the
next TWO lines to run the
code**********

%run Pf4busHw_Ieee; %
Uncomment to run the 4-bus system

%run DTSsys_Ieee_rvc; %
Uncomment to run the 85-bus system
%----------------------x-----------
-----------
%Original Ybus determination

zinfo=[brnch(:,1) brnch(:,2)
brnch(:,7) brnch(:,8) ];
nl=zinfo(:,1);
nr=zinfo(:,2);
nbus=max(max(nl), max(nr));
nbr = length(nl); % no.
of branches
% linedata = linedata30(); %
Calling "linedata3.m" for Line Data
nl = brnch(:,1);
nr = brnch(:,2);
R = brnch(:,7);
X = brnch(:,8);
b = brnch(:,9); %Ground
Admittance, B/2
a = brnch(:,14); %Tap setting Value
Z = R + j*X;
y = ones(nbr,1)./Z; %
To get inverse of each element
b = j*b;
Y = zeros(nbus,nbus); %
Initialise YBus
% Formation of off-diagonal
elements
for k = 1:nbr;
if nl(k)>0 && nr(k)>0 &&
a(k)~=0 && a(k)~=1;
Y(nl(k),nr(k)) =
Y(nl(k),nr(k))-y(k)/a(k);
Y(nr(k),nl(k)) =
Y(nl(k),nr(k));
elseif nl(k)>0 && nr(k)>0;

Y(nl(k),nr(k))=Y(nl(k),nr(k))-y(k);
Y(nr(k),nl(k))=Y(nl(k),
nr(k));
end

end
% Formation of diagonal
elements....
for n=1:nbus;
for k=1:nbr;
if nl(k) == n && a(k)~=0
&& a(k)~=1;
Y(n,n) = Y(n,n) +
y(k)/(a(k)^2) + b(k);
elseif nl(k) == n;

Y(n,n)=Y(n,n)+y(k)+b(k);
elseif nr(k) == n;
Y(n,n) = Y(n,n) +
y(k) + b(k);
end
end
end
ybusold=Y;
%------------old Ybus calculation
ends------------------------

%----------Original and modified
Iinjection calculation-------
syms p;
p=1;
pg=bus(:,9); %real
power
qg=bus(:,10);
%reactive power
xs=(0.05);
%generator reactance
busnbr=length(pg);
Vsol=bus(:,5);
theta=bus(:,6);
theta_degree=theta*(pi/180);
angle=cos(theta_degree)+j*(sin(thet
a_degree));
Vvector= Vsol.*(angle);
%original voltage vector
determination
a=zeros(busnbr,1);
iinj0=(ybusold)*(Vvector); %
for i=1:1:busnbr
if pg(i)==0 && qg(i)==0
I_inj(i,1)=iinj0(i);
elseif pg(i)~=0 && qg(i)~=0
a(i)=iinj0(i);

I_inj(i,1)=iinj0(i)+((Vvector(i))./
(j*xs));
a(i)=I_inj(i);
end
end
%-------------------Injection
calculation ends ------------------

%-----------------Creating
contingency------------------------
---
b=nbus;
fprintf('Branch numbers available
for contingency from 1 to %i\n',b);
f=input('Contingency from Bus:');
t=input('Contingency to Bus:');
syms flag; % to determine if a
branch exists between two user-
input buses
flag=0;
for i1=1:length(nl)
if nl(i1)==f && nr(i1)==t;
flag=1;
rowel=i1; %row to be
elimitated
break;
else
continue
end
end
if flag==1
disp('Contingency created');
brnch(rowel,:)=[];
else
disp ('Branch not found');
run iinjnew;
end
%---------Creating contingency
ends-----------------------------

%-------Calculating new Ybus (after
contingency)--------
zinfo=[brnch(:,1) brnch(:,2)
brnch(:,7) brnch(:,8) ];
nl=zinfo(:,1);
nr=zinfo(:,2);
nbus=max(max(nl), max(nr));
nbr = length(nl); % no.
of branches
% linedata = linedata30(); %
Calling "linedata3.m" for Line Data
nl = brnch(:,1);
nr = brnch(:,2);
R = brnch(:,7);
X = brnch(:,8);
b = brnch(:,9); % Ground
Admittance, B/2
a = brnch(:,14); % Tap setting
value
Z = R + j*X;
y = ones(nbr,1)./Z; %
To get inverse of each element
b = j*b;
Y = zeros(nbus,nbus); %
Initialise YBus
% Formation of off-diagonal
elements
for k = 1:nbr;
if nl(k)>0 && nr(k)>0 &&
a(k)~=0 && a(k)~=1;
Y(nl(k),nr(k)) =
Y(nl(k),nr(k))-y(k)/a(k);
Y(nr(k),nl(k)) =
Y(nl(k),nr(k));
elseif nl(k)>0 && nr(k)>0;

Y(nl(k),nr(k))=Y(nl(k),nr(k))-y(k);
Y(nr(k),nl(k))=Y(nl(k),
nr(k));
end

end
% Formation of diagonal
elements....
for n=1:nbus;
for k=1:nbr;
if nl(k) == n && a(k)~=0
&& a(k)~=1;
Y(n,n) = Y(n,n) +
y(k)/(a(k)^2) + b(k);
elseif nl(k) == n;

Y(n,n)=Y(n,n)+y(k)+b(k);
elseif nr(k) == n;
Y(n,n) = Y(n,n) +
y(k) + b(k);
end
end
end
%-----------Adding diagonal
elements to the Ybus----------%
xs=j*0.05;
yg=inv(xs);
pg=bus(:,9);
qg=bus(:,10);
busnbr=bus(:,1);
ybusnew0=Y;
buslgt=length(busnbr);
yzero=zeros(buslgt,buslgt);
for i=1:1:buslgt
if pg(i)~=0 && qg(i)~=0
yzero(i,i)=yg;
else
yzero(i,i)=yzero(i,i);
end
end
ybusnew1=yzero+ybusnew0;

%---------------Calculation of new
Voltages--------------
Vfin=(inv(ybusnew1))*(I_inj);
V=abs(Vfin);
%---------------New operating
voltages calculated--------

%---------------Voltage violation
calculation------------
zinfo=[brnch(:,1) brnch(:,2)
brnch(:,7) brnch(:,8) ];
nl=zinfo(:,1);
nr=zinfo(:,2);
nbus=max(max(nl), max(nr));
syms result;
n=1;
syms flagd
flagd=0;
fileID=fopen('output.m','a+');
fprintf(fileID,'\n------Voltage
Violations--------\n' );
fprintf(fileID,'\nBus\t\tV(p.u.)\t\
tVlimit_Violation\n');
for i=1:nbus;
if 0.95>V(i,1) || V(i,1)>1.05;
result =[i, V(i,1), min((abs
(V(i,1)-0.95)),abs((V(i,1)-
1.05)))];
fileID=fopen('output.m','a+');
fprintf(fileID,'\n%g\t\t%.5f\t\t%.5
f\n',i, V(i,1), min((abs (V(i,1)-
0.95)),abs((V(i,1)-1.05))));
w(n,:)=result;
flagd=1;
n=n+1;
end
end
if flagd==0
disp ( 'Voltage Violations:');
disp(' Bus V(pu) Vlimit
Violated ');
fileID=fopen('output.m','a+');
fprintf(fileID,'\nNo violation
found\n');
fclose(fileID);
else
disp ( 'Voltage Violations:') ;
disp(' Bus V(pu) Vlimit
Violated ')
disp (w)
end
%---------------Voltage violation
calculation ends------------

%---------------line power flow
violation calculations--------
r=1;
for i=1:length(brnch(:,1));

Vdiffpuij=(Vfin(brnch(i,1),:)-
Vfin(brnch(i,2),:));%*Ybus(brnch(i,
1),brnch(i,2));
x(r,:)=Vdiffpuij; %gives
Vector differenctial for branches

Ibrpuij=Vdiffpuij*ybusnew1(brnch(i,
1),brnch(i,2)); % gives branch
currents in pu
c(r,:)= Ibrpuij; %matrix of
branch currents in pu

Sbrpu=Vfin(brnch(i,1),:)*conj(Ibrpu
ij);
Sl_complex(r,:)=Sb*Sbrpu;
Sl=abs(Sl_complex);
r=r+1;
end

syms res;
q=1;
fileID=fopen('output.m','a+');
fprintf(fileID,'\n----------Branch
Violations---------\n');
fprintf(fileID,'\nFrom To
Sl(MVA) Slmx\n');
for i=1:length(brnch(:,1));%&
brnch(i,10)~=0;
%if brnch(i,10)>0 &&
(Sl(i,:))>brnch(i,10);
if (Sl(i,:))>brnch(i,10) &&
brnch(i,10)>0;
fileID=fopen('output.m','a+');
fprintf(fileID,'\n
%g\t\t\t%g\t\t%.5f\t\t\t%.5f\n
',brnch(i,1), brnch(i,2),
abs(Sl(i,:)), brnch(i,10));
fclose(fileID);
res =[brnch(i,1), brnch(i,2),
abs(Sl(i,:)), brnch(i,10)];
o(q,:)=res;
q=q+1;
end
end
disp ( 'Branch Overloads')
disp(' From To
Sl(MVA) Slmx ')
disp (o)
%---------------line power flow
violation calculations end--------

Results:
The results for a contingency assessment are
as under.
I) System One (4-bus system)
When the program is run the command
prompt asks the user to input the bus
numbers to create a contingency in the
system.
For instance, creating a contingency from
bus 2 to 4 looks like this:

Branch numbers available for contingency
from 1 to 4
Contingency from Bus:2
Contingency to Bus:4
Contingency created

The user is prompted to re-enter the bus
numbers in case when there is no branch
connection that exists in the network.
Results are sent to a file output.m.
The output for the above contingency is:
SIMULATION RESULTS FOR 4 BUS SYSTEM

------Voltage Violations--------

Bus V(p.u.) Vlimit_Violation

4 0.93728 0.01272



----------Branch Violations--------

From To Sl(MVA) Slmx

1 3 247.89190 50

1 2 102.09035 50

2 3 177.12821 50

3 4 314.66791 50
-----------------------------









II) System Two (85-bus system)
For example, creating a contingency from
bus 13 to 12 creates and output:
SIMULATION RESULTS FOR 85 BUS
SYSTEM

------Voltage Violations--------

Bus V(p.u.) Vlimit_Violation

14 0.93390 0.01610

36 0.92870 0.02130

48 1.11430 0.06430

----------Branch Violations--------

From To Sl(MVA) Slmx

38 33 88.62600 24
-----------------------------

References:
[1] Prof. Baran, M lecture notes for power systems
operations and control, NC State university, 2012.
[2] Power systems analysis, Hadi Saadat book
chapter 6.
[3]Webpage:
http://home.eng.iastate.edu/~jdm/ee552/PowerFlowE
quations.pdf
[4] MATLAB help.

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