# CHAPTER 3.4: UNSYMMETRICAL FAULTS IN POWER SYSTEMS¶

## Example 3.4.1, Page number 510-512¶

In :
import math
import cmath

#Variable declaration
MVA = 15.0    #Generator rating(MVA)
kV = 6.9      #Generator voltage(kV)
X_1 = 25.0    #Positive sequence reactance(%)
X_2 = 25.0    #Negative sequence reactance(%)
X_0 = 8.0     #Zero sequence reactance(%)
X = 6.0       #Reactor placed in line(%)

#Calculation
a = cmath.exp(1j*120.0*math.pi/180)                               #Operator
Z_1 = 1j*X_1/100                                                  #Positive sequence impedance(p.u)
Z_2 = 1j*X_2/100                                                  #Negative sequence impedance(p.u)
Z_g0 = 1j*X_0/100                                                 #Impedance(p.u)
Z = 1j*X/100                                                      #Impedance(p.u)
Z_0 = Z_g0+3*Z                                                    #Zero sequence impedance(p.u)
E_a = 1.0                                                         #Voltage(p.u)
E_b = a**2*E_a                                                    #Voltage(p.u)
#Case(a)
I_a0_a = 0                                                        #Current(A)
I_a1_a_pu = 1.0/(Z_1+Z_2)                                         #Current(p.u)
I_a1_a = I_a1_a_pu*MVA*1000/(3**0.5*kV)                           #Current(A)
I_a2_a = -I_a1_a                                                  #Current(A)
I_b0_a = 0                                                        #Current(A)
I_b1_a = a**2*I_a1_a                                              #Current(A)
I_b2_a = a*I_a2_a                                                 #Current(A)
I_a_a = I_a1_a+I_a2_a                                             #Line current(A)
I_b_a = I_b1_a+I_b2_a                                             #Line current(A)
I_c_a = -I_b_a                                                    #Line current(A)
I_g_a = 0                                                         #Ground wire current(A)
V_a_a = (E_a-I_a1_a*Z_1-I_a2_a*Z_2-I_a0_a*Z_0)*kV*1000/3**0.5     #Voltage(V)
V_b_a = (a**2*E_a+1j*3**0.5*I_a1_a_pu*Z_1)*kV*1000/3**0.5         #Voltage(V)
V_c_a = V_b_a                                                     #Voltage(V)
#Case(b)
I_a1_b_pu = E_a/(Z_1+(Z_2*Z_0/(Z_2+Z_0)))                         #Current(p.u)
I_a1_b = I_a1_b_pu*MVA*1000/(3**0.5*kV)                           #Current(A)
I_a2_b_pu = -Z_0*Z_2/(Z_2*(Z_0+Z_2))*I_a1_b_pu                    #Current(p.u)
I_a2_b = -Z_0*Z_2/(Z_2*(Z_0+Z_2))*I_a1_b                          #Current(A)
I_a0_b_pu = -Z_0*Z_2/(Z_0*(Z_0+Z_2))*I_a1_b_pu                    #Current(p.u)
I_a0_b = -Z_0*Z_2/(Z_0*(Z_0+Z_2))*I_a1_b                          #Current(A)
I_a_b = I_a0_b+I_a1_b+I_a2_b                                      #Line current(A)
I_b_b = I_a0_b+a**2*I_a1_b+a*I_a2_b                               #Line current(A)
I_c_b = I_a0_b+a*I_a1_b+a**2*I_a2_b                               #Line current(A)
I_0_b = 3*I_a0_b                                                  #Current in the ground resistor(A)
V_a_b_pu = E_a-I_a1_b_pu*Z_1-I_a2_b_pu*Z_2-I_a0_b_pu*Z_0          #Voltage(p.u)
V_a_b = abs(V_a_b_pu)*kV*1000/(3**0.5)                            #Voltage(V)
V_b_b = 0                                                         #Voltage(V)
V_c_b = 0                                                         #Voltage(V)

#Result
print('Case(a): Initial symmetrical rms line current when ground is not involved in fault, I_a = %.f A' %abs(I_a_a))
print('         Initial symmetrical rms line current when ground is not involved in fault, I_b = %.f A' %I_b_a.real)
print('         Initial symmetrical rms line current when ground is not involved in fault, I_c = %.f A' %I_c_a.real)
print('         Ground wire current = %.f A' %I_g_a)
print('         Line to neutral voltage, V_a = %.f V' %V_a_a.real)
print('         Line to neutral voltage, V_b = %.f V' %V_b_a.real)
print('         Line to neutral voltage, V_c = %.f V' %V_c_a.real)
print('Case(b): Initial symmetrical rms line current when fault is solidly grounded, I_a = %.f A' %abs(I_a_b))
print('         Initial symmetrical rms line current when fault is solidly grounded, I_b = (%.f+%.fj) A' %(I_b_b.real,I_b_b.imag))
print('         Initial symmetrical rms line current when fault is solidly grounded, I_c = (%.f+%.fj) A' %(I_c_b.real,I_c_b.imag))
print('         Ground wire current = %.fj A' %I_0_b.imag)
print('         Line to neutral voltage, V_a = %.f V' %V_a_b)
print('         Line to neutral voltage, V_b = %.f V' %V_b_b)
print('         Line to neutral voltage, V_c = %.f V' %V_c_b)
print('\nNOTE: Changes in the obtained answer from that of textbook is due to more precision here and approximation in textbook')

Case(a): Initial symmetrical rms line current when ground is not involved in fault, I_a = 0 A
Initial symmetrical rms line current when ground is not involved in fault, I_b = -4348 A
Initial symmetrical rms line current when ground is not involved in fault, I_c = 4348 A
Ground wire current = 0 A
Line to neutral voltage, V_a = 3984 V
Line to neutral voltage, V_b = -1992 V
Line to neutral voltage, V_c = -1992 V
Case(b): Initial symmetrical rms line current when fault is solidly grounded, I_a = 0 A
Initial symmetrical rms line current when fault is solidly grounded, I_b = (-4348+2445j) A
Initial symmetrical rms line current when fault is solidly grounded, I_c = (4348+2445j) A
Ground wire current = 4890j A
Line to neutral voltage, V_a = 4035 V
Line to neutral voltage, V_b = 0 V
Line to neutral voltage, V_c = 0 V

NOTE: Changes in the obtained answer from that of textbook is due to more precision here and approximation in textbook


## Example 3.4.2, Page number 512¶

In :
import math
import cmath

#Variable declaration
kVA = 10000.0     #Generator rating(kVA)
f = 50.0          #Frequency(Hz)
I_1 = 30.0        #Positive sequence current(%)
I_2 = 10.0        #Negative sequence current(%)
I_0 = 5.0         #Zero sequence current(%)
d = 1.0/100       #Diameter of conductor(m)
D = 5.0           #Triangular spacing(m)
kV = 30.0         #Generator voltage on open-circuit(kV)
l = 20.0          #Distance of line at short circuit occurance(km)

#Calculation
a = cmath.exp(1j*120.0*math.pi/180)                                #Operator
Z_g1 = kV**2*I_1*I_2/kVA                                           #Positive phase sequence reactance of generator(ohm)
Z_g2 = Z_g1*I_2/I_1                                                #Negative phase sequence reactance of generator(ohm)
Z_g0 = Z_g1*I_0/I_1                                                #Zero phase sequence reactance of generator(ohm)
r = d/2                                                            #Radius of conductor(m)
Z_l1 = 2.0*math.pi*f*(0.5+4.606*math.log10(D/r))*10**-7*l*1000     #Positive phase sequence reactance of line(ohm)
Z_l2 = 2.0*math.pi*f*(0.5+4.606*math.log10(D/r))*10**-7*l*1000     #Negative phase sequence reactance of line(ohm)
Z_1 = 1j*(Z_g1+Z_l1)                                               #Z1 upto the point of fault(ohm)
Z_2 = 1j*(Z_g2+Z_l2)                                               #Z2 upto the point of fault(ohm)
E_a = kV*1000/3**0.5                                               #Phase voltage(V)
I_a1 = E_a/(Z_1+Z_2)                                               #Positive sequence current in line a(A)
I_a2 = -I_a1                                                       #Negative sequence current in line a(A)
I_a0 = 0                                                           #Zero sequence current in line a(A)
I_b0 = 0                                                           #Zero sequence current in line b(A)
I_c0 = 0                                                           #Zero sequence current in line c(A)
I_a = I_a0+I_a1+I_a2                                               #Current in line a(A)
I_b = I_b0+a**2*I_a1+a*I_a2                                        #Current in line b(A)
I_c = I_c0+a*I_a1+a**2*I_a2                                        #Current in line c(A)

#Result
print('Current in line a, I_a = %.f A' %abs(I_a))
print('Current in line b, I_b = %.f A' %I_b.real)
print('Current in line c, I_c = %.f A' %I_c.real)

Current in line a, I_a = 0 A
Current in line b, I_b = -556 A
Current in line c, I_c = 556 A


## Example 3.4.3, Page number 512-513¶

In :
import math
import cmath

#Variable declaration
kVA = 10000.0                  #Alternator rating(kVA)
Z_g1 = complex(0.5,4.7)        #Positive sequence impedance(ohm/phase)
Z_g2 = complex(0.2,0.6)        #Negative sequence impedance(ohm/phase)
Z_g0 = complex(0,0.43)         #Zero sequence impedance(ohm/phase)
Z_l1 = complex(0.36,0.25)      #Impedance(ohm)
Z_l2 = complex(0.36,0.25)      #Impedance(ohm)
Z_l0 = complex(2.9,0.95)       #Impedance(ohm)
V = 6600.0                     #Voltage(V)

#Calculation
a = cmath.exp(1j*120.0*math.pi/180)                   #Operator
#Case(a)
E_a = V/3**0.5                                        #Phase voltage(V)
Z_1 = Z_g1+Z_l1                                       #Z1 upto the point of fault(ohm)
Z_2 = Z_g2+Z_l2                                       #Z2 upto the point of fault(ohm)
Z_0 = Z_g0+Z_l0                                       #Z0 upto the point of fault(ohm)
I_a = 3*E_a/(Z_1+Z_2+Z_0)                             #Fault current(A)
#Case(b)
I_a0 = abs(I_a)/3                                     #Zero sequence current of line a(A)
I_a1 = abs(I_a)/3                                     #Positive sequence current of line a(A)
I_a2 = abs(I_a)/3                                     #Negative sequence current of line a(A)
I_b0 = I_a0                                           #Zero sequence current of line b(A)
I_b1 = a**2*I_a1                                      #Positive sequence current of line b(A)
I_b2 = a*I_a2                                         #Negative sequence current of line b(A)
I_c0 = I_a0                                           #Zero sequence current of line c(A)
I_c1 = a*I_a1                                         #Positive sequence current of line c(A)
I_c2 = a**2*I_a2                                      #Negative sequence current of line c(A)
#Case(c)
V_b = E_a/(Z_1+Z_2+Z_0)*((a**2-a)*Z_2+(a**2-1)*Z_0)   #Voltage of the line b(V)
V_c = E_a/(Z_1+Z_2+Z_0)*((a-a**2)*Z_2+(a-1)*Z_0)      #Voltage of the line c(V)

#Result
print('Case(a): Fault current, |I_a| = %.f A' %abs(I_a))
print('Case(b): Zero sequence current of line a, I_a0 = %.f A' %I_a0)
print('         Positive sequence current of line a, I_a1 = %.f A' %I_a1)
print('         Negative sequence current of line a, I_a2 = %.f A' %I_a2)
print('         Zero sequence current of line b, I_b0 = %.f A' %I_b0)
print('         Positive sequence current of line b, I_b1 = (%.1f%.1fj) A' %(I_b1.real,I_b1.imag))
print('         Negative sequence current of line b, I_b2 = (%.1f+%.1fj) A' %(I_b2.real,I_b2.imag))
print('         Zero sequence current of line c, I_c0 = %.f A' %I_c0)
print('         Positive sequence current of line c, I_c1 = (%.1f+%.1fj) A' %(I_c1.real,I_c1.imag))
print('         Negative sequence current of line c, I_c2 = (%.1f%.1fj) A' %(I_c2.real,I_c2.imag))
print('Case(c): Voltage of the sound line to earth at fault, |V_b| = %.f V' %abs(V_b))
print('         Voltage of the sound line to earth at fault, |V_c| = %.f V' %abs(V_c))
print('\nNOTE: Changes in the obtained answer from that of textbook is due to more precision here')

Case(a): Fault current, |I_a| = 1364 A
Case(b): Zero sequence current of line a, I_a0 = 455 A
Positive sequence current of line a, I_a1 = 455 A
Negative sequence current of line a, I_a2 = 455 A
Zero sequence current of line b, I_b0 = 455 A
Positive sequence current of line b, I_b1 = (-227.4-393.8j) A
Negative sequence current of line b, I_b2 = (-227.4+393.8j) A
Zero sequence current of line c, I_c0 = 455 A
Positive sequence current of line c, I_c1 = (-227.4+393.8j) A
Negative sequence current of line c, I_c2 = (-227.4-393.8j) A
Case(c): Voltage of the sound line to earth at fault, |V_b| = 2638 V
Voltage of the sound line to earth at fault, |V_c| = 3255 V

NOTE: Changes in the obtained answer from that of textbook is due to more precision here


## Example 3.4.4, Page number 513-514¶

In :
import math
import cmath

#Variable declaration
V = 11000.0                    #Alternator voltage(V)
kVA = 50000.0                  #Alternator rating(kVA)
Z_l1 = complex(0.4,0.7)        #Positive sequence impedance of feeder(ohm)
Z_l2 = complex(0.4,0.7)        #Negative sequence impedance of feeder(ohm)
Z_l0 = complex(0.7,3.0)        #Zero sequence impedance of feeder(ohm)
Z_g1_A = complex(0,0.6)        #Positive sequence reactance(ohm)
Z_g1_B = complex(0,0.6)        #Positive sequence reactance(ohm)
Z_g2_A = complex(0,0.4)        #Negative sequence reactance(ohm)
Z_g2_B = complex(0,0.4)        #Negative sequence reactance(ohm)
Z_g0_A = complex(0,0.2)        #Zero sequence reactance(ohm)
Z_g0_B = complex(0,0.2)        #Zero sequence reactance(ohm)
Z_n_A = complex(0,0.2)         #Neutral reactance(ohm)
Z_n_B = complex(0,0.2)         #Neutra reactance(ohm)

#Calculation
a = cmath.exp(1j*120.0*math.pi/180)          #Operator
Z_g1 = 1.0/((1/Z_g1_A)+(1/Z_g1_B))           #Equivalent positive sequence impedance(ohm)
Z_g2 = 1.0/((1/Z_g2_A)+(1/Z_g2_B))           #Equivalent negative sequence impedance(ohm)
Z_g0 = 1.0/((1/Z_g0_A)+(1/Z_g0_B))           #Equivalent zero sequence impedance(ohm)
Z_n = 1.0/((1/Z_n_A)+(1/Z_n_B))              #Equivalent neutral impedance(ohm)
Z_1 = Z_l1+Z_g1                              #Positive sequence impedance(ohm)
Z_2 = Z_l2+Z_g2                              #Negative sequence impedance(ohm)
Z_0 = Z_l0+Z_g0+3*Z_n                        #Zero sequence impedance(ohm)
Z = Z_0*Z_2/(Z_0+Z_2)                        #Impedance(ohm)
E_R = V/3**0.5                               #Phase voltage(V)
I_R1 = E_R/(Z_1+Z)                           #Postive sequence current(A)
I_R2 = -Z*I_R1/Z_2                           #Negative sequence current(A)
I_R0 = -Z*I_R1/Z_0                           #Zero sequence current(A)
I_R = I_R0+I_R1+I_R2                         #Fault current in line(A)
I_Y = I_R0+a**2*I_R1+a*I_R2                  #Fault current in line(A)
I_B = I_R0+a*I_R1+a**2*I_R2                  #Fault current in line(A)
I_earth = 3.0*I_R0                           #Current through earth reactance(A)
V_neutral = abs(I_earth*Z_n)                 #Magnitude of potential above earth attained by generator neutral(V)

#Result
print('Fault current in the line R, I_R = %.f A' %abs(I_R))
print('Fault current in the line Y, I_Y = (%.f%.fj) A' %(I_Y.real,I_Y.imag))
print('Fault current in the line B, I_B = (%.f+%.fj) A' %(I_B.real,I_B.imag))
print('Potential above earth attained by the alternator neutrals = %.f V' %V_neutral)
print('\nNOTE: ERROR: Voltage is 11000 not 11000 kV as given in textbook statement')
print('      Changes in the obtained answer from that of textbook is due to more precision here')

Fault current in the line R, I_R = 0 A
Fault current in the line Y, I_Y = (-5128-933j) A
Fault current in the line B, I_B = (4654+3172j) A
Potential above earth attained by the alternator neutrals = 229 V

NOTE: ERROR: Voltage is 11000 not 11000 kV as given in textbook statement
Changes in the obtained answer from that of textbook is due to more precision here


## Example 3.4.5, Page number 514-515¶

In :
import math
import cmath

#Variable declaration
V = 6600.0             #Alternator voltage(V)
kVA = 10000.0          #Alternator rating(kVA)
x_1 = 15.0             #Reactance to positive sequence current(%)
x_2 = 75.0             #Reactance to negative sequence current(%)
x_0 = 30.0             #Reactance to zero sequence current(%)
R_earth = 0.3          #Earth resistance(ohm)

#Calculation
a = cmath.exp(1j*120.0*math.pi/180)     #Operator
E_g = V/3**0.5                          #Phase voltage(V)
#Case(a)
I = kVA*1000/(3**0.5*V)                 #Full load current of each alternator(A)
X = x_1*V/(100*3**0.5*I)                #Positive sequence reactance(ohm)
Z_g1 = 1j*X                             #Equivalent positive sequence impedance(ohm)
Z_g2 = Z_g1*x_2/100                     #Equivalent negative sequence impedance(ohm)
Z_g0 = Z_g1*x_0/100                     #Equivalent zero sequence impedance(ohm)
Z_1 = Z_g1/3                            #Positive sequence impedance(ohm)
Z_2 = Z_g2/3                            #Negative sequence impedance(ohm)
Z_0 = Z_g0/3                            #Zero sequence impedance(ohm)
I_a_a = 3*E_g/(Z_1+Z_2+Z_0)             #Fault current(A)
#Case(b)
Z_0_b = Z_g0                            #Impedance(ohm)
I_a_b = 3*E_g/(Z_1+Z_2+Z_0_b)           #Fault current(A)
#Case(c)
Z_0_c = R_earth*3+Z_g0                  #Impedance(ohm)
I_a_c = 3*E_g/(Z_1+Z_2+Z_0_c)           #Fault current(A)

#Result
print('Case(a): Fault current if all the alternator neutrals are solidly earthed, I_a = %.fj A' %I_a_a.imag)
print('Case(b): Fault current if only one of the alternator neutrals is solidly earthed & others isolated, I_b = %.fj A' %I_a_b.imag)
print('Case(c): Fault current if one of alternator neutrals is earthed through resistance & others isolated, I_c = %.f A' %abs(I_a_c))
print('\nNOTE: Changes in the obtained answer from that of textbook is due to more precision here')

Case(a): Fault current if all the alternator neutrals are solidly earthed, I_a = -25603j A
Case(b): Fault current if only one of the alternator neutrals is solidly earthed & others isolated, I_b = -19806j A
Case(c): Fault current if one of alternator neutrals is earthed through resistance & others isolated, I_c = 10692 A

NOTE: Changes in the obtained answer from that of textbook is due to more precision here


## Example 3.4.6, Page number 515-516¶

In :
import math
import cmath

#Variable declaration
kVA_G = 2000.0          #Generator rating(kVA)
X_G = 10.0              #Generator reactance(%)
kVA_T1 = 2000.0         #Transformer rating(kVA)
lv_T1 = 6.6             #LV side voltage(kV)
hv_T1 = 11.0            #HV side voltage(kV)
X_T1 = 5.0              #Transformer reactance(%)
X_cable = 0.5           #Cable reactance(ohm)
V_cable = 11.0          #Cable voltage(V)
kVA_T2 = 2000.0         #Transformer rating(kVA)
lv_T2 = 6.6             #LV side voltage(kV)
hv_T2 = 11.0            #HV side voltage(kV)
X_T2 = 5.0              #Transformer reactance(%)

#Calculation
a = cmath.exp(1j*120.0*math.pi/180)          #Operator
kVA_base = 2000.0                            #Base kVA
kV = 6.6                                     #Base voltage(kV)
X_1 = X_G*kV**2*10/kVA_base                  #10% reactance at 6.6 kV(ohm)
X_2 = X_T1*kV**2*10/kVA_base                 #5% reactance at 6.6 kV(ohm)
X_3 = (kV/hv_T1)**2*X_cable                  #0.5 ohm at 11kV when referred to 6.6kV(ohm)
Z_g1 = 1j*X_1                                #Positive sequence impedance of generator(ohm)
Z_g2 = Z_g1*0.7                              #Negative sequence impedance of generator equal to 70% of +ve sequence impedance(ohm)
T1_Z_T1_1 = 1j*X_2                           #Positive sequence impedance of transformer(ohm)
T1_Z_T1_2 = 1j*X_2                           #Negative sequence impedance of transformer(ohm)
Z_C1 = 1j*X_3                                #Positive sequence impedance of cable(ohm)
Z_C2 = 1j*X_3                                #Negative sequence impedance of cable(ohm)
T2_Z_T2_1 = 1j*X_2                           #Positive sequence impedance of transformer(ohm)
T2_Z_T2_2 = 1j*X_2                           #Negative sequence impedance of transformer(ohm)
Z_1 = Z_g1+T1_Z_T1_1+Z_C1+T2_Z_T2_1          #Positive sequence impedance(ohm)
Z_2 = Z_g2+T1_Z_T1_2+Z_C2+T2_Z_T2_2          #Negative sequence impedance(ohm)
Z_0 = 1j*X_2                                 #Zero sequence impedance(ohm)
E_a = kV*1000/3**0.5                         #Phase voltage(V)
#Case(a)
I_a1 = E_a/(Z_1+Z_2)                         #Positive sequence current(A)
I_a2 = -I_a1                                 #Negative sequence current(A)
I_a0 = 0                                     #Zero sequence current(A)
I_a = I_a1+I_a2+I_a0                         #Fault current in line a(A)
I_b = (a**2-a)*I_a1                          #Fault current in line b(A)
I_c = -I_b                                   #Fault current in line c(A)
#Case(b)
I_a_b = 3*E_a/(Z_1+Z_2+Z_0)                  #Fault current for line to ground fault(A)

#Result
print('Case(a): Fault current for line fault are')
print('         I_a = %.f A' %abs(I_a))
print('         I_b = %.f A' %abs(I_b))
print('         I_c = %.f A' %abs(I_c))
print('Case(b): Fault current for line to ground fault, |I_a| = %.f A' %abs(I_a_b))
print('\nNOTE: Changes in the obtained answer from that of textbook is due to more precision here')

Case(a): Fault current for line fault are
I_a = 0 A
I_b = 784 A
I_c = 784 A
Case(b): Fault current for line to ground fault, |I_a| = 1202 A

NOTE: Changes in the obtained answer from that of textbook is due to more precision here


## Example 3.4.7, Page number 516-518¶

In :
#Variable declaration
MVA_G1 = 40.0      #Generator rating(MVA)
kV_G1 = 13.2       #Generator voltage(kV)
X_st_G1 = 0.15     #Sub-transient reactance(p.u)
X_2_G1 = 0.15      #Negative sequence reactance(p.u)
X_0_G1 = 0.08      #Zero sequence reactance(p.u)
MVA_G3 = 60.0      #Generator rating(MVA)
kV_G3 = 13.8       #Generator voltage(kV)
X_st_G3 = 0.20     #Sub-transient reactance(p.u)
X_2_G3 = 0.20      #Negative sequence reactance(p.u)
X_0_G3 = 0.08      #Zero sequence reactance(p.u)
MVA_T1 = 40.0      #Transformer rating(MVA)
kV_lv_T1 = 13.8    #Transformer low voltage(kV)
kV_hv_T1 = 138     #Transformer high voltage(kV)
X_1_T1 = 0.10      #Positive sequence reactance(p.u)
X_2_T1 = 0.10      #Negative sequence reactance(p.u)
X_0_T1 = 0.08      #Zero sequence reactance(p.u)
MVA_T5 = 30.0      #Transformer rating(MVA)
kV_lv_T5 = 13.8    #Transformer low voltage(kV)
kV_hv_T5 = 138     #Transformer high voltage(kV)
X_1_T5 = 0.10      #Positive sequence reactance(p.u)
X_2_T5 = 0.10      #Negative sequence reactance(p.u)
X_0_T5 = 0.08      #Zero sequence reactance(p.u)
X_neutral = 0.05   #Reactance of reactor connected to generator neutral(p.u)

#Calculation
MVA_base = 100.0                                                  #Base MVA
kV_line = 138.0                                                   #Base voltage for line(kV)
kV_G = 13.8                                                       #Base voltage for generator(kV)
X_st_G1_pu = 1j*X_st_G1*(kV_G1/kV_G)**2*MVA_base/MVA_G1           #Impedance of G1 & G2(p.u)
X_2_G1_pu = 1j*X_2_G1*(kV_G1/kV_G)**2*MVA_base/MVA_G1             #Impedance of G1 & G2(p.u)
X_g0_G1_pu = 1j*X_0_G1*(kV_G1/kV_G)**2*MVA_base/MVA_G1            #Impedance of G1 & G2(p.u)
X_gn_G1_pu = 1j*X_neutral*(kV_G1/kV_G)**2*MVA_base/MVA_G1         #Impedance of G1 & G2(p.u)
X_st_G3_pu = 1j*X_st_G3*(kV_G3/kV_G)**2*MVA_base/MVA_G3           #Impedance of G3(p.u)
X_2_G3_pu = 1j*X_2_G3*(kV_G3/kV_G)**2*MVA_base/MVA_G3             #Impedance of G3(p.u)
X_g0_G3_pu = 1j*X_0_G3*(kV_G3/kV_G)**2*MVA_base/MVA_G3            #Impedance of G3(p.u)
X_gn_G3_pu = 1j*X_neutral*(kV_G3/kV_G)**2*MVA_base/MVA_G3         #Impedance of G3(p.u)
X_1_T1_pu = 1j*X_1_T1*MVA_base/MVA_T1                             #Impedance of T1,T2,T3 & T4(p.u)
X_2_T1_pu = 1j*X_2_T1*MVA_base/MVA_T1                             #Impedance of T1,T2,T3 & T4(p.u)
X_0_T1_pu = 1j*X_0_T1*MVA_base/MVA_T1                             #Impedance of T1,T2,T3 & T4(p.u)
X_1_T5_pu = 1j*X_1_T5*MVA_base/MVA_T5                             #Impedance of T5 & T6(p.u)
X_2_T5_pu = 1j*X_2_T5*MVA_base/MVA_T5                             #Impedance of T5 & T6(p.u)
X_0_T5_pu = 1j*X_0_T5*MVA_base/MVA_T5                             #Impedance of T5 & T6(p.u)
X_1_line_20 = 1j*20.0*100/kV_line**2                              #Impedance of 20 ohm line(p.u)
X_2_line_20 = 1j*20.0*100/kV_line**2                              #Impedance of 20 ohm line(p.u)
X_0_line_20 = 3.0*X_1_line_20                                     #Impedance of 20 ohm line(p.u)
X_1_line_10 = 1j*10.0*100/kV_line**2                              #Impedance of 10 ohm line(p.u)
X_2_line_10 = 1j*10.0*100/kV_line**2                              #Impedance of 10 ohm line(p.u)
X_0_line_10 = 3.0*X_1_line_10                                     #Impedance of 10 ohm line(p.u)
#Positive,negative and zero sequence network
Z_1_1 = X_1_T1_pu+X_1_T1_pu+X_1_line_20                           #Impedance(p.u)
Z_2_1 = X_1_T1_pu+X_1_T5_pu+X_1_line_10                           #Impedance(p.u)
Z_3_1 = X_1_T1_pu+X_1_T5_pu+X_1_line_10                           #Impedance(p.u)
Z_4_1 = Z_1_1*Z_2_1/(Z_1_1+Z_2_1+Z_3_1)                           #Impedance after star-delta transformation(p.u)
Z_5_1 = Z_3_1*Z_1_1/(Z_1_1+Z_2_1+Z_3_1)                           #Impedance after star-delta transformation(p.u)
Z_6_1 = Z_3_1*Z_2_1/(Z_1_1+Z_2_1+Z_3_1)                           #Impedance after star-delta transformation(p.u)
Z_7_1 = X_st_G1_pu+Z_4_1                                          #Impedance(p.u)
Z_8_1 = X_st_G1_pu+Z_5_1                                          #Impedance(p.u)
Z_9_1 = Z_7_1*Z_8_1/(Z_7_1+Z_8_1)                                 #Impedance in parallel(p.u). Refer Fig E4.14(e) & E4.14(f)
Z_10_1 = Z_9_1+Z_6_1                                              #Impedance(p.u). Refer Fig E4.14(f) & E4.14(g)
Z_11_1 = Z_10_1*X_st_G3_pu/(Z_10_1+X_st_G3_pu)                    #Impedance in parallel(p.u). Refer Fig E4.14(g) & E4.14(h)
Z_1 = Z_11_1                                                      #Positive sequence impedance(p.u)
Z_2 = Z_1                                                         #Negative sequence impedance(p.u)
Z_0 = X_g0_G3_pu+3.0*X_gn_G3_pu                                   #Zero sequence impedance(p.u)
E_g = 1.0                                                         #Voltage(p.u)
I_f_pu = 3*E_g/(Z_1+Z_2+Z_0)                                      #L-G fault current(p.u)
I_f = abs(I_f_pu)*MVA_base*1000/(3**0.5*kV_G)                     #Actual fault current(A)
MVA_fault = abs(I_f_pu)*MVA_base                                  #Fault MVA

#Result
print('Fault current for a L-G fault at C = %.f A' %I_f)
print('\nNOTE: Changes in the obtained answer from that of textbook is due to more precision here')

Fault current for a L-G fault at C = 16093 A

NOTE: Changes in the obtained answer from that of textbook is due to more precision here


## Example 3.4.8, Page number 518-519¶

In :
#Variable declaration
kV_G = 11.0               #Generator rating(kV)
X_1_G = 1j*0.1            #Positive sequence reactance of generator(p.u)
X_2_G = 1j*0.1            #Negative sequence reactance of generator(p.u)
X_0_G = 1j*0.02           #Zero sequence reactance of generator(p.u)
Z = 1.0                   #Earthing resistor(ohm)
X_1_T1 = 1j*0.1           #Positive sequence reactance of 2-winding transformer(p.u)
X_2_T1 = 1j*0.1           #Negative sequence reactance of 2-winding transformer(p.u)
X_0_T1 = 1j*0.1           #Zero sequence reactanc of 2-winding transformere(p.u)
X_1_T2_hv = 1j*0.05       #Positive sequence reactance of hv 3-winding transformer(p.u)
X_2_T2_hv = 1j*0.05       #Negative sequence reactance of hv 3-winding transformer(p.u)
X_0_T2_hv = 1j*0.05       #Zero sequence reactanc of hv 3-winding transformere(p.u)
X_1_T2_lv_1 = 1j*0.02     #Positive sequence reactance of lv 3-winding transformer(p.u)
X_2_T2_lv_1 = 1j*0.02     #Negative sequence reactance of lv 3-winding transformer(p.u)
X_0_T2_lv_1 = 1j*0.02     #Zero sequence reactanc of lv 3-winding transformere(p.u)
X_1_T2_lv_2 = 1j*0.05     #Positive sequence reactance of lv 3-winding transformer(p.u)
X_2_T2_lv_2 = 1j*0.05     #Negative sequence reactance of lv 3-winding transformer(p.u)
X_0_T2_lv_2 = 1j*0.05     #Zero sequence reactanc of lv 3-winding transformere(p.u)

#Calculation
MVA_b = 10.0                                                                             #Base MVA
kV_b = 11.0                                                                              #Base voltage(kV)
Z_n = Z*MVA_b/kV_b**2                                                                    #Impedance(p.u)
Z_1 = X_1_G+X_1_T1+X_1_T2_hv+((X_1_T2_lv_1*X_1_T2_lv_2)/(X_1_T2_lv_1+X_1_T2_lv_2))       #Positive sequence impedance(p.u)
Z_2 = X_2_G+X_2_T1+X_2_T2_hv+((X_2_T2_lv_1*X_2_T2_lv_2)/(X_2_T2_lv_1+X_2_T2_lv_2))       #Negative sequence impedance(p.u)
Z_0 = ((X_0_T1+X_0_T2_hv)*X_0_T2_lv_2/(X_0_T1+X_0_T2_hv+X_0_T2_lv_2))+X_0_T2_lv_1+3*Z_n  #Zero sequence impedance(p.u)
E = 1.0                                                                                  #Voltage(p.u)
I_f_pu = 3*E/(Z_1+Z_2+Z_0)                                                               #Fault current(p.u)
I_f = MVA_b*1000*abs(I_f_pu)/(3**0.5*kV_b)                                               #Fault current(A)

#Result
print('Fault current, I_f = %.f A' %I_f)
print('\nNOTE: Changes in the obtained answer from that of textbook is due to more precision here')

Fault current, I_f = 2474 A

NOTE: Changes in the obtained answer from that of textbook is due to more precision here


## Example 3.4.9, Page number 519¶

In :
#Variable declaration
MVA_G = 10.0      #Generator rating(MVA)
kV_G = 11.0       #Generator rating(kV)
X_1_G = 27.0      #Positive sequence reactance of generator(p.u)
X_2_G = 9.0       #Negative sequence reactance of generator(p.u)
X_0_G = 4.5       #Zero sequence reactance of generator(p.u)
X_1_L = 9.0       #Positive sequence reactance of line upto fault(p.u)
X_2_L = 9.0       #Negative sequence reactance of line upto fault(p.u)
X_0_L = 0         #Zero sequence reactance of line upto fault(p.u)

#Calculation
E_a = kV_G*1000/3**0.5          #Phase voltage(V)
Z_1 = 1j*(X_1_G+X_1_L)          #Positive sequence reactance(p.u)
Z_2 = 1j*(X_2_G+X_2_L)          #Negative sequence reactance(p.u)
I_b = 1j*3**0.5*E_a/(Z_1+Z_2)   #Fault current in line b(p.u)
I_c = -I_b                      #Fault current in line c(p.u)

#Result
print('Fault current in line b, I_b = %.f A' %abs(I_b))
print('Fault current in line c, I_c = %.f A' %I_c.real)

Fault current in line b, I_b = 204 A
Fault current in line c, I_c = -204 A


## Example 3.4.10, Page number 519-520¶

In :
import math
import cmath

#Variable declaration
MVA_A = 30.0        #Alternator rating(MVA)
kV_A = 11.0         #Alternator rating(kV)
X_1 = 2.5           #Reactance to positive sequence current(ohm)
X_2 = 0.8*X_1       #Reactance to negative sequence current(ohm)
X_0 = 0.3*X_1       #Reactance to zero sequence current(ohm)

#Calculation
#Case(a)
a = cmath.exp(1j*120.0*math.pi/180)       #Operator
Z_1 = 1j*X_1                              #Positive sequence impedance(ohm)
Z_2 = 1j*X_2                              #Negative sequence impedance(ohm)
Z_0 = 1j*X_0                              #Zero sequence impedance(ohm)
Z_02 = Z_0*Z_2/(Z_0+Z_2)                  #Impedance(ohm)
E_a = kV_A*1000/3**0.5                    #Phase voltage(V)
I_a1 = E_a/(Z_1+Z_02)                     #Positive sequence current(A)
I_a2 = -Z_0/(Z_0+Z_2)*I_a1                #Negative sequence current(A)
I_a0 = -Z_2/(Z_0+Z_2)*I_a1                #Zero sequence current(A)
I_0 = I_a0                                #Zero sequence current(A)
I_a = I_a0+I_a1+I_a2                      #Line current(A)
I_b = I_0+a**2*I_a1+a*I_a2                #Line current(A)
I_c = I_0+a*I_a1+a**2*I_a2                #Line current(A)
#Case(b)
I_n = 3*abs(I_0)                          #Current through ground(A)
#Case(c)
V_a2 = Z_02*I_a1                          #Negative sequence voltage(V)
V_a = 3*abs(V_a2)                         #Voltage of healthy phase to neutral(V)

#Result
print('Case(a): Currents in the faulted phase are')
print('         I_a = %.f A' %abs(I_a))
print('         I_b = %.f∠%.1f° A' %(abs(I_b),cmath.phase(I_b)*180/math.pi))
print('         I_c = %.f∠%.1f° A' %(abs(I_c),cmath.phase(I_c)*180/math.pi))
print('Case(b): Current through ground, I_n = %.f A' %I_n)
print('Case(c): Voltage of healthy phase to neutral, V_a = %.f V' %V_a)
print('\nNOTE: Changes in the obtained answer from that of textbook is due to more precision here')

Case(a): Currents in the faulted phase are
I_a = 0 A
I_b = 3234∠135.3° A
I_c = 3234∠44.7° A
Case(b): Current through ground, I_n = 4550 A
Case(c): Voltage of healthy phase to neutral, V_a = 3412 V

NOTE: Changes in the obtained answer from that of textbook is due to more precision here


## Example 3.4.11, Page number 520-521¶

In :
import math
import cmath

#Variable declaration
n = 6.0       #Number of alternator
kV_A = 6.6    #Alternator rating(kV)
X_1 = 0.9     #Positive sequence reactance(ohm)
X_2 = 0.72    #Negative sequence reactance(ohm)
X_0 = 0.3     #Zero sequence reactance(ohm)
Z_n = 0.2     #Resistance of grounding resistor(ohm)

#Calculation
E_a = kV_A*1000/3**0.5               #Phase voltage(V)
#Case(a)
Z_1_a = 1j*X_1/n                     #Positive sequence impedance when alternators are in parallel(ohm)
Z_2_a = 1j*X_2/n                     #Negative sequence impedance when alternators are in parallel(ohm)
Z_0_a = 1j*X_0/n                     #Zero sequence impedance when alternators are in parallel(ohm)
I_a_a = 3*E_a/(Z_1_a+Z_2_a+Z_0_a)    #Fault current assuming 'a' phase to be fault(A)
#Case(b)
Z_0_b = 3*Z_n+1j*X_0                 #Zero sequence impedance(ohm)
I_a_b = 3*E_a/(Z_1_a+Z_2_a+Z_0_b)    #Fault current(A)
#Case(c)
Z_0_c = 1j*X_0                       #Zero sequence impedance(ohm)
I_a_c = 3*E_a/(Z_1_a+Z_2_a+Z_0_c)    #Fault current(A)

#Result
print('Case(a): Fault current if all alternator neutrals are solidly grounded, I_a = %.f A' %I_a_a.imag)
print('Case(b): Fault current if one alternator neutral is grounded & others isolated, I_a = %.1f∠%.1f° A' %(abs(I_a_b),cmath.phase(I_a_b)*180/math.pi))
print('Case(c): Fault current if one alternator neutral is solidly grounded & others isolated, I_a = %.2fj A' %I_a_c.imag)
print('\nNOTE: ERROR: Calculation mistakes in the textbook solution')

Case(a): Fault current if all alternator neutrals are solidly grounded, I_a = -35724 A
Case(b): Fault current if one alternator neutral is grounded & others isolated, I_a = 13813.1∠-43.5° A
Case(c): Fault current if one alternator neutral is solidly grounded & others isolated, I_a = -20055.33j A

NOTE: ERROR: Calculation mistakes in the textbook solution


## Example 3.4.12, Page number 521-522¶

In :
import math
import cmath

#Variable declaration
MVA_A = 30.0        #Alternator rating(MVA)
kV_A = 6.6          #Alternator rating(kV)
X_G = 10.0          #Reactance of alternator(%)
kV_lv_T = 6.6       #Transformer lv side rating(kV)
kV_hv_T = 33.0      #Transformer hv side rating(kV)
X_T = 6.0           #Reactance of transformer(%)
kV_line = 33.0      #Transmission line voltage(kV)
X_line = 4.0        #Transmission line reactance(ohm)
X_g2 = 70.0         #Negative sequence reactance is 70% of +ve sequence reactance of generator(%)

#Calculation
MVA_base = 30.0                          #Base MVA
kV_base = 6.6                            #Base kV
Z_base = kV_base**2/MVA_base             #Base impedance(ohm)
Z_g1 = 1j*Z_base*X_G/100                 #Positive sequence impedance of alternator(ohm)
Z_T1 = 1j*Z_base*X_T/100                 #Positive sequence impedance of transformer(ohm)
Z_L1 = 1j*(kV_base/kV_line)**2*X_line    #Positive sequence impedance of transmission line(ohm)
Z_g2 = X_g2/100*Z_g1                     #Negative sequence impedance of alternator(ohm)
Z_T2 = 1j*Z_base*X_T/100                 #Negative sequence impedance of transformer(ohm)
Z_T0 = 1j*Z_base*X_T/100                 #Zero sequence impedance of transformer(ohm)
Z_L2 = Z_L1                              #Negative sequence impedance of transmission line(ohm)
Z_1 = Z_g1+Z_T1+Z_L1+Z_T1                #Positive sequence impedance(ohm)
Z_2 = Z_g2+Z_T2+Z_L2+Z_T2                #Negative sequence impedance(ohm)
Z_0 = Z_T0                               #Zero sequence impedance(ohm)
E_a = kV_base*1000/3**0.5                #Base voltage(V)
#Case(a)
I_sc = E_a/Z_1                           #Fault current if all 3 phases short circuited(A)
#Case(b)
I_a = 3*E_a/(Z_1+Z_2+Z_0)                #Fault current if single line is grounded assuming 'a' to be grounded(A)
#Case(c)
I_b = 1j*3**0.5*E_a/(Z_1+Z_2)            #Fault current for a short circuit between two lines(A)
I_c = -1j*3**0.5*E_a/(Z_1+Z_2)           #Fault current for a short circuit between two lines(A)

#Result
print('Case(a): Fault current if all 3 phases short circuited, I_sc = %.f∠%.f° A' %(abs(I_sc),cmath.phase(I_sc)*180/math.pi))
print('Case(b): Fault current if single line is grounded, I_a = %.fj A' %I_a.imag)
print('Case(c): Fault current for a short circuit between two lines, I_b = %.f A' %I_b.real)
print('         Fault current for a short circuit between two lines, I_c = %.f A' %I_c.real)
print('\nNOTE: ERROR: Calculation mistake in Z_2 in the textbook solution. Hence, changes in the obtained answer from that of textbook')

Case(a): Fault current if all 3 phases short circuited, I_sc = 7948∠-90° A
Case(b): Fault current if single line is grounded, I_a = -11404j A
Case(c): Fault current for a short circuit between two lines, I_b = 7211 A
Fault current for a short circuit between two lines, I_c = -7211 A

NOTE: ERROR: Calculation mistake in Z_2 in the textbook solution. Hence, changes in the obtained answer from that of textbook


## Example 3.4.13, Page number 522¶

In :
import math
import cmath

#Variable declaration
kV = 6.9          #Alternator rating(kV)
MVA = 10.0        #Alternator rating(MVA)
X_st = 0.15       #Sub-transient reactance(p.u)
X_2 = 0.15        #Negative sequence reactance(p.u)
X_0 = 0.05        #Zero sequence reactance(p.u)
X = 0.397         #Grounding reactor(ohm)

#Calculation
MVA_base = 10.0                         #Base MVA
kV_base = 6.9                           #Base kV
Z_base = kV_base**2/MVA_base            #Base impedance(ohm)
Z_n = X/Z_base                          #Grounding reactor(p.u)
Z_1 = 1j*X_st                           #Positive sequence impedance(p.u)
Z_2 = 1j*X_2                            #Negative sequence impedance(p.u)
Z_0 = 1j*(X_0+3*Z_n)                    #Zero sequence impedance(p.u)
E_a = 1.0                               #Phase voltage(p.u)
I_a_pu = 3*E_a/(Z_1+Z_2+Z_0)            #Sub-transient current in the faulty phase(p.u)
I_base = kV_base*1000/(3**0.5*Z_base)   #Base current(A)
I_a = abs(I_a_pu)*I_base                #Sub-transient current in the faulty phase(A)

#Result
print('Sub-transient current in the faulty phase, I_a = %.f A' %I_a)
print('\nNOTE: Changes in the obtained answer from that of textbook is due to more precision here')

Sub-transient current in the faulty phase, I_a = 4183 A

NOTE: Changes in the obtained answer from that of textbook is due to more precision here


## Example 3.4.14, Page number 522-523¶

In :
import math
import cmath

#Variable declaration
kVA = 10000.0    #Generator rating(kVA)
kV = 13.8        #Generator rating(kV)
X_st = 10.0      #Sub-transient reactance(%)
X_2 = 10.0       #Negative sequence reactance(%)
X_0 = 5.0        #Zero sequence reactance(%)
X = 8.0          #Grounding reactor(%)
X_con = 6.0      #Reactance of reactor connecting generator & transformer(%)

#Calculation
a = cmath.exp(1j*120.0*math.pi/180)    #Operator
Z_1 = 1j*(X_st+X_con)/100              #Positive sequence impedance(p.u)
Z_2 = 1j*(X_2+X_con)/100               #Negative sequence impedance(p.u)
Z_0 = 1j*X_con/100                     #Zero sequence impedance(p.u)
E_a = 1.0                              #Phase voltage(p.u)
I_a1 = E_a/(Z_1+Z_2+Z_0)               #Sub-transient current in the faulty phase(p.u)
I_A1 = 1j*I_a1                         #Positive sequence current(p.u)
I_A2 = -1j*I_a1                        #Negative sequence current(p.u)
I_A = I_A1+I_A2                        #Initial symmetrical r.m.s current in phase a(p.u)
I_B1 = a**2*I_A1                       #Positive sequence current(p.u)
I_B2 = a*I_A2                          #Negative sequence current(p.u)
I_B = I_B1+I_B2                        #Initial symmetrical r.m.s current in phase b(p.u)
I_C1 = a*I_A1                          #Positive sequence current(p.u)
I_C2 = a**2*I_A2                       #Negative sequence current(p.u)
I_C = I_C1+I_C2                        #Initial symmetrical r.m.s current in phase c(p.u)
I_base = kVA/(3**0.5*kV)               #Base current(A)
I_A_amp = I_A*I_base                   #Initial symmetrical r.m.s current in phase a(p.u)
I_B_amp = I_B*I_base                   #Initial symmetrical r.m.s current in phase b(p.u)
I_C_amp = I_C*I_base                   #Initial symmetrical r.m.s current in phase c(p.u)

#Result
print('Initial symmetrical r.m.s current in all phases of generator are,')
print(' I_A = %.f A' %abs(I_A_amp))
print(' I_B = %.f∠%.f° A' %(abs(I_B_amp),cmath.phase(I_B_amp)*180/math.pi))
print(' I_C = %.f∠%.f° A' %(abs(I_C_amp),cmath.phase(I_C_amp)*180/math.pi))

Initial symmetrical r.m.s current in all phases of generator are,
I_A = 0 A
I_B = 1907∠-90° A
I_C = 1907∠90° A