Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 27

Hawassa University

Institute of Technology
School of Electrical & Computer Engineering
Power System And Energy Engineering
4,2016
power system simulation lab I Report

prepared by:Tahir kedir


ID.No:PGeng/012/08

Submitted to
Dr.Slochnal
power system simulation lab I 4,2016

Contents
1.3. Algorithm of YBUS[formation of admittance matrix].................................................................3
1.3.1. Lab#1 without Reference:.........................................................................................................3
1.3.2. Lab#2 with Reference (Take Bus 5 as Reference).....................................................................4
1.3.3. Lab#3 with Reference mutual coupling (Take Bus 5 as Reference)...........................................5
1.4. Algorithm for GS method.................................................................................................................6
1.4. 1. Case (a): Systems with PQ buses present:....................................................................................6
1.4.1.1 Lab#4 PQ bus..............................................................................................................................6
1.4.2. Case (b): Systems with PV buses also present:..............................................................................7
1.4.2.1. Lab#5PV bus..........................................................................................................................8
1.5. Newton Raphson Method..............................................................................................................10
1.6. Fast Decouple Load Flow Method (FDLF)....................................................................................14
1.7. Symmetrical Fault analysis algorithm............................................................................................17
1.8. Unsymmetrical Fault analysis algorithm........................................................................................20
1.8.1.Single Line to Ground Fault.............................................................................................................20
1.8.2.Line to line Fault.......................................................................................................................22
1.8.3.Double Line to ground Fault.....................................................................................................25

6
power system simulation lab I 4,2016
1.3. Algorithm of YBUS[formation of admittance matrix]

1. Form z-primitive from the given network as follows:


z-primitive= [elements*elements];
2. Take the inverse of z-primitive to form y-primitive:
y-primitive=inv(z-primitive);
3. Determine the number of buses;
4. Form the incidence matrix (A):
A=[elements*buses];
Where:aij=1, if ith element is incidented and oriented away bus.
aij=-1, if ith element is incidented and oriented towards bus.
aij=0, if ith element is not incidented.
5. Take the transpose of incidence matrix[A]:
6. Compute the YBUS:
YBUS= A’*y-primitive*A;

1.3.1. Lab#1 without Reference:


zdata=[1 1 2 0.5+j*0.15; 2 1 3 0.8+j*0.3;3 2 3 0.15+j*0.45; 4 2 4 0.1+j*0.4; 5 3 4 0.35+j*0.15];
elements=max(zdata(:,1));
zprimitive=zeros(elements,elements);
for i=1:elements,
zprimitive(i,i)=zdata(i,4);
end
yprimitive=inv(zprimitive);
buses=max(max(zdata(:,2)),max(zdata(:,3)));
A=zeros(elements,buses);
for i=1:elements,
if zdata(i,2)~=0
A(i,zdata(i,2))=1;
end
if zdata(i,3)~=0
A(i,zdata(i,3))=-1;
end
end
A
Ybus=A'*yprimitive*A
A=
1 -1 0 0
1 0 -1 0
0 1 -1 0
0 1 0 -1
0 0 1 -1

6
power system simulation lab I 4,2016
YBus =
2.9308 - 0.9614i -1.8349 + 0.5505i -1.0959 + 0.4110i 0
-1.8349 + 0.5505i 3.0898 - 4.9034i -0.6667 + 2.0000i -0.5882 + 2.3529i
-1.0959 + 0.4110i -0.6667 + 2.0000i 4.1764 - 3.4454i -2.4138 + 1.0345i
0 -0.5882 + 2.3529i -2.4138 + 1.0345i 3.0020 - 3.3874i
1.3.2. Lab#2 with Reference (Take Bus 5 as Reference)
zdata=[1 0 1 0.5+j*0.15; 2 0 2 0.8+j*0.3;3 1 2 0.15+j*0.45;4 1 3 0.1+j*0.4; 5 2 3 0.35+j*0.15];
elements=max(zdata(:,1));
zprimitive=zeros(elements,elements);
for i=1:elements,
zprimitive(i,i)=zdata(i,4);
end
yprimitive=inv(zprimitive);
buses=max(max(zdata(:,2)),max(zdata(:,3)));
A=zeros(elements,buses);
for i=1:elements,
if (zdata(i,2)~=0)
A(i,zdata(i,2))=1;
end
if (zdata(i,3)~=0)
A(i,zdata(i,3))=-1;
end
end
A
Ybus=A'*yprimitive*A
A=
-1 0 0
0 -1 0
1 -1 0
1 0 -1
0 1 -1
Ybus =
3.0898 - 4.9034i -0.6667 + 2.0000i -0.5882 + 2.3529i
-0.6667 + 2.0000i 4.1764 - 3.4454i -2.4138 + 1.0345i
-0.5882 + 2.3529i -2.4138 + 1.0345i 3.0020 - 3.3874i

6
power system simulation lab I 4,2016

1.3.3. Lab#3 with Reference mutual coupling (Take Bus 5 as Reference)

zdata=[1 1 2 0.5+j*0.15 0 0.4;2 1 3 0.8+j*0.3 0 0.4;3 2 3 0.15+j*0.45 1 0;4 2 4 0.1+j*0.4 1 0;5 3


4 0.35+j*0.15 2 0];
element=max(zdata(:,1));
zprimitive=zeros(element,element);
for i=1:element
zprimitive(i,i)=zdata(i,4);
if zdata(i,5)~=0,
k=zdata(i,5);
zprimitive(i,k)=zdata(i,6);
end
end
yprimitive=inv(zprimitive);
buses=max(max(zdata(:,2)),max(zdata(:,3)));
A=zeros(element,buses);
for i=1:element,
if (zdata(i,2)~=0)
A(i,zdata(i,2))=1;
end
if (zdata(i,3)~=0)
A(i,zdata(i,3))=-1;
end
end
A
Ybus=A'*yprimitive*A

A=
1 -1 0 0
1 0 -1 0
0 1 -1 0
0 1 0 -1
0 0 1 -1
Ybus =
2.9308 - 0.9614i -1.8349 + 0.5505i -1.0959 + 0.4110i 0
-1.8349 + 0.5505i 3.0898 - 4.9034i -0.6667 + 2.0000i -0.5882 + 2.3529i
-1.0959 + 0.4110i -0.6667 + 2.0000i 4.1764 - 3.4454i -2.4138 + 1.0345i
0 -0.5882 + 2.3529i -2.4138 + 1.0345i 3.0020 - 3.3874i

6
power system simulation lab I 4,2016
1.4. Algorithm for GS method

1.4. 1. Case (a): Systems with PQ buses present:


1. Prepare data for the given system as required.
2. Formulate the bus admittance matrix YBUS. This is generally done by the rule of inspection.
3. Assume initial voltages for all buses, 2,3,…n. In practical power systems, the magnitude of
the bus voltages is close to 1.0 p.u. Hence, the complex bus voltages at all (n-1) buses
(except slack bus) are taken to be 1+j0. This is normally referred as the flat start solution.
4. Update the voltages. In any (k +1) iteration, from the voltages are given by
1
V (ik+1)= ¿
Y ii
Here note that when computation is carried out for bus-i, updated values are already
available for buses 2,3….(i-1) in the current (k+1) iteration.
5. Hence these values are used. For buses (i+1)…..n, values from previous, kth iteration are
used.
|∆V i(k+1 )|=|V (ik+1 )−V ki |< ε i=2,3 ,… . n
Where ε is the tolerance value. Generally it is customary to use a value of 0.0001 pu.
6. Compute slack bus power after voltages have converged [assuming bus 1 is slack
bus].
7. Compute the voltages for each of the iteration.

1.4.1.1 Lab#4 PQ bus


>> %electrical power system by D.Das
%example 7.2 PQ bus
n=3;
ybus=[20-j*50 -10+j*20 -10+j*30;-10+j*20 26-j*52 -16+j*32;-10+j*30 -16+j*32 26-j*62];
vold=[1.05 1 1];
p=[0 -2.556 -1.386];
q=[0 -1.102 -0.452];
vacc=vold;
delv=zeros(n,1);
%diff=10;
noofiter=1;
%while(diff>0.00001),
while (noofiter<3),
for i=2:n,
sumyv=0;
for k=1:n,
if(i~=k)
sumyv=sumyv+ybus(i,k)*vacc(k);
end
end
v(i)=[((p(i)-j*q(i))/conj(vacc(i))-sumyv)]/ybus(i,i);

6
power system simulation lab I 4,2016
delv=v(i)-vold(i);
vacc(i)=vold(i)+1.6*delv;
%diff=max((abs(vacc(2:n))-abs(vold(2:n))));
vold(i)=vacc(i);
end
noofiter;
v1=vacc(1)
v2=vacc(2)
v3=vacc(3)
noofiter=noofiter+1;
end
v1 =
1.0500
v2 =
0.9722 - 0.0494i, from book=V 2(1)=0.98256− j0.0387
v3 =
0.9940 - 0.0726i, from book=V 3(1) =0.9989− j0.0453629
v1 =
1.0500
v2 =
0.9789 - 0.0894i, from book=V 2(2) =0.98126− j 0.05226
v3 =
1.0036 - 0.0611i, from book=V 3(2) =0.9999− j 0.0469

1.4.2. Case (b): Systems with PV buses also present:


1. Prepare data for the given system as required.
2. Formulate the bus admittance matrix YBUS. This is generally done by the rule of inspection
3. Assume initial voltages for all buses, 2,3,…n. In practical power systems, the magnitude of
the bus voltages is close to 1.0 p.u. Hence, the complex bus voltages at all (n-1) buses
(except slack bus) are taken to be 1+j0. This is normally referred as the flat start solution.
4. At PV buses, the magnitude of voltage and not the reactive power is specified. Hence it is
needed to first make an estimate of Qi:
Qi=−ℑ ¿
Update the reactive power. In any (k +1) iteration, from the reactive power are given by
( k+1)
Qi =−ℑ ¿
5. If Qi(k+1)<Qi limit minimum, take Qi(k+1)=Qilimit minimum and treat PV bus as PQ bus, and if
Qi(k+1)>Qilimit maximum, take Qi(k+1)=Qilimit maximum and treat PV bus as PQ bus, and
calculate voltage magnitude with its phase angle as:
1
V (ik+1)= ¿
Y ii
6. If Qi is between the Qi limit minimum and Qi limit maximum then the PV bus is not
(k+1)

changed, so again calculate voltage magnitude and phase angle using Qi(k+1).

6
power system simulation lab I 4,2016
1
V (ik+1)= ¿
Y ii
7. Take only phase angle and maintain the voltage magnitude at PV bus only.

1.4.2.1. Lab#5PV bus


>> %power system analysis by P.S.R Murty
%worked example 5.1 PV bus
n=3;
vold=[1.05 1.03 1];
j=sqrt(-1);
ybus=[6.25-j*18.75 -1.25+j*3.75 -5+j*15;-1.25+j*3.73 2.9167-j*8.75 -1.6667+j*5;-5+j*15 -
1.6667+j*5 6.6667-j*20];
type=ones(n,1);
typechanged=zeros(n,1);
qlimitmax=zeros(n,1);
qlimitmin=zeros(n,1);
qcal=zeros(n,1);
vmagfixed=zeros(n,1);
type(2)=2;
qlimitmax(2)=1;
qlimitmin(2)=0;
vmagfixed(2)=1.03;
%diff=10
noofiter=1;
vacc=vold;
delv=zeros(n,1);
p=[0 -0.3 -0.6];
q=[0 0 -0.25];
%while(diiff>0.00001),
while(noofiter<3),
for i=2:n,
sumi=0;
if type(i)==2|typechanged(i)==1,
for k=1:n,
i=2;
%ybus(i,k)
%vacc(k)
sumi=sumi+ybus(i,k)*vacc(k);
end
%sumi
%vacc(i)
qcal(i)=-imag(conj(vacc(i))*sumi);
if (qcal(i)<qlimitmin(i)),
q(i)=qlimitmin(i);
type(i)=1;
typechanged(i)=1;

6
power system simulation lab I 4,2016
end
if (qcal(i)>qlimitmax(i)),
q(i)=qlimitmax(i);
type(i)=1;
typechanged=1;
end

if(qcal(i)>qlimitmin(i)|(qcal(i)<qlimitmax(i)))
q(i)=qcal(i);
type(i)=2;
typechanged(i)=0;
end
end
sumyv=0;
for k=1:n
if (i~=k)
sumyv=sumyv+ybus(i,k)*vacc(k);
end
end
%ybus(i,i)
%p(i)
%q(i)
%vacc(i)
v(i)=1/ybus(i,i)*(((p(i)-j*q(i))/conj(vacc(i)))-sumyv);
%acceleration factor=1
delv=v(i)-vold(i);
vacc(i)=vold(i)+1*delv;
if (type(i)==2)
b=atan(imag(vacc(i))/real(vacc(i)));
%polar to rectangular conversion
vacc(i)=vmagfixed(i)*(cos(b)+j*sin(b));
vold(i)=vacc(i);
end
end
noofiter;
v1=vacc(1)
v2=vacc(2)
v3=vacc(3)
noofiter=noofiter+1;
%delv(2:n);
%delv2=delv(2);
%delv3=delv(3);
%abs(delv(2:n));
%diff=max(abs(vacc(2:n)-abs(vold(2:n))))
end

6
power system simulation lab I 4,2016
v1 =
1.0500
v2 =
1.0295 - 0.0329i,from book=V 2(1)=1.02897− j0.0454874
v3 =
1.0246 - 0.0315i,from book=V 3(1) =1.029302− j 0.0491933
v1 =
1.0500
v2 =
1.0289 - 0.0477i,from book=V 2(2) =1.023216− j0.0611087
v3 =
1.0243 - 0.0340i,from book=V 3(2) =1.02− j0.03194278

1.5. Newton Raphson Method


Assignment
ALGORITHM:
Step 1: Start the Program
Step 2: Declare the Variable number of buses, ybus data etc.
Step 3: Read the Variable for bus, type , V, de, Pg, Qg, Pl, Ql, Qmin, Qmax
Step 4: To calculate P and Q
Pi=Real ¿
Qi=−ℑ ¿
Step 5: Set for loop for i=1:nbus, for k=1:nbus then calculate
P(i) & Q(i) End the Loop
Step 6: To check the Q limit Violation
(i). Set if iter<=10 &&iter>2
(ii). Set for n=2: nbus
Calculate Q(G), V(n) for Qmin or Qmax
(iii). End the Loop
Step 7: Change from specified Value
(i). Declare dealP= Pold-Pcal;
dealQ= Qold- Qcal;
dQ= Zeros(npq,1);
(ii). Set if type(i)==3
(iii). End the Loop
Step 8: Find Derivative of Real power injections from step 4 with angles for Jacobean J1.
Step 9: Find Derivative of Reactive power injections from step 4 with angles for J3.
Step 10: Find Derivative of Reactive power injections from step 4 with voltage for J4 & Real
power injections with voltage for J2.
Step 11: Form Jacobean Matrix J= [J1 J2;J3 J4].

6
power system simulation lab I 4,2016
Step 12: Display the output.
Step 13: End the Program.
%NEWTON RAPHSON METHOd
%load flow stability exercise 4
nb=3; %input(' Enter the number of buses= ')
Ybus=[20-j*50 -10+j*20 -10+j*30
-10+j*20 26-j*52 -16+j*32
-10+j*30 -16+j*32 26-j*62];
Ybusmag=abs(Ybus);
Ybusang=angle(Ybus)*(180/pi);
% Calculation of P and Q
v=[1.05 1.04 1];
Pold=[0 -4 2];
Qold=[0 0 -2.5];
P=[0 0 0];
Q=[0 0 0];
del=[0 0 0];
for p=2:nb
for q=1:nb
P(p)=P(p)+(v(p)*v(q)*Ybusmag(p,q)*cos(del(p)+angle(Ybus(p,q))-del(q)));
Q(p)=(Q(p)+(v(p)*v(q)*Ybusmag(p,q)*sin(del(p)-angle(Ybus(p,q))-del(q))));
delP(p)=Pold(p)-P(p);
delQ(p)=Qold(p)-Q(p);
end
end
P;
Q;
delP;
delQ;
%Calculation of J1
P2=[0 0 0];
for p=2:nb
for q=2:nb
if(p==q)
P1=2*v(p)*Ybusmag(p,q)*cos(angle(Ybus(p,q)));
for j=1:nb
if (j~=p)
P2(q)=P2(q)+v(j)*Ybusmag(q,j)*cos(del(q)+angle(Ybus(q,j))-del(j));
PV(p,q)=P1+P2(q);
end
end
else
PV(p,q)=v(p)*Ybusmag(p,q)*cos(del(p)+angle(Ybus(p,q))-del(q));

6
power system simulation lab I 4,2016
end
end
end
PV;
% Calculation of J2
Pdel=[0 0 0;0 0 0;0 0 0];
for p=2:nb
for q=2:nb
if(p==q)
for j=1:nb
if(j~=p)
Pdel(p,q)=Pdel(p,q)-v(j)*v(q)*Ybusmag(q,j)*sin(del(q)-angle(Ybus(p,j))-del(j));
end
end
else
Pdel(p,q)=-v(p)*v(q)*Ybusmag(p,q)*sin(del(p)+angle(Ybus(p,q))-del(q));
end
end
end
Pdel;
%Calculation of J3
Q2=[0 0 0];
for p=2:nb
for q=2:nb
if(p==q)
Q1=2*v(p)*Ybusmag(p,q)*sin(-angle(Ybus(p,q)));
for j=1:nb
if (j~=p)
Q2(q)=Q2(q)+v(j)*Ybusmag(q,j)*sin(del(q)-angle(Ybus(q,j))-del(j));
QV(p,q)=Q1+Q2(q);
end
end
else
QV(p,q)=v(p)*Ybusmag(p,q)*sin(del(p)-angle(Ybus(p,q))-del(q));
end
end
end
QV;
%Calculation of J4
Qdel=[0 0 0;0 0 0;0 0 0];
for p=2:nb
for q=2:nb
if(p==q)
for j=1:nb
if(j~=p)
Qdel(p,q)=Qdel(p,q)+v(j)*v(q)*Ybusmag(q,j)*cos(del(q)+angle(Ybus(p,j))-del(j));

6
power system simulation lab I 4,2016
end
end
else
Qdel(p,q)=-v(p)*v(q)*Ybusmag(p,q)*cos(del(p)+angle(Ybus(p,q))-del(q));
end
end
end
Qdel;
%Jacobian matrix
PV(1,:)=[ ];
PV(:,1)=[ ];
Pdel(1,:)=[ ];
Pdel(:,1)=[ ];
QV(1,:)=[ ];
QV(:,1)=[ ];
Qdel(1,:)=[ ];
Qdel(:,1)=[ ];
J=[PV Pdel;QV Qdel]
%Find the change in v&del
delP(1:1)=[];
delQ(1:1)=[];
delpq=[delP';delQ']
vdel=inv(J)*delpq
%Find new v&del
for i=1:nb-1
for j=2:nb
vnew(i)=v(j)+vdel(i);
delnew(i)=del(j)+vdel(i+2);
end
end
VNEW=[v(1) vnew]
DELNEW=[del(1) delnew]

J=
27.5800 -16.6400 55.1200 -33.2800
-16.0000 24.8600 -33.2800 64.7800
55.1600 -33.2800 -27.5600 16.6400
-32.0000 59.2200 16.6400 -27.1400
delpq =

-4.5616
3.1400
-1.1232

6
power system simulation lab I 4,2016
0.2800
vdel =
-0.0517
-0.0038
-0.0516
0.0106
VNEW =
1.0500 0.9483 0.9962
DELNEW =
0 -0.0516 0.0106

1.6. Fast Decouple Load Flow Method (FDLF)


Algorithm of FDLF:
Step 1: Read the slack bus voltages, real bus powers and reactive bus powers, bus voltage
magnitudes and reactive power limits.
Step 2: Form the Y bus matrix without line charging admittance and shunt admittance.
Step 3: Form B matrix, form Y bus matrix obtained in step 2.
Step 4: Form Y bus matrix with double the line charging admittance.
Step 5: Form B” matrix from Y bus matrix obtained in step 4.
Step 6: Calculate the inverse of B’ & B” matrices.
Step 7: Initialize the bus voltage.
Step 8: Calculate [∆P/|V|] , [ΔQ/|V|]
Step 9: If ΔP/ |V| & ΔQ/|V| are less than or equal to tolerance limit, solution has convergence
and go to step 12 otherwise increase iteration count and go to step 10.
Step 10: Calculate [Δδ] = [B’]-1[ΔP/ |V|]
[Δ|V|] = [B’’]-1[ΔQ/|V|]
Step 11: Update [δ] & [|V|] for all buses except slack bus.
[δ]new = [δ]old + [Δ δ];
[|V|]new = [|V|]old + [Δ|V|]
Step 12: Compute slack bus power, line flows, real power loss, reactive power loss etc.
%EXPERIMENT NUMBER 7
%FDLF-PQ $ PV BUSES
%load flow stability exercise 5
n=3;
j=sqrt(-1);
vold=[1.0 1.1 1.0];
ybus=[-j*15 j*10 j*5
j*10 -j*15 j*5
j*5 j*5 -j*10];
B=imag(ybus);
P=[0 4.82 -3.65];
Q=[0 0 -0.53];

6
power system simulation lab I 4,2016
type=ones(n,1);
typechanged=zeros(n,1);
Qlimitmax=zeros(n,1);
Qlimitmin=zeros(n,1);
vmagold=[1.4 1.0 1.04];
vmagfixed=zeros(n,1);
pical=zeros(n,1);
deltaP=zeros(n,1);
delold=zeros(n,1);
Qcal=zeros(n,1);
deltaQ=zeros(n,1);
deltavmag=zeros(n,1);
vacc=vold;
type(2)=3;
Qlimitmax(2)=5.5;
Qlimitmin(2)=0.0;
vmagfixed(2)=1.1;
%diff=10;
noofiter=1;
%while (noofiter<2),
for i=2:n,
sumi=0;
if type(i)==2 ||typechanged(i)==1
for k=1:n;
sumi=sumi+ybus(i,k)*vacc(k);
end
Qcal=-imag(conj(vacc(i))*sumi);
if (Qcal<Qlimitmin(i,1))
type(i)=1;
typechanged(i)=1;
Q(i)=Qlimitmin(i,1);
if (Qcal>Qlimitmax(i,1))
type(i)=1;
typechanged(i)=1;
Q(i)=Qlimitmax(i,1);
if (Qcal>Qlimitmin(i,1) ||Qcal<Qlimitmax(i,1));
type(i)=2;
typechanged(i)=2;
Q(i)=Qcal;
end
end
end
end
sumi=0;
for k=1:n,
sumi=sumi+ybus(i,k)*vacc(k);

6
power system simulation lab I 4,2016
end
pical(i)=real(conj(vacc(i))*sumi);
deltaP(i)=[P(i)-pical(i)];
deltaP(i)=deltaP(i)/vacc(i);
end
deltap2=deltaP(2);
deltaP3=deltaP(3);
deltaP=deltaP(2:n,1);
AB=-[B(2:n,2:n)];
inv(AB);
deltadel=inv(AB)*deltaP;
for i=1:n-1,
delnew(i)=delold(i)+deltadel(i);
delold(i)=delnew(i);
end
del2=delnew(1)
del3=delnew(2)
for i=2:n,
sumi=0;
if type(i)==1&typechanged==0
i;
m=i
for k=1:n,
sumi=sumi+ybus(i,k)*vacc(k);
end
Qcal(i)=-imag(conj(vacc(i))*sumi);
deltaQ(i)=[Q(i)-Qcal(i)];
deltaQ(i)=deltaQ(i)/abs(vacc(i));
end
end
for i=2:n,
if (typechanged==1)
i;
x=i
deltaQ(i)=[Q(i)-Qcal(i)];
deltaQ(i)=deltaQ(i)/abs(vacc(i));
end
end
for i=2:m,
AB=-[B(2:m,2:m)];
deltavmag=inv(AB)*deltaQ(i);
vmagnew=vmagold(1,i)+deltavmag;
end
vmagnew2=vmagnew
del2 =
0.2045

6
power system simulation lab I 4,2016
del3 =
-0.2627
vmagnew2 =
1.0376 1.0388
1.0388 1.0364

1.7. Symmetrical Fault analysis algorithm


Algorithm:
Step 1: Read line data, phase data, fault impedance etc.
Step 2: Compute [Z phase] matrix and calculate [Zphase]modi.
Step 3: Initialize count I = 0.
Step 4: Find the phase at which fault occurs I=I+1.
Step 5: Compute fault current at faulted phase and phase voltage at all lines.
Step 6: Compute all line and generator currents.
Step 7: Check if I< number of buses, if yes go to step 4 else go to step 8.
Step 8: Print the results and stop the program.
NB: this algorithm is mostly used for a transmission line with transformers, buses, and generator
loads.
%lab#8
%symmetrical fault analysis using zbus ex5
%n is no of buses
n=3;
j=sqrt(-i);
zbus=[j*0.6472 j*0.1472 j*0.102
j*0.1472 j*0.1472 j*0.102
j*0.102 j*0.102 j*0.0659];
%fault impedance zf=j*0.1pu
zf=j*0.1;
%voltage at the fault
vi=[0 0 0];
%bus before fault=vi(0)
vi=[1+j*0 1+j*0 1+j*0];
%v=vi(0)=prefault voltage
for i=1:n,
Ifc(i)=(vi(i))/(zbus(i,i)+zf);
%Ifc fault current
end
Ifc1=[abs(Ifc1), angle(Ifc1)*180/pi]
Ifc2=[abs(Ifc2), angle(Ifc2)*180/pi]
Ifc3=[abs(Ifc3), angle(Ifc3)*180/pi]
vp=zeros(n,1);%voltage at the healthy
%bus before fault=vr(0)

6
power system simulation lab I 4,2016
vp=[1+j*0 1+j*0 1+j*0];
va=zeros(n,1)%voltage at the healthy
%buses during fault=vr(f)
I=zeros(n,1);
%zbus(k,i)=impedance between the healthy
%bus k and the faulted bus i
for i=1:n,
for k=1:n,
if (k~=i)
i;
k;
%voltage at the healthy buses during fault
va(k)=vp(k)-(zbus(k,i)*Ifc(i));
van=[va(1) va(2) va(3)]
end
end
end
%I(i)=current flowing from bus i to bus k
for i=1:n,
for k=1:n,
i;
k;
%voltage at the buses during fault
va(k)=vp(k)-(zbus(k,i)*Ifc(i));
vak=[va(1) va(2) va(3)];
va(i)=vp(i)-(zbus(i,i)*Ifc(i));
va=[va(1) va(2) va(3)]
I(k)=(va(k)-va(i))/zbus(k,i);
I=[I(1) I(2) I(3)]
end
end

Ifc1 =
0.7727 90.0000
Ifc2 =
2.3356 90.0000
Ifc3 =
3.4801 90.0000
va =
0
0
0

van =
0 0.8030 0
van =

6
power system simulation lab I 4,2016
0 0.8030 0.8635
van =
0.4045 0.8030 0.8635
van =
0.4045 0.8030 0.5874
van =
0.3852 0.8030 0.5874
van =
0.3852 0.3852 0.5874
va =
0.1338 0.3852 0.5874
I=
0 0 0
va =
0.1338 0.8030 0.5874
I=
0 0 - 2.6246i 0
va =
0.1338 0.8030 0.8635
I=
0 0 - 2.6246i 0 - 4.1301i
va =
0.4045 0.4045 0.8635
I=
0 0 - 2.6246i 0 - 4.1301i
va =
0.4045 0.4045 0.8635
I=
0 0 0 - 4.1301i

va =
0.4045 0.4045 0.5874
I=
0 0 0 - 1.0350i
va =
0.3852 0.4045 0.6028
I=
0 + 1.2317i 0 0 - 1.0350i
va =
0.3852 0.3852 0.6028
I=
0 + 1.2317i 0 + 1.2317i 0 - 1.0350i
va =
0.3852 0.3852 0.6028
I=
0 + 1.2317i 0 + 1.2317i 0

6
power system simulation lab I 4,2016
1.8. Unsymmetrical Fault analysis algorithm

1. Assume initial values to zero


2. Let a single line to ground fault has occurred at node k of a network. assumed that
phase-a has touched the ground through an impedance Zf 
3.
4. the phase-a voltage at the fault point is given by

5. Take 'a' matrix


6. for single line to ground fault current

7. calculate zero, positive and negative sequence voltages as shown bellow respectively

8. Calculate fault voltage at point k as shown bellow

9. Calculate fault current at point k as follow

1.8.1.Single Line to Ground Fault


%symmetrical fault analysis
%lab#9
%single line to ground ex6
%a 30MVA,11kvgeneretor hasz1=z2=j*0.2pu
%zo=j*0.05pu line to ground fault
%occurs at the phase at the phase on the generatoer terminals
%find a line current and line to line voltages during fault conditions
%b)find the line current for a three phase fault
%bva=base mva=30mva
%n is no of buses
n=3;
bmva=30;
bkv=11;
e=1+j*0;
basecurrent=(bmva*10^6)/(sqrt(3)*bkv*10^3);
z1=j*2.2;

6
power system simulation lab I 4,2016
z2=j*1.9;
z0=j*3.4;
vp=zeros(n,1);
vs=zeros(n,1);
a=-0.5+j*0.866;
%%b=a*a
b=a^2;
A=[1 1 1;1 b a;1 a b];
%a)for single line to ground fault
Ia1=e/(z0+z1+z2);
Ia2=Ia1;
Ia0=Ia1;
Ia=Ia0+Ia1+Ia2;
I012=[Ia0;Ia1;Ia2]
va1=e-Ia1*z1;
va2=-Ia2*z2;
va0=-Ia0*z0;
V012=[va0;va1;va2]
Vabc=A*V012;
va=Vabc(1,1);
vb=Vabc(2,1);
vc=Vabc(3,1);
%line to line voltages at fault point are
vab=va-vb;
vbc=vb-vc;
vca=vc-va;
Vlv=[vab;vbc;vca]
%rectangular to polar conversion
V012p=[abs(V012), angle(V012)*180/pi]
Vlvp=[abs(Vlv),angle(Vlv)*180/pi]
%the actula values of line to line post fault voltages are
vabcactual=Vabc*((bkv*10^3)/sqrt(3));
Vabcp=[abs(vabcactual),angle(vabcactual)*180/pi];
%calculation of fault current for 3-fault let Ifc is fault current
Ifc=e/z1
I012p=[abs(I012), angle(I012)*180/pi]
Iabc=A*I012;
Iabcp=[abs(Iabc), angle(Iabc)*180/pi]
Iabcactual=[Iabc*basecurrent]
I012 =
0 - 0.1333i
0 - 0.1333i
0 - 0.1333i
V012 =
-0.4533
0.7067

6
power system simulation lab I 4,2016
-0.2533
Vlv =
0.6800 + 0.8314i
0.0000 - 1.6627i
-0.6800 + 0.8314i
V012p =
0.4533 180.0000
0.7067 0
0.2533 180.0000
Vlvp =
1.0740 50.7203
1.6627 -89.9985
1.0740 129.2815
Ifc =
0 - 0.4545i
I012p =
0.1333 -90.0000
0.1333 -90.0000
0.1333 -90.0000
Iabcp =
0.4000 -90.0000
0.0000 -90.0000
0.0000 -90.0000
Iabcactual =
1.0e+002 *
0 - 6.2984i
0 - 0.0001i
0 - 0.0001i
1.8.2.Line to line Fault
Algorithm

1. Assume initial values to zero


2. It is assumed that the fault has occurred at node k of the network. In this the phases
b and c got shorted through the impedance Zf .
3. Assume phase currents

4. Take 'a' matrix


Where a=-0.5+j*0.866 and a^2=-0.5-j*0.866

5. Expression for the voltage at the faulted point

6
power system simulation lab I 4,2016
6. Calculate fault current as follows

7. Calculate the phase voltages and currents if the sequence components.


%symmetrical fault analysis
%lab#10
%line to line fault analysis ex7
%a 30MVA,11kv generetor has z1=z2=j*0.2pu
%zo=j*0.05puand zf=0
%line fault occur between b and c phases on generetor terminals
%find the fault and line to neutral voltagesduring faault condition
%bva=base mva=30mva
%n is no of buses
n=3;
bmva=30;
bkv=11;
e=1+j*0;
basecurrent=(bmva*10^6)/(sqrt(3)*bkv*10^3);
z1=j*0.2;
z2=j*0.2;
zo=j*0.05;
vp=zeros(n,1);
vs=zeros(n,1);
a=-0.5+j*0.866;
%%b=a*a
b=a^2;
A=[1 1 1;1 b a;1 a b];
%a)fault current currentcalculation for line to line fault
Ia1=e/(z1+z2);
Ia2=-Ia1;
Iao=0;
Ia012=[Iao Ia1 Ia2]
%fault currents Ia Ib Ic
Ia=0;
Ib=(-j*sqrt(3)*e)/(z1+z2);
Ic=-Ib;
Iabc=[Ia Ib Ic]
va1=e-Ia1*z1;
va2=va1;
vao=0;
vao12=[vao va1 va2]
vs=[vao va1 va2]';
vp=A*vs;
%line to neutral voltages at the fault point are
va=vp(1,1);

6
power system simulation lab I 4,2016
vb=vp(2,1);
vc=vp(3,1);
vabc=[va vb vc]
%actual line to neutral currents at the point are
Iamag=abs(Ia);
delIa=atan(imag(Ia)/real(Ia))*180/pi;
Iaactual=Ia*basecurrent;
Iaactualmag=abs(Iaactual);
delIaactual=atan(imag(Iaactual)/real(Iaactual))*180/pi;
Ibmag=abs(Ib);
delIb=atan(imag(Ib)/real(Ib))*180/pi;
Ibactual=Ib*basecurrent;
Ibactualmag=abs(Ibactual);
delIbactual=atan(imag(Ibactual)/real(Ibactual))*180/pi;
Icmag=abs(Ic);
delIc=atan(imag(Ic)/real(Ic))*180/pi;
Icactual=Ic*basecurrent;
Icactualmag=abs(Icactual);
delIcactual=atan(imag(Icactual)/real(Icactual))*180/pi;
%actual line to neutral voltages at the point are
vamag=abs(va);
delva=atan(imag(va)/real(va))*180/pi;
vbmag=abs(vb);
delvb=atan(imag(vb)/real(vb))*180/pi;
vcmag=abs(vc);
delvc=atan(imag(vc)/real(vc))*180/pi;
%the actula values of line to line post fault voltages are
vaactual=va*bkv/sqrt(3);
vaactualmag=abs(vaactual);
delva=atan(imag(vaactual)/real(vaactual))*180/pi;
vbactual=vb*bkv/sqrt(3);
vbactaulmag=abs(vbactual);
delvb=atan(imag(vbactual)/real(vbactual))*180/pi;
vcactual=vc*bkv/sqrt(3);
vcactualmag=abs(vcactual);
delvc=atan(imag(vcactual)/real(vcactual))*180/pi;

Ia012 =
0 0 - 2.5000i 0 + 2.5000i

Iabc =
0 -4.3301 4.3301

vao12 =
0 0.5000 0.5000
vabc =

6
power system simulation lab I 4,2016
1.0000 -0.5000 -0.5000
1.8.3.Double Line to ground Fault
Algorithm

1. Assume initial values to zero


2. It is assumed that the fault has occurred at node k of the network. In this the phases
b and c got shorted through the impedance Zf to the ground.
3. Assume phase currents
I012=1/3*Iabc;
Ia=0;

4. Take 'a' matrix


Where a=-0.5+j*0.866 and a^2=-0.5-j*0.866
2. Expression for the voltage at the faulted point

3. Calculate fault current as follows

4. Calculate the phase voltages and currents if the sequencecomponents are given.

%symmetrical fault analysis


%lab#11
%double line to line fault analysis ex8
%a 30MVA,11kv generetor has z1=z2=j*0.2pu
%zo=j*0.05puand zf=0
%double line to ground occur fault occur between b and c phases and ground
%on generetor terminals
%find the fault current and line to neutral voltages during faault condition
%bva=base mva=30mva
%n is no of buses
n=3;
bmva=30;
bkv=11;
e=1+j*0;
basecurrent=(bmva*10^6)/(sqrt(3)*bkv*10^3);
z1=j*0.2;
z2=j*0.2;
zo=j*0.05;

6
power system simulation lab I 4,2016
vp=zeros(n,1);
vs=zeros(n,1);
Ip=zeros(n,1);
Isym=zeros(n,1);
Iactual=zeros(n,1);
a=-0.5+j*0.866;
%%b=a*a
b=a^2;
A=[1 1 1;1 b a;1 a b];
%a)fault current currentcalculation for double line to ground fault
Ia1=e/(z1+((z2+zo)/(z2+zo)));
Ia2=-Ia1*zo/(z2+zo);
Iao=-Ia1*z2/(z2+zo);
Ia012=[Iao Ia1 Ia2]
%fault currents Ia Ib Ic
Isym=[Iao Ia1 Ia2]';
Ip=A*Isym;
Ia=Ip(1,1);
Ib=Ip(2,1);
Ic=Ip(3,1);
Iabc=[Ia Ib Ic]
%actual line to neutral currents at the point are
Iamag=abs(Ia);
delIa=atan(imag(Ia)/real(Ia))*180/pi;
Iaactual=Ia*basecurrent;
Iaactualmag=abs(Iaactual);
delIaactual=atan(imag(Iaactual)/real(Iaactual))*180/pi;
Ibmag=abs(Ib);
delIb=atan(imag(Ib)/real(Ib))*180/pi;
Ibactual=Ib*basecurrent;
Ibactualmag=abs(Ibactual);
delIbactual=atan(imag(Ibactual)/real(Ibactual))*180/pi;
Icmag=abs(Ic);
delIc=atan(imag(Ic)/real(Ic))*180/pi;
Icactual=Ic*basecurrent;
Icactualmag=abs(Icactual);
delIcactual=atan(imag(Icactual)/real(Icactual))*180/pi;
%fault current Ifc=Ib+Ic
Ifc=Ib+Ic;
Ifcmag=abs(Ifc);
delIfc=atan(imag(Ifc)/real(Ifc))*180/pi;
Ifcactual=Ifc*basecurrent;
Ifcactualmag=abs(Icactual);
delIfcactual=atan(imag(Ifcactual)/real(Ifcactual))*180/pi;
%line to neutral voltages at the fault point are
va1=e-Ia1*z1;

6
power system simulation lab I 4,2016
va2=va1;
vao=va1;
va012=[vao va1 va2]
vs=[vao va1 va2]';
vp=A*vs;
va=vp(1,1)
vb=vp(2,1)
vc=vp(3,1)
%actual values of line to neutral voltages are
vaactual=va*bkv/sqrt(3);
vbactual=vb*bkv/sqrt(3);
vcactual=vc*bkv/sqrt(3);

Ia012 =
-0.7692 + 0.1538i 0.9615 - 0.1923i -0.1923 + 0.0385i
Iabc =
0 -0.9540 - 1.2300i -1.3537 + 0.7685i
va012 =
0.9615 - 0.1923i 0.9615 - 0.1923i 0.9615 - 0.1923i
va =
2.8846 + 0.5769i
vb =
4.2308e-005 +8.4615e-006i
vc =
4.2308e-005 +8.4615e-006i

End

You might also like