Index: Electrical Machines & Power Systems Lab
Index: Electrical Machines & Power Systems Lab
INDEX
S.NO. Name of the Experiment
10. Estimation of Frequency Response in Multi area system with Integral Control
Aim: To simulate the concept of Load Frequency Control of isolated power system employing
MATLAB/SIMILINK.
Simulation Model:
System parameters:
Tsg: 0.08sec; Tt: 0.3sec; Tps: 20sec; Kps: 300
Ki: 0.8; T 212: 0.196; R: 2.4; B: 0.425
Simulation parameters:
Time: 100sec
ode15s (stiff/NDF)
Waveforms:
Result: The concept of Load Frequency Control of isolated power system has been designed and the
frequency curves have been plotted using MATLAB.
Formation of YBus
AIM: To evaluate the Ybus for a given power system network consisting of 5-bus
System
nline=length(linedata(:,1));
j=sqrt(-1);
i=sqrt(-1);
for k=1:nline
lp(k)=linedata(k,1);
lq(k)=linedata(k,2);
r(k)=linedata(k,3);
x(k)=linedata(k,4);
ysh(k)=linedata(k,5);
a(k)=linedata(k,6);
z(k)= r(k)+j*x(k);
y(k)=1/z(k);
end
ybus=zeros(nbus,nbus);
yln =zeros(nbus,nbus);
% PI METHOD FOR OFF-NOMINAL ADMITTANCE OF TRANSFORMER
for k=1:nline
ylp(k)=[1/(a(k)^2)-1/a(k)]*y(k);
ylq(k)=[1-1/a(k)]*y(k);
y(k)=y(k)/a(k);
end
for k=1:nline
ybus(lp(k),lq(k))=ybus(lp(k),lq(k))-y(k);
ybus(lq(k),lp(k))=ybus(lp(k),lq(k));
ybus(lp(k),lp(k))=ybus(lp(k),lp(k))+y(k)+ylp(k)+j*ysh(k);
ybus(lq(k),lq(k))=ybus(lq(k),lq(k))+y(k)+ylq(k)+j*ysh(k);
end
ybus
OUTPUT :-
Y-BUS =
AIM: To find the solution of Load Flow of a Power System Network Employing Gauss-Seidel
Method
% lp lq r x ysh tap
delta(n)=pi/180*delta(n);
e(n)=vm(n)*cos(delta(n))+j*vm(n)*sin(delta(n));
P(n)=(Pg(n)-Pd(n))/basemva;
Q(n)=(Qg(n)-Qd(n))/basemva;
S(n)=P(n)+j*Q(n);
dv(n)=0;
end
maxerror=0.1;
iter=0;
for n=1:nbus
vc(n)=0+0*j;
vnew(n)=0+0*j;
end
while (maxerror>0.00001 & iter<15)
for m=1:nbus
for n=1:nbus
yv(n)=0+0*j;
end
if kb(m)==0 % Slackbus
vc(m)=vm(m);
e(m)=vc(m) ;
end
if kb(m)==2 %Load bus
for k=1:nbus
if k~=m
yv(m)=yv(m)+ybus(m,k)*e(k);
end
end
vc(m)=(conj(S(m))/conj(e(m))-yv(m))/ybus(m,m);
error(m)=abs(vc(m)-e(m));
e(m)=e(m)+1.4*(vc(m)-e(m));
end
if kb(m)==1 %Generator
bus
for k=1:nbus
if k~=m
yv(m)=yv(m)+ybus(m,k)*e(k);
end
end
cos(m)=real(e(m))/abs(e(m));
sin(m)=imag(e(m))/abs(e(m));
e(m)=vm(m)*cos(m)+j*vm(m)*sin(m);
Qnew(m)=-imag(conj(e(m))*(yv(m)*ybus(m,m)*e(m)))*100;
if(Qnew(m))<Qmin(m)
Q(m)=Qmin(m)/basemva;
S(m)=P(m)+j*Q(m);
e(m)=1.0+0*j;
vc(m)=((conj(S(m))/conj(e(m)))-
yv(m))/ybus(m,m);
e(m)=e(m)+1.4*(vc(m)-e(m));
elseif Qnew(m) >Qmax(m)
Q(m)=Qmax(m)/basemva;
S(m)=P(m)+j*Q(m);
e(m)=1+0*j;
vc(m)=((conj(S(m))/conj(e(m)))-
yv(m))/ybus(m,m);
e(m)=e(m)+1.4*(vc(m)-e(m));
else
Q(m)=Qnew(m)/basemva;
S(m)=P(m)+j*Q(m);
vc(m)=((conj(S(m))/conj(e(m)))-yv(m))/ybus(m,m);
cos(m)=real(vc(m))/(abs(vc(m)));
sin(m)=imag(vc(m))/(abs(vc(m)));
vnew(m)=vm(m)*cos(m)+j*vm(m)*sin(m);
e(m)=vnew(m);
end
end
end
maxerror=max(error);
iter=iter+1;
iter
e
end
sln
OUTPUT :-
( i ) BUS VOLTAGES :-
ITER. E1 E2 E3 E4
sln =
0 27.2172 +64.8737i -25.9601 +32.2794i 0
( i ) BUS VOLTAGES :-
ITER. E1 E2 E3 E4
sln =
0 27.4140 +71.6035i -25.7502 + 34.1245i 0
AIM:
To develop MATLAB Program for Load flow solution by fast decoupled Load flow Method
clear;
clc;
basemva=100;
% n code v del pg qg pd qd qmin qmax qsh
busdata=[1 0 1.06 0 0 0 0 0 0 0 0
2 2 1.0 0 40 30 20 10 0 0 0
3 2 1.0 0 0 0 45 15 0 0 0
4 2 1.0 0 0 0 40 5 0 0 0
5 2 1.0 0 0 0 60 10 0 0 0 ];
% lp lq r x ysh tap
linedata=[1 2 0.02 0.06 0.030 1
1 3 0.08 0.24 0.025 1
2 3 0.06 0.18 0.020 1
2 4 0.06 0.18 0.020 1
2 5 0.04 0.12 0.015 1
3 4 0.01 0.03 0.01 1
4 5 0.08 0.24 0.025 1 ];
Simulation Lab Page 12
G.PULLAIAH COLLEGE OF ENGG. & TECH., KURNOOL, DEPT. OF E.E.E.
for n=1:nbus
if(kb(n)==1|kb(n)==2)
ii=ii+1;
jj=0;
for m=1:nbus
if(kb(m)==1|kb(m)==2)
jj=jj+1;
B1(ii,jj)=imag(ybus(n,m));
end
end
end
end
ii=0;
for n=1:nbus
if(kb(n)==2)
ii=ii+1;
jj=0;
for m=1:nbus
if(kb(m)==2)
jj=jj+1;
B2(ii,jj)=imag(ybus(n,m));
end
end
end
end
B1inv=inv(B1);
B2inv=inv(B2);
maxerror=0.1;
iter=0;
while maxerror>0.00001&iter<15
iter=iter+1;
id=0;
iv=0;
for n=1:nbus
J11=0;
J33=0;
for m=1:nline
if(lp(m)==n|lq(m)==n)
if(lp(m)==n)
l=lq(m);
end
if(lq(m)==n)
l=lp(m);
end
J11=J11+vm(n)*vm(l)*ym(n,l)*sin(t(n,l)-delta(n)
+delta(l));
J33=J33+vm(n)*vm(l)*ym(n,l)*cos(t(n,l)-delta(n)
+delta(l));
end
end
pk=vm(n)^2*ym(n,n)*cos(t(n,n))+J33;
qk=-vm(n)^2*ym(n,n)*sin(t(n,n))-J11;
if(kb(n)==0)
p(n)=pk;
q(n)=qk;
end
if(kb(n)==1)
q(n)=qk;
qgc=q(n)*basemva+qd(n)-qsh(n);
if qmax(n)~=0
if iter<=20
if iter>=10
if(qgc<qmin(n)|qgc>qmax(n))
if(qgc<qmin(n))
vm(n)=vm(n)+0.0005;
else
vm(n)=vm(n)-0.0005;
end
end
end
end
end
end
if(kb(n)~=0)
id=id+1;
dp(id)=p(n)-pk;
dpv(id)=(p(n)-pk)/vm(n);
iv=iv+1;
dq(iv)=q(n)-qk;
dqv(iv)=(q(n)-qk)/vm(n);
end
end
f=dpv';
dd=-B1inv*dpv';
dv=-B2inv*dqv';
id=0;
iv=0;
for n=1:nbus
if(kb(n)~=0)
id=id+1;
delta(n)=delta(n)+dd(id);
iv=iv+1;
vm(n)=vm(n)+dv(iv);
end
end
maxerror=max(max(abs(dp)),max(abs(dq)));
iter
E=vm.*cos(delta)+j*vm.*sin(delta)
end
OUTPUT :-
ITER E0 E1 E2 E3 E4
Fast Decoupled Load Flow Solution For Distribution System Using MATLAB
AIM:
To develop MATLAB Program for fast decoupled Load flow Method for distribution System.
clear;
clc;
rxratio=1.5;
% n v delta pd qd ysh
busdata=[ 1 1.05 0 0.000 0.000 0
2 1.00 0 0.278 0.069 0
3 1.00 0 0.442 0.084 0
4 1.00 0 0.195 0.066 0
5 1.00 0 0.149 0.05 0
6 1.00 0 0.26 0.016 0.5 ];
% lp lq z
linedata=[ 1 2 0.052
2 3 0.035
2 4 0.0645
4 5 0.0117
4 6 0.075 ];
nline=length(linedata(:,1));
nbus=length(busdata(:,1));
j=sqrt(-1);
for k=1:nline
lp(k)=linedata(k,1);
lq(k)=linedata(k,2);
z(k)=linedata(k,3);
x(k)=sqrt((z(k)^2)/(((rxratio)^2)+1));
r(k)=rxratio*x(k);
z(k)=r(k)+j*x(k);
y(k)=1/z(k); %branch admittance
end
%initiation of G MATRIX
G=zeros(nbus,nbus);
%finding off diagonal elements of G MATRIX
for k=1:nline
G(lp(k),lq(k))=G(lp(k),lq(k))-real(y(k));
G(lq(k),lp(k))=G(lp(k),lq(k));
end
%finding diagonal elements of G MATRIX
for n=1:nbus
for k=1:nline
if ((lp(k)==n)||(lq(k)==n))
G(n,n)=G(n,n)+real(y(k));
end
end
end
invG=inv(G(2:nbus,2:nbus));
%reading the bus data
for k=1:nbus
bus(k)=busdata(k,1);
vm(k)=busdata(k,2);
delta(k)=busdata(k,3);
pd(k)=busdata(k,4);
qd(k)=busdata(k,5);
delta=pi/180*delta;
end
maxerror=1;
iter=0;
while(maxerror>0.0001 & iter<30)
iter=iter+1;
%initialisation of isp,ical
for k=1:nbus-1
isp(k)=0;
ik(k)=0;
end
%calculation of specified e.c.i.
for k=1:nbus-1
isp(k)=[conj(pd(k+1)+j*qd(k+1))/vm(k+1)];
end
%calculation of ik
for n=2:nbus
for k=1:nline
if lp(k)==n||lq(k)==n
if lp(k)==n
ik(n-1)=ik(n-1)+y(k)*(vm(lp(k))-vm(lq(k)));
end
if lq(k)==n
ik(n-1)=ik(n-1)+y(k)*(vm(lq(k))-vm(lp(k)));
end
end
end
end
%calculation of ical including the effect of shunt capacitance
for n=2:nbus
ik(n-1)=ik(n-1)+(j*busdata(n,6)*vm(n));
end
%finding e.c.i.mismatcher
for n=1:nbus-1
id(n)=-isp(n)-ik(n);
end
for i=1:nbus-1
delir(i,1)=real(id(i));
delii(i,1)=imag(id(i));
end
dele=invG*delir; %change in bus voltage(real part)
delf=invG*delii; %change in bus voltage(imag part)
%calculation of modified bus voltages
for i=1:nbus-1
e(i)=real(vm(i+1))+dele(i);
f(i)=imag(vm(i+1))+delf(i);
vm(i+1)=e(i)+j*f(i);
end
maxerror=max(max(abs(dele)),max(abs(delf)));
Em=abs(vm);
ang=angle(vm);
iter
Em
ang
end
OUTPUT :-
VOLTAGE MAGNITUDES :-
ITER E0 E1 E2 E3 E4 E5
1 1.0500 0.9684 0.9496 0.9235 0.9214 0.9048
ITER δ0 δ1 δ2 δ3 δ4 δ5
AIM:
To develop MATLAB Program for transient stability analysis for single connected to infinite
bus by point by point method.
Problem Formulation:
A 20MVA, 50Hz Generator delivers, 18MW a double circuit line to an infinite bus. The
generator has kinetic energy of 2.52 MJ/MVA at rated speed. The generator transient reactance of Xg
is 0.35pu. Each transmission, circuit has resistance if “0” and a reactance of 0.2pu. On a 20 MVA base
E=1.1pu and infinite bus voltage v = 1.0∟0, A 3-ф short circuit occurs at the midpoint of one of the
transmission lines plot swing curves with fault cleared by simultaneous opening of breakers at both
ends of the line at 2.5 cycles and 6.25 cycles and 6.25 cycles after the occurrence of fault also plot the
swing curve over the period of 0.5sec if fault is sustained.
clear;
clc;
t=0;
tf=0;
tfinal=0.5;
tc=0.125; %(FOR FAULT CLEARED AT 2.5 CYCLES:tc=0.05,
6.25CYCLES:tc=0.125, SUSTAINED FAULT:tc=0.5to1.0)
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-pmaxdf*sin(delta);
paav=(paminus+paplus)/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 0.6 0 160])
plot(time,ang,'ko-')
grid
OUTPUT :-
S.No. Time(t) Accelerating Power (Pa) (p.u.) for Fault cleared after-
(sec) 2.5cycles 6.25cycles Sustained fault
(tc=0.05sec) (tc=0.125sec)
S.No. Time (t) Torque Angle (δ) (degrees) for Fault cleared after-
(sec) 2.5cycles 6.25cycles Sustained fault
(tc=0.05sec) (tc=0.125sec)
Simulation Model
Waveform:
Result: The Simulink model of an AVR system is constructed & waveforms are obtained.
Aim: To simulate the concept of Automatic Generation Control of multi area system employing
MATLAB/SIMILINK.
Simulation Model:
System parameters:
Tsg: 0.08sec; Tt: 0.3sec; Tps: 20sec; Kps: 300
Ki: 0.8; T 212: 0.196; R: 2.4; B: 0.425
Simulation parameters:
Time: 100sec
ode15s (stiff/NDF)
Waveforms:
-1
-2
-3
-4
-5
0 10 20 30 40 50 60 70 80 90 100
Result: The concept of Automatic Generation Control of multi area system has been designed and the
frequency curves have been plotted using MATLAB.