You are on page 1of 60

1.

FORMATION OF Y BUS USING DIRECT INSPECTION METHOD

AIM: To form Ybus matrices using direct inspect method

Fig: One line diagram of power system to form Ybus


Theory:

The Ybus /Zbus matrix constitutes the models of the passive portions of the power network. Y bus matrix
is often used in solving load flow problems. It has gained widespread applications owing to its
simplicity of data preparation and the ease with which the bus admittance matrix can be formed and
modified for network changes. Of course, sparsity is one of its greatest advantages as it heavily
reduces computer memory and time requirements. In short circuit analysis, the generator and
transformer impedances must also be taken into account. In contingency analysis, the shunt elements
are neglected, while forming the Z-bus matrix, which is used to compute the outage distribution
factors.
This can be easily obtained by inverting the Y-bus matrix formed by inspection method or by
analytical method. The impedance matrix is a full matrix and is most useful for short circuit studies.
Initially, the Y-bus matrix is formed by inspection method by considering line data only. After
forming the Y-bus matrix, the modified Y-bus matrix is formed by adding the generator and
transformer admittances to the respective diagonal elements and is inverted to form the Z- bus
matrix.
The performance equation for a n-bus system in terms of admittance matrix can be written as,
 I  Y .... In  V 

Y .... YY   V 
1

  Y Y 
 I    
11 12 1


2 22 2n 2
21

 .    . .   . 
     
 .  . .   . 
 I 

n
Y
n1 Y .... Y  V 
n2 nn n

(or)
I = Ybus.V
The admittances Y11, Y12,… Y1n are called the self-admittances at the nodes and all other
admittances are called the mutual admittances of the nodes.

Flowchart:
Algorithm:

Step 1: Read the values of number of buses and the number of lines of the
given system.
Step 2: Read the self-admittance of each bus and the mutual admittance between
the buses.
Step 3: Calculate the diagonal element term called the bus driving point admittance,
Yij which is the sum of the admittance connected to bus i.
Step 4: The off-diagonal term called the transfer admittance, Yij which is the
negative of the admittance connected from bus i to bus j.
Step 5: Check for the end of bus count and print the computed Y-bus
matrix. Step 6: Compute the Z-bus matrix by inverting the Y-bus matrix.
Step 7: Stop the program and print the results.

Program
FORMATION OF Y-BUS USING DIRECT INSPECTION METHOD

Z=[ 1 2 0.05 0.15


1 3 0.10 0.30
2 3 0.15 0.45
2 4 0.10 0.30
3 4 0.05 0.15 ];

fb=Z(:,1);
tb=Z(:,2);
r=Z(:,3);
X=Z(:,4);
nbr=length(Z(:,1));
nbus=max(max(fb),max(tb));
Z=r+j*X;
y =ones(nbr,1)./Z;
Y =zeros(nbus,nbus);
for k=1:nbr
if fb(k)>0&tb(k)>0
Y(fb(k),tb(k))=Y(fb(k),tb(k))-y(k);
Y(tb(k),fb(k))=Y(fb(k),tb(k));
end
end
for n=1:nbus
for k=1:nbr
if fb(k)==n|tb(k)==n
Y(n,n)=Y(n,n)+y(k);
end
end
end
disp(Y)

SIMULATION OUTPUT
: 5.FORMATION OF Z-BUS
USING BUILDING ALGORITHM

AIM:
To Program the impedance matrix (Z-BUS) of a power system network by using building
algorithm technique.

SOFTWARE REQURIED:
Matlab Application Software: MATLAB R2012a
THEORY:

The Ybus /Zbus matrix constitutes the models of the passive portions of the power network. The
impedance matrix is a full matrix and is most useful for short circuit studies. An algorithm for
formulating [Zbus] is described in terms of modifying an existing bus impedance matrix designated as
[Zbus]old. The modified matrix is designated as [Zbus]new. The network consists of a reference bus and a
number of other buses. When a new element having self impedance Zb is added, a new bus may be
created (if the new element is a tree branch) or a new bus may not be created (if the new element is a
link). Each of these two cases can be subdivided into two cases so that Z b may be added in the
following ways:
1. Adding Zb from a new bus to reference bus.
2. Adding Zb from a new bus to an existing bus.
3. Adding Zb from an existing bus to reference bus.
4. Adding Zb between two existing buses.

Type 1 modification:

In type 1 modification, an impedance Zb is added between a new bus p and the reference bus as
shown in Figure 1

Network p
Zb Vp

Ref. Bus

Figure 1. Type 1 modification of Zbus

Let the current through bus p be Ip, then the voltage across the bus p is given by, Vp

= Ip Zb
The potential at other buses remains unaltered and the system equations can be written as,
V1    0   I 1 
    0  
I2
  
2
V  
    Zbus  old  0    
   
      0    
V    0  I 
  n
  
n
  0 0 0
         
Vp 0 0  Z  I 
b
     p 
Type 2 modification:

In type 2 modification, an impedance Zb is added between a new bus p and an existing bus k as
shown in Figure 2. The voltages across the bus k and p can be expressed as,
Vk(new) = Vk + Ip Zkk
Vp = Vk(new) + Ip Zp
= Vk + Ip(Zb + Zkk)
where, Vk is the voltage across bus k before the addition of impedance Zb
Zkk is the sum of all impedance connected to bus k.
1

 n

 Ik + Ip
Network  k
Z Ip
b

p
Ref. Bus

Figure 2.Type 2 Modification of Zbus

The system of equations can be expressed as,


V1    Z1k  I1 
  
 Z 2k   I 
V2     2 
    Z bus  old      
     
          
Vn       n 
   I
  
           
Z Z    
Z kk  Z b   I p 
p k1 k 2
V
   
Type 3 Modification:

In this modification, an impedance Zb is added between a existing bus k and a reference bus.
Then the following steps are to be followed:
1. Add Zb between a new bus p and the existing bus k and the modifications are done as in
type 2.
2. Connect bus p to the reference bus by letting Vp = 0.
To retain the symmetry of the Bus Impedance Matrix, network reduction technique can be
used to remove the excess row or column.

Type 4 Modification:

In this type of modification, an impedance Zb is added between two existing buses j and k as shown
in Figure 3. From Figure 3, the relation between the voltages of bus k and j can be written as,
Vk – Vj = IbZb (3)
1

n
Ij + Ib
Network j
Z Ib
b

k
Ik - Ib
Ref. Bus

Figure 3.Type 4 Modification of Zbus

The voltages across all the buses connected to the network changes due to the addition of
impedance Zb and they can be expressed as,
V1 = Z11I1 + Z12I2 + - - - - - - - - + Z1j(Ij + Ib) + Z1k(Ik – Ib)+- - -
V2 = Z21I1 + Z22I2 + - - - - - - - - + Z2j(Ij + Ib) + Z2k(Ik – Ib)+ - - -
   
Vj = Zj1I1 + Zj2I2 + - - - - - - - - + Zjj(Ij + Ib) + Zjk(Ik – Ib) + - - - (4)

Vk = Zk1I1 + Zk2I2 + - - - - - - - - + Zkj(Ij + Ib) + Zkk(Ik – Ib) + - - -


   
Vn = Zn1I1 + Zn2I2 + - - - - - - - - + Znj(Ij + Ib) + Znk(Ik – Ib) + - -
PROCEDURE:
1. Open Matlab software form run window.
2. Create a new M-file by selecting File – New – M-file
3. Type the program and save in the editor window.
4. Execute the program by pressing run tool for F5.
5. View the result.

PROBLEM STATEMENT:
The data of the power sytem network is show below. Form Z bus using building algorithm
technique:
FROM BUS TO BUS ELEMENT (Ω)

REFERNCE 1 0.25

REFERNCE 2 0.25

1 2 0.1

1 3 0.1

2 3 0.1
FLOW CHART:

START

INPUT Z primary into the Program

READ ELEMENTS .. [ELEMENTS,COLUMNS]=SIZE(Zprimary)

INITIALIZE A NULL MATRIX FOR STARTING


Zbus=[]

FOR COUNT = 1 to ELEMENTS GO TO LOOP

MAKING SIZE OF Zbus

[ROWS,COLS]=SIZE(Zbus)

FROM= Zprimary(COUT,2)
TO= Zprimary(COUNT,3)

VALUE= Zprimary(COUNT,4)

OBTAIN NEW BUS

NEWBUS=MAX(FROM,TO)

OBTAIN REFERENCE BUS


REF.BUS=MIN(FROM,TO)
NO
IF
NEWBUS> CURRENT BUS &&
REF.=0

YES

COMPUTE Z BUS=[Z BUS VALUE]

NO
IF

NEWBUS> CURRENT BUS &&


REF.~=0

YES

COMPUTE Z BUS=[Z BUS Z BUS(:,REF)


Z BUS(:,REF) VALUE+ZBUS(REF,REF)]

ASSIGN CURRENT BUS NO.= NEW BUS

IF

NEWBUS<=CURRENT BUS &&


REF.==0

YES

COMPOSE
ZBUS(:,newbuc)∗Zbuc(newbuc,:)
Zbus= Zbus- Zbuc(newbuc,newbuc)+vaSue
N
O IF
NEWBUS<=CURRENT BUS
&&
REF.
~=0

YE
S

COMPOS
E
{ZBUS(:,from)–Zbuc(:,to)}∗[Zbuc(from,:)–
Zbus= Zbus-
Zbuc(to,:)
vaSue+Zbuc(from,from)+Zbuc(to,to)–
2∗Zbuc(from,to)

GO TO
LOOP
DISPLAY
Zbus

STO
P
PROGRAM:
clc
display('Formation of zbus using z-bus building algorithm')
zprimary=input('Enter the System data in the matrix form'')
[elements columns]=size(zprimary);
%Initialize zbus matrix with a null matrix
zbus=[ ];
%currentbusno indicates maximum no. of buses added until now
currentbusno=0;
%process each row of zprimary
for count=1:elements,
[rows cols]=size(zbus);
from=zprimary(count,2);
to=zprimary(count,3);
value=zprimary(count,4);
%newbus variable indicates the maximum of the two buses
%newbus bus may or may not already be a part of existing zbus
newbus=max(from,to);
%ref variable indicates the minimum of the two buses
%& not necessarily the reference bus
%ref bus must always exist in the existing zbus
ref=min(from,to);
%Modification of type1
%A new element is added from new bus to reference bus
if newbus>currentbusno & ref==0
zbus=[zbus zeros(rows,1)
zeros(1,cols) value]
currentbusno=newbus;
continue
end
%Modificaton of type2
% A new element is added from new bus to old bus other than
% references bus
if newbus>currentbusno & ref ~=0
zbus=[zbus zbus(:,ref)
zbus(ref,:) value+zbus(ref,ref)]
currentbusno=newbus;
continue
end
%Modification of type3
%A new element is added between an old bus and reference bus
if newbus<=currentbusno & ref==0
zbus=zbus-1/(zbus(newbus,newbus)+value)*zbus(:,newbus)*zbus(newbus,:);
continue
end
%Modification of type4
%A new element is added between two old buses
if newbus<=currentbusno & ref~=0
zbus=zbus-1/(value+zbus(from,from)+zbus(to,to)-2*zbus(from,to))*((zbus(:,from)-
zbus(:,to))*((zbus(from,:)-zbus(to,:))))
continue
end
end
display('There is no modifications further for given network:')
display('So the final bus impedence matrix zbus is:')
zbus
RESULT:
4.LOAD FLOW ANALYSIS USING
NEWTON RAPHSON METHOD

AIM:
To Program the load flow analysis of a given power system network using Newton
raphson (NR) method.
SOFTWARE REQURIED:
Matlab Application Software: MATLAB R2012a
THEORY:

PROCEDURE:
1. Open Matlab software form run window.
2. Create a new M-file by selecting File – New – M-file
3. Type the program and save in the editor window.
4. Execute the program by pressing run tool for F5.
5. View the result.

PROBLEM STATEMENT:
Consider the three bus system each of three lines has series impedance of 0.02+0.08j p.u and
total shunt admittance of 0.02j p.u
The specified quantities of the buses are tabulated below:

BUS REAL LOAD REACTIVE REAL REACTIVE VOLTAGE


DEMAND(PD) LOAD POWER (P) POWER(Q)
DEMAND(QD)
1 2.0 1.0 - - 1.04+j0 p.u
2 0.0 0.0 0.5 1.0 -(PQ BUS)
3 1.5 0.6 0.0 Q3=? V=1.04
(PV BUS)
Controllable reactive power source is available at bus 3 with constraint 0≤QG3≤1.5 P.U
Find the load flow solution using the NR method. Use the tolerance of 0.01 for power mismatch.
FLOW CHART:
PROGRAM:
clc
n=3;
V=[1.04 1.0 1.04];
Y=input('Enter the ybus data in the form of matrix form into the system');
type=ones(n,1);
typechanged=zeros(n,1);
Qlimitmax=zeros(n,1);
Qlimitmin=zeros(n,1);
Vmagfixed=zeros(n,1);
type(3)=2;
Qlimitmax(3)=1.5;
Qlimitmin(2)=0;
Vmagfixed(2)=1.04;
diff=10;noofiter=1;
Pspec=[inf 0.5 -1.5];
Qspec=[inf 1 0];
S=[inf+j*inf (0.5-j*0.2) (-1.0+j*0.5) (0.3-j*0.1)];
while (diff>0.00001 | noofiter==0),
eqcount=1;
for i=2:n,
Scal(i)=0;
sumyv=0;
for k=1:n,
sumyv=sumyv+Y(i,k)*V(k);
end
Scal(i)=V(i)*conj(sumyv);
P(i)=real(Scal(i));
Q(i)=imag(Scal(i));
if type(i)==2 | typechanged(i)==1,
if(Q(i)>Qlimitmax(i) | Q(i)<Qlimitmin(i)),
if(Q(i)<Qlimitmin(i)),
Q(i)=Qlimitmin(i);
else
Q(i)=Qlimitmax(i);
end
type(i)=1;
typechanged(i)=1;
else
type(i)=2;
typechanged(i)=0;
end
end

if type(i)==1;
assoeqvar(eqcount)='P';
assoeqbus(eqcount)=i;
mismatch(eqcount)=Pspec(i)-P(i);
assoeqvar(eqcount+1)='Q';
assoeqbus(eqcount+1)=i;
mismatch(eqcount+1)=Qspec(i)-Q(i);

assocolvar(eqcount)='d';
assocolbus(eqcount)=i;
assocolvar(eqcount+1)='V';
assocolbus(eqcount+1)=i;
eqcount=eqcount+2;
else
assoeqvar(eqcount)='P';
assoeqbus(eqcount)=i;
assocolvar(eqcount)='d';
assocolbus(eqcount)=i;
mismatch(eqcount)=Pspec(i)-P(i);
eqcount=eqcount+1;
end
end
mismatch;
eqcount=eqcount-1;
noofeq=eqcount;
Update=zeros(eqcount,1);
Vprev=V;
abs(V);
abs(Vprev);
pause
Vprev=V;
for ceq=1:eqcount,
for ccol=1:eqcount,
am=real(Y(assoeqbus(ceq),assocolbus(ccol))*V(assocolbus(ccol)));
bm=imag(Y(assoeqbus(ceq),assocolbus(ccol))*V(assocolbus(ccol)));
ei=real(V(assoeqbus(ceq)));
fi=imag(V(assoeqbus(ceq)));

if assoeqvar(ceq)=='P' & assocolvar(ccol)=='d',


if assoeqbus(ceq)~=assocolbus(ccol),
H=am*fi-bm*ei;
else
H=-Q(assoeqbus(ceq))-
imag(Y(assoeqbus(ceq),assocolbus(ceq))*abs(V(assoeqbus(ceq)))^2);
end
Jacob(ceq,ccol)=H
end
if assoeqvar(ceq)=='P' & assocolvar(ccol)=='V',
if assoeqbus(ceq)~=assocolbus(ccol),
N=am*ei+bm*fi;
else

N=P(assoeqbus(ceq))+real(Y(assoeqbus(ceq),assocolbus(ceq))*abs(V(assoeqbus(ceq)))^2);
end
Jacob(ceq,ccol)=N

end
if assoeqvar(ceq)=='Q' & assocolvar(ccol)=='d',
if assoeqbus(ceq)~=assocolbus(ccol),
J=-(am*ei+bm*fi);
else
J=P(assoeqbus(ceq))-
real(Y(assoeqbus(ceq),assocolbus(ceq))*abs(V(assoeqbus(ceq)))^2);
end
Jacob(ceq,ccol)=J
end
if assoeqvar(ceq)=='Q' & assocolvar(ccol)=='V',
if assoeqbus(ceq)~=assocolbus(ccol),
L=am*fi-bm*ei;
else

L=Q(assoeqbus(ceq))-
imag(Y(assoeqbus(ceq),assocolbus(ceq))*abs(V(assoeqbus(ceq)))^2);
end
Jacob(ceq,ccol)=L
end
end
end

Jacob
pause
Update=inv(Jacob)*mismatch';
Update
noofeq=1;
for i=2:n,
if type(i)==1
newchinangV=Update(noofeq);
newangV=angle(V(i))+newchinangV;
newchinmagV=Update(noofeq+1)*abs(V(i));
newmagV=abs(V(i))+newchinmagV;
V(i)=pol2cart(newmagV,newangV*180/pi);
noofeq=noofeq+2;
else
newchinangV=Update(noofeq);
newangV=angle(V(i))+newchinangV;
V(i)=pol2cart(abs(V(i)),newangV*180/pi);
noofeq=noofeq+1;
end
end
clear mismatch Jacob Update assoeqvar assoeqbus assocolvar assocolbus
diff=min(abs(abs(V(2:n))-abs(Vprev(2:n))));
noofiter=noofiter+1;
end

RESULT:
3.LOAD FLOW ANALYSIS USING
GAUSS-SIDEL(GS) METHOD

AIM:
To Program the load flow analysis of a given power system network using GAUSS
SIDEL(GS) method for only PQ bus.
SOFTWARE REQURIED:
Matlab Application Software: MATLAB R2012a
THEORY:

Load flow analysis is the study conducted to determine the steady state operating condition of the given
system under given conditions. A large number of numerical algorithms have been developed and Gauss Seidel
method is one of such algorithm.
Problem Formulation
The performance equation of the power system may be written of
[I bus] = [Y bus][V bus] …………..(1)
Selecting one of the buses as the reference bus, we get (n-1) simultaneous equations. The bus loading
equations can be written as
Ii = Pi-jQi / Vi* (i=1,2,3,…………..n)……………… (2)
Where
Pi=Re ∑𝑛𝐾=1 Vi ∗ Yik Vk] …………… (3)

Qi= -Im [∑𝑛𝐾=1 Vi ∗ Yik Vk]. ………….(4)


∑𝑛𝐾=1 Vi ∗ Yik Vk
The bus voltage can be written in form of
n
Vi=(1.0/Yii)[Ii- Σ Yij Vj] ………….(5)
j=1
j≠i(i=1,2,…………n)& i≠slack bus
Substituting Ii in the expression for Vi, we get
n
Vi new=(1.0/Yii)[Pi-JQi / Vio* - Σ Yij Vio]…….. (6)
J=1
The latest available voltages are used in the above expression, we get
n n
Vi new=(1.0/Yii)[Pi-JQi / Voi* - Σ YijVjn- Σ Yij Vio] ----------(7)
J=1 j=i+1
Algorithm
Step1: Read the data such as line data, specified power, specified voltages, Q limits at the generator buses
and tolerance for convergences
Step2: Compute Y-bus matrix.
Step3: Initialize all the bus voltages.
Step4: Iter=1
Step5: Consider i=2, where i’ is the bus number.
Step6: check whether this is PV bus or PQ bus. If it is PQ bus goto step 8 otherwise go to next step.
Step7: Compute Qi check for q limits violation. QGi=Qi+QLi.
7).a).If QGi>Qi max, equate QGi = Qimax. Then convert it into PQ bus.
7).b).If QGi<Qi min, equate QGi = Qi min. Then convert it into PQ bus.
Step8: Calculate the new value of the bus voltage using gauss seidal formula.
i=1: n
Vi= (1.0/Yii) [(Pi-j Qi)/(Vi0)*- ∑𝑛𝑗=1 Yij Vj − Σ YijVj0]
J=1 J=i+1
Adjust voltage magnitude of the bus to specify magnitude if Q limits are not violated.
Step9: If all buses are considered go to step 10 otherwise increments the bus no. i=i+1 and Go to step6.
Step10: Check for convergence. If there is no convergence goes to step 11 otherwise go to step12.
Step11: Update the bus voltage using the formula.
Vinew=Vi old+ α(vinew-Viold) (i=1,2,…..n) i≠ slackbus ,α is the acceleration factor=1.4
Step12: Calculate the slack bus power, Q at P-V buses real and reactive give flows real and reactance line
Step13: Stop

PROCEDURE:
1. Open Matlab software form run window.
2. Create a new M-file by selecting File – New – M-file
3. Type the program and save in the editor window.
4. Execute the program by pressing run tool for F5.
5. View the result.

PROBLEM STATEMENT:
For the power system network , the generators are connected to the all the four buses while
loads are at bus 2 and bus 3. Values of real and reactive powers listed below. All the buses other
than slack bus is PQ bus
BUS NO. Pi (P.U) Qi (P.U) Vi (P.U) REMARKS
1 - - 1.04+j0 Slack
2 0.5 -0.2 - PQ Bus
3 -1.0 0.5 - PQ Bus
4 0.3 -0.1 - PQ Bus
Assume a flat voltage profile, find the voltage and bus angle at the three buses using gauss sidel
mtheod.
FLOW CHART:
PROGRAM:
clc
n=4;
V=[1.04 1 1 1];
Y=input('Enter the admittance matrix of the given power system network')
% Bus types are initialised in type array to code 1 which stands for PQ bus. code 2 stands for PV
bus
type=ones(n,1);
% when Q limits are exceeded for a PV Bus type is changed to PQ temporarly
%an element i of typechanged is set to 1 in case its bus status is
%temporarily changed from PQ to PV. otherwise it is zero
typechanged=zeros(n,1);
Qlimitmax=zeros(n,1);
Qlimitmin=zeros(n,1);
Vmagfixed=zeros(n,1);
diff=10;noofiter=1;
Vprev=V;
while(diff>0.00001 | noofiter==1),
display('Voltage values at each bus: ')
Voltage=abs(V)
abs(Vprev);
Vprev=V;
P=[inf 0.5 -1 0.3];
Q=[inf -0.2 0.5 -0.1];
S=[inf+j*inf (0.5-j*0.2) (-1.0+j*0.5) (0.3-j*0.1)];
for i=2:n,
if type(i)==2 | typechanged(i)==1,
if(Q(i)>Qlimitmax(i) | Q(i)<Qlimitmin(i)),
if(Q(i)<Qlimitmin(i)),
Q(i)=Qlimitmin(i);
else
Q(i)=Qlimitmax(i);
end
type(i)=1;
typechanged(i)=1;
else
type(i)=2;
typechanged(i)=0;
end
end
sumyv=0;
for k=1:n,
if(i~=k)
sumyv=sumyv+Y(i,k)*V(k);
end
end
V(i)=(1/Y(i,i))*((P(i)-j*Q(i))/conj(V(i))-sumyv);
if type(i)==2 & typechanged(i)~=1,
V(i)=pol2cart(Vmagfixed(i),angle(V(i))*180/pi);
end
end
diff=max(abs(abs(V(2:n))-abs(Vprev(2:n))));
noofiter=noofiter+1;
end
display('After end of last iteration Final voltage values at each buse :')
V
RESULT:
6.Symmetrical Fault analysis using Z-bus

AIM:
To Program the given power system network for determination of fault currents and
voltages for various types of fault occurring in the system.
SOFTWARE REQURIED:
Matlab Application Software: MATLAB R2012a
THEORY:

Short circuits and other abnormal conditions often occur on a power system. Short circuits are
usually called “faults” by power system engineers. Some defects, other than short circuits are
also termed as faults.
Faults are caused either by insulation failures or by conducting path failures. The failure
of insulation results in short circuits which are very harmful as they may damage some
equipment of the power system. Most of the faults in transmission and distribution lines are
caused by over voltages due to lightning or switching surges, or by external conducting objects
falling on overhead lines. Overvoltages due to lightning or switching surges cause flashover on
the surface of insulators resulting in short circuits. Short circuits are also caused by tree branches
or other conducting objects falling on the overhead lines.
The fault impedance being low, the fault currents are relatively high. The fault currents
being excessive, they damage the faulty equipment and the supply installation. Also, the system
voltage may reduce to a low level, windings and busbars may suffer mechanical damage due to
high magnetic forces during faults and the individual generators in a power station or group of
generators in different power stations may loose synchronism
The symmetrical fault occurs when all the three conductors of a three-phase line
are brought together simultaneously into a short–circuit condition as shown in Figure 1.
A
B
C

IA IB IC

Short circuit

Figure 1 Symmetrical Fault on Three-Phase system


This type of fault gives rise to symmetrical currents i.e. equal fault currents with 1200
displacement. Thus referring to Figure 5.1, fault currents IA, IB and IC will be equal in magnitude
with 1200 displacement among them. Because of balanced nature of fault, only one phase needs to
be considered in calculations since condition in the other two phases will also be similar.
A three-phase short circuit occurs rarely but it is most severe type of fault involving largest
currents. For this reason, the balanced short-circuit calculations are performed to determine these
large currents to be used to determine the rating of the circuit breakers.

Flowchart:

Start

Read line data, Bus data,fault impedance etc

Compute Ybus matrix & modified Ybus matrix

Compute Zbus matrix by inverting modified bus

I=0

Find the bus at which fault occurs I = I+1

Compute fault current at faulted bus and


bus voltage at all buses

Compute all line current at unfaulty


area & gen currents

Is
I < nb
No

Yes

Print the Result

Stop
Formula Used:

V
i) Fault Current, If =
Z f ppZ
Z
Fault Voltage, Vf = V (1 bus )
ii)
Z Z
f pp

PROCEDURE:
1. Open Matlab software form run window.
2. Create a new M-file by selecting File – New – M-file
3. Type the program and save in the editor window.
4. Execute the program by pressing run tool for F5.
5. View the result.

PROBLEM STATEMENT:
For the single line diagram consisting of generator and load followed by star-delta transformers
connected via transmission line. The rating of the system is below
GENERATOR: 100 MVA, 13.8 KV, Xll=0.15 , X2=0.17 , X0=0.05 P.U
TRANSFORMER: 100MVA, 13.8/138KV, X=0.10 P.U
TRANSMISSION LINE: X1=X2=20Ω , X0=60Ω
MOTOR: 100 MVA , 13.8KV , Xll=0.20 , X2=0.21 , X0=0.10 P.U
PRFAULT VOLTAGE: 1.05+J0
Calculate the fault currents and voltages for the power system network on occurrence of three-
phase fault.
PROGRAM:
clc
%%This is the program to determine fault currents and voltages for SLGF and DLGF and LLL
%%System Base Data
BaseMVA=100; BaseKvolt1=13.8; BaseKvolt2=138;
%%Genertor data
GMVA=100; GKV=13.8;
ZG1=Input('Enter the genetaror positive sequency impedance :')
ZG2=Input('Enter the genetaror Negative sequency impedance :')
ZG0=Input('Enter the genetaror zero sequency impedance :')
PrefalV=input('Enter the Pre fault voltage : ')
%%Transformers Data in P.U
ZT11=Input('Enter the Transformer1 positive sequency impedance:')
ZT12=Input('Enter the Transformer1 negativesequency impedance:' )
ZT10=Input('Enter the Transformer1 zero sequency impedance: ')
ZT21=Input('Enter the Transformer2 positive sequency impedance:')
ZT22=Input('Enter the Transformer2 negativesequency impedance: ')
ZT20=Input('Enter the Transformer2 zero sequency impedance: ')
%%Transmission line data in P.U
Ztran1=Input('Enter the Trans. line +VE sequency impedance : ')
Ztran2=Input('Enter the Trans. line -VE sequency impedance : ')
Ztran0=Input('Enter the Trans. line zero sequency impedance: ')
%%Motor data in p.u
ZM1=Input('Enter the Trans. line +VE sequency imp. : ')
ZM2=Input('Enter the Trans. line +VE sequency imp. : ')
ZM0=Input('Enter the Trans. line +VE sequency imp. : ')
Zn=Input('Enter the Trans. line +VE sequency imp. : ')
%%Fault data
Zfault=0;
Ibase=BaseMVA/(sqrt(3)*BaseKvolt1);
%%positive sequence network Impedance value
Z1=((ZG1+ZT11+Ztran1+ZT21)*ZM1)/((ZG1+ZT11+Ztran1+ZT21)+ZM1);
%% Negative sequency network Impedanece value
Z2=((ZG2+ZT12+Ztran2+ZT22)*ZM2)/((ZG2+ZT12+Ztran2+ZT21)+ZM2);
%%Zero sequency network Impedanece value
Z0= ZM0+(3*Zn);
%% Three Phase (LLL) Fault
display('################################################################')
display(' fault currents and voltages for LLL fault in p.u: ')
display('################################################################')
VR0=0;VR1=0;VR2=0;IR2=0;IR0=0;
IR1=ER1/Z1;
Ifaulttotal=IR1
display('Fault currents and Voltages in R,Y and B phases in p.u')
Ifault=a*[IR0;IR1;IR
Vfault=a*[VR0;VR1;VR2]
display('Total fault current actual value in KA')
Ifaultact=Ibase*Ifaulttotal

RESULT:
Unsymmetrical Fault analysis using Z-bus

AIM:
To Program the given power system network for determination of fault currents and
voltages for various types of fault occurring in the system.
SOFTWARE REQURIED:
Matlab Application Software: MATLAB R2012a

PROCEDURE:
1. Open Matlab software form run window.
2. Create a new M-file by selecting File – New – M-file
3. Type the program and save in the editor window.
4. Execute the program by pressing run tool for F5.
5. View the result.

PROBLEM STATEMENT:
For the single line diagram consisting of generator and load followed by star-delta transformers
connected via transmission line. The rating of the system is below
GENERATOR: 100 MVA, 13.8 KV, Xll=0.15 , X2=0.17 , X0=0.05 P.U
TRANSFORMER: 100MVA, 13.8/138KV, X=0.10 P.U
TRANSMISSION LINE: X1=X2=20Ω , X0=60Ω
MOTOR: 100 MVA , 13.8KV , Xll=0.20 , X2=0.21 , X0=0.10 P.U
PRFAULT VOLTAGE: 1.05+J0
Calculate the fault currents and voltages for the power system network on occurrence of SLGF,
DLGF, and three-phase fault.
FLOW CHART:

Start

Read line data, Bus data,fault impedance etc

Compute Ybus matrix & modified Ybus matrix

Compute Zbus matrix by inverting modified bus

I=0

Find the bus at which fault occurs I = I+1

Compute fault current at faulted bus and


bus voltage at all buses

Compute all line current at unfaulty


area & gen currents

Is
I < nb
No

Yes

Print the Result

Stop
PROGRAM:
clc
%%This is the program to determine fault currents and voltages for SLGF and DLGF and LLL
%%System Base Data
BaseMVA=100; BaseKvolt1=13.8; BaseKvolt2=138;
%%Genertor data
GMVA=100; GKV=13.8;
ZG1=Input('Enter the genetaror positive sequency impedance :')
ZG2=Input('Enter the genetaror Negative sequency impedance :')
ZG0=Input('Enter the genetaror zero sequency impedance :')
PrefalV=input('Enter the Pre fault voltage : ')
%%Transformers Data in P.U
ZT11=Input('Enter the Transformer1 positive sequency impedance:')
ZT12=Input('Enter the Transformer1 negativesequency impedance:' )
ZT10=Input('Enter the Transformer1 zero sequency impedance: ')
ZT21=Input('Enter the Transformer2 positive sequency impedance:')
ZT22=Input('Enter the Transformer2 negativesequency impedance: ')
ZT20=Input('Enter the Transformer2 zero sequency impedance: ')
%%Transmission line data in P.U
Ztran1=Input('Enter the Trans. line +VE sequency impedance : ')
Ztran2=Input('Enter the Trans. line -VE sequency impedance : ')
Ztran0=Input('Enter the Trans. line zero sequency impedance: ')
%%Motor data in p.u
ZM1=Input('Enter the Trans. line +VE sequency imp. : ')
ZM2=Input('Enter the Trans. line +VE sequency imp. : ')
ZM0=Input('Enter the Trans. line +VE sequency imp. : ')
Zn=Input('Enter the Trans. line +VE sequency imp. : ')
%%Fault data
Zfault=0;
Ibase=BaseMVA/(sqrt(3)*BaseKvolt1);
%%positive sequence network Impedance value
Z1=((ZG1+ZT11+Ztran1+ZT21)*ZM1)/((ZG1+ZT11+Ztran1+ZT21)+ZM1);
%% Negative sequency network Impedanece value
Z2=((ZG2+ZT12+Ztran2+ZT22)*ZM2)/((ZG2+ZT12+Ztran2+ZT21)+ZM2);
%%Zero sequency network Impedanece value
Z0= ZM0+(3*Zn);
%%single line to ground fault(SLGF)
display('################################################################')
display('fault currents and voltages for LG fault in p.u: ')
display('################################################################')
ER1=PrefalV;
IR1=ER1/(Z1+Z2+Z0+(3*Zfault));
IR2=IR1;
IR0=IR1;
IR=[IR0;IR1;IR2];
IfaultTotal=3*IR1
X=[Z0 0 0;0 Z1 0;0 0 Z2]; IR=[IR0;IR1;IR2];
Z=X*IR;
VR=[0;ER1;0]-Z;
a=[1 1 1;1 -0.5-j*0.8666 -0.5+j*0.8666;1 -0.5+j*0.8666 -0.5-j*0.8666 ];
display('Fault currents and Voltages in R,Y and B phases in p.u:')
VFault=a*VR
Ifault=a*IR
%convert in to actual value
display('Total fault current actual value in KA')
Ifaultact=Ibase*IfaultTotal
%% Double to ground fault(DLGF)
display('################################################################')
display(' fault currents and voltages for LLG fault in p.u: ')
display('################################################################')
IR1=ER1/(Z1+( Z2*((Z0+(3*Zfault))/(Z2+Z0+(3*Zfault)))));
IR2=-IR1*((Z0+(3*Zfault))/(Z2+Z0+(3*Zfault)));
IR0=-(IR1+IR2);
IR=[IR0;IR1;IR2];
IfaultTotal=3*IR0
VR0=-((Z0*IR0)+(3*Zfault));
VR1=(-(IR1*Z1))+ER1;
VR2=-(IR2*Z2);
VR=[VR0;VR1;VR2];
display('Fault currents and Voltages in R,Y and B phases in p.u')
Ifault=a*IR
Vfault=inv(a)*3*VR
display('Total fault current actual value in KA')
Ifaultact=Ibase*IfaultTotal
Vfault=a*[VR0;VR1;VR2]
display('Total fault current actual value in KA')
Ifaultact=Ibase*Ifaulttotal

RESULT:
7. Economic Load Dispatch with & without transmission losses

AIM:
To Program the Economic dispatch of a power system by using lambda iteration method.
SOFTWARE REQURIED:
Matlab Application Software: MATLAB R2012a
THEORY:

A modern power system is invariably fed from a number of power plants. Research and development
has led to efficient power plant equipment. A generating unit added to the system today is likely to be
more efficient than the one added some time back. With a very large number of generating units at
hand, it is the job of the operating engineers to allocate the loads between the units such that the
operating costs are the minimum. The optimal load allocation is by considering a system with any
number of units. The loads should be so allocated among the different units that every unit operates
at the same incremental cost. This criterion can be developed mathematically by the method of
lagrangian multiplier.

Statement of Economic Dispatch Problem:

In a power system, with negligible transmission losses and with N number of spinning thermal
generating units the total system load PD at a particular interval can be met by different sets of
generation schedules.
PG1(K), PG2(K)…. PGN(K) ; k =1,2,… ......... NS
Out of these NS sets of generation schedules, the system operator has to choose that set of
schedule which minimizes the system operating cost which is essentially the sum of the production
costs of all the generating units. This economic dispatch problem is mathematically stated as an
optimization problem. Given the number of available generating units Ns their production cost
function, their operating limits and the system load PD.
To determine the set of generating schedule PG,
Min FT = 
N
F .P  (1)
i Gi
i 1
N

  P  P Gi D
=0 (2)
i 1

PGi min  PGi  PGi max (3)


The unit production cost function is usually approximated by a quadratic function.
F P   a P  b P  c
2
i=1,2……N (4)
i Gi i Gi i Gi i
where ai, bi and ci are constants.

The ED problem is given by the equations (1) to (4). By omitting the inequality constraint the
reduced ED problem may be restated as an unconstrained optimization problem by augmenting
the objective function with the constraint function Φ multiplied by Lagrange multiplier λ to



Fi PGi     PGi  PD

obtain the Lagrange function L as, N N
Min: L(PG1,…..PGN, λ)=  (5)
i 1 i 1
The necessary conditions for the existence of solution to (5) are given by,
L dF i P Gi 
0 ; i=1,2…..N (6)
PGi dPGi  
L
0 N P  PD (7)

Gi
i 1
The solution to ED problem can be obtained by solving simultaneously the necessary conditions
(6) and (7) which state that the economic generation schedules not only satisfy the system power
balance equation (8) but also demand that the incremental cost rates of all the units be equal to λ
which can be interpreted as “incremental cost of received power” when the inequality constraints
(3) are included in the ED problem the necessary condition (6) gets modified as

dF PG 
= λ for PGi,min  PGi  PGi, max
i i

dPG
i

 λ for PGi = PGi,max


 λ for PGi = PGi, min (8)

Methods of Solution for ED without Loss

The solution to the ED problem with the production cost function assumed to be a quadratic function,
equation (4), can be obtained by simultaneously solving (6) and (7) using a direct method as given
below,

dFi (PGi )
= 2aiPGi + bi = λ; i = 1,2, .......... N (9)
dPG
i

From Equation (9) we obtain


PGi = (λ – bi) /2ai ; i = 1,2,............N (10)
Substituting Equation (10) in Equation (7) we obtain
N

 (  b ) / 2ai = PD
i1
i
N N

  (1/ 2a )   (b / 2a )  PD
i 1 1
i1 i1
N N

  (PD   (b / 2a )) /  (1/ 2a ) i i i
(11)
i1 i1
Start

Read the data co-efficients ai,bi,ci and PD

Assume initial value of Lagrangian, λ1

Find Pgi = λ- bi/2ai ; i= 1,2,…….NG

Is∑ PGi<
PD No
Yes
Assume λ2< λ1 Value
Assume λ2 > λ1 Value

Find Pgi = λ2-bi/2ai

Yes
Check
∑Pgi = Pd

No

2  1
Calculate λ3= λ +2 Pd  PG2 
PG2  PG1

Find Pgi= λ3- bi/2ai

Print the generator real power


as output

Stop
The method of solution involves computing λ using equation (11) and than computing the
economic schedules PGi; i=1,2,. ......... N using equation (10). In order to satisfy the operating limits
(3) the following iterative algorithm is to be used.

Algorithm for ED without loss (For quadratic production cost function)

Step 1: Compute λ using Equation (11)

Step 2: Compute using Equation (10) the economic schedules, PGi ; i = 1,2,. ............ N

Step 3: If the computed PGi satisfy the operating


limits PGi, min  PGi  PGi, max ; i = 1,2,. N
Then stop, the solution is reached. Otherwise proceed to step 4

Step 4: Fix the schedule of the NV number of violating units whose generation PGi
violates the operating limits (12) at the respective limit, either PG i,max or
PGi,min

Step 5: Distribute the remaining system load PD minus the sum of the fixed generation
schedules to the remaining units numbering NR (= N-NV) by computing λ
using
Equation (11) and the PGi; i using equation (10) where  is the set of
NR NR
remaining units.

Step 6: Check whether optimality condition (8) is satisfied. If yes, stop the
solution Otherwise, release the generation schedule fixed at PGi,max or
PGi,min of
those generators not satisfying optimality condition (8), include these units in the
remaining units, modify the sets  ,NV and
NR
the remaining load. Go to step 5.

PROCEDURE:
1. Open Matlab software form run window.
2. Create a new M-file by selecting File – New – M-file
3. Type the program and save in the editor window.
4. Execute the program by pressing run tool for F5.
5. View the result.

PROBLEM STATEMENT:
The fuel cost function in Rs/Hr for three thermal plants are given below
C1=420+9.2P1+0.004P12 ; 100≤ P1 ≤ 200
C2=350+8.5P2+0.0029P22 ; 150 ≤ P2 ≤ 500
Where P1, P2 , P3 are in M.W. Neglecting the line losses and including generating limits,
PL=0.034P12+0.00643P22 (P.U.).
Determine the optimal scheduling of generators if the total demand is 640.82 M.W.
PROGRAM:
clc;
clear;
cost data=input('Enter the data in the form of pmin pmax');
ng=length(costdata(:,1));
for i=1:ng
uno(i)=costdata(i,1);
d(i)=costdata(i,2);
b(i)=costdata(i,3);
a(i)=costdata(i,4);
pmin(i)=costdata(i,5);
pmax(i)=costdata(i,6);
end
lambda=12.1;
iter=0;
pd=640.82;
delp=0.1;
dellambda=0;
lossdata=[0.0346 0.00643];
totgencost=0;
for i=1:ng
B(i)=lossdata(1,i);
end
while abs(delp)>=0.01
lambda=lambda+dellambda;
iter=iter+1;
pl=0;
sum=0;
delpla=0;
for i=1:ng
den=2*(a(i)+lambda*B(i)*0.01);
p(i)=(lambda-b(i))/den;
pl=pl+(B(i)*0.01*p(i)*p(i));
sum=sum+p(i);
end
delp=pd+pl-sum;
for i=1:ng
den=2*(a(i)+lambda*B(i)*0.01)^2;
delpla=delpla+(a(i)+B(i)*0.01*b(i))/den;
end
dellambda=delp/delpla;
end
dellambda=0;
for i=1:ng
pv(i)=0;
pvfin(i)=0;
end
limvio=0;
for i=1:ng
if p(i)<pmin(i)|p(i)>pmax(i)
limvio=1;
break;
end
end
if limvio==0
disp('GENERATION IS WITHIN THE LIMITS');
end
delp=0.1;
if limvio==1
while (abs(delp)>=0.01)
disp('GENERATION IS NOT WITHIN THE LIMITS');
disp('VIOLATED GENERATION NUMBER');
i
if p(i)<pmin(i)
disp('GENERATION OF VIOLATED UNIT(MW)');
p(i)
disp('CORRESPONDING VIOLATED LIMIT IS pmin');
elseif p(i)>pmax(i)
disp('GENERATOR OF VIOLATED UNIT(MW)');
p(i)
disp('CORRESPONDING VIOLATED LIMIT IS pmax');
end
pl=0;
sum=0;
delpa=0;
for i=1:ng
pv(i)=0;
end
for i=1:ng
if p(i)<pmin(i)|p(i)>pmax(i)
pv(i)=1;
pvfin(i)=1;
if p(i)<pmin(i)
p(i)=pmin(i);
end
if p(i)>pmax(i)
p(i)=pmax(i);
end
end
end
for i=1:ng
if pvfin(i)~=1
den=2*(a(i)+lambda*B(i)*0.01)^2;
delpa=delpa+(a(i)+B(i)*0.01*b(i))/den;
end
sum=sum+p(i);
end
delp=pd+pl-sum;
delambda=delp/delpa;
lambda=lambda+dellambda;
sum=0;
for i=1:ng
if pvfin(i)~=1
den=2*(a(i)+lambda*B(i)*0.01);
p(i)=(lambda-b(i))/den;
end
pl=pl+(B(i)*0.01*p(i)*p(i));
sum=sum+p(i);
end
delp=pd+pl-sum;
end
end
for i=1:ng
den=1-(B(i)*p(i)*2*0.01); l(i)=1/den;
end
for i=1:ng
totgencost=totgencost+(d(i)+b(i)*p(i)+a(i)*p(i)*p(i));
ifc(i)=2*a(i)+p(i)+b(i);
end
disp('FINAL OUTPUT OF MATLAB PROGRAM dispatch4.m');
lambda
disp('GENRATION UNIT OPTIMAL GENERATIN (MW)');
[uno;p]'
disp('PENALITY FACTORS ARE'); disp('UNIT
NO.: L');
[uno;l]'
disp('TOTAL GENERATION COST(RS./hr)');
totgencost

RESULT:
Load Flow Solution Using Fast Decoupled Method

Aim:

To become proficient in the usage of software in solving load flow problems using Fast
decoupled load flow method.

Theory:

Load flow study is useful in planning the expansion of power system as well as determining best
operation of the system. The principle obtained from load flow study is the magnitude and phase
angle of the voltage at each bus and real and reactive power flowing in each line. Load flow analysis
may be performed using A.C. network analyzer and also by digital computer. But now- a-days digital
computer oriented load flow analysis is a standard practice.
The fast decoupled load flow method is a very fast method of obtaining load flow solutions.
This method requires less number of arithmetic operations to complete an iteration consequently.
This method requires less time per iterations. In N-R method, the elements of Jacobian are to be
computed in each iteration .So the time per iteration is considerably more in N-R method than in
FDLF. The rate of convergence in FDLF method is slow requiring considerably more number of
iterations to obtain a solution than in the case of N-R method. However accuracy is same in both the
cases. In this method both the speeds as well as the sparsity are exploited. This is an extension of N-
R method formulated in polar co-ordinates with certain approximation which results into a fast
algorithm for load flow solution.
In practice, transmission system operating under steady state possesses strong
interdependence between active powers and bus voltages, angles, similarly there is strong
interdependence between bus voltage and reactive power

Pk Pk Em 
Hkm  ; Nkm 
 m Em
Qk Qk Em
Jkm  ; Lkm 
 m Em
Pp QP Eq
H pq  ; Lpq 
 q Eq
The equation for power flow are again expressed below for calculating elements of Jacobian (ie H
& L)

 Ep Eq Ypq cospq   p   q 
n
Pp  Ep EqYpp cos pp  

q1, p

Qp  Ep EqYpp sin pp   Ep EqYpq sin pq   p   q 


Therefore the elements of Jacobian (ie H & L) can be calculated as from the equations above of
power. OFF diagonal element of H is
Pp
HPQ  
sin      
p q
 q
pq
Flowchart:

Start

Read the input data

Form the Y bus matrix

Form B’ and B” matrix

Set flat voltage profile except for slack bus

Set convergence criterion є


C

Set iteration count p=0

Calculate real & reactive power

Calculate
P  Q  P  H M  
 ,   Q   N V 
 V  V     L  

No
Are
P  Q  Find   & V  by solving the
 ,     equations:
 V  V 
   1  2 V 
     
Yes V   3  4  Q 

Calculate real & reactive line Uptate voltage magnitude t phase


flow, bus powers angles

V   V 
new old
 V 

    
Print the results
  
new old

Stop
C
Algorithm:

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.

Program:

clc
clear
%-------------v-----del-----Pg-----Qg----Pd----Qd-------------
bus = [ 1 1.04 0.00 0.00 0.00 0.00 0.00 0.00 0.00 1;
2 1.02533 0.00 1.63 0.00 0.00 0.00 0.00 0.00 2;
3 1.02536 0.00 0.85 0.00 0.00 0.00 0.00 0.00 2;
4 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3;
5 1.00 0.00 0.00 0.00 0.90 0.30 0.00 0.00 3;
6 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3;
7 1.00 0.00 0.00 0.00 1.00 0.35 0.00 0.00 3;
8 1.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 3;
9 1.00 0.00 0.00 0.00 1.25 0.50 0.00 0.00 3];

% formation of y bus for nominal tap ratio i.e. a=1


%----------------r-------x------------b------------
line = [1 4 0.0 0.0576 0. 1. 0. ;
4 5 0.017 0.092 0.158 1. 0. ;
5 6 0.039 0.17 0.358 1. 0. ;
3 6 0.0 0.0586 0. 1. 0. ;
6 7 0.0119 0.1008 0.209 1. 0. ;
7 8 0.0085 0.072 0.149 1. 0. ;
8 2 0.0 0.0625 0. 1. 0. ;
8 9 0.032 0.161 0.306 1. 0. ;
9 4 0.01 0.085 0.176 1. 0. ];

r = size(line);
p = r(1);
w = line(:,2 );
buses = max(w);

% b=zeros(1,buses);
ybus = zeros(buses,buses);
y = zeros(buses,buses);

for k= 1:p % finding the elements of ybus


l= line(k,1);
m= line(k,2);

y(l,m) = 1/(line(k,3)+ 1i*line(k,4));


y(m,l) = y(l,m);
% b(l) = b(l)+(i*line(k,5))/2;
% b(m) = b(m)+(i*line(k,5))/2;

end

for i = 1:buses
for j = 1:buses

if i==j
ybus(i,j) = ybus(i,j)+sum(y(i,:)); %+ b(i);
end

if i~=j
ybus(i,j) = -1*y(i,j);
end
end
end
ybus;
b = -imag(ybus);

%formation of b' matrtix


b1=zeros(buses-1,buses-1);
for i = 1:buses-1
for j = 1:buses-1
b1(i,j) =b(i+1,j+1);
end
end
b1;

%formation of b" matrtix


%assuming all the load buses are at last
b2=zeros(buses-3,buses-3);
for i = 1:buses-3
for j = 1:buses-3
b2(i,j) =b(i+3,j+3);
end
end
b2

v = bus(:,2);
del = bus(:,3);
Pg = bus(:,4);
Qg = bus(:,5);
Pd = bus(:,6);
Qd = bus(:,7);

Pspec = Pg-Pd;
Qspec = Qg-Qd;
iter = 1;
slack = 1;
tolerance = .01;
flag=1

while flag==1;

m = real(ybus);
n = imag(ybus);
P = zeros(buses,1);
Q = zeros(buses,1);
iter= iter+1;

for i=1:buses %finding bus real and reactive power


for j=1:buses
P(i) = P(i)+ (v(i)*v(j)*(m(i,j)*cos(del(i)-del(j))+n(i,j)*sin(del(i)-del(j))));
Q(i) = Q(i)+ (v(i)*v(j)*(m(i,j)*sin(del(i)-del(j))-n(i,j)*cos(del(i)-del(j))));
end
end

P
Q
%finding del P by v
for i=1:(buses-1)
if(i<slack)
delP(i,1)= Pspec(i)-P(i);
else
delP(i,1)=(Pspec(i+1)-P(i+1));

end
delPbyv(i,1)=delP(i,1)/v(i,1);
end

%finding del Q by v
c=0;
for i=1:buses
if bus(i,10)==3
c=c+1;
delQ(c,1)= (Qspec(i)-Q(i));
delQbyv(c,1)= delQ(c,1)/v(i,1);
end
end

if max(abs(delP))>tolerance | max(abs(delQ))>tolerance
flag=1; % tolerance check
else
flag=0;
end

%calc correction vector


deldel = inv(b1)*delPbyv;
delv = inv(b2)*delQbyv;

%updating values
for i=1:(buses-1)
del(i+1,1)= del(i+1,1)+deldel(i,1);
end

c=0;
for i=1:buses
if bus(i,10)==3
c=c+1;
v(i,1)=v(i,1)+delv(c,1);
end
end

iter
v
del
end
7. TRANSIENT STABILITY OF SINGLE MACHINE CONNECTED TO
INFINITE BUS BY POINT BY POINT METHOD
Aim: To determine transient stability of single machine connected to infinite bus by point by point method
Apparatus: MATLAB software with PC compatibility
THEORY:
Stability of power system is its ability to return to normal or stable operating conditions after having been
subjected to some form of disturbance. Increase in load is a kind of disturbance. Causes for disturbances are
 Change in load
 Loss of excitation
 Switching operation
 Fault conditions

PROBLEM:
A 20 MVA ,50 HZ generator delivers 18MW over a double circuit line to an infinite bus. The generator has
kinetic energy of 2.52MJ/MVA at rated speed. The generator transient reactance is X1d =0.35PV. Each
transmission circuit has R=0 and reactance of 0.2Pu on a 20MVA base. |E1|=1.1Pu and infinite bus voltage(v)=
1.0<00. A 3-ø short circuit occurs at midpoint of one of transmission lines. Plot swing curve for 0.25cycles.

CALCULATION:
Base MVA =
Inertia constant M(Pu) = H/180f =
Pre fault:
XL=
Pe1`=pmax1sinδ

Pre fault power transfer=


Initial power angle is given by
2.44 sinδ0 = 0.9
δ0 =
During fault:
X11 =
Pe11 = pmax11 sin δ
=
Past fault:
X111 =
Pe111 =

Let us choose ∆t = 0.05S


Pa (n-1) = Pm - Pmax sin δ (n-1)

∆δn =∆δn-1 + (∆t)2/m Pa (n-1)

δn =δn-1 +∆δn

Pa for first interval


Pa(O) =∆Pu and Pa (o+) =
Pa(oavg) =
PROGRAM:

% Point by Point method


clear
t=0
tf=0
tfinal=0.5
tc=0.125
tstep=0.05
m=2.52/(180*50)
i=2
delta=21.64*pi/180
ddelta=0
time(1)=0
ang(1)=21.64
pm=0.9
pmaxbf=2.44
pmaxdf=0.88
pmaxaf=2.00
while t<tfinal,
if(t==tf)
paminus=0.9-Pmaxbf*sin(delta)
paplus=0.9-pmaxaf*sin(delta)
paav=(paminus+pa)/2
pa=paav
end
if(t==tc)
paminus=0.9-pmaxdf*sin(delta)
paplus=0.9-pmaxaf*sin(delta)
paav=(paminus+paplus)/2
pa=paav
end
if(t>tf&t<tc),
pa=pm-pmaxdf*sin(delta)
end
if(t>tc)
pa=pm-pmaxaf*sin(delta)
end
t,pa
ddelta=ddelta+(tstep*tstep*pa/m)
delta=(delta*180/pi+ddelta)*pi/180
deltadeg=delta*180/pi
t=t+tstep
pause
time(i)=t
ang(i)=deltadeg
i=i+1
end
axis=([0.06 0 160])
plot(time,ang,'ko-')

APPLICATIONS:
 Stability of power system is done by some sessions. So, these sessions need this sort of analysis for fast
operation.
 Torque (or) load angle adjustment (or) control uses these in stability (or) transient analysis of the power
system.

RESULT:

You might also like