PSE Record
PSE Record
LABORATORY
(R 2019)
BONAFIDE CERTIFICATE
Name :……………………………………………………………..
Course/branch : M.E / POWER SYSTEM ENGINERING
Register No.
Certified that this is the bonafide record of work done by the above student in
the POWER SYSTEM SIMULATION Laboratory during the year 2019 - 2020
PAGE STAFF
S.NO DATE EXPERIMENT NAME
NO SIGNATURE
AIM:
To calculate various line flows of an interconnected power system using the
Newton Raphson method of power flow analysis and to determine the voltage and load
angle at all buses in the system.
SOFTWARE REQUIRED:
MAT LAB Software
ALGORITHM:
Step 1: Assume a flat start profile 1+j0 for all buses except the slack bus in the specified
voltage and it is not modified in any iteration. Form YBUS matrix with angle and
magnitude.
1
iii) ƏQi/ Əδi= + Pi - |Vi| |Vi| |Yii| Cos(θii)
iv) ƏQi/ ƏVi= +Qi / |Vi| - |Vi||Yii| Sin(θii)
Step 5:
i. Delete the row of [Del P, Del Q] matrix with respect to the slack bus, PV bus as
required by finding the type of bus.
ii. Delete the rows and columns of Jacobian matrix with respect to the slack bus and
pv bus as required by finding the type of bus.
iii. Match the size of both [Del P, Del Q] matrix and Jacobian matrix to proceed futher.
P
V J 1
Q
Step 7: Update state vector using
V new = V old + ΔV
Δnew = δ old + Δδ
2
PROBLEM:
PROGRAM:
MATLAB CODE FOR NEWTON RAPHSON METHOD:
%NR Method
clc;
clear all;
%line data From Bus To Bus R X B
linedata= [1 2 0.05 0.15 0;
1 3 0.1 0.3 0;
2 3 0.15 0.45 0;
2 4 0.1 0.3 0;
3 4 0.05 0.15 0];
%bus data [Bus no. type Vsp Theta PGi QGi PLi QLi]
%type slack-0; PV-1; PQ-2
busdata= [1 0 1.04 0 0 0;
2 1 1.04 0 0.5 -0.2;
321 0 -1 0.5;
421 0 0.3 -0.1];
nlines=length(linedata(:,1));
frombus=linedata(:,1);
tobus=linedata(:,2);
resis=linedata(:,3);
reac=linedata(:,4);
b=linedata(:,5);
3
type=busdata(:,2);
V= busdata(:,3);
npv = sum(type==1);
npq=sum(type==2);
del= busdata(:,4);
Psp=busdata(:,5);
Qsp=busdata(:,6);
delsp=zeros((npv+npq),1);
Vsp=zeros(npq,1);
zimp=resis+j*reac;
Yadm=1./zimp;
badm=j*b;
nbus= length(busdata(:,1));
Ybus=zeros(nbus,nbus);
for k=1:nlines
Ybus(frombus(k),tobus(k))=Ybus(frombus(k),tobus(k))-Yadm(k);
Ybus(tobus(k),frombus(k))=Ybus(frombus(k),tobus(k));
Ybus(frombus(k),frombus(k))=Ybus(frombus(k),frombus(k))-Ybus(frombus(k),tobus(k));
Ybus(tobus(k),tobus(k))= Ybus(tobus(k),tobus(k))-Ybus(tobus(k),frombus(k));
end;
disp('Bus admittance matrix bus');
Ybus
ybusmag= abs(Ybus);
ybusangle= angle(Ybus);
G= real(Ybus);
B= imag(Ybus);
pq =find(type==2);
pv=find(type==0|type==1);
tol=1;
poweracc= 10^-3;
iter=1;
while(tol>poweracc)
4
Pcal(q)= Pcal(q)+(ybusmag(q,r)*
V(r)*V(q)*cos(ybusangle(q,r)+del(r)-del(q)));
end
for r=1:nbus
Qcal(q)= Qcal(q)-(ybusmag(q,r)*V(r)*V(q)*
sin(ybusangle(q,r)+del(r)-del(q)));
end
end
end
dPa= Psp-Pcal;
dQa= Qsp-Qcal;
5
J11(x,y)=J11(x,y) + V(m)*V(n)*(-G(m,n)*sin(del(m)-del(n))+B(m,n)*cos(del(m)-
del(n)));
end
J11(x,y)= J11(x,y)-((V(m)^2)*B(m,m));
else
J11(x,y)= V(m)*V(n)*(G(m,n)*sin(del(m)-del(n))-B(m,n)*cos(del(m)-del(n)));
end
end
end
%Computation Of J12
for x=1:(npv+npq)
m=x+1;
for y=1:npq
n=pq(y);
if n==m
for n=1:(npq+npv+1)
J12(x,y)= J12(x,y)+ V(n)*(G(m,n)*cos(del(m)-del(n))+B(m,n)*sin(del(m)-del(n)));
end
J12(x,y)= J12(x,y)+ V(m)*G(m,m);
else
J12(x,y)= V(m)*(G(m,n)*cos(del(m)-del(n))+B(m,n)*sin(del(m)-del(n)));
end
end
end
%Computation of J21
for x=1:npq
m= pq(x);
for y=1:(npv+npq)
n= y+1;
if n==m
for n=1:(npq+npv+1)
J21(x,y)= J21(x,y)+V(m)*V(n)*(G(m,n)*cos(del(m)-del(n))+B(m,n)*sin(del(m)-
del(n)));
end
J21(x,y)=J21(x,y)-((V(m)^2)*G(m,m));
else
J21(x,y)= V(m)*V(n)*(-G(m,n)*cos(del(m)-del(n))-B(m,n)*sin(del(m)-del(n)));
end
end
end
%Computation of J22
6
for x=1:npq
m=pq(x);
for y=1:npq
n=pq(y);
if n==m
for n=1:(npq+npv+1)
J22(x,y)= J22(x,y)+V(n)*(G(m,n)*sin(del(m)-del(n))-B(m,n)*cos(del(m)-del(n)));
end
J22(x,y)=J22(x,y)-(V(m)*B(m,m));
else
J22(x,y)= V(m)*(G(m,n)*sin(del(m)-del(n))-B(m,n)*cos(del(m)-del(n)));
end
end
end
J=[J11,J12;J21,J22];
X= J\M;
dth= X(1:nbus-1);
dV=X(nbus:end);
7
OUTPUT:
Ybus =
V=
1.0400
1.0400
1.0520
1.0459
del =
0
0.0146
-0.1028
-0.0335
RESULT:
Using Mat Lab program given network is analyzed by Newton-Rapshon method
and the calculated values of following parameters are verified with the output result.
a. Voltage at all PQ buses
b. Angle at all PV & PQ buses
8
Exp.No: 2
POWER FLOW ANALYSIS BY FAST DECOUPLED LOAD
Date :
FLOW METHOD
AIM:
To calculate various line flows of an interconnected power system using Fast
Decoupled Method of power flow analysis and to determine the voltage and load angle
at all buses in the system.
SOFTWARE REQUIRED:
MAT LAB Software
ALGORITHM:
Step 1: Formulate Y-bus matrix then compute bus susceptance matrix B’ &B’’.
Step 2 : Assume that flat start for starting voltage solution.
Del =0 for i=1, 2….N (for all buses except slack bus).
|V1| =1.0 for i=M+1….N (for all PQ bus).
|Vi| =|Vi| spec for all PV buses & slack bus.
Step 3: For load buses, calculate Pical & Qical
Pical =∑|Vi||Yij||Vj| Cos(θij+δj- δi)
Qical=∑|Vi||Yij||Vj| Sin(θij+δj- δi)
Step 4: For PV bus calculate Pical.
Step 5: Compute mismatch vector
ΔPi = Pi(spec)-Pical.
ΔQi = Qi(spec)-Qical.
Step 6: Compute
ΔPi(max) =Max | ΔPi| ; i=1,2….N
ΔQi(max) =Max | ΔQi| ; i=M+1,2….N
Step 7: Calculate
[Δδi] = -[B’]-1 { ΔPi/ |vi|}
[Δvi] = -[B’’]-1 { ΔQi/ |vi|}
Step 8: Update state correction
Step 9: This procedure is continued until
| ΔPi| < ε & | ΔQi|< ε
Step 10: Stop.
9
PROBLEM:
10
Qsp=busdata(:,6);
zimp=resis+j*reac;
Yadm=1./zimp;
badm=j*b;
nbus= length(busdata(:,1));
Ybus=zeros(nbus,nbus);
% Computation of Y bus
for k=1:nlines
Ybus(frombus(k),tobus(k))=Ybus(frombus(k),tobus(k))-Yadm(k);
Ybus(tobus(k),frombus(k))=Ybus(frombus(k),tobus(k));
Ybus(frombus(k),frombus(k))=Ybus(frombus(k),frombus(k))-Ybus(frombus(k),tobus(k));
Ybus(tobus(k),tobus(k))= Ybus(tobus(k),tobus(k))-Ybus(tobus(k),frombus(k));
end;
fprintf('Bus admittance matrix:\n');
Ybus
ybusmag = abs(Ybus);
ybusangle = angle(Ybus);
%Computation of constant matrices
B=imag(Ybus);
Bds=B(2:nbus,2:nbus);
pqst= find(type==2);
pqs=pqst(1);
Bdsds= B(pqs:nbus,pqs:nbus);
iter=1;
poweracc= 0.0001;
tol=1;
while(tol>poweracc)
11
k=1;
dP2 =zeros((nbus-1),1);
dP1 =zeros((nbus-1),1);
for i=2:nbus
if(type(i)==1|type(i)==2)
dP1(k)= dPa(i)/V(i);
dP2(k)=dPa(i);
k=k+1;
end
end
k=1;
dQ1 =zeros(pqcount,1);
dQ2 =zeros(pqcount,1);
for i=2:nbus
if(type(i)==2)
dQ1(k)= dQa(i)/V(i);
dQ2(k)=dQa(i);
k=k+1;
end
end
M=[dP2;dQ2];
%Computation of delth, delV
X1= - inv(Bds)*dP1;
X2= -inv(Bdsds)*dQ1;
X=[X1;X2];
dth= X(1:nbus-1);
dV=X(nbus:end);
iter=iter+1;
tol= max(abs(M));
end
fprintf('\nConverged at the end of %dth iteration\n',iter);
fprintf('\nThe bus voltages are:\n');
V
fprintf('The bus voltage angles are:\n');
del
12
OUTPUT:
Ybus =
V=
1.0400
1.0400
1.0520
1.0459
del =
0
0.0146
-0.1028
-0.0335
RESULTS:
Using Mat Lab program given network is analyzed by Fast - Decoupled method and
the calculated values of following parameters are verified with the output result.
a. Voltage at all PQ buses
b. Angle at all PV & PQ buses
13
Exp No:3 SMALL SIGNAL STABILITY ANALYSIS OF SINGLE MACHINE
Date: INFINITE BUS SYSTEM USING CLASSICAL MACHINE
MODEL
AIM:
To analyse the small signal stability of a single machine connected to infinite bus using classical
machine model.
SOFTWARE REQUIRED:
MATLAB
ALGORITHM:
Step 1: Calculate the current from the given complex power and the terminal voltage.
Step 2: Calculate the infinite bus voltage and the machine internal voltage
Step 3: Obtain the value for synchronising torque by using the relation
E V
Ks cos 0
Xt
Where is the angular difference between the infinite bus voltage and the machine internal
voltage.
Step 4: Calculate the entries of A matrix.
- Kd/(2H) - Ks/(2H)
A
Ws 0
Step 5: Find the eigen values and the eigen vectors for the A matrix.
Step 6: The left modal matrix is obtained by taking inverse of the right modal matrix
Step 7: Calculate the entries of the participation factor matrix.
Step 8: From the characteristic equation damping ratio and natural frequency are calculated.
PROGRAM:
14
V=1;
Kd=10;
Zext= 0.65;
XT= Xdd+ Zext;
delw= -Kd/(2*H);
%Finding the value of I
I= (P-j*Q)/V;
Imag = abs(I);
Iang= angle(I);
%Finding Voltage at infinite bus
Vinf = V- j*Zext*I;
%Finding Voltage behind transient reactance
E= V+ j*I*Xdd;
%Finding Synchronising torque coeff
Ks= (E*Vinf/XT)*cos(angle(E)-angle(Vinf));
Kss=abs(Ks);
% Finding the A matrix assuming the classical model
del= zeros(2,1);
A=zeros(2,2);
B=zeros(2,1);
A=[ ((-Kd/(2*H))) ((-Kss/(2*H)))
ws 0];
disp('A matrix');
A
%finding eigen value, damping ratio and natural frequency
disp('Eigen Values:');
lambda= eig(A)
[r,v]=eig(A);
disp('Right Eigen vector:');
r
disp('Left eigen vector:');
l= inv(r)
disp('Natural frequency:');
wn= sqrt(det(A))
disp('Damping Ratio:');
e= Kd/(4*H*wn)
wd= wn*sqrt(1- (e*e));
%Participation factor matrix
n=2;
fori=1:n
for k=1:n
p(i,k)= r(i,k)*l(k,i);
end;
end;
disp('Particiption factor matrix:');
p
pmag=abs(p);
ptheta=angle(p)*(180/pi);
15
%Initialisation of State variables
x=zeros(2,100);
x0=[0 ;(5*pi/180)];
i=0;
%Plots
for t=0:0.001:40
i=i+1;
x = (r(:,1)*l(1,:)*x0)*exp(lambda(1,1)*t)+
((r(:,2)*l(2,:)*x0)*exp(lambda(2,1)*t));
T(i)=t;
deltt(i)=x(2,:);
delw(i)=x(1,:);
end
plot(T,deltt)
plot(T,delw)
OUTPUT:
A matrix
A =
-1.6287 -0.1137
314.1593 0
Eigen Values:
lambda =
-0.8143 + 5.9203i
-0.8143 - 5.9203i
r =
l =
16
Natural frequency:
wn =
5.9760
Damping Ratio:
e =
0.1363
RESULT:
The small signal stability of a single machine connected to infinite bus is analysed using classical
machine model and the participation matrix is obtained.
17
Exp.No: 4
AVAILABLE TRANSFER CAPABILITY
Date :
AIM:
To Calculate the available transfer capability for the given power system network
using DC load flow solution.
SOFTWARE REQUIRED:
MATLAB Software.
THEORY:
Available Transfer Capability (ATC) is the measure of the transmission capability
remaining in the physical transmission network for further electricity transfers, over and above
already committed users. It is defined as Total Transfer Capability less Existing Transmission
Commitments, less a Capacity Benefit Margin, less a Transmission Reliability Margin.
Total move Capability (TTC) is the amount of electric power that can be moved
or transferred reliably from one area to another area of the interconnected transmission systems
by way of transmission lines (or paths) between those areas under specified system conditions.
This value may reflect contractual arrangements or be based on certain equipment limitations
or system conditions.
TTC represents the reliability limit of a transmission path at any specified point in time.
Existing Transmission Commitments (ETC) is the measure of any transmission capacity
committed for use. Existing Transmission Commitments (ETCs) are a Transmission Provider’s
existing transmission capacity obligations which may include transmission contracts, OATT
transmission reservations, Native Load usage, reasonably forecasted (over the Planning
Horizon) Native or Network Load growth, or other obligations that impact Firm ATC.
ALGORITHM:
Step 1: Calculate the power flow through each line using DC Load Flow.
Step 2: Calculate the total transfer capability of the line by using the reactance of each line
TTT=1/X
Step 3: Compute the available transfer capability for each line using the relation
ATC=TTC-ETC
Step 4: For an increase in generation calculate the new power flow through each line.
Step 5: Calculate the transmission and distribution factor for each line
18
TDF=New power-Old power /Change in power flow.
ITC=TTC-ETC/TDF
Step 7: The line with minimum ITC is the limiting element and the ATC of the limiting
element is the Available Transfer capability of the line.
Step 8: In case of outage of a line, calculate the new power flow through each line.
Step 9: Calculate the transmission and distribution factor for each line
ITC=TTC-ETC/FCTDF
Step 11: The line with minimum ITC is the limiting element and the ATC of the limiting
element is the ATC of the line.
PROBLEM:
19
PROGRAM:
% Y bus
clc;
clear all;
% line data From Bus To Bus R X B
linedata= [1 2 0 0.5 0;
1 3 0 0.3 0;
1 4 0 0.6 0;
2 3 0 0.2 0;
3 4 0 0.1 0;];
busdata=[1;1;-1;-1];
P=busdata(:,1);
nlines=length(linedata(:,1));
frombus=linedata(:,1);
tobus=linedata(:,2);
resis=linedata(:,3);
reac=linedata(:,4);
b=linedata(:,5);
zimp=resis+j*reac;
Yadm=1./zimp;
badm=j*b;
nbus= max(max(frombus),max(tobus));
Ybus=zeros(nbus,nbus);
for k=1:nlines
Ybus(frombus(k),tobus(k))=Ybus(frombus(k),tobus(k))-Yadm(k);
Ybus(tobus(k),frombus(k))=Ybus(frombus(k),tobus(k));
Ybus(frombus(k),frombus(k))=Ybus(frombus(k),frombus(k))-Ybus(frombus(k),tobus(k));
Ybus(tobus(k),tobus(k))= Ybus(tobus(k),tobus(k))-Ybus(tobus(k),frombus(k));
end;
disp('Bus admittance matrix bus');
Ybus
ybusmag= abs(Ybus);
ybusangle= angle(Ybus);
Xred= zeros(nbus,nbus);
G= real(Ybus);
B= imag(Ybus);
BT= Ybus(2:nbus,2:nbus);
XT= inv(BT);
Xred(2:nbus,2:nbus)= XT;
Xred= imag(Xred)
%PTDF Calculation
y=2;
z=3;
20
for p=1:nlines
PTDF(p,1)=((Xred(frombus(p),y)-Xred(frombus(p),z))-(Xred(tobus(p),y)-
Xred(tobus(p),z)))/reac(p);
end
disp('PTDF:');
PTDF
%Calculation of base case flows
theta= zeros(nbus,1);
theta(2:nbus)= imag(XT) *P(2:nbus);
for p=1:nlines
PO(p)= (theta(frombus(p))-theta(tobus(p)) )/reac(p);
end
disp('Base case flows:');
PO=PO'
%Calculation of Plmax
Pmax=1.5;
for p=1:nlines
Plmax(p)= abs((Pmax- PO(p)))/abs(PTDF(p));
end
Plmax= Plmax';
Atc =min(Plmax);
fprintf('ATC is %f',Atc);
OUTPUT:
Bus admittance matrix bus
Ybus =
Xred =
0 0 0 0
0 0.2253 0.1154 0.0989
0 0.1154 0.1615 0.1385
0 0.0989 0.1385 0.2044
21
PTDF:
PTDF =
-0.2198
0.1538
0.0659
0.7802
-0.0659
Base case flows:
PO =
-0.0220
0.6154
0.4066
0.9780
0.5934
ATC is 0.669014
RESULT:
Thus the available transfer capability for the given power system network using DC
load flow solution is calculated and verified by MATLAB coding.
22
Exp No:5 STATE ESTIMATION (DC)
Date:
AIM:
To write and run the program for DC circuit state estimation using MATLAB program.
SOFTWARE REQUIRED:
MATLAB
ALGORITHM:
Step 1: Start
Step 2: Read the measurement data [Z] and weights of the measuring meters [W]and
system model matrix [H].
Step 3: Calculate [G] matrix.
Step 4: Calculate the state estimate matric [ X ] and [ Z ] matrix.
Step 5: Compute the error[ e ]=[ Z ] - [ Z ]
Step 6: Find [ R' ] [ I HG 1 H T R 1 ]R
Step 7: Compute the standardized error estimates Si for bad data detection
Step 8: The measurement corresponding to the max[|Si|] is the bad data
Step 9: Leave the erroneous data and repeat the steps to get the revised estimates Z4 bad
measurement data.
PROBLEM:
For a DC circuits shown in below the meter readings are Z1=9.01A, Z2=3.02A,
Z3=6.98V and Z4=4.4V. assuming that the ammeters are more accurate than volt meters. The
measurement weights are respectively 100,100,50, and 50. Estimate the values of voltage
sources V1, V2. Result obtained from the above problem is not acceptable because of bad data
measurements. Identify and remove the bad data and estimate V1 and V2.
23
MATLAB CODE FOR DC STATE ESTIMATION:
%State Estimation
clc;
clear all;
Z=[9.01;3.02;6.98;4.40];
w=[100 100 50 50];
W=diag(w);
R=inv(W);
H=[0.625 -0.125;
-0.125 0.625;
0.375 0.125;
0.125 0.375];
Nm=length(Z);
Ns=length(H(1,:));
%State variable estimates computation
if Nm>Ns
G= H'*W*H;
Xest= inv(G)*H'*W*Z;
elseif Nm==Ns
Xest= inv(H)*Z;
elseXest= H'*inv(H*H')*Z;
end
Xest;
fprintf('The state variable estimates are \nV1=%f V\nV2=%f
V',Xest(1),Xest(2));
Zest= H*Xest;
E=Z-Zest;
%Calculation of Rmodified and Standardised error estimates
Rmod= (eye(Nm)- H*inv(G)*H'*inv(R))*R;
fori=1:Nm
S(i)=E(i)/((Rmod(i,i))^0.5);
end
S=S';
%Finding the bad measurement data
q=max(abs(S));
QQ= find(abs(S)==q);
fprintf('\n\nErroneous measurement is the %d thmeasurement,i.e. Z%d',QQ, QQ);
%Revised estimates
Nm= Nm-1;
Z(QQ)=[];
H([QQ],:)=[];
W([QQ],:)=[];
W(:,[QQ])=[];
if Nm>Ns
G= H'*W*H;
Xest= inv(G)*H'*W*Z;
elseif Nm==Ns
Xest= inv(H)*Z;
elseXest= H'*inv(H*H')*Z;
24
end
fprintf('\n\nThe corrected state variable estimates are \nV1=%f V\nV2=%f
V',Xest(1),Xest(2));
Zest= H*Xest;
E=Z-Zest;
OUTPUT:
The state variable estimates are
V1=15.868070 V
V2=7.758596 V
V1=16.007391 V
V2=8.026522 V>>
RESULT:
Thus the State Estimation of the DC circuit Program has run and verified by using MATLAB
software.
25
Exp.No.:6 COMPUTATION OF HARMONIC INDICES GENERATED BY A
RECTIFIER FEEDING A R-L LOAD
Date:
AIM:
To perform the harmonic analysis of single phase fully controlled rectifier feeding a
RL Load.
SOFTWARE REQUIRED:
MATLAB Simulink
THEORY:
Rectifier is a power electronic device that converts AC into DC. But the output is not
a perfect DC. The output contains harmonics. These harmonics get reflected back into
the AC source current. That is why we have input current harmonics in rectifiers.
Harmonics is a voltage or current at multiples of fundamental frequency. Total
harmonic distortion (THD) of a signal is the measurement of harmonics present in the
fundamental.
PROCEDURE:
2. With the help of Simulink library, select different blocks required, place them and connect
them according to the circuit diagram.
3. In each Scope block used, tap on “Settings”. Select “Save Data to Workspace”.
8. FFT analysis of the signal is displayed. Also, THD of the signal is displayed.
26
SIMULATION DIAGRAM
FFT ANALYSIS
RESULT:
Thus the harmonic indices generated by a Single phase fully controlled rectifier feeding a RL
Load is evaluated by means of FFT analysis in MATLAB Simulink.
27
Exp.No: 7
LOCATIONAL MARGINAL PRICING COMPUTATION OF
Date :
RESTRUCTURED POWER SYSTEM
AIM
To calculate the Locational Marginal Price (LMP) of restructured power system using
MATLAB software.
SOFTWARE USED
MATLAB software
THEORY
Locational marginal pricing (LMP) is the sum of supplying the next energy marginal
cost, cost of losses due to increment and transmission congestion cost.
LMP is the true indicator of marginal pricing of energy.
LMP models can be broadly classified as ACOPF and DCOPF models.
DCOPF model based upon DC power flow approximation and has the following
advantages:
o Simplicity
o Speed of convergence
o Availability of LMP components
ALGORITHM
STEP 2: Calculate the line flows with only one generator(with least operating cost)
operating.
STEP4: Calculate the generations i.e., generation schedule after limiting the overloaded line
to its flow limits.
STEP 5: Assume a load rise of 1MW and find ΔPG1, ΔPG2,…, ΔPGm where no of
generator,m=1,2,..,n.
28
PROBLEM
300 MW
$10/MWh 125 MW
150 MW x
2x
50 MW 100 MW
175 MW
200 MW
$20/MWh
PROGRAM:
%LMP
clc;
clear all;
%line data
%From_bus To_bus reactance line_flow_limit
linedata= [1 2 1 150;
1 3 1 50;
2 3 2 120];
%Bus Data
%Pg Pload
busdata= [500 0 10;
0 125 0;
200 175 20];
Pg= busdata(:,1);
Pl=busdata(:,2);
Op_cost =busdata(:,3);
x= linedata(:,3);
linelimit= linedata(:,4);
%Calculation of line flows with only one generator with lower op. cost
Plnew= zeros(3,1);
y=find(Pl);
29
X=x(1)+x(2)+x(3);
Plnew(1,1)= ((x(2)+x(3))/X)*Pl(y(1))+(x(2)/X)*Pl(y(2));
Plnew(2,1)= (x(1)/X)*Pl(y(1))+((x(2)+x(3))/X)*Pl(y(2));
Plnew(3,1)= (-x(1)/X)*Pl(y(1))+(x(2)/X)*Pl(y(2));
fprintf('Line flows:\n');
fprintf('%f MW\n%f MW\n%f MW\n',Plnew(1),Plnew(2),Plnew(3));
%Determination of line exceeding its limit
for t=1:3
if( Plnew(t)>linelimit(t))
fprintf('\nLine %d exceeds the limit\n',t);
z=t;
end
end
%Setting the exceeded line's flow to its max. limit
Plnew(z)=linelimit(z);
Plnew(z);
%Finding the optimum generations
syms Pg2 Pg1
eqn=(((x(1)/X)*Pl(y(1)))+(((x(2)+x(3))/X)*(Pl(y(2))-Pg2)))==Plnew(z);
Pg2 = solve(eqn,Pg2);
eqn= Pg1+ Pg2 == sum(Pl);
Pg1= solve(eqn,Pg1);
Pgen =[Pg1;0;Pg2];
fprintf('\nThe optimum generations are');
fprintf('\nGenerator 1=%f MW;\nGenerator 2 =%f MW\n',Pg1,Pg2);
%Computation of LMP at Load bus
Lmp= zeros(3,1);
Lmp=Op_cost;
syms delPg1 delPg2
eqn1= delPg1+ delPg2==1;
eqn2= ((x(1)/X)*delPg1)+((-x(3)/X)*delPg2)==0;
[delPg1 delPg2]=solve(eqn1,eqn2,delPg1,delPg2);
Lmp(2)= delPg1*Lmp(1) + delPg2*Lmp(3);
fprintf('\nLMP s of all the buses:\n')
Lmp
OUTPUT:
Line flows:
137.500000 MW
162.500000 MW
12.500000 MW
Line 2 exceeds the limit
30
The optimum generations are
Generator 1=150.000000 MW;
Generator 2 =150.000000 MW
Lmp =
10.0000
13.3333
20.0000
RESULT
Thus, the Locational Marginal Prices (LMP) at all the buses are computed using MATLAB.
31
Exp No:8 CONTINGENCY ANALYSIS BY GENERATOR SHIFT FACTOR
Date: AND LINE OUTAGES DISTRIBUTION FACTOR METHOD
AIM:
To develop matlab program for doing contingency analysis on the given sample
power system network using generator shift factor
SOFTWARE REQUIRED:
MATLAB
ALGORITHM:
Step 1: formulate y bus matrix then compute bus susceptance matrix B’ and inverse of
B’
m n
Step 2: find line flows using the following formule f base
x mn
Step 3:
Thus the new base value is found by using the formula given,
f l f l 0 ali Pi
Where, ali is the generator shift factor.
Step 4:
ii. Line outage distribution factor method
When the line is removed, the line outage distribution factor is given by
1
xl
xin xim x jn x jm
d l ,k
1
1
x k x nn 2 x nm x mm
The line outage is given by f l f l 0 d lk f k
32
Step 5: Stop the process.
nlines=length(linedata(:,1));
frombus=linedata(:,1);
tobus=linedata(:,2);
resis=linedata(:,3);
reac=linedata(:,4);
b=linedata(:,5);
type=busdata(:,2);
V= busdata(:,3);
npv = sum(type==1);
npq=sum(type==2);
del= busdata(:,4);
Psp=busdata(:,5);
Qsp=busdata(:,6);
zimp=resis+j*reac;
Yadm=1./zimp;
badm=j*b;
nbus= length(busdata(:,1));
Ybus=zeros(nbus,nbus);
%Ybus computation
for k=1:nlines
Ybus(frombus(k),tobus(k))=Ybus(frombus(k),tobus(k))-Yadm(k);
Ybus(tobus(k),frombus(k))=Ybus(frombus(k),tobus(k));
Ybus(frombus(k),frombus(k))=Ybus(frombus(k),frombus(k))+badm(k)-
Ybus(frombus(k),tobus(k));
Ybus(tobus(k),tobus(k))= Ybus(tobus(k),tobus(k))+badm(k)-
Ybus(tobus(k),frombus(k));
end;
33
disp('Bus admittance matrix bus');
Ybus
ybus= abs(Ybus);
for a=1:nbus
for b=1:nbus
if a~=b
ybus(a,b)=-ybus(a,b);
end
end
end
ybusred= ybus(2:nbus,2:nbus);
xred= inv(ybusred);
X(2:nbus,2:nbus)= xred;
disp('Sensitivity matrix');
X
34
% Calculation of line flows after a generator shift/line outage
u=input('Enter the line for which flow is to be computed :');
t=input('Enter the outaged generator :');
fprintf('\nLine flow of the line-%d:\n',u)
Pll =PO(u)+aa(u,t)*(-Psp(t)*100)
uu=input('Enter the line for which flow is to be computed :');
tt=input('Enter the outaged line :');
fprintf('\nLine flow of line-%d:\n',uu);
POu = PO(uu)+bb(uu,tt)*PO(tt)
OUTPUT:
Bus admittance matrix bus
Ybus =
Sensitivity matrix
X =
0 0 0 0
0 0.1379 0.1215 0.0776
0 0.1215 0.2242 0.0982
0 0.0776 0.0982 0.1530
PO =
0.2913
0.5087
0.5616
0.2297
-0.0384
35
Line outage sensitivity matrix
0 1.0000 -0.4000 -0.5500 -0.4000
1.0000 0 0.4000 0.5500 0.4000
-0.3529 0.3529 0 0.4500 -1.0000
-0.6471 0.6471 0.6000 0 0.6000
-0.3529 0.3529 -1.0000 0.4500 0
Pll =
34.7662
POu =
0.0667
RESULT :
Thus the contingency analysis is performed on the given power system network by generator
shift factor method and line outage distribution factor method the output has been verified using
MATLAB.
36
Exp.No.: 9
LINE ENERGISATION USING EMTP
Date :
AIM:
SOFTWARE REQUIRED:
EMTP-RV
THEORY:
For a transmission line, if the source is stiff, a high percentage of a source voltage is
impressed across the line at the time the breaker closes to energize the line, if the line
is open at far end or terminated in a load such as an unloaded transformer which has a
high surge impedance, the wave that propagates will essentially double at the far end.
This overvoltage caused at the remote end can put severe stress on the components at
that location.
Conditions can be more critical if the line has trapped charges in it. Reclosing a line
with trapped charges will further induce overvoltages at the other end.
Use of closing resistors (pre insertion resistors) reduces the voltage impressed on the
line. Before closing the line, switch S1 connected to PIR is switched first, followed by
switch S2.
By this way PIR modifies the TRV on the main breaker S2.
PROCEDURE:
1. Open EMTP-RV and create a new file, by selecting “create EMTP default design”.
2. Select the components from library and place and connect them according to the circuit
diagram.
3. Double tap each component and set properties for each block/component that you use.
4. Set proper switching logic/breaker logic for the switches you use. (according to the
analysis)
5. Navigate to “Simulation options” and set the time step, simulation time, frequency
details.
6. Run the simulation.
7. Select ‘view scopes with mplot’ or ‘view scopes with scopeview’ to view the plots.
37
CIRCUIT DIAGRAM:
OUTPUT:
38
VOLTAGE AT THE OPEN CIRCUIT END OF A PRECHARGED LINE WITHOUT PIR:
39
RESULT:
Thus the analysis of switching surges while energizing a long distributed parameter line
was done using EMTP-RV successfully.
INFERENCE:
It was found that overvoltages occur at the remote end while energizing the line, and it
is reduced while using PIR.
40
Exp No:10
INDUCTION MOTOR STARTING ANALYSIS
Date:
AIM:
To perform induction motor starting analysis.
SOFTWARE REQUIRED:
MATLAB.
ALGORITHM:
Step 1: Start
Step 2: Read the induction motor data –Full load Amperes (FLA), RPM, frequency, R1, R2,
X1, X2, J, NS and Nr.
2N s
Step 5: Calculate the synchronous speed ;
60
Step 6: Consider steady state model of induction machine, read V1, V2, V3.
Step 9: Change in Speed ∆ω= Percentage speed (previous) - Percentage speed (current)
J s
Step 12: Calculate t ;
T
41
Step 15: Plot Torque Vs Slip & Torque Vs Speed & Torque Vs Time & Current Vs Time.
42
OUTPUT:
RESULT:
Thus, the analysis was done on induction motor starting and the above characteristics curves
were plotted.
43