TMS = 0.5 #Time multiplier setting
I_f = 5000.0 #Fault current(A)
CT = 500.0/5 #CT ratio
set_plug = 1.0 #Relay plug set
I_relay = 5.0 #Rated relay current(A)
PSM = I_f/(CT*set_plug*I_relay) #Plug setting multiplier
T1 = 1.0 #Time of operation for obtained PSM & TMS of 1 from graph.Refer Fig 14.22
T2 = TMS*3/T1 #Time of operation(sec)
print('Operating time of the relay = %.1f sec' %T2)
I_f_A = 6000.0 #3-phase fault current of substation A(A)
I_f_B = 5000.0 #3-phase fault current of substation B(A)
I_f_C = 3000.0 #3-phase fault current of substation C(A)
I_f_D = 2000.0 #3-phase fault current of substation D(A)
I_L_max = 100.0 #Maximum load cuurent(A)
T = 0.5 #Operating time of breakers(sec)
import math
import cmath
I_set = 1.0 #Setting current(A)
I_L_maxD = I_L_max #Maximum load current at D(A)
CT_D = I_L_max/1 #CT ratio
PSM_D = I_f_D/(CT_D*I_set) #Plug setting multiplier
TMS_D = 0.1 #Time multiplier setting
T_D = 0.14*TMS_D/(PSM_D**0.02-1) #Time of operation(sec)
I_L_maxC = I_L_max+I_L_maxD #Maximum load current at C(A)
CT_C = I_L_maxC/1 #CT ratio
PSM_C = I_f_C/(CT_C*I_set) #Plug setting multiplier
T_C = T_D+T #Minimum time of operation(sec)
TMS_C = T_C*(PSM_C**0.02-1)/0.14 #Time multiplier setting
I_L_maxB = I_L_max+I_L_maxC #Maximum load current at B(A)
CT_B = I_L_maxB/1 #CT ratio
PSM_B = I_f_B/(CT_B*I_set) #Plug setting multiplier
T_B = T_C+T #Minimum time of operation(sec)
TMS_B = T_B*(PSM_B**0.02-1)/0.14 #Time multiplier setting
I_L_maxA = I_L_max+I_L_maxB #Maximum load current at A(A)
CT_A = I_L_maxA/1 #CT ratio
PSM_A = I_f_A/(CT_A*I_set) #Plug setting multiplier
T_A = T_B+T #Minimum time of operation(sec)
TMS_A = T_A*(PSM_A**0.02-1)/0.14 #Time multiplier setting
print('Relay A :')
print('CT ratio = %.f/1' %CT_A)
print('PSM of R_A = %.1f' %PSM_A)
print('TMS of R_A = %.1f sec' %TMS_A)
print('\nRelay B :')
print('CT ratio = %.f/1' %CT_B)
print('PSM of R_B = %.2f' %PSM_B)
print('TMS of R_B = %.1f sec' %TMS_B)
print('\nRelay C :')
print('CT ratio = %.f/1' %CT_C)
print('PSM of R_C = %.1f' %PSM_C)
print('TMS of R_C = %.1f sec' %TMS_C)
print('\nRelay D :')
print('CT ratio = %.f/1' %CT_D)
print('PSM of R_D = %.1f' %PSM_D)
print('TMS of R_D = %.2f sec' %TMS_D)
kv_hv = 66.0 #Voltage rating of HV side of transformer(kV)
kv_lv = 11.0 #Voltage rating of LV side of transformer(kV)
CT = 300.0/5 #CT ratio on low tension side
I = 300.0 #Assumed current flowing at low tension side(A)
I_HT = kv_lv/kv_hv*I #Line current on HT side(A)
I_LT_CT = I/CT #Pilot wire current from LT side(A)
CT_ratio_HT = I_HT*3**0.5/I_LT_CT #Ratio of CT on HT side
print('Ratio of CT on high tension side = %.fâ3/%.f' %(I_HT,I_LT_CT))
kv = 11.0 #Voltage rating(kV)
MVA = 5.0 #MVA rating
R = 10.0 #Resistance(ohm)
per_a = 0.15 #Armature winding reactance
per_trip = 0.3 #Relay trip for out-of-balance
x_p = per_a*kv**2/MVA #Winding Reactance(ohm)
V = kv/3**0.5*1000 #Phase voltage(V)
I = per_trip*MVA*1000/(3**0.5*kv) #Out of balance current(A)
p = (((R*I)**2/(V**2-(x_p*I)**2))**0.5)*100 #Percentage of winding remains unsupported
print('Percentage of winding that remains unprotected , p = %.1f percentage' %p)