from __future__ import division
import cmath
#Given data :
l=1 #in km
I=100 #in Ampere
cosfi=0.8 #Power factor(lag) unitless
VC=200 #in volt
IL=60 #in Ampere
cosfi_load=0.9 #Power factor(lag) unitless
R=0.6 #in ohm
XL=0.08 #in ohm
IC=I*complex(0.8,-0.6) #in Ampere
z=complex(0.06,0.08)/2 #in ohm
VD_BC=z*IC #in volt
VB=VC+VD_BC #in volt
IB=IL*complex(0.9,-0.4357)+IC #in Ampere
VD_AB=z*IB #in volt
VD_AB=round(VD_AB.real,2)+round(VD_AB.imag,2)*1J
print "V.D. from sending end to mid point =" ,VD_AB,"Volt"
print "V.D. from mid point to the far end =",VD_BC,"Volt"
from __future__ import division
from sympy import symbols
#Given data :
l=500 #in meter
i=1 #in Ampere/meter
IL1=200;IL2=150;IL3=50;IL4=100 #in Ampere
l1=100;l2=200;l3=300;l4=400 #in meter
r=0.1 #in ohm/km
Vd=250 #in volt
I=symbols('I')
Drop_AC=100*(r/10**3)*(I-i*l1/2)
Drop_CD=I
Drop_DE=100*r*(I-550)-I*100/2
Drop_EF=100*r*(I-700-I*100/2)
Drop_FB=100*r*(I-900-I*100/2)
VD_tot=0.05*I-27 #in volts
#both ends are fed with same voltage,
#VD_tot should be equal to zero."
I=27/0.05 #in Ampere
print "Curent = %0.2f Ampere" %I
Drop_AD=(0.01*I-0.5)+(0.01*I-3.5)
print "Value at minimum potential at D = %0.2f V" %(Vd-Drop_AD)
#Note : Ans in the book is wrong as 27/0.05 gives 540 instead of 54.
from __future__ import division
#Given data :
l=250 #in meter
VA=230 #in volt
VB=232 #in volt
r=0.5 #in ohm/km
r=0.5/10**3 #in ohm/m
RAC=r*50*2 #in ohm
RCD=RAC;RDE=RAC;REF=RAC;RFB=RAC #in ohm
#VA-VB=VAC+VCD+VDE+VEF+VFB #in volt
Ia=(VA-VB+15)/(5*RAC) #Ampere
IAC=Ia;ICD=IAC-20;IDE=IAC-60;IED=-IDE;IEF=IAC-100;IFE=-IEF;IFB=IAC-120;IBF=-IFB #in Ampere
print "IAC = %0.f A" %IAC
print "ICD = %0.f A" %ICD
print "IDE = %0.f A" %IDE
print "IED = %0.f A" %IED
print "IEF = %0.f A" %IEF
print "IFE = %0.f A" %IFE
print "IFB = %0.f A" %IFB
print "IBF = %0.f A" %IBF
VAC=IAC*RAC #in volt
VCD=ICD*RCD #in volt
VD=VA-VAC-VCD #in volt
print "The minimum potential = %0.1f Volt" %(VD)
from __future__ import division
#Given data :
VA=235 #in volt
VB=236 #in volt
l=200 #in meter
IL1=20;IL2=40;IL3=25;IL4=30 #in Ampere
l1=50;l2=75;l3=100;l4=50 #in meter
r=0.4 #in ohm/km
r=0.4/10**3 #in ohm/m
RAC=r*l1*2 #in ohm
RCD=r*(l2-l1)*2*RAC;RDE=r*(l2-l1)*2*RAC;REF=r*l1*2*RAC;RFB=r*l1*2*RAC #in ohm
#VA-VB=VAC+VCD+VDE+VEF+VFB #in volt
IA=(VA-VB+9.6)/(0.16) #in Ampere
IAC=IA;ICD=IA-IL1;IDE=IA-IL1-IL2;IEF=IA-IL1-IL2-IL3;IFB=IA-IL1-IL2-IL3-IL4 #in Ampere
print "IAC = %0.2f A" %IAC
print "ICD = %0.2f A" %ICD
print "IED = %0.2f A" %(-IDE)
print "IFE = %0.2f A" %-IEF
print "IFB = %0.2f A" %-IFB
VAC=IAC*RAC #in volt
VCD=ICD*RCD #in volt
VD=VA-VAC-VCD #in volt
print "The minimum potential = %0.3f Volt" %VD
# Answer wrong in the textbook due to accuracy.
from __future__ import division
#Given data :
VA=400 #in volt
r=0.03 #in ohm/km
r=0.03/1000 #in ohm/m
RAB=r*500*2 #in ohm
RBC=r*300*2 #in ohm
RAB=r*700*2 #in ohm
RAB=r*500*2 #in ohm
#VA-VB=VAC+VCD+VDE+VEF+VFB #in volt
IA=(17.4)/(0.09) #in Ampere
VAB=(RAB)*IA #in volt
VB=VA-VAB #in volt
print "Voltage at B = %0.2f Volts" %VB
VBC=(RBC)*(IA-150) #in volt
VC=VB-VBC #in volt
print "Voltage at C = %0.2f Volts" %VC
IBC=IA-150 #in A
print "Current in section BC = %0.2f A "%IBC
#Note : Answer of VB is wrong in the book.
from __future__ import division
#Given data :
VA=240 #in volt
MAxVDrop=VA*5/100 #in volt
rho=2.87*10**-6 #in ohm-cm
#VAB+VBC+VCA=0 #in volt
IA=(3200)/(26) #in Ampere
IAB=IA #in Ampere
IBC=IA-100 #in Ampere
#Allowed voltage drop: IAB*RAB+IBC*RBC=12
R=12/(1015.26) #in ohm
RAB=R*300*2/100 #in ohm
RBC=R*600*2/100 #in ohm
RCA=R*400*2/100 #in ohm
#formula : R=rho*l/a
a=rho*(100*100)/R #in cm**2
print "Cross section area = %0.2f cm2 " %a
from __future__ import division
from numpy import sqrt
#Given data :
R=0.2 #in ohm/km
X=0.1 #in ohm/km
ZAM=((R+X*1J)/1000)*200 #in ohm
ZMB=((R+X*1J)/1000)*100 #in ohm
I1=100*(0.707-0.707*1J) #in A
I2=200*(0.8-0.6*1J) #in A
IAM=I1+I2 #in Ampere
VAM=ZAM*IAM #in volts
VMB=ZMB*I2 #in volts
VAB=VAM+VMB #in volts
magVAB=sqrt(VAB.real**2+VAB.imag**2)
print "Total voltage drop = %0.2f Volts" %magVAB
from __future__ import division
from numpy import sqrt, sin, pi, arctan, arccos, cos
import cmath
#Given data :
VB=200 #in volts
R=0.2 #in ohm/km
X=0.3 #in ohm/km
I=100 #in Ampere
ZAB=(R+X*1J) #in ohm
ZMB=ZAB/2 #in ohm
ZAM=ZMB #in ohm
cosfi_1=0.6 #unitless
cosfi_2=0.8 #unitless
IMB=I*(cosfi_2-cosfi_1*1J) #in A
I2=IMB #in Ampere
VMB=IMB*ZMB #in volts
VM=VB+VMB #in volts
print "Voltage at M = %.2f∠%.2f°" %(abs(VM),cmath.phase(VM)*180/pi)
#print('Sending end voltage , V_S = %.2f∠%.2f° kV/phase' %(abs(V_S*10**-3),cmath.phase(V_S)*180/math.pi))
fi=arctan(VM.imag/VM.real)*180/pi #in degree
fi_1=arccos(cosfi_1)*180/pi #in degree
fi_VBandI1=fi_1-fi #in degree
I1=I*(cos(fi_VBandI1*pi/180)-sin(fi_VBandI1*pi/180))*1J #in Ampere
IAM=I1+I2 #inA Ampere
VAM=ZAM*IAM #in volts
VA=VM+VAM #in volts
magVA=sqrt(VA.real**2+VA.imag**2)
print "Voltage at A, standing end voltage = %0.2f Volts" %magVA
#Answer wrong in the textbook.
#Given data :
l=500 #in meter
VA=200 #in volt
MAxVDrop=6 #in % of declared voltage
rho=0.014 #in ohm/m
#VD in the distributor=53*10**3*r
AllowedVD=VA*(6/100) #in volts
r=AllowedVD*10**6/(53*10**3) #in ohm/meter
#formula : R=rho*l/a
a=rho*(2*l)/r #in m**2
print "Cross section area = %0.2f m2 " %(a)
#Given data :
l=300 #in meter
I=0.75 #in A/m
R=0.00018 #in ohm/m
x=200 #in meter
Vs=250 #in volt
VD=I*R*(l*x-x**2/2) #in volt
V_A=Vs-VD #in volt(Voltage at 200m from end A)
print "Voltage as 200m from supply end A = %0.1f Volts" %V_A
#Given data :
l=600 #in meter
VA=440 #in volt
VB=400 #in volt
R=0.01 #in ohm/100m
RAC=(R/100)*300 #in ohm
RCD=(R/100)*300 #in ohm
RDE=(R/100)*100 #in ohm
REF=(R/100)*200 #in ohm
RFB=(R/100)*300 #in ohm
#VA-VB=VAC+VCD+VDE+VEF+VFB #in volt
IA=(VA-VB+42.5)/(0.12) #in Ampere
IAC=IA;ICD=IA-100;IDE=IA-300;IFE=IA-550;IFB=IA-850 #in Ampere
print "Current fed at A, IA = %0.1f A "%IAC
print "Current fed at B, IB = %0.1f A "%-IFB
#Given data :
VA=220 #in volt
VB=200 #in volt
R=0.1 #in ohm/km
I=1 #in A/m
l=500 #in meter
R=2*R/1000 #in ohm/m
x=(VA-VB)/(I*R*l)+l/2 #in meter
Vmin=VA-I*R*x**2/2 #in volts
print "Value of minimum potential = %0.2f V "%Vmin
IA=I*x #in A
print "Current supplied from end A = %0.f A " %IA
IB=I*(l-x) #in A
print "Current supplied from end B = %0.f A"%IB
#Given data :
VL=240 #in volt
Router=0.2 #in ohm
I1=VL/5 #in Ampere
I2=VL/6 #in Ampere
Ineutral=I1-I2 #in Ampere
#Applying KVL on +ve side
V1=VL+I1*0.2+8*0.4 #in volt
print "Voltage at +ve side = %0.1f V" %V1
#Applying KVL on +ve side
V2=VL-(8*0.4)+I2*0.2 #in volt
print "Voltage at -ve side = %0.1f V" %V2
#Given data :
#Applying KVL on +ve side
V1=200-(600*0.015)-(100)*0.03 #in volt
print "Voltage at +ve side = %0.f V" %V1
#Applying KVL on -ve side
V2=200-(-100*0.03)-500*0.0015 #in volt
print "Voltage at -ve side = %0.1f V" %V2
#Note : answer of 2nd part is wrong in the book.
from sympy import symbols
x=symbols('x')
#Given data :
#VD in section AC from RHS:
VD1=(40+x)*0.02+0.17*x
#VD in section AC from LHS:
VD2=(350-x)*0.015+(150-x)*0.03
#Equating two VDs we get
#x*0.02+0.17*x+0.015*x+x*0.03=350*0.015+150*0.03-40*0.02
x=(350*0.015+150*0.03-40*0.02)/0.082 #in A
VB=500-(x+40)*0.02 #in volts
print "Potential at point B = %0.2f V" %VB
VC=VB-(x*0.017) #in volts
print "Potential at point C = %0.2f V" %VC
VD=500-(350-x)*0.015 #in volts
print "Potential at point D = %0.2f V" %VD
#Note : Answer of 3rd part is given wrong in the book.
from sympy import symbols
x=symbols('x')
#Given data :
#Applying KVL in loop AFEDA:
p1=((0.016*x)+0.09*(x-30)+0.14*(x-17)-0.1*y) #eqn(1)
#Applying KVL in loop ADCBA:
p2=(0.1*y-0.12*(95-x-y)-.01*(145-x-y)-0.008*(165-x-y)) #eqn(2)
#Equating two equtions we get
#3.9*x-125=97.75-0.75*x
x=(97.75+125)/(3.9+0.75) #in A
y=97.75-0.75*x #in A
print "x = %0.f A" %x
print "y = %0.2f A"%y
print "Point of minimum ppotential is E."
#Given data :
V=200 #in volt
I=1 #in A/m
R=2*0.05/1000 #in ohm/m
l=1*1000 #in meter
IT=I*l #in Ampere
RT=R*l #in ohm
VD=IT*RT/8 #in volt
Vmin=V-VD #in volt
print "Minimum potential occurs at mid point. It is %0.2f V" %Vmin
#Given data :
VB=400 #in volt
ZAC=0.04+0.08*1J #in ohm
ZCB=0.08+1J*0.12 #in ohm
I1=60*(0.8-1J*0.6)
I2=120*(0.8-1J*0.6)
VCB=I2*ZCB #in Volt
VAC=(I1+I2)*ZAC #in volt
VC=VB+I2*ZCB #in Volt
print "Voltage at C =",VC,"Volt"
VA=VC+(I1+I2)*ZAC #in volt
print "Voltage at A =",VA,"Volt"
#Answer not accurate in the textbook.