#Calculate breakdown voltage
#(a)Based on equation 4.13
p = 101.3 # kPa
Ep = 2400.4/0.027
E = p*Ep
d = 1*10**-3 # 1 mm
Vs1 = E*d
print"Part (a): based on equation 4.13"
print"Breakdown voltage = %.2f V or %.2f kV"%(Vs1,round(Vs1*10**-3))
#(b)Corrsponding to an avelanche size of 10**8
p = 101.3 # kPa
Cp = Ep*0.027*p
Vs2 = (18.42 + (Cp*10**-3))/0.027
print"\n Part (b):Corrsponding to an avelanche size of 10**8"
print"Breakdown voltage = %.2f V or %.2f kV"%(Vs2,round(Vs2*10**-3,1))
#(b)According to criteria expressed by Equations 5.4 and 5.5
p = 101.3 # kPa
Vs3a = 9.4
Vs3b = 9.2
print"\n Part (c):According to criteria expressed by Equations 5.4 and 5.5"
print"Breakdown voltage = %.2f kV or %.2f kV"%(Vs3a,Vs3b)
#Answer may vary due to round off error
#Calculate breakdown voltage at atm pressure 3 and 5
#(a)Based on equation 5.14
p = 101.3 # kPa
Ep = 2400.4/0.027
E = p*Ep
d = 1*10**-3 # 1 mm
Vs13 = E*d*3 # at 3 atm
Vs15 = E*d*5 # at 5 atm
print"Part (a): based on equation 5.14"
print"Breakdown voltage = %.3f kV or %.3f kV"%(Vs13*10**-3,round(Vs15*10**-3,2))
#(b)According to eqution 5.13
p = 101.3 # kPa
Cp3 = Ep*0.027*p*3 # at 3 atm
Vs23 = (18.42 + (Cp3*10**-3))/0.027
Cp5 = Ep*0.027*p*5 # at 5 atm
Vs25 = (18.42 + (Cp5*10**-3))/0.027
print"\n Part (b):According to eqution 5.13"
print"Breakdown voltage = %.3f V or %.3f kV"%(Vs23*10**-3,round(Vs25*10**-3,2))
#(b)According to criteria expressed by Equations 5.4 and 5.5
p = 101.3 # kPa
Vs3a = 27.73 # at 3 atm
Vs3b = 45.5 # at 5 atm
print"\n Part (c):According to criteria expressed by Equations 5.4 and 5.5"
print"Breakdown voltage = %.3f kV or %.3f kV"%(round(Vs3a,1),round(Vs3b,1))
#Answer may vary due to round off error
#Calculate corona onset voltage
s = 4 # cm
r = 1 # cm
D = 5*10**2 # cm
dt = 1
E0 = 30*dt*(1 + 0.3*(dt*r)**0.5)
print"E0 = kVpeak/cm",E0
#using equations (5.18), the positive and negative corona
En = 27.501 # kVpeak/cm
#part a
Vp1 = 6.2*E0
Vn1 = 6.2*En
print"\n Part (a)"
print"The postive corona = %.2f kVpeak"%Vp1
print"The negative corona = %.2f kV"%round(Vn1)
#part b
Vp2 = 8.32*E0
Vn2 = 8.32*En
print"\n Part (b)"
print"The postive corona = %.2f kVpeak"%Vp2
print"The negative corona = %.2f kV"%round(Vn2,1)
#part c
Vp3 = 9.97*E0
Vn3 = 9.97*En
print"\n Part (c)"
print"The postive corona = %.2f kVpeak"%Vp3
print"The negative corona = %.2f kV"%round(Vn3,1)
#part d
Vp4 = 11.79*E0
Vn4 = 11.79*En
print"\n Part (d)"
print"The postive corona = %.2f kVpeak"%Vp4
print"The negative corona = %.2f kV"%round(Vn4,1)
#part e
Vp5 = 12.16*E0
Vn5 = 12.16*En
print"\n Part (d)"
print"The postive corona = %.2f kVpeak"%Vp5
print"The negative corona = %.2f kV"%round(Vn5,1)
#Answer CONSIDERABLY vary due to round off error.
#Calculate corona onset voltage
from math import log
t = 5*5*8.66 # the three side of the trangle in m
Deq = 6.004626#nthroot(t,3)
dt = 1 #delta = 1 at standard temperature and pressure
r = 1 #radius of the conductor
En = 27.501 # kVpeak/cm
E0 = 30*dt*(1. + 0.3*(dt*r)**0.5)
V0peak = E0*log(Deq*10**2)
V0 = En*log(Deq*10**2)
print"Mean geometric distance between the conductors %d m"%Deq
print"E0 = %d kVpeak/cm"%E0
print"V0peak = %.1f kVpeak"%V0peak
print"V0 = %.2f kV"%round(V0,1)
#Answers may vary due to round off error
#Calculate corona power loss
from math import log
p = 75. # pressure
t = 35. # temprature
m1 = 0.92
m2 = 0.95
Deq = 6.004626 #nthroot(t,3)
dt = (3.92*p)/(273+t) #Relative air density
E0 = 30.*dt*(1. + 0.3*(dt)**0.5)*m1*m2
En = 27.501 # kVpeak/cm
Vph = (275.*10**3)/3**0.5
V0peak = E0*log(Deq*10**2)
V0 = En*log(Deq*10**2)
V0ratio = 275./V0
print"Reative air density = %.3f"%dt
print"Corona onset field = %.3f kVpeak/cm"%E0
print"V0peak = %f kVpeak"%V0peak
print"V0 = %f kV"%V0
print"Ration of V0 = %.3f "%V0ratio
K = 0.05 # K factor
Pc = (3.73*K*50*Vph**2)/(Deq*10**2)**2
Cc = Pc*10**3/Vph
print"Corona power loss Pc = %.3f kW/km"%(Pc*10**-5)
print"Corona current = %.3f mA/Km"%round(Cc*10**-2,1)
#Answer vary due to round off error
#Some of the answers provided in the textbook are wrong
#Calculate corona onset voltage and effective corona envelope
from math import log
#(a) corona onset voltage
r = 3.175 # cm
h = 13 # m
m= 0.9 # m1 and m2
dt = 1 # Relative air density
E0 = 30*dt*(1 + 0.3/(r)**0.5)*m*m
V0 = 20*r*log(2*h*10**2/r)
print"E0 = %.1f kVpeak/cm or 20 kV/cm"%E0
print"V0 = %.0f kV"%V0
print"V0 (line to line) = %.1f kV"%round(V0*(3)**0.5,1)
#(b)Corona envelope at 2.5 p.u
V = 2.5*525 # line to line voltage * 2.5
print"Voltage (line to line) = %.1f kV"%V
#Solving the equations in trail and error method
print"Envelope radius = 5 cm"
# Answers may vary due to round off error.