Power System Simulation Lab
Power System Simulation Lab
SEMBODAI, NAGAPATTINAM.
DEPARTMENT OF ELECTRICAL AND ELECTRONICS
Prepared by,
Date: 18.06.2015
Page
S.No Date Name of the Experiment Marks Remarks
No
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
AIM:
SOFTWARE REQUIRED:
MATLAB software package
FORMULAE:
Single phase Inductance = 10-7[1+4log(d/r)]
Capacitance = 3.14*8.854*10-12/log(d/r)
Three phase Inductance = 10-7[0.5+2log(d/r)]
Capacitance = 2*3.14*8.854*10-12/log(d/r)
Dequivalent = [d1*d2*d3]1/3
where
d = spacing of conductors
r = radius of conductors
ALGORITHM:
STEP 1: Find that the given transmission line is single phase or three phase
STEP 2: If it is single phase, get the value of distance between the conductors.
STEP 3: Get the radius of the conductor
STEP 4 : Using the appropriate formula, find inductance and capacitance.
STEP 5: If the given system is three phase, classify whether it is symmetrical or
unsymmetrical
STEP 6: If symmetrical, get the distance between the conductors and radius of the
PROBLEM:
Determine the sending end voltage, current, power & power factor for a 160km
section of 3phase line delivering 50MW at 132kV and P.F 0.8 lagging. Also find the
efficiency and regulation of the line. Resistance per line 0.1557ohm per km, spacing
3.7m, 6.475m, 7.4m transposed. Evaluate the A, B, C, D parameters also. Diameter
1.956cm.
Write and execute a MATLAB program and also verify the output with the
manual calculation results.
PROGRAM :
clc;
clear all;
ab=input('value of ab');
bc=input('value of bc');
ca=input('value of ca');
pr=input('receiving end power in MW');
vr=input('receiving end voltage in kv');
pfr=input('receiving end power factor');
l=input('length of the line in km');
r=input('resistance/ph/km');
f=input('frequency');
D=input('diameter in m');
rad=D/2;
newrad=(0.7788*rad);
deq=(ab*bc*ca)^(1/3);
L=2*10^(-7)*log(deq/rad);
C=(2*pi*8.854*10^-12)/log(deq/rad);
XL=2*pi*f*L*l*1000;
rnew=r*l;
Z=rnew+1i*(XL);
Y=1i*(2*pi*f*C*l*1000);
a=1+((Z*Y)/2);
d=a;
b=Z;
c=Y*(1+((Z*Y)/4));
vrph=(vr*10^3)/1.732;
EXECUTION:
AIM:
To form the bus admittance matrix (Y bus) for a given power system using
MATLAB program.
SOFTWARE REQUIRED:
MATLAB software package
ALGORITHM:
STEP1: Read all the data namely R and X for the system.
STEP2: Calculate the mutual or transfer reactance for the reactance between i and j and
i=j= 1, 2, 3, 4
PROBLEM
Form the Ybus matrix for the given power system. Write and execute a MATLAB
program and also verify the output with the manual calculation results.
clear all;
clc;
n= input('Enter the number of buses');
fprintf('Enter your choice');
p= input ('1. impedance, 2. admittance');
if (p==1)
for q= 1:n
for r=q+1:n
fprintf('Enter the impedance value between %d-%d',q,r);
z(q,r)=input(':');
if (z(q,r)==0)
y(q,r)=0;
else
y(q,r)=inv(z(q,r));
end
y(r,q)= y(q,r);
fprintf('enter the half line charging admittance');
x(q,r)= input(':');
x(r,q)=x(q,r);
end
end
elseif (p==2)
for a= 1:n
for b=a+1:n
fprintf('Enter the admittance value between %d-%d',a,b);
y(a,b)=input(':');
y(b,a)= y(a,b);
fprintf('enter the half line charging admittance');
x(a,b)= input(':');
x(b,a)=x(a,b);
end
end
else
fprintf('enter the correct choice');
end
tr=zeros(n,n);
fprintf('Off-Nominal Tap ratio exists in the system? Enter 1.Yes
2.No');
o= input(':');
if(o==1)
for k=1:n
for l=k+1:n
fprintf('Transformer tap for %d-%d exists? 1.Yes 2.No',k,l)
g=input(':');
if(g==1)
fprintf('Enter the choice 1.1:a 2.a:1 ?')
d=input(':');
EXECUTION:
AIM:
To form the bus impedance matrix (Z bus) for a given power system using
MATLAB program.
SOFTWARE REQUIRED:
MATLAB software package
ALGORITHM:
It in the step by step programmable technique which places branch by branch.
It is the advantage that modification of the network does not require complete rebuilding
of Z bus.
STEP3: Build the Z bus for the given network & print the Z bus matrix
PROBLEM:
Form the Zbus matrix for the given power system. Write and execute a MATLAB
program and also verify the output with the manual calculation results.
clc;
clear all;
e = input('enter the no of elements:');
disp('1.Btwn a new node and reference');
disp('2.Btwn a new node and existing node');
disp('3.Btwn an existing node and reference');
disp('4.Btwn two existing nodes');
zb=complex(0,0);
zt=complex(0,0);
for i=1:e
if(i==1)
a=0;
else
[a,c]=size(zb);
end
b=a+1;
disp(['elements no:',num2str(i)]);
ty(i)=input('enter the type of element:');
z(i)=input('enter the impedance value:');
s(i)=input('enter the starting node:');
t(i)=input('enter the ending node:');
if(ty(i)==1)
zb(b,b)=z(i);
for j=1:a
zb(j,b)=0;
zb(b,j)=0;
end
disp(zb);
elseif(ty(i)==2)
zb(b,b)=z(i)+zb(t(i),t(i));
for j=1:a
zb(b,j)=zb(t(i),j);
EXECUTION:
AIM:
To find load flow analysis using Gauss-Seidal method in MATLAB
SOFTWARE REQUIRED:
MATLAB software package
ALGORITHM:
STEP1: The slack bus voltage magnitude and angle are measured usually V1 =1 p.u. with
the load profile known at each bus, we allocate Pi and Qi to all generating
Stations with this step, bus injections (Pi+Qi) are known at all buses other than
the slack bus.
STEP2: Assembly of bus admittance matrix: with the line and shunt admittance data
stored in the computer . Y bus is assembled by using the algorithm developed
earlier . Alternatively bus is assembled using Y bus= ATYA where the input is
in the form of primitive admittance matrix Y and singular connection bus
incidence matrix A
STEP3: Iterative computation of bus voltages (Vi, i=1,2.n) to start iteration a set of
initial values is assumed, since in a power system the voltage spread is not too
wide, it is normal practice to use a flat voltage start, i.e. initially all voltages are
set equal to (1+j0) expect slack bus voltage which is fixed . this reduced the n
equations in complex number which are to solved iteratively for finding complex
voltages V2,V3,...Vn. If complex no options are not available in a computer, the
equation is real unknown js
We also define,
Ai=Pi-jQi/Yii=2,..n
Bik=Yik I=2,.k#i
The iterative process is continued till the change in magnitude of bus voltage
|Vi(r+1)
Between two consecutive is less than a certain for all bus voltages i.e.,
Also we see if
STEP4: Computation of slack bus power; substitution of all bus voltages computed in
step3 with Vi and I=1 yield real and reactive power at slack bus i.e, S1=P1+jQ1
STEP5: Computation of line flows; this is the last step in the load flow analysis where in
the power flows on the various lines of the network are computed. This also
enables us to check whether any line overloaded. Consider the line connecting
buses I and k. The line and transformer at each end can be represented by a circuit
with series admittance Yik and to shunt admittances Yiko. As the current fed by
bus Iin to the line can be expressed as
PROBLEM:
Figure shows the one-line diagram of a three-bus power system with generation at bus1.
The magnitude of voltage at bus1 is adjusted to 1.05 per unit. The scheduled loads at
buses 2 & 3 are as marked on the diagram. Line impedances are marked in per unit on a
100MVA base and the line charging susceptances are neglected.
PROGRAM:
Thus the load flow analysis using is performed by Gauss-Seidal method and a
program is developed using MATLAB to find the solution of load flow for given power
system and the output is verified.
AIM:
To develop in MATLAB to find the solution of power flows using Newton
Raphson method.
SOFTWARE REQUIRED:
MATLAB software package
ALGORITHM:
STEP 1: Assume a flat profile 1+j0 for all buses except the slack bus in the
Specified voltage and it is not modified in any iteration.
STEP 3: Set the iteration count K=0 and assumed voltage profile of the buses
are denoted as V10,V20Vn0.
STEP 5: Check for slack bus. If it is a slack bus then go to step 13. Otherwise
Go to next step.
STEP 6: Calculate the real & reactive power of bus p using the following
equation,
Ppk=k q=1{epk(eqkGpq+fqkBpq)+fpk(fqkGpq-eqkBpq)}
Where,
Pp spec=specified real power of bus p.
STEP 8: Check for generator bus. If it is a generator bus gob to next step
otherwise go to step 12.
STEP 10: If the calculated reactive power is within the soecified limit then
consider this bus as generator bus. Now calculate the voltage
residue using the equation
|VPK|2 =|Vp spec|2-|Vpk|2
erehW |Vp spec| = specified voltage magnitude for generation bus.
Then go to step 13.
STEP 11: If the reactive power limit violated the treat this bus as a load bus.
Now the specified reactive power for this bus will correspond to
Limit violated
STEP 12: Calculate the change in reactive power for load bus change in
reactive power,
Qk=|Qp spec|-Qpk
STEP 13: Repeat the step 5 to 12 until all residues are calculated for
increment the bus count n. by 1 to 5 steps until the bus count is n.
STEP 14: Determine the largest of the absolute value of the residue (i.e.)
Find the largest value among Ppk,Qpk or |Vpk|2
STEP 15: Compare E and E, if E<E then go to step 20. If E>E go to next
Step.
STEP 16: Determine the element, the load flow equation using kth iteration
Value.
STEP 17: Calculate the increment in real and reactive part of voltage e pk and
fpk by solving the matrix equation B=JC.
Figure shows the one-line diagram of a three-bus power system with generators at buses
1& 3. The magnitude of voltage at bus1 is adjusted to 1.05 per unit. The magnitude of
voltage at bus 3 is fixed at 1.04pu with a real power generation of 200 MW. A load
consists of 400 MW and 250 MVAR is taken from bus2. Line impedances are marked in
per unit on a 100MVA base and the line charging susceptances are neglected.
PROGRAM:
clear all;
clc;
v=[1.05;1.0;1.04];
d=[0;0;0];
ps=[-4;2.0];
qs=-2.5;
n= input('Enter the number of buses ');
fprintf('Enter your choice');
p= input ('1. impedance, 2. admittance');
if (p==1)
for q= 1:n
EXECUTION:
Thus the load flow analysis using is performed by Newton-Raphson method and a
program is developed using MATLAB to find the solution of load flow for given power
system and the output is verified.
AIM:
To develop a MATLAB program to perform the fault analysis for a given power
system.
SOFTWARE REQUIRED:
MATLAB software package
ALGORITHM:
STEP 1: Get the data for positive and negative sequence impedance materials.
STEP 2: Enter the bus code number, base kV, base MVA number.
choices.
STEP 6: Enter the fault impendence value, fault bus code, and fault bus voltage.
PROBLEM:
Consider the 3bus system as shown in figure. The generators are 100 MVA with transient
reactance 10% each. Both the transformers are 100 MVA with a leakage reactance of 5%.
The reactance of each of the lines to a base of 100 MVA, 110kV is 10%. Obtain the short
circuit calculation for a 3phase solid short circuit on bus 3.
Assume pre-fault voltages to be 1pu and pre-fault currents to be zero.
PROGRAM:
clear all;
close all;
clc;
kv=input('enter the base kv');
mva=input('enter the base mva');
bc=[(mva*1000)/(sqrt(3)*kv)];
e = input('enter the no of elements:');
disp('1.Btwn a new node and reference');
disp('2.Btwn a new node and existing node');
disp('3.Btwn an existing node and reference');
disp('4.Btwn two existing nodes');
zb=complex(0,0);
zt=complex(0,0);
for i=1:e
if(i==1)
a=0;
else
[a,c]=size(zb);
end
b=a+1;
EXECUTION:
Thus a program is developed using MATLAB to perform the fault analysis for a
given power system network and the output is verified.
AIM:
To analyze the transient stability of a single machine infinite bus system by point
by point method using MATLAB.
SOFTWARE REQUIRED:
MATLAB software package
ALGORITHM:
STEP 1: Evaluate the accelerating power Pa.
STEP 3: The change in angular velocity for the first interval is calculated.
STEP 4: The change in rotor angle for the first interval is also calculated.
STEP 5: If the discontinuity occurs due to removal of the fault or due to switching
STEP 6: To evaluate Pa when under first situation, one should use the value
STEP 7: To evaluate Pa under the situation, a weighted average value of Pa before and
n = n-1 + deln
PROBLEM:
Consider a system which consists of generator having a rating of 50 MVA & H=2.7
MJ/MVA at rated speed. E=1.05, V=1, Xd =0.2, X1=X2=0.4 pu. The generator supplies
50 MW to the infinite bus when a 3phase fault occurs at middle of line 2.
i). Plot swing curve for a sustained fault up to 0.5 sec.
ii). Plot the swing curve if the fault is cleared in 0.1 sec by simultaneous opening of
breakers at both ends of line 2.
iii).Find the critical clearing angle & clearing time.
iv). Write and execute a MATLAB program and also verify the output with the manual
calculation results.
PROGRAM:
clear all;
clc;
t=0;
tf=0;
f=input('Enter the input frequency');
s= input('Enter the machine rating');
ang(1)=input('Enter the inital angle');
h=input('Enter the moment of inertia constant');
tfinal=input('Enter the end time');
tstep=input('Enter the change in time');
tc=input('enter the clearing time');
pm=input('enter the power transfer');
pmaxbf=input('enter the prefault power');
pmaxdf=input('enter the power during fault');
pmaxaf=input('enter the postfault power');
m= (s*h)/(180*f);
delta=ang(1)*pi/180;
i=2;
EXECUTION:
Thus the transient stability analysis for single machine connected to infinite bus
and fault clearance in different time was studied.
AIM:
To analyze the small signal stability of the given power system with the help of
MATLAB program.
SOFTWARE REQUIRED:
MATLAB software package
ALGORITHM:
STEP: 1 Click the PSCAD icon.
STEP: 2 Open the untiled window and create the model for of transient stability analysis
of multimachine power system from the various library functions available in the
PSCAD browser.
STEP: 4 Double click the scope and we can get the waveform.
PROBLEM:
Infinite
bus
The shown fig shows the system representation applicable to a thermal generating station
consisting of four 555 MVA, 24kV, 60 Hz units. The network reactances are in per unit
on 220 MVA, 24kV base (referred to the LT side of the step up transformer). Resistances
are assumed to be negligible. The objective of this problem analyzes the small signal
stability characteristics of the system about the steady state operating condition following
the loss of ckt1. The post fault systems condition is per unit on the 220MVa, 24kV base
as follows; P=0.9, Q=0.3 (over excited), Et=1.0360, EB=0.99500.
Electrical and Electronics Engineering Page 47
The generators are to be modeled as a single equivalent generator represented by the
classical model by the following parameters expressed in pu on 2220MVA, 24 kV, base
X2=0.2, H=3.5.
a). Write the linearized state equations of the system. Determine the eigen values ( 1, 2)
damped frequency of oscillation in HZ, damping ratio and undamped natural frequency
for each of the following parameters expresses values of damping coefficients. i). KD=0, .
ii). KD=10. iii). KD= -10.
PROGRAM:
clc;
clear all;
p=0.9;q=0.3;f=60;xd=0.3*i;xtr=0.15*i;x1=0.5*i;x2=0.93*i;Et=1;Eb=0.995;
w0=2*pi*f;
s=p+q*i;
It=s'/Et';
FL=input('ENTER THE FAULTED LINE NO:');
if FL==1
xt=xd+xtr+x2;
else
xt=xd+xtr+x1;
end
E=Et+It*xd;
D=angle(E)-angle(Eb);
ks=(abs(E)*abs(Eb)*cos(D))/abs(xt);
H=input('ENTER THE VALUE OF INTERTIA CONSTANT , H:');
kd=input('ENTER THE Kd VALUE :');
A=[(-kd/(2*H)) (-ks/(2*H));w0 0];
lambda=eig(A)
w=ks*w0/(2*H);
wn=sqrt(w)/(2*pi)
z=0.5*kd/sqrt(2*ks*H*w0)
wd=wn*sqrt(1-z*z)
[VD]=eig(A);
g=[(-0.0019+0.0168*i) (-0.0019-0.0168*i); 1 1];
L=inv(g);
[P]=[L(1,1)*g(1,1) L(1,2)*g(2,1);L(1,2)*g(2,1) L(2,2)*g(2,2)]
theta=acos(z)
D0=5*pi/180;
t=0:.01:3;
Dd=D0/sqrt(1-z^2)*exp(-z*wn*t).*sin(wd*t+theta);
d=(D+Dd)*180/pi;
plot(t,d),grid
xlabel('t sec'),ylabel('delta degree')
Thus the small signal stability of the given power system is analyzed & the output
is verified using MATLAB program.
AIM:
To plot the electromagnetic transients in power systems using MATLAB.
SOFTWARE REQUIRED:
MATLAB software package
FORMULAE USED:
2E f / L
it ( s)
s ( s zc / L )
2E f
et ( s)
( s zc / L )
2 E (1 e Zct / L )
it ( s)
zc
E (1 2e Zct / L )
ir
zc
Case (ii): Line terminated by capacitance
1 1
2E( )
s Zcc
it ( s)
Zc
2E
it ( s)
Zc s
et 2e f
er e f
ir i f
Case (iv):
Short circuited line
it 2i f
er e f
ir i f
Ef=10000;
L=0.004;
Zc=400;
n1=[2*Ef 0];
d1=[1 Zc/L];
t=0:0.00001:0.0001;
Et=step(n1,d1,t);
plot(t,Et,'r');
Er=Et-Ef;
hold on;
plot(t,Er,'b')
Ef=10000;
C=0.000000009;
Zc=400;
n1=[2*Ef/(Zc*C)];
d1=[1 1/(Zc*C)];
t=0:0.00001:0.0001;
Et=step(n1,d1,t);
plot(t,Et,'r');
Er=Et-Ef;
holdon;
plot(t,Er,'b')
Ef=10000;
C=0.000000009;
Zc=400;
n1=[2*Ef/Zc 0];
d1=[1 1/(Zc*C)];
t=0:0.00001:0.0001;
It=step(n1,d1,t);
plot(t,It,'r');
holdon;
If=Ef/Zc;
Ir=It-If;
plot(t,Ir,'b')
Ef=10000;
L=0.004;
Zc=400;
n1=[2*Ef 0];
d1=[1 Zc/L];
tf(n1,d1)
t=0:0.00001:0.0001;
EXECUTION
AIM:
To become familiar with modeling and analysis of the frequency and tie-line flow
dynamics of a power system without and with load frequency controllers (LFC) and to
design better controllers for getting better responses using MATLAB simulink.
SOFTWARE REQUIRED:
MATLAB software package
ALGORITHM:
STEP: 2 Open the untitled window and create the model for loan frequency control of
single area system using various library functions available in the simulink
browser.
STEP: 4 Double click the scope and we can get the waveform as change in frequency
STEP: 5 Simulate the model for uncontrolled case and observe the waveform.
STEP: 6 Simulate the model for controlled case (i.e.), introduce one integral control in
STEP: 7 Finally compare the results obtained from simulation and comment the result.
A two area system connected by a tie line has the following parameters on a 1000 MVA
common base
Area 1 2
Speed Regulation R1=0.05 R2=0.0625
Frequency sensitive load D1=0.6 D2=0.9
coefficient
Inertia Constant H1=5 H2=4
Base power 1000 MVA 1000 MVA
Governor time constant g1=0.2 sec g2=0.3 sec
Turbine time constant T1=0.5 sec T2=0.6 sec
The units are operating in parallel at the nominal frequency of 50Hz. The synchronizing
power coefficient is computed from the initial operating condition and is given to be Ps=2
pu. A load change of 187.5MW occurs in area1. Determine the new steady state
frequency and the change in tie-line flow.
Thus, the load frequency dynamics of single area and two area system are
analyzed using MATLAB simulink and the outputs are verified.
AIM:
SOFTWARE REQUIRED:
MATLAB software package
ALGORITHM:
STEP 1: Assign initial estimated value for .
STEP 2. Compute Pgi corresponding to (IC) I= from the following equation
Pgi=ai+bi(Ic)i+ci(Ic)2
(a) If the simulation is less than demand then assign a new value
new= old+
(b) If the simulation is greater than demand then assign a new value
new= old-
STEP 5: Print the corresponding units generation for Pg=Pd.
PROBLEM:
Find the optimal dispatch total cost for the plants.
2
C1= 500+5.3P1+0.004P1
2
C2= 400+5.5P2+0.006P2
2
C3= 200+5.8P3+0.009P3
150<= P2<=350;
100<= P3<=225;
Write and execute a MATLAB program and also verify the output with the manual
calculation results.
PROGRAM:
clc;
clear all;
pd=input('enter the demand of power in mw');
O=input('with limit enter 1 else enter 0');
n=input(' enter the no buses');
for i=1:n
disp('enter the cost fun');
disp(i);
a(i)=input('coefficient of a:');
b(i)=input('coefficient of b:');
c(i)=input('coefficient of c:');
if(O==1)
pmax(i)=input('PMAX');
pmin(i)=input('PMIN');
else
end
end
s=0;
s1=0;
for i=1:n
s=s+(b(i)/(2*c(i)));
s1=s1+(1/(2*c(i)));
end
if(O==1)
lam=input('enter the value of lambda');
else
lam=(pd+s)/(s1);
end
for k=1:50
for i=1:n
pg(i)=(lam-b(i))/(2*c(i));
if(O==1)
if(pg(i)>pmax(i))
pg(i)=pmax(i);
elseif(pg(i)<pmin(i))
pg(i)=pmin(i);
EXECUTION:
Thus a solution for economic load dispatch in power system is developed by using
MATLAB Program.