Computer Applicaation in Power System Lab. Manual
Computer Applicaation in Power System Lab. Manual
Institute of Technology
School of Electrical and Computer Engineering
Power System II Laboratory Activities
Note: Please try to solve the given Activities using Power World Simulator, ETAP and
Matlab/ Simulink/ or PSAT
Experiment #1: Solving Power Flow Problem Using Matlab/ M-File (Optional)
Procedures
1. Write the M- file Code on the Matlab script editor.
2. Solve/ Run the simulation and fix any of the problem
clc
clear
%Newton Raphson Method
%{
To get results in form:
- phase and magnitude ,Os=1
- Real+jImag ,Os=2
%}
Os=2;
%Number of Iteratuions:
Its=12;
%Number of Buses:
Nb=5;
%Number of Lines:
Nl=6;
%Choose delta reference;
Delta_r=2;
%{
Transmission line parameters:
Write them without j or i
1st & 2nd column for line "From-To"
From | To | R | X | Gsh | Bsh
%}
T=[1 2 0.0108 0.0640 0.01 0.1
2 3 0 0.04 0 0
1 4 0.0235 0.0941 0.05 2
2 5 0.0118 0.0471 0.02 1
3 5 0.0147 0.0588 0 0
4 5 0.0118 0.0529 0.05 2];
%{
Generators & loads:
1|Page
Start from bus 1 to Nb
Assumptions Eg~=0,|Vbus|=1
if Eg~=0 && Pd==0 (slack bus)
even if you choose Delta_r
Eg | Pg | Sd
%}
B=[1.05 0 0
0 0 3+2.5i
0 0 1+0.8i
0 0 2.5+2.5i
1 1.8 0.8+0.8i];
% ---------DO NOT TOUCH------------
G50=0;
for ff=1:Nb
if B(ff,1)~=0
G50=1;
break;
end
end
for f=1:Nb
if B(f,1)~=0 && B(f,2)==0
Delta_r=f;
break;
end
end
if G50==1
Y=zeros(Nb,Nb);
k=1:Nb;
N=0;
for i=1:Nb
for z=1:Nl
for j=1:2
if T(z,j)==k(1,i)
M=(T(z,3)+T(z,4)*1i)^-1;
if abs(M)==inf
M=0;
end
N=N+M+(T(z,5)+T(z,6)*1i)*0.5;
if j/2 ~= 1
P=T(z,2);
Y(i,P)=-M;
elseif j/2 == 1
P=T(z,1);
Y(i,P)=-M;
end
2|Page
end
end
end
Y(i,i)=N;
N=0;
end
for Its2=1:Its
Un=0;
o=0;
Delta = sym('Delta',[1 Nb]);
Results = sym('DD',[Nb 3])*0;
V = sym('V',[1 Nb]);
F=sym('F',[1 Nb*2]);
Gy=real(Y);
By=imag(Y);
Pd=real(B(:,3));
Pa=Pd-B(:,2);
Qd=imag(B(:,3));
F(1,Delta_r)=0;
Delta(1,Delta_r)=0;
Results(Delta_r,1)=V(1,Delta_r);
Results(Delta_r,3)='Zero';
for i=1:Nb
if B(i,1)~=0
Results(i,1)=V(1,i);
V(1,i)=1;
Results(i,2)=V(1,i);
end
end
for i=1:Nb
if V(1,i)==1
F(1,i+Nb)=0;
end
end
C=0;
for i=1:Nb
if F(1,i)~=0
for j=1:Nb
C=C+V(1,i)*(Gy(i,j)*V(1,j)*cos(Delta(1,i)-Delta(1,j)));
C=C+V(1,i)*(By(i,j)*V(1,j)*sin(Delta(1,i)-Delta(1,j)));
end
F(1,i)=C+Pa(i,1);
C=0;
end
end
3|Page
for i=1:Nb
if F(1,Nb+i)~=0
for j=1:Nb
C=C+V(1,i)*(Gy(i,j)*V(1,j)*sin(Delta(1,i)-Delta(1,j)));
C=C+V(1,i)*(-By(i,j)*V(1,j)*cos(Delta(1,i)-Delta(1,j)));
end
F(1,Nb+i)=C+Qd(i,1);
C=0;
end
end
M=F;
F=sym('0');
C1=1;
C2=1;
while(C2~=Nb*2+1)
if M(1,C2)~=0
F(C1,1)=M(1,C2);
C1=C1+1;
end
C2=C2+1;
end
Vari=sym('0');
C1=1;
C2=1;
while(C2~=Nb+1)
if Delta(1,C2)~=0
Vari(C1,1)=Delta(1,C2);
C1=C1+1;
end
C2=C2+1;
end
C2=1;
while(C2~=Nb+1)
if V(1,C2)~=1
Vari(C1,1)=V(1,C2);
Un(C1,1)=1;
C1=C1+1;
end
C2=C2+1;
end
J=jacobian(F,Vari);
for u=1:Its2
Np=double(subs(J,Vari,Un));
Un=double(Un-((Np^-1)*subs(F,Vari,Un)));
end
4|Page
H=size(Un);
H=H(1,1);
H1=size(Delta);
H1=H1(1,2);
for i=1:H
for j=1:H1
if Vari(i,1)==Delta(1,j)
for o=1:Nb
if (Results(o,3)~='Zero' && Results(o,3)==0)
Results(o,3)=Un(i,1);
if Results(o,1)==0
Results(o,1)=V(1,j);
end
break;
end
end
break;
end
end
end
H=size(Un);
H=H(1,1);
H1=size(Results);
H1=H1(1,1);
for i=1:H
for k=1:H1
if Results(k,1)==Vari(i,1) && Results(k,2)==0
Results(k,2)=Un(i,1);
end
end
end
Nub=sym('0');
Vs=sym('0');
H3=size(Results);
H3=H3(1,1);
for i=1:H3
if Results(i,3)=='Zero'
Results(i,3)=0;
end
end
H3=size(Results);
H3=H3(1,1);
Vs=Results(1:H3,1);
format short
Nub=transpose(double(Results(1:H3,2:3)));
gg=Nub(2,1:H3)*(180/pi);
5|Page
if Its2~=1
fprintf('------------------------------------------------------- \n')
end
fprintf('Iteration #%d',Its2)
fprintf(' \n')
disp(transpose(Vs));
if Os==1
disp(Nub(1,1:H3))
format short
disp(' Delta in radian :')
disp(Nub(2,1:H3))
disp(' Delta in degree :')
disp(gg);
end
if Os==2
for Hi=1:H3
Nubi(1,Hi)=Nub(1,Hi)*(cos(Nub(2,Hi))+1i*sin(Nub(2,Hi)));
end
disp(Nubi);
end
end
end
if G50==0
disp('There are no sources in the system !!');
end
% -----------The End-----------
6|Page
Figure 1: given power system
Questions
1. Simulate your network effectively and examine the property of the circuit?
2. Discuss on the effect of different fault types and the results you obtained?
Experiment #2: Overcurrent Relay and CB
Use the given data in the table and follow the procedures correctly!
Table 2: System given Data
No. Component/ parameter Set value
1 Three-Phase Source 15kV, 50Hz
2 Three-Phase Series RL Load 200MW, 50MVAR, 15kV, 50Hz
Procedures
1. Open MATLAB/ Simulink new model and the library too.
2. From simscape>Simulink gallery>simpower, or by searching each component/ or features
you can add components to the blank window.
3. connect each feature as Figure 1 below.
4. By double clicking each component you have to specify its parameters as you want.
5. The relay is designed in subsystem and seen as black box, but the inner configuration is
shown in Figure 2.
6. Finally, powergui is required as circuit solver to undertake the simulation process.
7|Page
Figure 2: General schematic diagram of the system
8|Page
d) A DLG at bus 3 through a fault impedance Zf = j0.1 pu
Simulate the given system in case of short circuit and transient analysis using ETAP power station
to validate your calculations?
Table 4: System Data
Item Voltage (KV) X1 X2 X0
G1 20 0.15 0.15 0.05
G2 20 0.15 0.15 0.05
T1 20/220 0.1 0.1 0.1
9|Page
10 | P a g e
Questions
1) Simulate the network as proposed by the above questions and apply the sub-transient,
transient and steady state fault options?
2) Discuss on the voltage and fault current simulation results you obtained?
Generation Load
13 | P a g e
Figure 1: IEEE 6-Bus system
14 | P a g e
Figure 2: Simulation of IEEE 6-Bus System
Questions
Tabulate PF results and write interpretations of the proposed data that you have from the complete
report.
2. Short Circuit Analysis
For the given network, simulate all types of shunt faults at bus 5 and see the effect of each fault
type and severity?
Procedures
1. Open new project window from file
2. On the new window blank space and materials on the right edge will appear so that you can
drag whatever you want
3. After placing and setting all features you can connect each other accordingly.
4. Then, by double clicking a device/ feature, you can set the parameters that you have allotted
in a case.
5. But for beginners it highly recommended that to fill all the parameters (especially the
impedance) of generators, transformers and lines is setting typical data on its popup
window and press OK.
6. For lines follow and fill all wrap options of the top task bar reasonably! Refer Power System
I Course contents (like line parameters and mechanical design of transmission lines)
7. The click the Short circuit Analysis Icon from the top task bar.
15 | P a g e
8. Now you can simulate the sub-transient, transient and steady state conditions off all fault
types by clicking , and icons respectively and you can also select fault
type from display options on the right edge of your window.
9. Finally, you can gather the simulation result in PDF by clicking the report manager on the
right edge of the window by letting a file name to your results.
10. If you’re interested to have the complete report, plz click complete and press OK.
11. ENJOY IT!
Note:- You have to allow one swing bus all the time!
16 | P a g e
5. But for beginners it highly recommended that to fill all the parameters (especially the
impedance) of generators, transformers and lines is setting typical data on its popup
window and press OK.
6. For lines follow and fill all wrap options of the top task bar reasonably! Refer Power System
I Course contents (like line parameters and mechanical design of transmission lines)
7. The click the Transient Stability Analysis Icon from the top task bar.
8. Now click the icon to run the transient issues.
9. Then click the plot dialogue icon to plot your cases.
10. Finally, you can gather the simulation result in PDF by clicking the report manager on the
right edge of the window by letting a file name to your results.
11. If you’re interested to have the complete report, plz click complete and press OK.
12. ENJOY IT!
17 | P a g e
If the three-phase fault is occurred at transmission line 2 (bus 4 to bus 5) at t=20sec and is
supposed to be cleared at t=20.5sec and if the simulation time is 100sec. plot the following
parameters at G2 after the system has been regained its stability?
18 | P a g e
POWER SYSTEM II SIMULATION LABORATORY MANUAL
e-mail: [email protected]/ [email protected]
Now discuss about each of the plotted graphs with respect to transient stability analysis concepts?
Note:- Every group member should take responsibilities of preparing report, presentation and
reply for questions!
19