from numpy import sqrt
from __future__ import division
#Given Data :
Load=100 #in MW
V=380 #in KV
d=100 #in km
rho=0.045 #in ohm/cm**2/km
w=0.01 #in kg/cm**3
Eff=90 #in %
IL=Load*10**6/(sqrt(3)*V*10**3) #in Ampere
P_loss=Load*(100-Eff)/100 #in MW
P_loss=P_loss*10**6 #in Watt
P_loss=P_loss/3 #in watt/conductor
R_con=P_loss/IL**2 #in ohm/conductor
#R_con=R_con/d #in ohm/conductor/km
a=rho*d/R_con #in cm**2
vol=a*d #in cm**3
W_cu=vol*w #in Kg
W_cu*=100*10**3*3 # kg per 100 km
print "Weight of Cu for 3 conductors of 100 km length %0.f Kg" %W_cu
#Note : answer in the book is not accurate.
from numpy import sqrt
from __future__ import division
#Given Data :
R=2 #in ohm
X=6 #in ohm
P=10000*10**3 #in watts
cos_fir=0.8 #unitless
VR=22*10**3 #in volt
I=P/(sqrt(3)*VR*cos_fir) #in Ampere
VR_phase=VR/sqrt(3) #in volt
Vs=sqrt((VR_phase*cos_fir+I*R)**2+(VR_phase*sqrt(1-cos_fir**2)+I*X)**2)
print "Sending end voltage Vs(phase) %0.2f V" %Vs
R=((Vs-VR_phase)/VR_phase)*100 # %
print "Regulation = %0.2f %%" %R
# Ans in the textbook is not accurate.
from numpy import sqrt
from __future__ import division
#Given Data :
l=10*10**3 #in meter
P_del=4000 #in KVA
cos_fir=0.9 #unitless
VL=11*10**3 #in volt
R=0.2*10 #in ohm/phase/10km
X=0.3*10 #in ohm/phase/10km
I=P_del*10**3/(sqrt(3)*VL) #in Ampere
VR_phase=VL/sqrt(3) #in volt
Vs=sqrt((VR_phase*cos_fir+I*R)**2+(VR_phase*sqrt(1-cos_fir**2)+I*X)**2) # V
Vs*=sqrt(3)/1000 # kV
print "Sending end voltage Vs(line) %0.4f KV" %Vs
Reg=((Vs-VL/1000)/VL*1000)*100 # %
print "Regulation = %0.3f %%" %Reg
Losses3line=3*I**2*R #in watt
P_rec=P_del*cos_fir #in KW
Pin=P_rec+Losses3line/1000 #in KW
ETA=P_rec/Pin #unitless
ETA*=100 # %
print "Transmission Efficiency = %0.3f %%" %ETA
cos_fis=(VR_phase*cos_fir+I*R)/(Vs*1000/sqrt(3)) #unitless
print "Sending end PF = %0.4f lag" %cos_fis
from numpy import sqrt
from __future__ import division
#Given Data :
l=15*10**3 #in meter
Pt=10000 #in kW
cos_fir=0.8 #unitless
VL=33*10**3 #in volt
R=0.2*15 #in ohm/phase/15km
X=0.4*15 #in ohm/phase/15km
I=Pt*10**3/(sqrt(3)*VL*cos_fir) #in Ampere
VR_phase=VL/sqrt(3) #in volt
Vs=sqrt((VR_phase*cos_fir+I*R)**2+(VR_phase*sqrt(1-cos_fir**2)-I*X)**2)
Vs*=sqrt(3)/1000 #
print "Sending end voltage Vs(line) = %0.3f KV " %Vs
Vs=sqrt((VR_phase*cos_fir+I*R)**2+(VR_phase*sqrt(1-cos_fir**2)-I*X)**2)
cos_fis=(VR_phase*cos_fir+I*R)/Vs #unitless
print "Sending end PF = %0.4f leading " %cos_fis
Reg=((Vs-VR_phase)/VR_phase)*100 # %
print "Regulation = %0.3f %%" %Reg
from numpy import array, sqrt, roots, poly
import cmath
from sympy import symbols
VR=symbols('VR')
#Given Data :
Vs_line=33*10**3 #in volt
cos_fir=0.8 #unitless
P_KVA=6000 #in KVA
P_KW=P_KVA*cos_fir #in KW
cos_fir=0.8 #unitless
impedence=complex(2,6) #in ohm/phase
R=impedence.real #in ohm
X=impedence.imag #in ohm
Vs_phase=Vs_line/sqrt(3) #in volt
##
I=P_KVA*10**3/sqrt(3)/VR
Vs = VR+I*R*cos_fir+I*X*sin_fir
#polynomial p = [1 -Vs_phase P_KVA*10**3*R*cos_fir/sqrt(3)+P_KVA*10**3*X*sin_fir/sqrt(3)]
sin_fir=sqrt(1-cos_fir**2)
p=poly((1,-Vs_phase,P_KVA*R*cos_fir/sqrt(3)+P_KVA*X*sin_fir/sqrt(3)) )
VR=roots(p) # Calculating roots of the polynomial
VR=VR[1] #(root calculated using -ve sign is discarded in shreedharacharya method)
VR_line=VR*sqrt(3) #in volt
print "(i) Line voltage at receiving end = %0.2f KV" %(VR_line/1000)
Regulation=((Vs_line-VR_line)/VR_line)*100 #unitless
print "(ii) Regulation = %0.2f %%" %Regulation
I=P_KVA*10**3/(sqrt(3)*VR_line)
#I=P*10**3/(sqrt(3)*VR_line) #in Ampere
TotalLoss=3*I**2*R #in watt
Pout=P_KVA*cos_fir #in KW
Pin=Pout+TotalLoss/1000 #in KW
ETA=Pout/Pin #unitless
print "(iii) Transmission Efficiency = %0.2f %%" %(ETA*100)
#NOTE : Answer wrong : Accuracy efficiency in textbook'
from numpy import sqrt
from __future__ import division
#Given Data :
P_del=10000*10**3 #in Watts
cos_fir=0.8 #unitless
R=0.95 #in ohm/km
VR=132*10**3 #in volt
IL=P_del/(sqrt(3)*VR*cos_fir) #in Ampere
#TotalLosses=3*I**2*R and should be equal to (7.5/100)*P_del #in watt
l=(7.5/100)*P_del/(3*IL**2*R) #in km
print "Distance = %0.2f km " %l
from __future__ import division
from numpy import sqrt
#Given Data :
I=180 #in Ampere
cos_fir=0.8 #unitless
R=0.7 #in ohm/phase
X=1.2 #in ohm/phase
ETA=90 #in %
Pdev_BY_VR=3*I*cos_fir #in KW
Psending_BY_VR=Pdev_BY_VR/(ETA/100) #in kW
Losses=3*I**2*R #in watt
VR=Losses/(Psending_BY_VR-Pdev_BY_VR) #in volt
Vs=sqrt((VR*cos_fir+I*R)**2+(VR*sqrt(1-cos_fir**2)+I*X)**2)
print "Sending end voltage Vs(line) = %0.2f Volts" %(Vs*sqrt(3))
from __future__ import division
from numpy import log, sqrt, pi
#Given Data :
d=1*100 #in cm
dia=1 #in cm
r=dia/2 #in cm
Length=20 #in km
V=33 #in KV
P=10 #in MW
cosfi=0.8 #unitless
f=50 #in Hz
R=0.19 #in ohm/km/phase
#Part (i) :
L=2*10**-7*log(d/r) #in H/m
L20=L*Length*10**3 #in H
XL=2*pi*f*L20 #in ohm
R20=R*Length #in ohm
Z=sqrt(R20**2+XL**2) #in ohm
IR=P*10**3/(sqrt(3)*V*cosfi)
Losses=3*IR**2*R20 #in watt
ETA=P/(P+Losses/10**6) #unitless
print "(i) Efficiency of line = %0.2f %%" %(ETA*100)
#Part (ii) :
VR=V*1000/sqrt(3) #in volt
Vs=((VR*cosfi+IR*R20)+(VR*sqrt(1-cosfi**2)+IR*XL))
print "(ii) Regulation = %0.2f %% " %(((Vs-VR)/VR)*100)
#Note : Answer in the book is wrong. In second last line of the solution in the book 16079+12885 is taken as 20605 instead of 28964.
from __future__ import division
from numpy import sqrt
#Given Data :
R=2.5 #in ohm
X=4.33 #in ohm
I=120 #in Ampere
Vr=3300 #in volt
cos_fir=0.8 #unitless
Vs=Vr+I*R*cos_fir+I*X*sqrt(1-cos_fir**2) #in volt
print "Sending end voltage = %0.2f Volts" %Vs
from __future__ import division
from numpy import sqrt
#Given Data :
Pt=4000*10**3 #in watt(power to be transmitted)
VR=11000 #in volt
cos_fir=0.9 #unitless
R=1 #in ohm
X=2.5 #in ohm
I=Pt/VR #in Ampere
Vs=VR+I*R*cos_fir+I*X*sqrt(1-cos_fir**2) #in volt
print "(i) Sending end voltage = %0.2f Volts" %Vs
Reg=(Vs-VR)*100/VR #in %
print "(ii) Regulation = %0.3f %%" %Reg
cos_fis=(VR*cos_fir+I*R)/Vs #unitless
print "(iii) Sending end pf = %0.3f lag " %(cos_fis)
losses=I**2*R #in watts
Pr=Pt*cos_fir #in wats(Receiving end power)
Psend=Pr+losses #in watts
Eff=Pr*100/Psend #unitless
print "(iv) Transmission efficiency = %0.2f %%" %(Eff)
from numpy import sqrt
from __future__ import division
#Given Data :
L=20 #in Km(length of the line)
Pdev=3000*10**3 #in watt(power delivered)
cos_fir=0.8 #unitless
VR=11*1000 #in volt
R=0.15*L #in ohm
X=0.4*L #in ohm
I=Pdev/VR #in Ampere
Vs=VR+I*R*cos_fir-I*X*sqrt(1-cos_fir**2) #in volt
print "(i) Sending end voltage = %0.2f Volts" %Vs
Reg=(VR-Vs)*100/VR #in %
print "(ii) Regulation = %0.2f %% "%Reg
cos_fis=(VR*cos_fir+I*R)/Vs #unitless
print "(iii) Sending end pf = %0.3f lag" %cos_fis
losses=I**2*R #in watts
Pr=Pdev*cos_fir #in wats(Receiving end power)
Psend=Pr+losses #in watts
Eff=Pr*100/Psend #unitless
print "(iv) Transmission efficiency = %0.2f %%" %(Eff)
from numpy import sqrt
from __future__ import division
#Given Data :
R=2 #in ohm
X=3 #in ohm
VR=10*1000 #in volt
P=1000*10**3 #in watt(power delivered)
cos_fir=0.8 #unitless
I=P/(VR*cos_fir) #in Ampere
Vs=sqrt((VR*cos_fir+I*R)**2+(VR*sqrt(1-cos_fir**2)+I*X)**2) #in volt
Reg=(Vs-VR)*100/VR #in %
print "(i) Regulation = %0.2f %%" %Reg
losses=I**2*R #in watts
Pr=P*cos_fir #in wats(Receiving end power)
Psend=Pr+losses #in watts
Eff=Pr*100/Psend #unitless
print "(ii) Transmission efficiency = %0.2f %% " %(Eff)
from numpy import sqrt
from __future__ import division
#Given Data :
R=1.5 #in ohm
X=4 #in ohm
VR=11*1000 #in volt
VRphase=VR/sqrt(3) #in volt/phase
P=6000 #in KVA(power delivered)
cos_fir=0.8 #unitless
I=P*1000/(3*VRphase) #in Ampere
Vs=VRphase+cos_fir*I*R+sqrt(1-cos_fir**2)*I*X #in volt
Vs=Vs*sqrt(3) #in volt(not phase)
Reg=(Vs-VR)*100/VR #in %
print "(i) Regulation = %0.1f %%" %Reg
losses=3*I**2*R/1000 #in Kw
Pr=P*cos_fir #in wats(Receiving end power)
Psend=Pr+losses #in watts
Eff=Pr*100/Psend #unitless
print "Transmission efficiency = %0.1f %%" %Eff