import cmath
#Variable declaration
d = 30.0/10 #Diameter of conductor(cm)
delta = 0.95 #Air density factor
m = 0.95 #Irregularity factor
E = 230.0 #Line voltage(kV)
g_0 = 30.0/2**0.5 #Breakdown strength of air(kV/cm)
#Calculation
E_0 = E/3**0.5 #Disruptive critical voltage(kV)
r = d/2.0 #Radius of conductor(cm)
D = cmath.exp(E_0/(m*delta*g_0*r))*r/100 #Minimum spacing between conductors(m)
#Result
print('Minimum spacing between conductors, D = %.3f m' %abs(D))
print('\nNOTE: Changes in obtained answer from that of textbook due to precision')
import math
#Variable declaration
V = 220.0 #Operating line voltage(kV)
f = 50.0 #Frequency(Hz)
d = 1.5 #Diameter of conductor(cm)
D = 300.0 #Distance b/w conductor(cm)
delta = 1.05 #Air density factor
g_0 = 21.1 #Breakdown strength of air(kV/cm)
m = 1.0 #Irregularity factor
#Calculation
E = V/3**0.5 #Phase voltage(kV)
r = d/2.0 #Radius of conductor(cm)
E_0 = m*g_0*delta*r*math.log(D/r) #Disruptive critical voltage to neutral(kV/phase)
E_0_ll = 3**0.5*E_0 #Line-to-line Disruptive critical voltage(kV)
P = 244.0*10**-5*(f+25)/delta*(r/D)**0.5*(E-E_0)**2 #Corona loss(kW/km/phase)
P_total = P*3.0 #Corona loss(kW/km)
#Result
print('Critical disruptive voltage, E_0 = %.2f kV/phase = %.2f kV (line-to-line)' %(E_0,E_0_ll))
print('Corona loss, P = %.2f kW/km' %P_total)
print('\nNOTE: ERROR: Calculation mistake in the final answer in textbook')
import math
#Variable declaration
V = 132.0 #Operating line voltage(kV)
f = 50.0 #Frequency(Hz)
d = 1.17 #Diameter of conductor(cm)
D = 300.0 #Distance b/w conductor(cm)
m = 0.96 #Irregularity factor
b = 72.0 #Barometric pressure(cm)
t = 20.0 #Temperature(°C)
#Calculation
delta = 3.92*b/(273.0+t) #Air density factor
r = d/2.0 #Radius of conductor(cm)
E_0 = 21.1*m*delta*r*math.log(D/r) #Critical disruptive voltage for fair weather condition(kV/phase)
E_0_foul = 0.8*E_0 #Critical disruptive voltage for foul weather(kV/phase)
E = V/3**0.5 #Phase voltage(kV)
P_fair = 244.0*10**-5*(f+25)/delta*(r/D)**0.5*(E-E_0)**2 #Corona loss for fair weather condition(kW/km/phase)
P_foul = 244.0*10**-5*(f+25)/delta*(r/D)**0.5*(E-E_0_foul)**2 #Corona loss for foul weather condition(kW/km/phase)
#Result
print('Corona loss in fair weather, P = %.3f kW/km/phase' %P_fair)
print('Corona loss in foul weather, P = %.3f kW/km/phase' %P_foul)
import math
#Variable declaration
V = 110.0 #Operating line voltage(kV)
f = 50.0 #Frequency(Hz)
l = 175.0 #Line length(km)
d = 1.0 #Diameter of conductor(cm)
D = 300.0 #Distance b/w conductor(cm)
t = 26.0 #Temperature(°C)
b = 74.0 #Barometric pressure(cm)
m = 0.85 #Irregularity factor
m_v_local = 0.72 #Roughness factor for local corona
m_v_gen = 0.82 #Roughness factor for general corona
#Calculation
delta = 3.92*b/(273.0+t) #Air density factor
r = d/2.0 #Radius of conductor(cm)
E_0 = 21.1*m*delta*r*math.log(D/r) #Critical disruptive voltage(kV) rms
E_v_local = 21.1*m_v_local*delta*r*(1+(0.3/(delta*r)**0.5))*math.log(D/r) #Critical disruptive voltage for local corona(kV) rms
E_v_gen = 21.1*m_v_gen*delta*r*(1+(0.3/(delta*r)**0.5))*math.log(D/r) #Critical disruptive voltage for general corona(kV) rms
E = V/3**0.5 #Phase voltage(kV)
#Case(i)
P_c_i = 244.0*10**-5*(f+25)/delta*(r/D)**0.5*(E-E_0)**2 #Peek's formula for fair weather condition(kW/km/phase)
P_c_i_total = P_c_i*l*3 #Total power loss(kW)
#Case(ii)
P_c_ii = 244.0*10**-5*(f+25)/delta*(r/D)**0.5*(E-0.8*E_0)**2 #Peek's formula for stormy condition(kW/km/phase)
P_c_ii_total = P_c_ii*l*3 #Total power loss(kW)
#Case(iii)
F_iii = 0.0713 #From text depending on E/E_0
P_c_iii = 21.0*10**-6*f*E**2*F_iii/(math.log10(D/r))**2 #Peterson's formula for fair condition(kW/km/phase)
P_c_iii_total = P_c_iii*l*3 #Total power loss(kW)
#Case(iv)
F_iv = 0.3945 #From text depending on E/E_0
P_c_iv = 21.0*10**-6*f*E**2*F_iv/(math.log10(D/r))**2 #Peterson's formula for stormy condition(kW/km/phase)
P_c_iv_total = P_c_iv*l*3 #Total power loss(kW)
#Result
print('Case(i) : Power loss due to corona using Peek formula for fair weather condition, P_c = %.3f kW/km/phase' %P_c_i)
print(' Total corona loss in fair weather condition using Peek formula = %.1f kW' %P_c_i_total)
print('Case(ii) : Power loss due to corona using Peek formula for stormy weather condition, P_c = %.2f kW/km/phase' %P_c_ii)
print(' Total corona loss in stormy condition using Peek formula = %.f kW' %P_c_ii_total)
print('Case(iii): Power loss due to corona using Peterson formula for fair weather condition, P_c = %.4f kW/km/phase' %P_c_iii)
print(' Total corona loss in fair condition using Peterson formula = %.2f kW' %P_c_iii_total)
print('Case(iii): Power loss due to corona using Peterson formula for fair weather condition, P_c = %.4f kW/km/phase' %P_c_iv)
print(' Total corona loss in stormy condition using Peterson formula = %.1f kW' %P_c_iv_total)
print('\nNOTE: ERROR: Calculation mistake in the final answer in textbook')
import cmath
#Variable declaration
V = 132.0 #Operating line voltage(kV)
f = 50.0 #Frequency(Hz)
dia = 1.956 #Diameter of conductor(cm)
v_c = 210.0 #Disrputive voltage(kV)
g_0 = 30.0/2**0.5 #Breakdown strength of air(kV/cm)
#Calculation
r = dia/2.0 #Radius of conductor(cm)
V_c = v_c/3**0.5 #Disrputive voltage/phase(kV)
m_0 = 1.0 #Irregularity factor
delta = 1.0 #Air density factor
d = cmath.exp(V_c/(m_0*delta*g_0*r))*r #Spacing between conductors(cm)
#Result
print('Spacing between the conductors, d = %.f cm' %abs(d))
print('\nNOTE: Changes in the obtained answer from that of textbook is due to precision')
#Variable declaration
P_c1 = 53.0 #Total corona loss(kW)
V_1 = 106.0 #Operating line voltage(kV)
P_c2 = 98.0 #Total corona loss(kW)
V_2 = 110.9 #Operating line voltage(kV)
V_3 = 113.0 #Operating line voltage(kV)
#Calculation
E_1 = V_1/3**0.5 #Phase voltage(kV)
E_2 = V_2/3**0.5 #Phase voltage(kV)
P_ratio = (P_c2/P_c1)**0.5
E_0 = (P_ratio*E_1-E_2)/(P_ratio-1) #Disruptive critical voltage(kV)
E_3 = V_3/3**0.5 #Phase voltage(kV)
W = ((E_3-E_0)/(E_1-E_0))**2*P_c1 #Corona loss at 113 kV(kW)
#Result
print('Disruptive critical voltage, E_0 = %.f kV' %E_0)
print('Corona loss at 113 kV, W = %.f kW' %W)
import math
#Variable declaration
d = 3.0 #Diameter of conductor(cm)
e_r = 4.0 #Relative permittivity
d_1 = 3.5 #Internal diameter of porcelain bushing(cm)
d_2 = 9.0 #External diameter of porcelain bushing(cm)
V = 25.0 #Voltage b/w conductor and clamp(kV)
#Calculation
r = d/2.0 #Radius of conductor(cm)
r_1 = d_1/2.0 #Internal radius of porcelain bushing(cm)
r_2 = d_2/2.0 #External radius of porcelain bushing(cm)
g_2max = r/(e_r*r_1) #Maximum gradient of inner side of porcelain
g_1max = V/(r*math.log(r_1/r)+g_2max*r_1*math.log(r_2/r_1)) #Maximum gradient on surface of conductor(kV/cm)
#Result
print('Maximum gradient on surface of conductor, g_1max = %.2f kV/cm' %g_1max)
print('Since, gradient exceeds 21.1 kV/cm, corona will be present')
import math
#Variable declaration
d = 2.0 #Diameter of conductor(cm)
D = 150.0 #Spacing b/w conductor(cm)
delta = 1.0 #Air density factor
#Calculation
r = d/2.0 #Radius of conductor(cm)
V_d = 21.1*delta*r*math.log(D/r) #Disruptive critical voltage(kV/phase)
V_d_ll = 3**0.5*V_d #Line voltage for commencing of corona(kV)
#Result
print('Line voltage for commencing of corona = %.2f kV' %V_d_ll)
print('\nNOTE: Solution is incomplete in textbook')