In [2]:

```
# Variables
#For Recloser
InstT = 0.03; #From Curve A #instaneous Time
TimeD = 0.17; #From Curve B #Time Delay
#For Relay
PickU = 0.42; #From Curve C #Pick Up
Reset = (1./10)*60; #Assuming a 60 s reset time for the relay with number 10 time dial setting
RecloserOT = 1; #Assumed Recloser Open Time
RelayCTI = InstT/PickU; #Relay Closing Travel during instanmath.taneous operation
RelayRTI = (-1)*RecloserOT/Reset; #Relay Reset Travel during instanmath.taneuos
# Calculations
RelayCTD = TimeD/PickU;
RelayRTD = (-1)*RecloserOT/Reset; #Relay Reset Travel during trip
NetRelayTravel = RelayCTD-RelayRTD;
# Results
print 'During instanmath.taneous Operation'
print '|Relay Closing Travel| < |Relay Rest Travel|'
print '|%g percent| < |%g percent|'%(RelayCTI*100,RelayRTI*100)
print 'During the Delayed Tripping Operations'
print 'Total Relay Travel is from:'
print '%g percent to %g percent to %g percent'%(RelayCTD*100,RelayRTD*100,RelayCTD*100)
print 'Since this Net Total Relay Travel is less than 100 percent the desired recloser to relay coordination is accomplished'
```

In [3]:

```
import math
# Variables
Vln = 7200.; #Line to Neutral Voltage
Vll = 12470.; #Line to Line Voltage
Z1sys = 0.7199+(1j*3.4619); #system impedance to the regulated 12.47kV bus
ZGsys = 0.6191+(1j*3.3397); #system impedance to ground
l = 2; #Dismath.tance of the Fault from the substation
#From Table 10-7; Various Paramters Can Be found out
z0a = 0.1122+(1j*0.4789);
z011 = (-0.0385-(1j*0.0996));
z1 = 0.0580+(1j*0.1208);
C = 5.28; #Cable consmath.tant
# Calculations
Z0ckt = 2*(z0a+z011)*C; #Zero Sequence Impedance
Z1ckt = 2*z1*C; #Positive Sequence Impedance
ZGckt = ((2*Z1ckt)+Z0ckt)/3; #Impedance to ground of line
#Note That the calculation of the above term is wrong in the text book
Z1 = Z1sys+Z1ckt; #Total Positive Sequence
ZG = ZGsys+ZGckt; #Total impedance to ground
If3phi = Vln/abs(Z1); #Three Phase Fault at point 10
IfLL = 0.866*If3phi; #Line to Line Fault at point 10
IfLG = Vln/(abs(ZG)); #Single Line to Ground Fault
# Results
print 'a The Zero and Postive sequence impedance of the line to point 10 are:',
print (Z0ckt),
print (Z1ckt)
print 'b The impedance to ground of the line to point 10',
print (ZGckt)
print 'c The Total positive sequence impedance including system impedance is',
print (Z1)
print 'd The Total Impedance to ground to point 10 including system impedance is',
print (ZG)
print 'All the Above impedances are in ohm'
print 'e) The Three phase fault current at point 10 is %g A'%(If3phi)
print 'f) The line to line fault current at point 10 is %g A'%(IfLL)
print 'g) The Line to Ground Current at point 10 is %g A'%(IfLG)
```

In [5]:

```
import math
from numpy import exp
# Variables
St = 5*(10**6); #Capacity of Transformer
Zt = 1j*0.065; #Transformer Reacmath.tance
SB3phi = 1*(10**6); #3 Phase Power Base
VBLL = 69*(10**3); #Line to line voltage
VBLLn = 12.47*(10**3); #Line To line voltage
Vf = 1; #Per Unit Value of Voltage
Zb = (VBLL**2)/SB3phi; #Base Impedance
#Zckt and Zf and Zt are Zero for Bus 1
#Zckt and Zf are Zero for Bus 2
#Power Generation of the system
SMax = 600*(10**6); #Maximum
SMin = 360*(10**6); #Minimum
# Calculations
Xt = 0.065; #Transformer Reacmath.tance in per unit
MZsysmax = (VBLL**2)/SMax; #System Impedance at Maximum Power Generation
Ib = SB3phi/(math.sqrt(3)*VBLL); #Base Current
Zsysmaxpu = MZsysmax*exp(1j*math.pi*90/180)/Zb; #System Impedance Phasor
#Three Phase Fault Current
If3phimaxpu1 = abs(Vf/(Zsysmaxpu));
If3phimax1 = If3phimaxpu1*Ib;
Sf3phimax1 = math.sqrt(3)*VBLL*If3phimax1/1000000;
#Line to Line Fault Current
IfLLmax1 = 0.866*If3phimax1;
SfLLmax1 = VBLL*IfLLmax1/1000000;
#Line to Ground Fault
IfLGmaxpu1 = abs(3*Vf/((2*Zsysmaxpu)));
IfLGmax1 = IfLGmaxpu1*Ib;
SfLGmax1 = VBLL*IfLGmax1/(1000000*math.sqrt(3));
Stn = SB3phi; #Numreical Value is Equal
Ztn = Zt*(Stn/St); #New Per Unit Transformer Reacmath.tance
#New Base Values
Zbn = (VBLLn**2)/SB3phi;
Ibn = Stn/(math.sqrt(3)*VBLLn);
#Three Phase Fault Current
If3phimaxpu2 = abs(Vf/(Zsysmaxpu+Ztn));
If3phimax2 = If3phimaxpu2*Ibn;
Sf3phimax2 = math.sqrt(3)*VBLLn*If3phimax2/1000000;
#Line to Line Fault Current
IfLLmax2 = 0.866*If3phimax2;
SfLLmax2 = VBLLn*IfLLmax2/1000000;
#Line to Ground Fault
IfLGmaxpu2 = abs(3*Vf/((2*Zsysmaxpu)+(3*Ztn)));
IfLGmax2 = IfLGmaxpu2*Ibn;
SfLGmax2 = VBLLn*IfLGmax2/(1000000*math.sqrt(3));
#Minimum Power Generation
MZsysmin = (VBLL**2)/SMin; #System Impedance at Maximum Power Generation
Ib = SB3phi/(math.sqrt(3)*VBLL); #Base Current
Zsysminpu = MZsysmin*exp(1j*math.pi*90/180)/Zb; #System Impedance Phasor
#Three Phase Fault Current
If3phiminpu1 = abs(Vf/(Zsysminpu));
If3phimin1 = If3phiminpu1*Ib;
Sf3phimin1 = math.sqrt(3)*VBLL*If3phimin1/1000000;
#Line to Line Fault Current
IfLLmin1 = 0.866*If3phimin1;
SfLLmin1 = VBLL*IfLLmin1/1000000;
#Line to Ground Fault
IfLGminpu1 = abs(3*Vf/((2*Zsysminpu)));
IfLGmin1 = IfLGminpu1*Ib;
SfLGmin1 = VBLL*IfLGmin1/(1000000*math.sqrt(3));
Stn = SB3phi; #Numreical Value is Equal
Ztn = Zt*(Stn/St); #New Per Unit Transformer Reacmath.tance
#New Base Values
Zbn = (VBLLn**2)/SB3phi;
Ibn = Stn/(math.sqrt(3)*VBLLn);
#Three Phase Fault Current
If3phiminpu2 = abs(Vf/(Zsysminpu+Ztn));
If3phimin2 = If3phiminpu2*Ibn;
Sf3phimin2 = math.sqrt(3)*VBLLn*If3phimin2/1000000;
#Line to Line Fault Current
IfLLmin2 = 0.866*If3phimin2;
SfLLmin2 = VBLLn*IfLLmin2/1000000;
#Line to Ground Fault
IfLGminpu2 = abs(3*Vf/((2*Zsysminpu)+(3*Ztn)));
IfLGmin2 = IfLGminpu2*Ibn;
SfLGmin2 = VBLLn*IfLGmin2/(1000000*math.sqrt(3));
# Results
print 'a For Maximum Power Generation:'
print 'Bus 1'
print '3 phase fault current is %g A and %g MVA'%(If3phimax1,Sf3phimax1)
print 'Line to Line fault current is %g A and %g MVA'%(IfLLmax1,SfLLmax1)
print 'Line to ground fault current is %g A and %g MVA'%(IfLGmax1,SfLGmax1)
print 'Bus 2'
print '3 phase fault current is %g A and %g MVA'%(If3phimax2,Sf3phimax2)
print 'Line to Line fault current is %g A and %g MVA'%(IfLLmax2,SfLLmax2)
print 'Line to ground fault current is %g A and %g MVA'%(IfLGmax2,SfLGmax2)
print 'b For Minimum Power Generation:'
print 'Bus 1'
print '3 phase fault current is %g A and %g MVA'%(If3phimin1,Sf3phimin1)
print 'Line to Line fault current is %g A and %g MVA'%(IfLLmin1,SfLLmin1)
print 'Line to ground fault current is %g A and %g MVA'%(IfLGmin1,SfLGmin1)
print 'Bus 2'
print '3 phase fault current is %g A and %g MVA'%(If3phimin2,Sf3phimin2)
print 'Line to Line fault current is %g A and %g MVA'%(IfLLmin2,SfLLmin2)
print 'Line to ground fault current is %g A and %g MVA'%(IfLGmin2,SfLGmin2)
#Note that 0.00166666666 is not rounded as 0.0017
#Hence you find all the answers close by
```

In [6]:

```
import math
# Variables
#Percent Impedances of the substation transformer
Rtp = 1.;
Ztp = 7.;
Xtp = math.sqrt((Ztp**2)-(Rtp**2));
Ztpu = Rtp+(1j*Xtp); #Transformer Impedance
Vll = 12.47; #Line to Line voltage in kV
Vln = 7.2; #Line to Neutral Voltage
V = 240.; #Secondary Voltage
St = 7500.; #Rating of the transformer in kVA
Sts = 100.; #Rating of Secondary Transformer
Ztp = Ztpu*((Vll**2)*10/St);
SSC = complex(.466,0.0293);
#From Table 10-7
Z1 = 0.0870+(1j*0.1812);
Z0 = complex(0.1653,0.4878);
ZG = ((2*Z1)+Z0)/3; #Impedance to Ground
Zsys = 0 ; #Assumption Made
Zeq = Zsys+Ztp+ZG; #Equivalent Impedance of the Primary
PZ2 = Zeq*((V/(Vln*1000))**2); #Primary Impedance reffered to secondary
# Calculations
#Distribution Tranformer Parameters
Rts = 1;
Zts = 1.9;
Xts = math.sqrt((Zts**2)-(Rts**2));
Ztspu = complex(Rts,Xts);
Zts = Ztspu*((V/1000)**2)*10/Sts; #Distribution Transformer Reacmath.tance
Z1SL = (60./1000)*SSC; #Impedance for 60 feet
Zeq1 = PZ2+Zts+Z1SL; #Total Impedance to the fault in secondary
IfLL = V/abs(Zeq1); #Fault Current At the secondary fault point F
# Results
print 'a The Impedance of the substation in ohms',
print (Ztp)
print 'b The Positive And Zero Sequence Impedances in ohms',
print (Z1),
print (Z0)
print 'c The Line to Ground impedance in the primary system in ohms',
print (ZG)
print 'd The Total Impedance through the primary in ohms',
print (Zeq)
print 'e The Total Primary Impedance referred to the secondary in ohms',
print (PZ2)
print 'f The Distribution transformer impedance in ohms',
print (Zts)
print 'g the Impedance of the secondary cable in ohms',
print (Z1SL)
print 'h The Total Impedance to the fault in ohms',
print (Zeq1)
print 'i) The Single Phase line to line fault for the 120/240 V three-wire service in amperes is %g A'%(IfLL)
```