J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
Experiment No : 1
Load Flow Incorporating SVC
Program :
clear all;
format short;
nbus=5;
ntrans=7;
tol=1;
count=0;
%Transmission Line data
transsend=[1;1;2;2;2;3;4];
transrecv=[2;3;3;4;5;4;5];
transrest=[0.02;0.08;0.06;0.06;0.04;0.01;0.08];
transreac=[0.06;0.24;0.18;0.18;0.12;0.03;0.24];
transcond=[0;0;0;0;0;0;0];
%Bus data
vmag(1)=1.06;vang(1)=0;
transsusc=[0.06;0.05;0.04;0.04;0.03;0.02;0.05];
vmag(2)=1.0;vang(2)=0;
vmag(3)=1.0;vang(3)=0;
vmag(4)=1.0;vang(4)=0;
vmag(5)=1.0;vang(5)=0;
%Generator Bus data
ngen=1;
genp(2)=0.4;
genq(2)=0;
genqmax(2)=3;
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
genqmin(2)=-3;
%Load bus
nload=4;
loadp(2)=0.2;
loadp(3)=0.45;
loadp(4)=0.4;
loadp(5)=0.6;
loadq(2)=0.2;
loadq(3)=0.15;
loadq(4)=0.05;
loadq(5)=0.1;
%SVC data
nsvc=1;
suscep(1)=0.02;
svcsend(1)=3;
losuscep(1)=-0.25;
hisuscep(1)=0.35;
desvol=1.0;
%Formation of Zbus
for k=1:ntrans
imp(transsend(k),transrecv(k))=transrest(k)+j*transreac(k);
imp(transrecv(k),transsend(k))=imp(transsend(k),transrecv(k));
susc(transsend(k),transrecv(k))=j*transsusc(k);
susc(transrecv(k),transsend(k))=susc(transsend(k),transrecv(k));
end
imp
%Formation of Ybus
for k=1:nbus
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
for l=1:nbus
if imp(k,l)==0
ybus(k,l)=0;
else ybus(k,l)=-1/imp(k,l);
end
end
end
for k=1:nbus
sum1=0;
sum2=0;
for l=1:nbus
sum1=sum1+ybus(k,l);
sum2=sum2+0.5*susc(k,l);
end
ybus(k,k)=sum2-sum1;
end
ybus
g=real(ybus);
h=imag(ybus);
%Calculation of net powers
netp=zeros(1,nbus);
netq=zeros(1,nbus);
for k=1:ngen+1
netp(k)=netp(k)+genp(k);
netq(k)=netq(k)+genq(k);
end
for k=2:nload+1
netp(k)=netp(k)-loadp(k);
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
netq(k)=netq(k)-loadq(k);
end
while tol>1e-08
%Calculation of Active and Reactive powers
pcal=zeros(1,nbus);
qcal=zeros(1,nbus);
for k=1:nbus
ptemp=0;
qtemp=0;
for i=1:nbus
ptemp=ptemp+vmag(k)*vmag(i)*(g(k,i)*cos(vang(k)-vang(i))+h(k,i)*sin(vang(k)-vang(i)));
qtemp=qtemp+vmag(k)*vmag(i)*(g(k,i)*sin(vang(k)-vang(i))-h(k,i)*cos(vang(k)-vang(i)));
end
pcal(k)=ptemp;
qcal(k)=qtemp;
end
for k=1:nbus
if netp(k)==0&&netq(k)==0
disp('slack bus')
elseif netp(k)<0
disp('load bus')
else
if (qcal(k)>genqmax(k))
net(k)=genqmax(k);
disp('generator bus becomes load bus')
delq(k-1)=netq(k)-qcal(k);
elaseif(qcal(k)<genqmin(k))
netq(k)=genqmin(k);
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
disp('generator bus becomes load bus')
delq(k-1)=netq(k)-qcal(k);
end
end
end
%Calculation of SVC power
for k=1:nsvc
qcal(svcsend(k))=qcal(svcsend(k))-vmag(svcsend(k))^2*suscep(k);
end
%Calculation of mismatch powers
dpq=zeros(1,2*(nbus-1));
dp=zeros(1,nbus);
dq=zeros(1,nbus);
dp=netp-pcal;
dq=netq-qcal;
for k=1:nbus
if(netp(k)==0&&netq(k)==0)
dp(k)=0;
dq(k)=0;
elseif netp(k)>0
dq(k)=0;
end
end
d1=dp';
d2=dq';
kk=1;
for k=2:nbus
dpq(kk)=d1(k);
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
dpq(kk+nbus-1)=d2(k);
kk=kk+1;
end
dpq'
tol=max(abs(dpq));
%Formation of Jacobian Matrix
jacob=zeros(2*(nbus-1),2*(nbus-1));
for k=2:nbus
temp1=0;
temp2=0;
temp3=0;
temp4=0;
for l=2:nbus
if l==k
for i=1:nbus
temp1=temp1+vmag(k)*vmag(i)*(g(k,i)*cos(vang(k)-vang(i))+h(k,i)*sin(vang(k)-vang(i)));
temp2=temp2+vmag(k)*vmag(i)*(g(k,i)*sin(vang(k)-vang(i))-h(k,i)*cos(vang(k)-vang(i)));
end
u(k-1,k-1)=-temp2-vmag(k)^2*h(k,k);
x(k-1,k-1)=temp1+vmag(k)^2*g(k,k);
w(k-1,k-1)=temp1-vmag(k)^2*g(k,k);
z(k-1,k-1)=temp2-vmag(k)^2*h(k,k);
else
u(k-1,l-1)=vmag(k)*vmag(l)*(g(k,l)*sin(vang(k)-vang(l))-h(k,l)*cos(vang(k)-vang(l)));
x(k-1,l-1)=vmag(k)*vmag(l)*(g(k,l)*cos(vang(k)-vang(l))+h(k,l)*sin(vang(k)-vang(l)));
w(k-1,l-1)=-x(k-1,l-1);
z(k-1,l-1)=u(k-1,l-1);
end
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
end
end
jacob=[u x;w z];
for k=1:nbus
if netp(k)>0
kk=2*k+1;
jacob(kk,:)=0;
jacob(:,kk)=0;
jacob(kk,kk)=1;
end
end
%SVC Jacobian Matrix
for k=1:nsvc
jacob(:,2*svcsend(k))=0;
jacob(2*svcsend(k),2*svcsend(k))=-vmag(svcsend(k))^2*suscep(k);
end
%Updating of statevariables
def=inv(jacob)*dpq';
i=1;
for k=2:nbus
vang(k)=vang(k)+def(i);
vmag(k)=vmag(k)+def(i+nbus-1)*vmag(k);
i=i+1;
end
%SVC state variables
for k=1:nsvc
vmag(svcsend(k))=desvol(k);
ii=suscep(k)*def(2*svcsend(k));
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
vv=def(2*svcsend(k));
if ii>0.1
vv=0.1/suscep(k);
elseif ii<-0.1
vv=-0.1/suscep(k);
end
suscep(k)=suscep(k)+suscep(k)*vv;
end
%Checking SVC limits
for k=1:nsvc
if suscep(k)>hisuscep(k)
suscep(k)=hisuscep(k);
elseif suscep(k)<losuscep(k)
suscep(k)=losuscep(k);
end
end
count=count+1;
end
count
%Calculation of losses
pqsend=zeros(1,ntrans);
pqrecv=zeros(1,ntrans);
pqloss=zeros(1,ntrans);
totalloss=0;
for ii=1:ntrans
vsend(ii)=(vmag(transsend(ii))*cos(vang(transsend(ii))))+vmag(transsend(ii))*sin(vang(transsend(ii))*j);
vrecv(ii)=(vmag(transrecv(ii))*cos(vang(transsend(ii))))+vmag(transrecv(ii))*sin(vang(transrecv(ii))*j);
impedance=transrest(ii)+j*transreac(ii);
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
current=(vsend(ii)- vrecv(ii))/impedance+vsend(ii)*(j*transsusc(ii))*0.5;
pqsend(ii)=vsend(ii)*conj(current);
current=(vrecv(ii)- vsend(ii))/impedance+vrecv(ii)*(j*transsusc(ii))*0.5;
pqrecv(ii)=vrecv(ii)*conj(current);
pqloss(ii)=pqsend(ii)+pqrecv(ii);
end
pqloss
vsend
vrecv
%Calculation of Active and Reactive Power
pqbus=zeros(1,nbus);
for ii=1:ntrans
pqbus(transsend(ii))=pqbus(transsend(ii))+pqsend(ii);
pqbus(transrecv(ii))=pqbus(transrecv(ii))+pqrecv(ii);
end
%Correcting Generator Contributions
for ii=1
pqbus(ii+1)=pqbus(ii+1)+loadp(ii+1)+j*loadq(ii+1);
end
p=real(pqbus);
q=imag(pqbus);
%Calculation of Reactive power inSVC
for k=1:nsvc
qsvc(k)=-vmag(svcsend(k))^2*suscep(k);
end
%Calculation of total loss
for k=1:7
totalloss=totalloss+pqloss(k);
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
end
vmag
vang=vang*180/pi
totalloss=totalloss*100
%Displaying Results
for i=1:nbus
j=1;
a(i,j)=i;
b(i,j)=vmag(i);
c(i,j)=vang(i);
d(i,j)=p(i);
e(i,j)=q(i);
end
for i=1:ntrans
j=1;
aa(i,j)=i;
bb(i,j)=pqloss(i);
end
display({'busno' 'vmag' 'vang' 'p' 'q'})
[a b c d e]
display({'transno' 'pqloss'})
[aa bb]
qsvc
suscep
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
OUTPUT :
With nsvc=1
imp =
0.0000 + 0.0000i 0.0200 + 0.0600i 0.0800 + 0.2400i 0.0000 + 0.0000i 0.0000 + 0.0000i
0.0200 + 0.0600i 0.0000 + 0.0000i 0.0600 + 0.1800i 0.0600 + 0.1800i 0.0400 + 0.1200i
0.0800 + 0.2400i 0.0600 + 0.1800i 0.0000 + 0.0000i 0.0100 + 0.0300i 0.0000 + 0.0000i
0.0000 + 0.0000i 0.0600 + 0.1800i 0.0100 + 0.0300i 0.0000 + 0.0000i 0.0800 + 0.2400i
0.0000 + 0.0000i 0.0400 + 0.1200i 0.0000 + 0.0000i 0.0800 + 0.2400i 0.0000 + 0.0000i
ybus =
6.2500 -18.6950i -5.0000 +15.0000i -1.2500 + 3.7500i 0.0000 + 0.0000i 0.0000 + 0.0000i
-5.0000 +15.0000i 10.8333 -32.4150i -1.6667 + 5.0000i -1.6667 + 5.0000i -2.5000 + 7.5000i
-1.2500 + 3.7500i -1.6667 + 5.0000i 12.9167 -38.6950i -10.0000 +30.0000i 0.0000 + 0.0000i
0.0000 + 0.0000i -1.6667 + 5.0000i -10.0000 +30.0000i 12.9167 -38.6950i -1.2500 + 3.7500i
0.0000 + 0.0000i -2.5000 + 7.5000i 0.0000 + 0.0000i -1.2500 + 3.7500i 3.7500 -11.2100i
slack bus
load bus
load bus
load bus
ans =
0.5000
-0.3750
-0.4000
-0.6000
0.1500
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
0.0050
-0.0600
slack bus
load bus
load bus
load bus
ans =
0.0003
-0.0063
-0.0037
-0.0192
-0.0676
-0.0077
-0.0164
slack bus
load bus
load bus
load bus
ans =
1.0e-04 *
0.1656
-0.0358
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
0.0379
-0.4917
-0.0918
-0.0748
-0.4425
slack bus
load bus
load bus
load bus
ans =
1.0e-09 *
0.1220
-0.0037
0.0533
-0.3244
-0.0107
-0.0371
-0.3030
count = 4
pqloss =
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
Columns 1 through 5
0.0244 + 0.0095i 0.0134 - 0.0130i 0.0040 - 0.0283i 0.0047 - 0.0258i 0.0115 + 0.0050i
Columns 6 through 7
0.0005 - 0.0184i 0.0006 - 0.0468i
vsend =
Columns 1 through 5
1.0600 + 0.0000i 1.0600 + 0.0000i 0.9994 - 0.0358i 0.9994 - 0.0358i 0.9994 - 0.0358i
Columns 6 through 7
0.9964 - 0.0845i 0.9904 - 0.0888i
vrecv =
Columns 1 through 5
1.0000 - 0.0358i 1.0000 - 0.0845i 0.9994 - 0.0845i 0.9938 - 0.0888i 0.9746 - 0.0988i
Columns 6 through 7
0.9908 - 0.0888i 0.9713 - 0.0988i
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
vmag =
1.0600 1.0000 1.0000 0.9944 0.9752
vang =
0 -2.0533 -4.8379 -5.1073 -5.7975
totalloss =
5.9061 -11.7701i
'busno' 'vmag' 'vang' 'p' 'q'
1.0000 1.0600 0 1.3035 0.8287
2.0000 1.0000 -2.0533 0.3836 -0.7263
3.0000 1.0000 -4.8379 -0.4461 0.0699
4.0000 0.9944 -5.1073 -0.3924 -0.0256
5.0000 0.9752 -5.7975 -0.5895 -0.0644
'transno' 'pqloss'
1.0000 + 0.0000i 0.0244 + 0.0095i
2.0000 + 0.0000i 0.0134 - 0.0130i
3.0000 + 0.0000i 0.0040 - 0.0283i
4.0000 + 0.0000i 0.0047 - 0.0258i
5.0000 + 0.0000i 0.0115 + 0.0050i
6.0000 + 0.0000i 0.0005 - 0.0184i
7.0000 + 0.0000i 0.0006 - 0.0468i
qsvc = -0.2047
suscep = 0.2047
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
With nsvc=0
Total loss =
5.9410 -11.3832i
'busno' 'vmag' 'vang' 'p' 'q'
1.0000 1.0600 0 1.3045 0.8847
2.0000 1.0000 -2.0612 0.3846 -0.5679
3.0000 0.9872 -4.6367 -0.4476 0.1398
4.0000 0.9841 -4.957 -0.3925 -0.0263
5.0000 0.9717 -5.7649 -0.5895 -0.0646
'transno' 'pqloss'
1.0000 + 0.0000i 0.0245 + 0.0097i
2.0000 + 0.0000i 0.0146 - 0.0088i
3.0000 + 0.0000i 0.0035 - 0.0291i
4.0000 + 0.0000i 0.0045 - 0.0261i
5.0000 + 0.0000i 0.0116 + 0.0055i
6.0000 + 0.0000i 0.0004 - 0.0183i
7.0000 + 0.0000i 0.0004 - 0.0467i
qsvc = 0
suscep = 0.0200
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
Experiment No : 2
Voltage Profile Improvement Using STATCOM
Program :
%STATCOM(Static Synchronus Compensator)
%Clear the work space and command window
clear;
clc;
%System parameters
Vload_nominal=1.0;
Vload=0.9;
Qload=0.2;
%STATCOM Paramaters
Vstatcom=1.0;
Qstatcom=0.2;
%calculate STATCOM current injection
Istatcom=(Qload+Qstatcom)/Vstatcom;
%update load voltage with statcom compensation
Vload_compensated = Vload_nominal+1j*Istatcom;
%Display the results
disp('Load voltage without STATCOM:');
disp(Vload);
disp('Load voltage with STATCOM:');
disp(abs(Vload_compensated));
%Calculate voltage stability index(VSI) without STATCOM
VSI_without_STATCOM=abs(Vload_nominal-Vload)/Vload_nominal;
%Calculate voltage stability index(VSI) with STATCOM
VSI_with_STATCOM=abs(Vload_nominal-abs(Vload_compensated))/Vload_nominal;
disp('Voltage Stability Index (VSI) without STATCOM: ');
disp(VSI_without_STATCOM);
disp('Voltage Stability Index (VSI) with STATCOM: ');
disp(VSI_with_STATCOM);
%Plot the voltage phasors
figure;
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
hold on;
plot([0,real(Vload)],[0,imag(Vload)],'b','LineWidth',2);
plot([0,real(Vload_compensated)],[0,imag(Vload_compensated)],'r','LineWidth',2);
hold off;
axis equal;
xlim([-1.5,1.5]);
ylim([-1.5,1.5]);
xlabel('Real(pu)');
ylabel('Load Voltage without STATCOM','Load Voltage witn STATCOM','Location','Northeast');
title('Voltage Phasors with STATCOM compensation');
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
OUTPUT :
Load voltage without STATCOM:
0.9000
Load voltage with STATCOM:
1.0770
Voltage Stability Index (VSI) without STATCOM:
0.1000
Voltage Stability Index (VSI) with STATCOM:
0.0770
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
Experiment No : 3
Evaluation of Real and Reactive power including Line Losses
Program :
#include<stdio.h>
#include<conio.h>
#include<math.h>
#define PI 3.1415
typedef struct complex
{
float r,i;
}complex;
int main()
{
complex
v,v1,v2,vi,zs,zLo,zLi,zLialpha,zLialpha2,I,SLo,S,zeq,S12,ztcsc,ztcscalpha,z12,dS12,dcp;
float f,L,Ls,Li,c,xs,xLi,xc,lamda,omega,alpha1,xtcsc,sigma;
float delta,delta1;
complex v12,v22;
int K,alpha,simga1;
printf("\n Give the data of v.r,v.i,zLi.r,SLo.r,SLo.i,zs.r \n");
scanf("%f%f%f%f%f%f",&v.r,&v.i,&zLi.r,&SLo.r,&SLo.i,&zs.r);
printf("\n Give the data of Ls.Li,f,c \n");
scanf("%f%f%f%f",&Ls,&Li,&f,&c);
printf("\n v.r = %2f \n",v.r);
printf("\n v.i = %2f \n",v.i);
printf("\n zLi.r = %2f , SLo.r = %2f , SLo.i = %2f , zs.r = %2f \n",zLi.r,SLo.r,SLo.i,zs.r);
printf("\n Ls=%3f,Li=%3f,f=%2f,c=%6f \n",Ls,Li,f,c);
// for uncompensated line
zs.i = 2 * PI * f * Ls;
printf ("\n zs.i = %2f \n",zs.i);
zLi.i = 2 * PI * f * Li;
printf ("\n zLi.i = %2f \n",zLi.i);
zLo.r = (v.r * v.r)/(SLo.r);
printf ("\n zLo.r = %2f \n",zLo.r);
zLo.i = (v.r * v.r)/(SLo.i);
printf ("\n zLo.i = %2f \n",zLo.i);
zeq.r =(zs.r+zLi.r+zLo.r);
printf ("\n zeq.r = %2f \n",zeq.r);
zeq.i =(zs.i+zLi.i+zLo.i);
printf ("\n zeq.i = %2f \n",zeq.i);
I.r = ((v.r * zeq.r)+(v.r * zeq.i))/((zeq.r * zeq.r)+(zeq.i*zeq.i));
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
I.i = ((v.i * zeq.i)-(v.r * zeq.r))/((zeq.r * zeq.r)+(zeq.i*zeq.i));
I.i=(-1)*I.i;
S.r=(v.r * I.r)-(v.i * I.i);
S.i=(v.i * I.r)+(v.r * I.i);
if(S.i >= 0.0)
{
printf("\n The power delivered to the load = %.2f + %.2fj",S.r,S.i);
}
else
{
printf("\n The power delivered to the load = %.2f + %.2fj",S.r,S.i);
}
}
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
OUTPUT :
Give the data of v.r,v.i,zLi.r,SLo.r,SLo.i,zs.r
11 0 5 25 50 0.01
Give the data of Ls.Li,f,c
0.001 0.023 50 0.000350
v.r = 11.000000
v.i = 0.000000
zLi.r = 5.000000 , SLo.r = 25.000000 , SLo.i = 50.000000 , zs.r = 0.010000
Ls=0.001000,Li=0.023000,f=50.000000,c=0.000350
zs.i = 0.314150
zLi.i = 7.225450
zLo.r = 4.840000
zLo.i = 2.420000
zeq.r = 9.850000
zeq.i = 9.959600
The power delivered to the load = 12.22 + 6.07j
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
Experiment No : 4
Real and Reactive power flow using UPFC
Program :
#include <stdio.h>
#include <math.h>
#include <conio.h>
#define PI 3.1415
//Program without controller
int main()
{
float Vs,Vr,X,delta,Po,Qo,delta1 ;
printf("\n Give the data of Vs,Vr,X, delta in degrees \n");
scanf("%f%f%f%f",&Vs,&Vr,&X,&delta);
delta1 = (PI * delta)/180.0;
Po= ((Vs * Vr)/X)*sin(delta1);
Qo=((Vs * Vr)/X)*(1-cos(delta1));
printf("The real power Po = %2f in w.p.u \n",Po);
printf("the reactive power Qo = %2f in p.u.VAR \n",Qo);
// with contorller
float Vpq,Xc,rho,rho1;
printf("\n Give data of Vpq \n");
scanf("%f",&Vpq);
printf("\n Give the value of Xc,rho \n");
scanf("%f%f",&Xc,&rho);
rho1 = rho * PI/180 ;
float Pc,Qc;
Pc = (((Vs*Vr)/Xc)*sin(delta1)-((Vs * Vpq)/Xc) * cos(delta1 /2.0 + rho1));
Qc = (((Vs*Vr)/Xc)*(1-cos(delta1))-((Vs * Vpq)/Xc) * sin(delta1 /2.0 + rho1));
printf("\n Pc = %2f \n",Pc);
printf("\n Qc = %2f \n",Qc);
}
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
OUTPUT :
Give the data of Vs,Vr,X, delta in degrees
1 1 1 30
The real power Po = 0.499987 in w.p.u
the reactive power Qo = 0.133967 in p.u.VAR
Give data of Vpq
0.25
Give the value of Xc,rho
0.5 15
Pc = 0.566957
Qc = 0.017940
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
Experiment No : 5
Real and Reactive Power Enhancement Using Midpoint Voltage
Regulation For Line Segment
Program :
#include <stdio.h>
#include <math.h>
#include <conio.h>
#define PI 3.1415
int main()
{
// Program for without controller
float Vs,Vr,X,delta,Po,Qo,delta1;
printf("\nGive the data of Vs,Vr,X,delta In degree \n");
scanf("%f%f%f%f",&Vs,&Vr,&X,&delta);
delta1=(PI * delta)/180;
Po = ((Vs * Vr)/X)*sin(delta1);
Qo = ((Vs * Vr)/X)*(1-cos(delta1));
printf("\n The real power Po = %.2f in p.u.W \n",Po);
printf("\n The reactive power Qo = %.2f in p.u.VAR \n",Qo);
//with contoller using line segmentation VAR compensator
float Pp,Qp;
Pp = ((Vs * Vr)/(X/2.0))*sin(delta1/2.0);
Qp = ((Vs * Vr)/(X/4.0))*(1-cos(delta1/2.0));
printf("\n The real power after using VAR controller \n");
printf("Pp = %.2f \n",Pp);
printf("\n The reactive power after using VAR controller \n");
printf("Qp = %.2f \n",Qp);
}
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
OUTPUT:
Give the data of Vs,Vr,X,delta In degree
1 1 1 60
The real power Po = 0.87 in p.u.W
The reactive power Qo = 0.50 in p.u.VAR
The real power after using VAR controller
Pp = 1.00
The reactive power after using VAR controller
Qp = 0.54
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
Experiment No : 6
Finding Maximum Power Without and With SSSC
Program :
#include <stdio.h>
#include <math.h>
#define PI 3.1415
int main()
{
float Vs,Vr,Vq,X,delta,Po,Qo,delta1;
// program for uncompensated system.
printf("\n Give the data of Vs,Vr,Vq,X,delta in degrees \n ");
scanf("%f%f%f%f%f",&Vs,&Vr,&Vq,&X,&delta);
delta1 = PI * delta/180.0 ;
Po = ((Vs * Vr)/X) * sin(delta1);
Qo = ((Vs * Vr)/X) * (1-cos(delta1));
printf("\n The real power Po =%2f in p.u.W \n",Po);
printf("\n The reactive power Qo =%2f in p.u.W \n",Qo);
//program compensation through voltage injection
float Pq;
Pq = ((Vs * Vr)/X) * sin(delta1) + ((Vr * Vq)/X) * (cos(delta1)/2.0);
printf("\n The power due to voltage injection Pq = %.2f \n",Pq);
// program with degree of compensation of capacitor
float K,Pk;
printf("\n Give the data of K = \n");
scanf("%f",&K);
Pk = ((Vs*Vr)/(X*(1-K)))*sin(delta1);
printf("\n The power with k degree of compensation is = %.2f \n",Pk);
}
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
OUTPUT :
For K = 0.2
Give the data of Vs,Vr,Vq,X,delta in degrees
1 1 0.707 1 90
The real power Po =1.000000 in p.u.W
The reactive power Qo =0.999954 in p.u.W
The power due to voltage injection Pq = 1.00
Give the data of K =
0.2
The power with k degree of compensation is = 1.25
For K = 0.33
Give the data of Vs,Vr,Vq,X,delta in degrees
1 1 0.707 1 90
The real power Po =1.000000 in p.u.W
The reactive power Qo =0.999954 in p.u.W
The power due to voltage injection Pq = 1.00
Give the data of K =
0.33
The power with k degree of compensation is = 1.49
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
Experiment No : 7
Series Capacitive Compensation
Program :
#include <stdio.h>
#include <math.h>
#include <conio.h>
#define PI 3.1415
int main()
{
// Before compensation
float Vs,Vr,X,delta,delta1,Pom,Qom,K,Pcm,Qcm;
printf("\n Give the data of Vs,Vr,X,delta in degrees \n");
scanf("%f%f%f%f",&Vs,&Vr,&X,&delta);
delta1 = (delta * PI/180);
Pom = ((Vs * Vr)/X) * sin(delta1);
Qom = ((Vs * Vr)/X) * (1-cos(delta1));
printf("\n The max real power Pom = %.2f in p.u.W \n",Pom);
printf("\n The max reactive power = %.2f in p.u.VAR \n",Qom);
// After compensation
printf("\n Give the value of K= \n");
scanf("%f",&K);
Pcm = ((Vs * Vr)/(X*(1-K))) * sin(delta1);
Qcm = ((Vs * Vr)/X) * ((2*K)/((1-K)*(1-K))) * (1-cos(delta1));
printf("\n The real power after compensation = %.2f \n",Pcm);
printf("\n The reactive power after compensation = %.2f \n",Qcm);
}
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
OUTPUT :
For K =0.2
Give the data of Vs,Vr,X,delta in degrees
1 1 1 90
The max real power Pom = 1.00 in p.u.W
The max reactive power = 1.00 in p.u.VAR
Give the value of K=
0.2
The real power after compensation = 1.25
The reactive power after compensation = 0.62
For K = 0.4
Give the data of Vs,Vr,X,delta in degrees
1 1 1 90
The max real power Pom = 1.00 in p.u.W
The max reactive power = 1.00 in p.u.VAR
Give the value of K=
0.4
The real power after compensation = 1.67
The reactive power after compensation = 2.22
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
Experiment No : 8
Power System Stability Using STATCOM
Program :
s=tf('s');
X = input('Enter the value of X :');
k = input ('Enter the value of k :');
Td = input('Enter the value of Td :');
T1 = input('Enter the value of T1 :');
g = X/k*exp(-Td*s)/(1+T1*s)
T2 = input('Enter the value of T2 :');
h = 1/(1+T2*s)
T = feedback(g,h)
%stepplot(T)
bode(T)
[Gm,Pm,Wgm,Wpm]=margin(T)
if(Gm>0&&Pm>0)
disp('System is stable')
else
disp('System, is unstable')
end
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
OUTPUT :
For Strong System :
Enter the value of X :4.761
Enter the value of k :0.846
Enter the value of Td :0.0005
Enter the value of T1 :0.014
g=
5.628
exp(-0.0005*s) * -----------
0.014 s + 1
Continuous-time transfer function.
Enter the value of T2 :0.004
h=
1
-----------
0.004 s + 1
Continuous-time transfer function.
T=
a=
x1 x2
x1 -71.43 -250
x2 402 -250
b=
u1
x1 16
x2 0
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
c=
x1 x2
y1 25.12 0
d=
u1
y1 0
(values computed with all internal delays set to zero)
Internal delays (seconds): 0.0005
Continuous-time state-space model.
Gm =
7.8734
Pm =
87.9777
Wgm =
3.1668e+03
Wpm =
554.1341
System is stable
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
For Weak System :
Enter the value of X :9.552
Enter the value of k :0.846
Enter the value of Td :0.0005
Enter the value of T1 :0.014
g=
11.29
exp(-0.0005*s) * -----------
0.014 s + 1
Continuous-time transfer function.
Enter the value of T2 :0.004
h=
1
-----------
0.004 s + 1
Continuous-time transfer function.
T=
a=
x1 x2
x1 -71.43 -500
x2 403.2 -250
b=
u1
x1 32
x2 0
c=
x1 x2
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
y1 25.2 0
d=
u1
y1 0
(values computed with all internal delays set to zero)
Internal delays (seconds): 0.0005
Continuous-time state-space model.
Gm =
3.8954
Pm =
63.0026
Wgm =
3.1465e+03
Wpm =
998.3829
System is stable
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
Strong System :
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
For Weak System
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
Experiment No : 9
Power System Stability Using TSC/TCR ( SVC )
Program :
s=tf('s');
X = input('Enter the value of X :');
k = input ('Enter the value of k :');
Td = input('Enter the value of Td :');
T1 = input('Enter the value of T1 :');
g = X/k*exp(-Td*s)/(1+T1*s)
T2 = input('Enter the value of T2 :');
h = 1/(1+T2*s)
T = feedback(g,h)
%stepplot(T)
bode(T)
[Gm,Pm,Wgm,Wpm]=margin(T)
if(Gm>0&&Pm>0)
disp('System is stable')
else
disp('System, is unstable')
end
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
OUTPUT :
For Strong System:
Enter the value of X :4.761
Enter the value of k :0.846
Enter the value of Td :0.00555
Enter the value of T1 :0.035
g=
5.628
exp(-0.00555*s) * -----------
0.035 s + 1
Continuous-time transfer function.
Enter the value of T2 :0.04
h=
1
----------
0.04 s + 1
Continuous-time transfer function.
T=
a=
x1 x2
x1 -28.57 -100
x2 40.2 -25
b=
u1
x1 16
x2 0
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
c=
x1 x2
y1 10.05 0
d=
u1
y1 0
(values computed with all internal delays set to zero)
Internal delays (seconds): 0.00555
Continuous-time state-space model.
Gm =
1.8144
Pm =
38.2487
Wgm =
291.9238
Wpm =
175.7786
System is stable
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
For Weak System :
Enter the value of X :9.552
Enter the value of k :0.846
Enter the value of Td :0.00555
Enter the value of T1 :0.014
g=
11.29
exp(-0.00555*s) * -----------
0.014 s + 1
Continuous-time transfer function.
Enter the value of T2 :0.004
h=
1
-----------
0.004 s + 1
Continuous-time transfer function.
T=
a=
x1 x2
x1 -71.43 -500
x2 403.2 -250
b=
u1
x1 32
x2 0
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
c=
x1 x2
y1 25.2 0
d=
u1
y1 0
(values computed with all internal delays set to zero)
Internal delays (seconds): 0.00555
Continuous-time state-space model.
Gm =
1.7023
Pm =
-87.3694
Wgm =
1.4061e+03
Wpm =
524.3468
System, is unstable
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
For Strong System
J.N.T.U. College of Engineering page no:…………..
Anantapur.
Date:………………
For Weak System