import math
#initialisation of variables
D = 20.0 #in ft
f = 60.0 #in Hz
#From Table A.1 and A.3
d = 0.642 #in inches
X_a = 0.1074e6 #in ohm-mi
X_d = 0.0889e6 #in ohm-mi
#finding radius
r = d/(2*12) #divided by 12 convert in to ft
#Calculations
print('Calculations using conductor spacing and radius')
X_c = 1.779 * math.log(D/r)/f
B_c = 1 / X_c
print(" Capactive reatance = %.4fe6 ohm mi to neutral " %X_c)
print(" Capactive susceptance = %.4fe-6 mho/mi to neutral " %B_c)
#calculations using capacitive reactance at 1-ft spacing and spacing factor
print('Calculations using capacitive reactance at 1-ft spacing and spacing factor')
X_c1 = X_a + X_d
print(" Capactive reatance = %.4fe6 ohm mi per conductor " %(X_c1/10**6))
X_c11 = 2 * X_c1
B_c1 = 1 / X_c11
#Results
print(" Line-to-line capactive reatance = %.4fe6 ohm mi " %(X_c11/10**6))
print(" Line-to-line capactive susceptance = %.4fe-6 mho mi " %(B_c1*10**6))
import math
#initialisation of variables
D_12 = 20.0 #in ft
D_23 = D_12
D_31 = 38.0 #in ft
f = 60.0 #in Hz
V = 220e3 #in volts
l = 175 #in mi
k = 8.85e-12 #permittivity in F/m
#From tables A.1 and A.3
d = 1.108#in inches
X_a1 = 0.0912e6#in ohm mi
X_d1 = 0.0952e6#in ohm mi
#Calculations
r = d / ( 2 * 12)#division by 12 to convert in to ft
D_eq = (D_12*D_23*D_31)**(1.0/3)
C_n = (2*math.pi*k)/math.log(D_eq/r)
X_c = 1.0/(2*math.pi*f*C_n*1609) #division by 1609 to convert to ohm mi
print(" Capacitance = %.4fe-12 F/m " %(C_n*1e12))
print(" Capacitive reactance = %.4fe6 ohm mi " %(X_c/1e6))
#Calculations From tables
X_c1 = X_a1 + X_d1
print('Using capacitive reactance at 1-ft spacing and spacing factor')
print(" Capacitive reactance = %.4fe6 ohm mi " %(X_c1/1e6))
X_c_l = X_c1/l #Capacitive reactance for 175mi
I_chg = 2*math.pi*f*V*C_n*1609/math.sqrt(3.0)
I_chg_l = I_chg * l
Q =math.sqrt(3)*V*I_chg_l
#Results
print('For a lenght of 175mi')
print(" Capacitive reactance = %.4f ohm to neutral " %X_c_l)
print(" Charging current per mile = %.3f A/mi " %I_chg)
print('For a lenght of 175mi')
print(" Charging current = %.0f A " %I_chg_l)
print(" Total charging megavolt-amperes = %.1f Mvar " %(Q/1e6))
import math
#initialisation of variables
d = 0.45 #in m
k = 8.85e-12 #in F/m
D_ab = 8 #in m
D_bc = D_ab
D_ca = 16 #in m
f = 60 #in Hz
#From tables
D = 1.382 #in inches
#Calculations
r = D*0.3048/(2.0*12) #divison by 12 to convert in to ft
#multiplication by 0.3048 to convert ft to m
D_b_sC = math.sqrt( r * d)
D_eq = (D_ab * D_bc * D_ca)**(1/3)
C_m = 2* math.pi*k/math.log(D_eq / D_b_sC)
X_c = 1e-3/(2*math.pi*f*C_m) #1e-3 #to convert m to km
#Results
print(" Capacitance = %.3fe-12 F/m " %(C_m * 1e12))
print(" Capacitive reactance = %.4fe6 ohm km per phase to neutral" %(X_c/1e6))
import math
#initialisation of variables
f = 60.0 #in Hz
k = 8.85e-12 #in F/m
D_eq = 16.1 #in ft
D_a_a1 = 26.9
D_b_b1 = 21.0
D_c_c1 = D_a_a1 #in ft
#From Table A.1
d = 0.680#in inches
#calculations
r = d /(2*12)
D_p_sC = (math.sqrt(D_a_a1 * r) * math.sqrt(D_b_b1 * r) * math.sqrt(D_c_c1 * r))**(1.0/3)
C_n = 2 * math.pi * k / math.log(D_eq / D_p_sC)
B_c = 2 * math.pi * f * C_n * 1609.0 #1609 to convert from m to mi
#Results
print("printprint Capacitance = %.3fe-12 F/m printprint" %(C_n*1e12))
print("printprint Capacitive susceptance = %.2fe-6 mho per mi per phase to neutral" %(B_c*1e6))