import math
#initialisation of variables
L=2*(10**-7)*math.log(100/.75) #inductance per unit length
C=2*math.pi*(10**-9)/(36*math.pi*math.log(100.0/0.75)) #Capacitance per phase per unit length (F/m)
Z1=math.sqrt(L/C)
E=11000.0
#Calculations
print("(i)the natural impedence of line=%.0f ohms" %Z1)
Il=E/(math.sqrt(3)*Z1) #line current(amps)
print("(ii)line current =%.1f amps" %Il)
R=1000.0
Z2=R
E1=2*Z2*E/((Z1+Z2)*math.sqrt(3))
Pr=3*E1*E1/(R*1000) #Rate of power consumption
Vr=(Z2-Z1)*E/(math.sqrt(3)*(Z2+Z1)*1000) #Reflected voltage
Er=3*Vr*Vr*1000/Z1 #rate of reflected voltage
print("(iii)rate of energy absorption =%.1f kW" %Pr)
print("rate of reflected energy =%.1f kW" %Er)
print("(iv)Terminating resistance should be equal to surge impedence of line =%.0f ohms" %Z1)
L=.5*(10**-8)
C=10**-12
Z=math.sqrt(L/C) # surge impedence
VR=2*Z*11/((Z1+Z)*math.sqrt(3))
Vrl=(Z-Z1)*11/((Z1+Z)*math.sqrt(3))
PR1=3*VR*VR*1000/(Z)
d=Vrl
Prl=3*d*d*1000.0/Z1
#Results
print("(v)Refracted power =%.1f kW" %PR1)
print("Reflected power =%.1f kW" %Prl)
##Answer don't match exactly due to difference in rounding off of digits i between calculations
import math
#initialisation of variables
Xlc=0.3*(10**-3) # inductance of cable(H)
Xcc=0.4*(10**-6) # capacitance of cable (F)
Xlo=1.5*(10**-3) #inductance of overhead line(H)
Xco=.012*(10**-6) # capacitance of overhead line (F)
#Calculations
Znc=math.sqrt((Xlc/Xcc))
Znl=math.sqrt((Xlo/Xco))
#Results
print("Natural impedence of cable=%.2f ohms " %Znc)
print("Natural impedence of overhead line=%.1f ohms " %Znl)
E=2*Znl*15/(353+27)
print("voltage rise at the junction due to surge =%.2f kV " %E)
import math
#initialisation of variables
Z1=600.0
Z2=800.0
Z3=200.0
E=100.0
#Calculations
E1=2*E/(Z1*((1/Z1)+(1/Z2)+(1/Z3)))
Iz2=E1*1000.0/Z2
Iz3=E1*1000.0/Z3
#Results
print("Transmitted voltage =%.2f kV " %E1)
print("The transmitted current in line Z2=%.2f amps " %Iz2)
print("The transmitted current in line Z3=%.1f amps " %Iz3)
#Answer don't match exactly due to difference in rounding off of digits i between calculations
import math
#initialisation of variables
Z=350.0 #surge impedencr (ohms)
#Calculations
C=3000.0*(10**-12) # earth capacitance(F)
t=2.0*(10**-6)
E=500.0
E1=2*E*(1-math.exp((-1*t/(Z*C))))
#Results
print("the maximum value of transmitted voltage=%.2f kV " %E1)
import math
#initialisation of variables
Z=350.0 #surge impedencr (ohms)
L=800*(10**-6)
t=2*(10**-6)
E=500.0
#Calculations
E1=E*(1-math.exp((-1*t*2*Z/L)))
#Results
print("The maximum value of transmitted voltage=%.1f kV " %E1)
import math
#initialisation of variables
eo=50.0
x=50.0
R=6.0
Z=400.0
G=0
v=3*(10**5)
e=2.68
#Calculations
e1=(eo*(e**((-1/2)*R*x/Z)))
# answess does not match due to the difference in rounding off of digits.
print("(i)the value of the Voltage wave when it has travelled through a distance 50 Km=%.1f kV " %e1)
Pl=e1*e1*1000.0/400
io=eo*1000.0/Z
t=x/v
H=-(50*125*400*((e**-0.75)-1))/(6.0*3*10**5)
#Results
print("(ii)Power loss=%.3fkW \n heat loss=%.3f kJ" %(Pl,H))