In [8]:

```
'''A 3-phase, 4-wire system is used for lighting. Compare the amount of copper required with that needed for a
2-wire D.C. system with same line voltage. Assume the same losses and balanced load. The neutral is one half
the cross-section of one of the respective outers.'''
from sympy import Symbol
#(a) Two-wire DC
#We know that, I = P/V .Therefore
I = Symbol('I')
#Also let the resistance be R1
R1 = Symbol('R1')
#power loss is
loss1 = 2*(I*I)*R1
#(b) Three-phase,4-wire
#We know that, I2 = P/3*V .Therefore I2 = I/3
#Also let the resistance be R2
R2 = Symbol('R2')
#power loss is
loss2 = 3*(I/3*I/3)*R2
#loss1/loss2 = 2*I^2*R1/(I^2*R2*1/3) .Let ratio of resistances is R1/R2 = r1_r2
#As loss1 = loss2
r1_r2 = 1.0/6
#Let the ratio of areas of conductors be a1_a2 As R o< 1/A
a2_a1 = 1/r1_r2
#Cu loss of 3-phase/Cu loss of dc system = 3.5*A2*l/2*A1*l
ratio = (3.5/2)/a2_a1
print "Cu for 3-phase system = ",round(ratio,2)," * Cu for dc system."
```

In [1]:

```
'''Estimate the weight of copper required to supply a load of 100 MW at upf by a 3-phase, 380-kV system over a distance
of 100 km. The neutral point is earthed. The resistance of the conductor is 0.045 ohm/cm^2/km. The weight of copper
is 0.01 kg/cm^3. The efficiency of transmission can be assumed to be 90 percent.'''
#Power loss in the line
loss1 = (1 - 0.9) * 100.0 #MW
#Line current Il = P/vl*cosQ
Il = 100 * 1.0e+6/(1.732*380*(1.0e+3)*1) #A
#Since I^2R loss in 3-conductors is loss1, loss per conductor is
loss_c = loss1*1.0e+6/3 #W
#Resistance per conductor Using loss = I^2*R
R_c = loss_c/(Il*Il) #ohm
#Resistance per conductor per km
R_km = R_c/100 #ohm
#Conductor cross-section
Vol = 0.045/R_km #m^3
#Volume of copper per meter run
Vol = Vol*100 #cm^3
#Weight of copper for 3-conductor for 100 km length
wt = 3 * (Vol * 0.01) * 100 * 1000 #kg
print "Wt of copper for 3-conductors = ",round(wt,2),"kg."
```

In [38]:

```
'''A d.c. 2-wire distribution system is converted into a.c. 3-phase, 3-wire system by adding a third conductor of
the same size as the two existing conductors. If voltage between conductors and percentage power loss remain the same, calculate
the percentage additional balanced load which can now be carried by the conductors at 0.95 p.f.'''
from sympy import Symbol
#(a)DC 2-wire system
#Let us assume
V = 1.0
R = 1.0
I1 = Symbol('I1')
#Power transmitted
P1 = V*I1
#Power loss
loss1 = 2*(I1**2)*R
#%power loss = power loss/Power transmitted
ploss1 = loss1/P1
#(b)3-phase, 3-wire system
I2 = Symbol('I2')
#Power transmitted P = 1.732*VI*cosQ
P2 = 1.732*V*I2*(0.95)
#Power loss
loss2 = 3*(I2**2)*R
#%power loss = power loss/Power transmitted
ploss2 = loss2/P2
#As ploss1 == ploss2
I2 = 2*(0.95)*I1/1.732
P2 = 1.732*V*I2*(0.95)
#Add. power transmitted
ptrans = (P2 - P1)/P1 *100 #%
print "Additional power transmitted = ",round(ptrans,2),"%."
```

In [41]:

```
'''A 2-phase, 3-wire a.c. system has a middle conductor of same cross-sectional area as the outer and supplies a load
of 20 MW. The system is converted into 3-phase, 4-wire system by running a neutral wire. Calculate the new power which
can be supplied if voltage across consumer terminal and percentage line losses remain the same. Assume balanced load.'''
from sympy import Symbol
#(a)2-phase 3-wire system
#Let us assume
V = 1.0
R = 1.0
cosQ = 1.0
I1 = Symbol('I1')
#Power transmitted
P1 = 2*V*I1*cosQ
#Power loss
loss1 = 2*(I1**2)*R
#%power loss = power loss/Power transmitted
ploss1 = loss1/P1
#(b)3-phase, 4-wire system
I2 = Symbol('I2')
#Power transmitted P = 1.732*VI*cosQ
P2 = 3*V*I2*cosQ
#Power loss
loss2 = 3*(I2**2)*R
#%power loss = power loss/Power transmitted
ploss2 = loss2/P2
#As ploss1 == ploss2
I2 = I1
P2 = 3*V*I2*cosQ
#New Power that can be supplied P1/P2 = 20/x
pnew = 20*P2/P1 #MW
print "Additional power transmitted = ",round(pnew,2),"MW."
```

In [2]:

```
'''What is the inductance per loop metre of two parallel conductors of a single phase system if each has a diameter of 1
cm and their axes are 5 cm apart when conductors have a relative permeability of (a) unity and (b) 100. The relative
permeability of the surrounding medium is unity in both cases. End effects may be neglected and the current may be assumed
uniformly distributed over cross-section of the wires.'''
import math as m
# (a)
# u = u0
u0 = 4*3.14*1.0e-7 #H/m
ui = 1.0
L = u0/3.14*(m.log(5.0/0.5) + ui/4)*1.0e+6 #uH/m
print "L = ",round(L,2),"uH/m."
# (b)
# u = u0
u0 = 4*3.14*1.0e-7 #H/m
ui = 100.0
L = u0/3.14*(m.log(5.0/0.5) + ui/4)*1.0e+6 #uH/m
print "L = ",round(L,2),"uH/m."
```

In [3]:

```
'''A 20-km single-phase transmission line having 0.823 cm diameter has two line conductors separated by 1.5 metre.
The conductor has a resistance of 0.311 ohm per kilometre. Find the loop impedance of this line at 50 Hz.'''
import math as m
#Given
length = 20.0*1000 #m
u = 4*3.14*1.0e-7 #H
ui = 1.0
D = 1.5 #m
r = 0.823/2*1.0e-2 #m
#inductance is
L = length*(u/3.14*(m.log(D/r) + ui/4 )) #H
#reactance is
X = 2*3.14*50.0*L #ohm
#loop resistance
R = 2*length*0.311/1000 #ohm
#impedance is
Z = m.sqrt(X*X + R*R) #ohm
print "loop impedance is = ",round(Z,2),"ohm."
```

In [4]:

```
'''The conductors in a single-phase transmission line are 6 m above ground. Each conductor has a diameter of 1.5 cm
and the two conductors are spaced 3 m apart. Calculate the capacitance per km of the line
(i) excluding ground effect and (ii) including the ground effect.'''
import math as m
#Given
D = 3.0 #m (distance between conductors)
r = 1.5/2*1e-2 #m (radius)
h = 6.0 #m (height from ground)
eps = 8.85e-12 #epsilon (constant)
#(i)Capacitance per km excluding ground effect
Cn = 2*3.14*eps/(m.log(D/r))*1.0e+9 #uF/km
print "Capacitance (excluding ground effect) = ",round(Cn,5),"uF/km"
#(ii)Capacitance including ground effect
Cn = 2*3.14*eps/(m.log(D/(r*m.sqrt(1 + D*D/(4*h*h)))))*1.0e+9 #uF/km
print "Capacitance (including ground effect) = ",round(Cn,5),"uF/km"
```

In [14]:

```
'''A single-phase line has an impedance of 5ang(60) and supplies a load of 120 A,3,300 V at 0.8 p.f. lagging.
Calculate the sending-end voltage and draw a vector diagram.'''
import cmath as cm
import math as m
#Given
Er = cm.rect(3300.0,0) #V (Voltage)
Z = cm.rect(5.0,3.14/3) #ohm (Impedance)
pf = 0.8 #power factor
theta = m.acos(pf) #Q (power factor angle)
I = cm.rect(120.0,-theta) #A (current)
#Voltage drop
V = (I)*(Z) #V
#Sending-end voltage is
Es = Er + V #V
Es = m.sqrt(Es.real**2 + Es.imag**2)#V
print "Sending-end voltage = ",round(Es,2),"V."
```

In [6]:

```
'''An overhead, single-phase transmission line delivers 1100 kW at 33 kV at 0.8 p.f. lagging. The total resistance of the line is
10ohm and total inductive reactance is 15ohm . Determine
(i) sending-end voltage (ii) sending-end p.f. and (iii) transmission efficiency.'''
import math as m
import cmath as cm
#Given
P = 1100.0 #kW (Power delivered)
V = 33.0 #kV (Voltage)
pf = 0.8 # (Power factor)
R = 10.0 #ohm (Resistance)
X = 15.0 #ohm (Reactance)
#Full-load line current is
I = P/(V*pf) #A
theta = m.acos(pf) #Q (power factor angle)
I = cm.rect(I,-theta) #ohm (impedance)
#Line-loss
loss = I*I*R/1000 #kW
#(iii)Transmission efficiency
eff = (P/(P+loss))*100 #%
#Line voltage drop is IZ
Z = R + 1j * X
#Sending end voltage is
Es = V + I*Z/1000 #V
Es1 = m.sqrt(Es.real**2 + Es.imag**2) #V
print "Sending end voltage is = ",round(Es1,2),"V."
#Sending end pf angle is
theta2 = theta + cm.phase(Es)
pf2 = m.cos(theta2) #power factor
print "Power factor = ",round(pf2,3),"lag"
```

In [7]:

```
'''What is the maximum length in km for a 1-phase transmission line having copper conductors of 0.775 cm^2 cross-section
over which 200 kW at unity power factor and at 3300 V can be delivered ? The efficiency of transmission is 90 per cent.
Take specific resistance as (1.725 * 10–8) ohm-m.'''
#Given
A = 0.775e-4 #m^2 (Area of copper conductor)
P = 200.0 #kW (Power)
V = 3300.0 #V (Voltage)
pf = 1.0 # (Power factor)
rho = 1.725e-8 #ohm-m (Specific Resistance)
#Sending-end power is
Es = P/0.9 #kW
#Line losses
loss = Es - P #kW
#Line current
I = P/(V*pf)*1000 #A
#If R is resistance of consuctor then 2*I^2*R = loss
R = loss/(2*I*I)*1000 #ohm
#Now, using R = rho*l/A . The length is
l = R*A/rho #m
l = l/1000 #km
print "Max. length in km is = ",round(l,2),"km."
```

In [8]:

```
'''An industrial load consisting of a group of induction motors which aggregate 500 kW at 0.6 power factor lagging is
supplied by a distribution feeder having an equivalent impedance of (0.15 + j0.6) ohm. The voltage at the load end of
the feeder is 2300 volts.
(a) Determine the load current.
(b) Find the power, reactive power and voltampere supplied to the sending end of the feeder.
(c) Find the voltage at the sending end of the feeder.'''
import math as m
import cmath as cm
#Given
P = 500.0 #kW (Power)
V = 2300.0 #V (Voltage)
pf = 0.6 # (Power factor)
#(a)line current
I = P*1000/(V*pf*1.732) #A (Current)
theta = m.acos(pf) # (Power factor angle)
I1 = cm.rect(I,-theta) #A
Z = 0.15 + 1j*0.6 #ohm (Impedance)
#Voltage drop is
drop = I1*Z #V
#Sending end voltage is
Es = V + drop #V
Es = abs(Es)
#Sending end pf angle is
theta2 = theta + cm.phase(Es)
pf2 = m.cos(theta2) #power factor
pf21 = m.sin(theta2) #sinQ component
#Sending power = root(3)*Vl*Il*cosQ
Ps = 1.732*Es*I*pf2/1000 #kW
#Sending end reactive power = root(3)*Vl*Il*sinQ
Prs = 1.732*Es*I*pf21/1000 #kVAR
#Sending end volt ampere kVA = root(3)*Vl*Il
Pvs = 1.732*Es*I/1000 #kVA
print "load current = ",round(I,2),"A"
print "Voltage at sending end is = ",round(Es,2),"V."
print "Sending power = ",round(Ps,2),"kW."
print "Sending end reactive power = ",round(Prs,2),"kVAR."
print "Sending end volt ampere kVA = ",round(Pvs,2),"kVA."
```

In [15]:

```
'''A 33-kV, 3-phase generating station is to supply 10 MW load at 31 kV and 0.9 power factor lagging over a 3-phase
transmission line 3 km long. For the efficiency of the line to be 96% , what must be the resistance and reactance of the line?'''
import math as m
#Given
#Power Output
pout = 10.0 #MW (Power output)
eff = 0.96 # (Efficiency)
pin = pout/eff #MW (Power input)
#Total loss
loss = pin - pout #MW
#Full-load current I = P/V*pf*root(3)
I = pout*1e+6/(31.0e+3*0.9*1.732) #A
#If R is resistance per phase,then 3*I*I*R = loss
R = loss*1e+6/(3*I*I) #ohm
#Now, Vs per phase is
Vs = 33/1.732 #kV
#Vr per phase is
Vr = 31/1.732 #kV
#Using Vs = Vr + I(RcosQ + XsinQ )
X = ((Vs - Vr)/I*1000 - R*0.9)/m.sqrt(1 - 0.9*0.9)
print "Resistance R = ",round(R,2),"ohm."
print "Reactance X = ",round(X,2),"ohm."
```

In [16]:

```
'''A balanced Y-connected load of (300 + j100) ohm is supplied by a 3-phase line 40 km long with an impedance of
(0.6 + j0.7) ohm per km (line-to-neutral). Find the voltage at the receiving end when the voltage at the sending
end is 66 kV. What is the phase angle between these voltages? Also, find the transmission efficiency of the line.'''
import math as m
from sympy import Symbol,solve,Eq
#Resistance for 40 km conductor length
R = 40 * 0.6 #ohm
#Reactance for 40 km conductor length
X = 40 * 0.7 #ohm
#Total resistance/phase
R1 = R + 300 #ohm
#Total reactance/phase
X1 = X + 100 #ohm
#Total impedance/phase
Z = m.sqrt(R1**2 + X1**2) #ohm
#Line current
Il = 66000.0/1.732/Z #A
#Now,
theta = m.atan(100.0/300.0)
cosQ = m.cos(theta)
sinQ = m.sin(theta)
#Voltage drop in conductor resistance
dropR = Il*R #V
#Voltage drop in conductor reactance
dropX = Il*X #V
#Let us assume recieving end voltage as Vr
Vr = Symbol('Vr')
#Sending-end voltage is
Vs1 = 66000.0/1.732 #V
Vs2 = (Vr + dropR*cosQ + dropX*sinQ)**2 + (dropX*cosQ - dropR*sinQ)**2 #V
eq = Eq(Vs1*Vs1,Vs2)
Vr = solve(eq)
Vr1 = Vr[1] #V
#Line-voltage across load
Vrl = Vr1*1.732/1000 #kV
print "Voltage at recieving end = ",round(Vrl,2),"V."
#Angle between voltages
a_b = (dropX*cosQ - dropR*sinQ)/(Vr1 + dropR*cosQ + dropX*sinQ)
theta2 = m.atan(a_b)*180/3.14 #angle
print "Angle between voltages = ",round(theta2,2),"degrees."
#Transmission Efficiency
eff = (300.0/R1)*100
print "Transmission efficiency is = ",round(eff,2),"%."
```

In [17]:

```
'''Define ‘regulation’ and ‘efficiency’ of a short transmission line.A 3-phase, 50-Hz, transmission line having resistance of
5ohm per phase and inductance of 30 mH per phase supplies a load of 1000 kW at 0.8 lagging and 11 kV at the receiving end. Find.
(a) sending end voltage and power factor (b) transmission efficiency (c) regulation.'''
import math as m
import cmath as cm
#Recieving-end Voltage\phase
Vr = 11000.0/1.732 #V
#Line current
Il = 1000.0e+3/(1.732*11000.0*0.8) #A
#Inductive reactance
Xl = 2*3.14*50*30.0e-3 #ohm
R = 5.0 #ohm
#Impedance
Z = R + 1j*Xl #ohm
#drop per conductor
theta = m.atan(0.8)
Il1 = cm.rect(Il,-theta)
drop = Il1*(Z) #ohm
#(a)Sending end voltage
Vs = Vr + drop #V
Vs1 = abs(Vs)*1.732/1000 #kV
#For power factor
theta2 = theta + cm.phase(Vs)
#Power factor
pf = m.cos(theta2)
#(b)
#Power loss
loss = 3*Il*Il*R/1000 #kW
#Input Power
pin = 1000.0 + loss #kW
#Transmission efficiency
eff = 1000.0/pin *100 #%
# (c)% Voltage regulation
reg = (Vs1 - 11.0)/11.0*100 #%
print "Sending end voltage is = ",round(Vs1,2),"V."
print "Power factor = ",round(pf,2)
print "Transmission Efficiency = ",round(eff,2),"%"
print "Voltage Regulation = ",round(reg,2),"%"
```

In [2]:

```
'''A short 3-φ line with an impedance of (6 + j8) ohm per line has sending and receiving end line voltages of 120 and
110 kV respectively for some receiving-end load at a p.f. of 0.9. Find the active power and the reactive power at the
receiving end.'''
import math as m
#Given
R = 6.0 #ohm
X = 8.0 #ohm
cosQ = 0.9
sinQ = m.sqrt(1 - 0.9*0.9)
#Sending end-voltage
Vs = 120.0/1.732*1000 #V
#Recieving end-voltage
Vr = 110.0/1.732*1000 #V
#Now Vs = Vr + IRcosQ + IXsinQ.Therefore,line current is
I = (Vs - Vr)/(R*cosQ + X*sinQ) #A
#Active Power at recieving end
act_pwr = 1.732*110.0*I*cosQ #kW
#Reactive Power at recieving end
rct_pwr = 1.732*110.0*I*sinQ #kVAR
print "Active power = ",round(act_pwr),"kW."
print "Reactive power = ",round(rct_pwr),"kVAR."
```

In [3]:

```
'''A 3-phase, 20 km line delivers a load of 10 MW at 11 kV having a lagging p.f. of 0.707 at the receiving end.
The line has a resistance of 0.02 ohm/km phase and an inductive reactance of 0.07 ohm/km/phase. Calculate the regulation
and efficiency of the line. If, now, the receiving end p.f. is raised to 0.9 by using static capacitors, calculate the
new value of regulation and efficiency.'''
import cmath as cm
import math as m
print "-------pf = 0.707------- "
#(i) When pf = 0.707 (lag)
pf = 0.707
#line current
Il = 10.0e+6/(1.732*11000*pf) #A
#Vr per phase
Vr = 11000.0/1.732 #V
#Total resistance/phase for 20km
R = 20*0.02 #W
#Total reactance/phase for 20km
X = 20*0.07 #W
#Total impedance/phase
Z = R + 1j*X #ohm
#If Vr is taken as reference vector,then drop per phase is
theta = m.acos(pf)
Il1 = cm.rect(Il,-theta) #A
#drop/phase
drop = Il1*Z #V
#Sending end voltage
Vs = Vr + drop #V
Vs1 = abs(Vs) #V
#% regulation
reg = (Vs1 - Vr)/Vr*100
print "% regulation = ",round(reg,2)
#Total line loss
loss = 3*Il*Il*R/1.0e+6 #MW
#Total output
tot_op = 10.0 + loss #MW
#Efficiency
eff = 10.0/tot_op*100
print "Efficiency = ",round(eff,2)
#-----------------------------------------------------------------------------------------------------------------------#
print "-------pf = 0.9--------- "
#(ii) When pf = 0.9 (lag)
pf = 0.9
#line current
Il = 10.0e+6/(1.732*11000*pf) #A
#If Vr is taken as reference vector,then drop per phase is
theta = m.acos(pf)
Il1 = cm.rect(Il,-theta) #A
#drop/phase
drop = Il1*Z #V
#Sending end voltage
Vs = Vr + drop #V
Vs1 = abs(Vs) #V
#% regulation
reg = (Vs1 - Vr)/Vr*100
print "% regulation = ",round(reg,2)
#Total line loss
loss = 3*Il*Il*R/1.0e+6 #MW
#Total output
tot_op = 10.0 + loss #MW
#Efficiency
eff = 10.0/tot_op*100
print "Efficiency = ",round(eff,2)
```

In [4]:

```
'''A load of 1,000 kW at 0.8 p.f. lagging is received at the end of a 3-phase line 10 km long. The resistance and inductance
of each conductor per km are 0.531 W and 1.76 mH respectively. The voltage at the receiving end is 11 kV at 50 Hz.
Find the sending-end voltage and the power loss in the line. What would be the reduction in the line loss if the p.f.
of the load were improved to unity?'''
import cmath as cm
import math as m
#Line current
Il = 1000.0 * 1000/(1.732 * 11 * 1000 * 0.8) #A
#Voltage/phase
V = 11000/1.732 #V
X = 2*3.14*50* 1.76e-3 *10 #ohm
R= 0.531 * 10 #ohm
Z = R + 1j*X
#Voltage drop/phase
theta = m.acos(0.8)
Il1 = cm.rect(Il,-theta)
drop = Il1*Z #V
#Sending end voltage is
Vs = V + drop #V
#line-to-line sending-end voltage
Vs1= abs(Vs)*1.732/1000 #kV
#Total loss
loss = 3*Il*Il*R/1000 #kW
#Line current for unity p.f.
Il2 = 1000/(11*1.732) #A
#New losses
new_loss = 3*Il2*Il2*R/1000 #kW
#Reduction in loss
red_loss = loss - new_loss #kW
print "Sending end-voltage is = ",round(Vs1,2),"kV."
print "Total loss = ",round(loss,2),"kW."
print "Reduction in loss = ",round(red_loss,2),"kW."
```

In [18]:

```
'''Estimate the distance over which a load of 15,000 kW at 0.85 p.f. can be delivered by a 3-phase transmission line
having conductors of steel-cored aluminium each of resistance 0.905 W per kilometre. The voltage at the receiving end
is to be 132 kV and the loss in transmission is to be 7.5% of the load.'''
#Line current
Il = 15000/(132 * 1.732 * 0.85) #A
#Total loss
loss = (7.5/100)*15000 #kW
#If R is the resistance of one conductor, then 3*I^2*R = loss
R = loss*1000/(3*Il*Il) #ohm
#Length of the line
length = R/0.905 #km.
print "Length of line = ",round(length,2),"km."
```

In [19]:

```
'''A 3-phase line has a resistance of 5.31 ohm and inductance of 0.0176 H. Power is transmitted at 33 kV, 50-Hz from one end
and the load at the receiving end is 3,600 kW at 0.8 p.f. lagging. Find the line current, receiving-end voltage,
sending-end p.f. and efficiency of transmisson.'''
from sympy import Symbol,solve,Eq
import math as m
import cmath as cm
#Let us assume that Vr is receiving end voltage
Vr = Symbol('Vr')
#Power delivered/phase = Vr*I*cosQ.Therefore I is
I = (3600.0/3)*1000/(0.8*Vr)
#Sending end voltage/phase =
Vs = 33000.0/1.732 #V
R = 5.31 #ohm
X = 2*3.14*0.0176*50 #ohm
#Now,
cosQ = 0.8
sinQ = m.sqrt(1 - 0.8*0.8)
#As we know, Vs = Vr + IRcosQ + IXsinQ
Vs2 = Vr + I*R*cosQ + I*X*sinQ #V
eq = Eq(Vs,Vs2)
Vr = solve(eq)
Vr1 = Vr[1] #V
#Line voltage at receiving end
Vrl = Vr1*1.732/1000 #kV
I = (3600.0/3)*1000/(0.8*Vr1) #A
Vs = Vr1 + I*(cosQ - 1j*sinQ)*(R + 1j*X) #V
#Power factor
theta = m.acos(0.8) + cm.phase(Vs)
pf2 = m.cos(theta)
print "Power factor = ",round(pf2,3)
#Power lost in line is
loss = 3*I*I*R/1000 #kW
#Power at sending end is
tot_pwr = 3600.0 + loss #kW
#Eficiency of transmission is
eff = 3600.0/tot_pwr*100
print "Efficiency of transmission line is = ",round(eff,2)
```

In [13]:

```
'''A 3-phase short transmission line has resistance and reactance per phase of 15 ohm and 20 ohm respectively. If the sending-end
voltage is 33 kV and the regulation of the line is not to exceed 10%, find the maximum power in kW which can be transmitted
over the line. Find also the kVAR supplied by the line when delivering the maximum power.'''
import math as m
#Given
Vs = 33000.0/1.732 #V (Sending end voltage)
Vr = Vs/(1 + 10.0/100) #V (Receiving end voltage)
Z = m.sqrt(15**2 + 20**2) #ohm (impedance)
R = 15.0 #ohm (resistance)
X = 20.0 #ohm (reactance)
#Maximum Power transmitted is given by
Pmax = (Vr/Z)**2*(Z*(Vs/Vr) - R) #watts/phase
#Total max. power
ptot = Pmax*3/1e+6 #MW
#kVAR supplied per phase is given by
pkvar = (Vr/Z)**2*X/1e+3 #kW
#Total kVAR supplied
kvartot = 3*pkvar #kW
print "Total Maximum power = ",round(ptot,2),"MW."
print "Total kVAR supplied = ",round(kvartot,2),"kW."
```

In [6]:

```
'''A 3-phase, 50-Hz generating station supplies a load of 9,900 kW at 0.866 p.f. (lag) through a short overhead transmission line.
Determine the sending-end voltage if the receiving-end voltage is 66 kV and also the efficiency of transmission.
The resistance per km is 4ohm and inductance 40 mH. What is the maximum power in kVA that can be transmitted through
the line if both the sending and receiving-end voltages are kept at 66 kV and resistance of the line is negligible.?'''
import math as m
#Resistance
R = 4.0 #ohm
#Reactance
X = 40.0e-3*(2*3.14*50)#ohm
#Impedance
Z = m.sqrt(R*R + X*X) #ohm
#Line current
I = 9900.0/(1.732*66*0.866) #A
#Receiving end voltage
Vr = 66000.0/1.732 #V
#Now,
cosQ = 0.866
sinQ = m.sqrt(1 - 0.866**2)
#Sending end voltage is
Vs = Vr + I*R*cosQ + I*X*sinQ #V
#Line value of sending end voltage
Vs1 = Vs*1.732/1000 #kV
print "Sending end voltage = ",round(Vs1,2),"kV."
#Total line loss
loss = 3*I*I*R/1000 #kW
#Efficiency is
eff = 9900.0/(9900.0 + loss)*100#%
print "Efficiency = ",round(eff,2),"%"
#Max. value of Q for 3-phases are (As Vs = Vr R is negligible)
Z = X #ohm
max_value = (3*Vr*Vr)/(Z*Z)*X*1e-3 #kVA
print "Max. value of Q for 3-phases are = ",round(max_value,-1),"kVA."
```

In [7]:

```
'''3-phase load of 2000 kVA,0.8 p.f. is supplied at 6.6 kV, 50-Hz by means of a 33 kV transmission line 20 km long and a 5 : 1
transformer. The resistance per km of each conductor is 0.4 ohm and reactance 0.5 ohm. The resistance and reactance of the
transformer primary are 7.5 ohm and 13.2 ohm, whilst the resistance of the secondary is 0.35 ohm and reactance 0.65 ohm.
Find the voltage necessary at the sending end of transformission line when 6.6 kV is maintained at the load-end and find
the sending-end power factor. Determine also the efficiency of transmission.'''
import math as m
#Impedance of high voltage line
Zh = 8.0 + 1j*10.0 #ohm
#Impedance of transformer(primary side)
Zt = 7.5 + 1j*13.2 #ohm
#Total impedance on high tension side
Ztot_h = Zh + Zt #ohm
#Impedance as referred to secondary side
Zsec = Ztot_h/(5**2) #ohm
#Total impedance on high tension side
Ztot_l = Zsec + (0.35 + 1j*0.65) #ohm
#Now,kVA load per phase
load = 2000.0/3 #kVA
#Receiving-end voltage per phase
Vr = 6.6/1.732 #kV
#current in line is
I = load/Vr #A
#Now,
cosQ = 0.8
sinQ = m.sqrt(1 - 0.8*0.8)
#Drop per conductor
drop = I*(Zsec.real*cosQ + Zsec.imag*sinQ) #V
#Sending end voltage is
Vs = Vr + drop/1000 #kV
#Sending end voltage referred from high voltage side
Vs = Vs*5 #kV
#Line sending end voltage
Vsl = Vs*1.732 #kV
#If theta is phase angle at sending end then
tantheta = (sinQ + I*Zsec.imag/(Vr*1000))/(cosQ + I*Zsec.real/(Vr*1000))
theta = m.atan(tantheta)
pf = m.cos(theta)
print "Power factor at sending end = ",round(pf,2)
#power loss/phase
loss = (I*I)*0.97/1000 #kW
#power at the receiving end/phase
power = 2000.0*cosQ/3 #kW
#Transmission efficiency
eff = power/(power + loss)*100
print "Transmission efficiency = ",round(eff,2),"%"
```

In [20]:

```
'''A (medium) single-phase transmission line 50 km long has the following constants :
resistance/km = 0.5 ohm ; reactance/km = 1.6 ohm
susceptance/km = 28 * 10−6 S ; receiving-end line voltage = 66,000 V
Assuming that total capacitance of the line is located at receiving end alone, determine the
sending-end voltage, the sending-end current and regulation. The line is delivering 15,000 kW at
0.8 p.f. lagging. Draw a vector diagram to illustrate your answer.'''
import math as m
import cmath as cm
#Load current at receiving end Using I = P/VcosQ
Ir = 15.0e+6/(66e+3*0.8) #A
#Total resistance is
R = 0.5*50.0 #ohm
#Total reactance is
X = 1.6*50.0 #ohm
#Susceptance
B = 28e-6*50.0 #Siemens
#Capacitive admittance
Y = B #Siemens
#Sending end current Is is vector sum of load current Ir and capacitive current Ic
Er = 66000.0
Ic = 1j*Er*Y #A
theta = m.acos(0.8)
Irl = cm.rect(Ir,-theta) #A
#Sending end current is
Is = Irl + Ic #A
Z = R + 1j*X #ohm
print "Sending end current is",round(abs(Is),2),"A."
#line drop
drop = Is*Z #V
#Sending end voltage is
Es = Er + drop #V
print "Sending end voltage is",round(abs(Es)),"V."
#Voltage regulation is
reg = (abs(Es)-abs(Er))/abs(Er)*100 #%
print "Voltage regulation = ",round(reg,2),"%."
```

In [9]:

```
'''A 3-phase, 50-Hz overhead transmission line 100 km long with 132 kV between lines at the receiving end has the
following constants :
resistance/km/phase = 0.15 ohm inductance/km/phase = 1.20 mH
capacitance/km/phase = 0.01 mF
Determine, using an approximate method of allowing for capacitance, the voltage, current and
p.f. at the sending end when the load at the receiving end is 72 MW at 0.8 p.f. lagging. Draw vector
diagram for the circuit assumed.'''
import math as m
import cmath as cm
#For a 100-km length of line
#Resistance of line is
R = 0.15*100 #ohm
Xl = (2*3.14*50)*(1.2e-3)*100 #ohm
Xc = 1/(2*3.14*50*0.1e-3)*100 #ohm
#Using nominal T-method
Vr = 132/1.732 #kV
#Load current
Ir = (72e+6)/(1.732*132e+3*0.8) #A
#Load current is
theta = m.acos(0.8)
Irl = cm.rect(Ir,-theta) #A
#Impedance Zbc is
Zbc = R/2 + 1j*Xl/2 #ohm
#Drop/phase over BC is
drop = Irl*Zbc #V
#Now, voltage V1 is
V1 = Vr*1000 + drop #V
#From fig. Ic is
Ic = V1/(-1j*Xc) #A
#Sending end current is
Is = Ic + Irl #A
#Impedance Zab is
Zab = R/2 + 1j*Xl/2 #ohm
#Drop/phase over AB is
drop2 = Is*Zab #V
#Sending end voltage is
Vs = V1 + drop2 #V
#Line value of sending end voltage is
Vsl = 1.732*abs(Vs)/1000 #kV
print "Line value of sending end voltage =",round(Vsl,2),"kV."
#Phase angle between Vs and Is is
angle = abs(cm.phase(Vs)) + abs(cm.phase(Is))
pf = m.cos(angle) #(lag)
print "Power factor = ",round(pf,3),"lagging."
```

In [10]:

```
'''A 3-phase, 50-Hz transmission line, 100 km long delivers 20 MW at 0.9 p.f. lagging and at 110 kV. The resistance and
reactance of the line per phase per km are 0.2 ohm and 0.4 ohm respectively while the capacitive admittance is 2.5 * 10e−6 S per
km. Calculate (a) the voltage and current at the sending end and (b) the efficiency of transmission. Use the nominal T-method.'''
import math as m
import cmath as cm
#Resistance for 100 km is
R = 0.2*100 #ohm
#Reactance for 100 km is
X = 0.4*100 #ohm
#Capacitive admittance for 100 km is
Y = 2.5e-6*100 #Siemens
#Receiving end voltage Er is
Er = 110.0/1.732 #kV
Ir = 20.0e+6/(1.732*110e+3*0.9) #A
#Now
cosQ = 0.9
sinQ = m.sqrt(1 - 0.9*0.9)
theta = m.acos(0.9)
Irl = cm.rect(Ir,-theta) #A
#Impedance is
Zbc = R/2 + 1j*X/2 #ohm
#Voltage drop between point B and C is
dropbc = Irl*Zbc #V
V1 = Er*1000 + dropbc #V
#Current through capacitor
Ic = V1*1j*Y #A
#Sending end current is
Is = Ic + Irl #A
Zab = Zbc
#Voltage drop between point A and B is
dropab = Irl*Zab #V
Vs = V1 + dropab #V
#Line value of sending end voltage is
Vsl = 1.73*abs(Vs)/1000 #kV
print "Line value of sending end voltage =",round(Vsl,2),"kV."
print " sending end current =",round(abs(Is),2),"A."
#Phase angle between Vs and Is is
angle = abs(cm.phase(Vs)) + abs(cm.phase(Is))
pf = m.cos(angle) #(lag)
#Input power
pin = 1.73*abs(Vsl)*abs(Is)*pf/1e+3 #MW
#Efficiency
eff = 20.0/pin*100
print "Efficiency = ",round(eff,2),"%."
```

In [11]:

```
'''A 3-phase transmission line,100 km long has following constants:
resistance per km per phase = 0.28 ohm ; inductive reactance per km per phase = 0.63 ohm .
Capacitive susceptance per km per phase = 4 * 10e-6 siemens.
If the load at the receiving end is 75 MVA at 0.8 p.f. lagging with 132 kV between lines calculate sending-end voltage,
current and p.f. Use nominal-pi-method.'''
import math as m
import cmath as cm
#For 100 km length line
#Resistance/phase
R = 0.28*100 #ohm
#Inductive Reactance/phase
Xl = 0.63*100 #ohm
#Capacitive Susceptance/phase
Y = 4.0e-6*100 #S
#Capacitive Susceptance at each end
Y = 1j*Y/2 #S
#Receiving end voltage Vr is
Vr = 132e+3/1.732 #V
#Receiving end current Ir is
Ir = 75.0e+6/(1.732*132e+3*0.8) #A
theta = m.acos(0.8)
Irl = cm.rect(Ir,-theta) #A
#Current through capacitance is
Ic = Vr*Y #A
#Now
Il = Ic + Irl #A
#Drop per conductor is
Zl = R +1j*Xl #ohm
drop = Il*Zl #V
#sending end voltage
Vs = Vr + drop
#Line value of sending-end voltage
Vsl = abs(Vs)*1.732/1000 #kV
print "Line value of sending-end voltage",round(Vsl,2),"kV."
#
Ic2 = Vs*Y #A
Is = Ic2 + Il
#Angle between VS and IS
angle = abs(cm.phase(Vs)) + abs(cm.phase(Is))
pf = m.cos(angle)
#cos41.4 = 0.75
print "power factor = ",round(pf,2)
```

In [12]:

```
'''A 100-km long, three-phase, 50-Hz transmission line has resistance/phase/km = 0.1 ohm ; reactance/phase/km = 0.5 ohm ;
susceptance/phase/km = 10 * 10−6 siemens.If the line supplies a load of 20 MW at 0.9 p.f. lagging at 66 kV at the receiving end,
calculate by nominal ‘p’ method, the regulation and efficiency of the line.Neglect leakage.'''
import math as m
import cmath as cm
#For a 100 km line
#resistance/phase
R = 0.1 * 100 #ohm
#inductive reactance/phase
Xl = 0.5 * 100 #ohm
#Capacitive susceptance/phase
Yc = 10.0 * 1.0e-6 * 100 #siemens
#Susceptance at each end
Yc = 1j*Yc/2 #siemens
#Voltage at receiving end is
Vr = 66.0e+3/1.732 #V
Ir = 20.0e+6/(1.732*66e+3*0.9) #A
theta = m.acos(0.9)
Irl = cm.rect(Ir,-theta) #A
Ic1 = Vr*Yc #A
Il = Irl + Ic1 #A
#drop/conductor
Zl = R + 1j*Xl #ohm
drop = Il*Zl #V
#Sending end voltage is
Vs = Vr + drop #V
#Line value of sending end voltage
Vsl = abs(Vs)*1.732/1000 #kV
Ic2 = Vs*Yc #A
#Sending end current is
Is = Ic2 + Il #A
#Phase angle between Vs and Is is
angle = abs(cm.phase(Vs)) + abs(cm.phase(Is))
pf = m.cos(angle) #(lag)
#(i) Regulation is
reg = (abs(Vsl) - 66.0)/66.0 * 100
print "Regulation = ",round(reg,2),"%"
#(ii)Efficiency
#Input power is
pin = 1.732*Vsl*abs(Is)*pf*1000.0/1.0e+6 #MW
eff = 20.0/pin*100 #%
print "Transmission efficiency = ",round(eff,2),"%."
```

In [13]:

```
'''(a) A 50-Hz, 3-phase, 100-km long line delivers a load of 40 MVA at 110 kV and 0.7 p.f. lag. The line constants
(line to neutral) are :
resistance of 11 ohms, inductive reactance of 38 ohms and capacitive susceptance of 3 * 10−4 siemens. Find the sending-end
voltage, current,power factor and efficiency of power transmission.
(b) draw the vector diagram.
(c) If the sending-end voltage is held constant and load is removed, calculate the receiving-end voltage and current.'''
import math as m
import cmath as cm
#resistance/phase
R = 11.0 #ohm
#inductive reactance/phase
Xl = 38.0 #ohm
#Capacitive susceptance/phase
Yc = 3.0e-4 #siemens
#Susceptance at each end
Yc = 1j*Yc/2 #siemens
#Voltage at receiving end is
Vr = 110.0e+3/1.732 #V
Ir = 40.0e+6/(1.732*110e+3) #A
theta = m.acos(0.7)
Irl = cm.rect(Ir,-theta) #A
Ic1 = Vr*Yc #A
Il = Irl + Ic1 #A
#drop/conductor
Zl = R + 1j*Xl #ohm
drop = Il*Zl #V
#Sending end voltage is
Vs = Vr + drop #V
#Line value of sending end voltage
Vsl = abs(Vs)*1.732/1000 #kV
Ic2 = Vs*Yc #A
#Sending end current is
Is = Ic2 + Il #A
print "Line value of sending end voltage = ",round(Vsl,2),"kV."
print "Sending end current = ",round(abs(Is),2),"A."
#Phase angle between Vs and Is is
angle = abs(cm.phase(Vs)) + abs(cm.phase(Is))
pf = m.cos(angle) #(lag)
#Efficiency
#Input power is
pin = 1.732*Vsl*abs(Is)*pf*1000.0/1.0e+6 #MW
eff = (40.0*0.7)/pin*100 #%
print "Transmission efficiency = ",round(eff,2),"%."
#(c)Under no-load condition, current in the conductor is Ic1
#Drop/phase =
drop = Ic1*Zl #V
#Sending end voltage is
Vs = Vr + drop #V
Ic2 = Vs*Yc #A
Is = Ic1 + Ic2 #A
print "Receiving end voltage = ",round(abs(Vs),2),"V."
print "Receiving end current = ",round(abs(Is),2),"A."
```

In [21]:

```
'''Find the following for a single-circuit transmission line delivering a load of 50 MVA at 110 kV and p.f. 0.8 lagging :
(i) sending-end voltage, (ii) sending-end current, (iii) sending-end power, (iv) efficiency of
transmission. (Given A = D = 0.98 ∠3º , B = 110 ∠75º ohm, C = 0.0005 ∠80º ohm).'''
import math as m
import cmath as cm
#Receiving end voltage Vr is
Vr = 110.0/1.732 #kV
Ir = 50.0e+6/(1.732*110e+3) #A
theta = m.acos(0.8)
Irl = cm.rect(Ir,theta) #A
#Now,
A = D = cm.rect(0.98,3*3.14/180)
B = cm.rect(110.0,75*3.14/180)
C = cm.rect(0.0005,80*3.14/180)
#(i)Sending end voltage is
Vs = A*Vr*1000 + B*Irl #V
print "Sending end voltage is = ",round(abs(Vs),2),"V."
#(ii)Sending end current is
Is = C*Vr*1000 + D*Irl #A
print "Sending end current is = ",round(abs(Is),2),"A."
#Angle between Vs and Is is
angle = cm.phase(Is) - cm.phase(Vs)
pf = m.cos(angle)
#(iii)Sending end power is
s_pwr = 3*abs(Vs)*abs(Is)*pf/1.0e+6 #MW
print "Sending end power is = ",round(s_pwr,2),"MW."
#Receiving end power is
r_pwr = 50.0*0.8 #MW
#(iv)Transmission efficiency
eff = r_pwr/s_pwr*100 #%
print "Transmission efficiency = ",round(eff,2),"%"
```

In [22]:

```
'''A 150 km, 3-φ, 110-V, 50-Hz transmission line transmits a load of 40,000 kW at 0.8 p.f. lag at receiving end.
resistance/km/phase = 0.15 ohm, reactance/km/phase = 0.6 ohm ; susceptance/km/phase = 10e−5 S
(a) determine the A, B, C and D constants of the line . (b) find regulation of the line.'''
import math as m
import cmath as cm
#For a 150km length line
R = 0.15*150.0 #ohm
X = 0.6*150.0 #ohm
Y = 1j*1.0e-5*150.0 #S
Z = R + 1j*X #ohm
#(a)
A = D = 1 + Y*Z/2
B = Z
C = Y*(1 + Y*Z/4)
print "A = " ,A
print "B = " ,B
print "C = " ,C
print "D = " ,D
#(b)
Vr = 110/1.732*1000 #V
Ir = 40.0e+6/(1.732*110*0.8*1000)#A
theta = m.acos(0.8)
Irl = cm.rect(Ir,-theta) #A
#Sending end voltage is
Vs = A*Vr + B*Irl #V
#Now, Vs = A*Vro => Vro = Vs/A
Vro = Vs/A #V
#Voltage regulation
reg = (abs(Vro) - abs(Vr))/abs(Vr)*100
print "Voltage regulation = ",round(reg,2),"%."
```

In [24]:

```
'''A 132-kV, 50-Hz, 3-phase transmission line delivers a load of 50 MW at 0.8 p.f. lagging at receiving-end.
The generalised constants of the transmission line are A = D = 0.95 ∠1.4º ; B = 96 ∠ 7.8º ; C = 0.0015 ∠90º
Find the regulation of the line and the charging current. Use nominal T-method.'''
import math as m
import cmath as cm
#Given
A = D = cm.rect(0.95,1.4*3.14/180)
B = cm.rect(96.0,78*3.14/180)
C = cm.rect(0.0015,90*3.14/180)
#Receiving end voltage
Ir = 50e+6/(1.732*132e+3*0.8) #A
theta = m.acos(0.8)
Irl = cm.rect(Ir,-theta) #A
Vr = 132e+3/1.732 #V
#Sending end voltage
Vs = A*Vr + B*Irl #V
#Sending end current
Is = C*Vr + D*Irl #A
Vro = abs(Vs)/abs(A)
#% Regulation
reg = (abs(Vro) - abs(Vr))/abs(Vr)*100 #%
print "Regulation = ",round(reg,2),"%"
#Charging current
Ic = Is - Irl #A
print "Charging current Ic = ",complex(round(Ic.real,2),round(Ic.imag,2)),"A."
```

In [10]:

```
'''A 3-phase transmission line consists of two lines 1 and 2 connected in series,line 1 being at the sending end and
2 at the receiving end. The respective auxiliary constants of the two lines are :
A1, B1, C1, D1 and A2, B2, C2, D2. Find the A, B, C, D constants of the whole line which is equivalent to two
series-connected lines.'''
from sympy import Symbol
A1 = Symbol('A1')
B1 = Symbol('B1')
C1 = Symbol('C1')
D1 = Symbol('D1')
A2 = Symbol('A2')
B2 = Symbol('B2')
C2 = Symbol('C2')
D2 = Symbol('D2')
Vr = Symbol('Vr')
Ir = Symbol('Ir')
#--------For A &C---------------#
Ir = 0
Vr = 1
#For line no. 2
V = A2*Vr + B2*Ir
I = C2*Vr + D2*Ir
#For line no. 1
Vs = A1*V + B1*I
Is = C1*V + D1*I
#For A
print "A = ",Vs
print "C = ",Is
#--------For B & D---------------#
Ir = 1
Vr = 0
#For line no. 2
V = A2*Vr + B2*Ir
I = C2*Vr + D2*Ir
#For line no. 1
Vs = A1*V + B1*I
Is = C1*V + D1*I
#For A
print "B = ",Vs
print "D = ",Is
```

In [17]:

```
'''Find the disruptive critical voltage for a transmission line having :
conductor spacing = 1 m ; conductor (stranded) radius = 1 cm
barometric pressure = 76 cm of Hg ; temperature = 40ºC
Air break-down potential gradient (at 76 cm of Hg and at 25ºC) = 21.1 kV (r.m.s.)/cm.'''
import math as m
#Given
g0 = 21.1 #kV/cm (air breakdown potential gradient)
m0 = 0.85 #(assumed)
d = 3.92*76/(273 + 40)
r = 1.0 #cm
D = 100.0 #cm
#Vc = 2.3*m0*g0*d*r*log(D/r)
Vc = 2.3*m0*g0*d*r*m.log10(D/r) #kV
#Line voltage
Vc = 1.732*Vc
print "Critical voltage = ",round(Vc,2),"kV."
```

In [23]:

```
'''Find the disruptive critical and visual corona voltage of a grid-line operating at 132 kV.
conductor dia = 1.9 cm ; conductor spacing = 3.81 m
temperature = 44ºC ; barometric pressure = 73.7 cm
conductor surface factor : fine weather = 0.8 ; rough weather = 0.66.'''
import math as m
#Given
m0 = 0.8 #
d = 3.92*73.7/(273 + 44)
r = 1.9 #cm
D = 381.0 #cm
#Vc = 2.3*m0*g0*d*r*log(D/r)
Vc = 48.8*m0*d*r/2*m.log10(2*D/r) #kV
#Line voltage
Vc = 1.732*Vc
print "Critical voltage = ",round(Vc,2),"kV."
#(b)
#Vv = 2.3*g0*mv*d*r*(1 + 0.3/root(d*r))*log10(D/r)
mv = 0.66
Vv = 48.8*mv*d*r*(1 + 0.3/m.sqrt(d*r))*m.log10(D/r)
print "visual corona voltage = ",round(Vv,2),"kV."
```

In [2]:

```
'''A certain 3-phase equilateral transmission line has a total corona loss of 53 kW at 106 kV and a loss of 98 kW at 110.9 kV.
What is the disruptive critical voltage between lines? What is the corona loss at 113 kV?'''
from sympy import Symbol,solve,Eq
#total corona loss P o< (V- Vc)^2
# P1/P2 = (V1 - Vc)^2/(V2 - Vc)^2
V1 = 106/1.732 #kV
V2 = 110.9/1.732 #kV
#Let Vc be distruptive critical voltage
Vc = Symbol('Vc')
#ratio P1/P2 =
P1_P2a = 53.0/98.0
#Ratio (V1 - Vc)^2/(V2 - Vc)^2
P1_P2b = (V1 - Vc)**2/(V2 - Vc)**2
#Equating the ratios
eq = Eq(P1_P2a,P1_P2b)
Vc = solve(eq)
Vc1 = Vc[0] #kV/km
#Now, W/98 = (Vb - Vc)^2/(V2 - Vc)^2
W = 98*(113/1.732 - Vc1)**2/(V2 - Vc1)**2 #kW
print "Critical disruptive voltage = ",round(Vc1,2),"kV/km."
print "Corona loss = ",round(W,2),"kW."
```

In [25]:

```
'''A 3-phase, 50-Hz, 220-kV transmission line consists of conductors of 1.2 cm radius spaced 2 metres at the corners of an
equilateral triangle. Calculate the corona power loss per km of the line at a temperature of 20ºC and barometric pressure of
72.2 cm.Take the surface factors of the conductor as 0.96.'''
import math as m
#As we know P = 241*(f+25)/d*root(r/D)*(V-Vc)^2
#Here,
d = 3.92*(72.2)/(273 + 20)
#Given
m0 = 0.96 # (surface factors)
D = 200.0 #cm (distance btwn condr.)
r = 1.2 #cm (radius of condr.)
#Critical Voltage
Vc = 48.8*m0*d*r*m.log10(D/r) #kV/phase
V = 220.0/1.732 #kV/phase
P = 241*(50+25)/d*m.sqrt(r/D)*(V-Vc)**2*1.0e-5 #kW/km/phase
#Total loss for 3-phase
loss = 3*P #kW/km/phase
print "corona power loss per km = ",round(loss,2),"kW/km/phase."
```

In [26]:

```
'''A single-core lead-covered cable is to be designed for 66-kV to earth. Its conductor radius is 1.0 cm and its three insulating
materials A, B, C have permittivities of 5.4 and 3 respectively with corresponding maximum safe working stress of 38 kV per cm
(r.m.s. value), 26-kV per cm and 20-kV per cm respectively. Find the minimum diameter of the lead sheath.'''
import math as m
from sympy import solve,Symbol,Eq
#Given
gA = 38.0 #kV/cm (working stress on A)
gB = 26.0 #kV/cm (working stress on B)
gC = 20.0 #kV/cm (working stress on C)
ea = 5.0 # (rel. permittivity of A)
eb = 4.0 # (rel. permittivity of B)
ec = 3.0 # (rel. permittivity of C)
ra = 1.0 #cm (radius A)
#Working stress O< 1/(rel. permittivty)*(condr. radius)
#gA/gB = rb*eb/ra*ea
#Radius of B is
rb = (gA/gB)*(ra*ea/eb) #cm
#gA/gC = rc*ec/ra*ea
#Radius of C is
rc = (gA/gC)*(ra*ea/ec) #cm
#Now , V = g*r*2.3*log10(r1/r)
V1 = gA*ra*2.3*m.log10(rb/ra) #kV
V2 = gB*rb*2.3*m.log10(rc/rb) #kV
V = 66.0 #kV
V3 = V - V1 - V2 #V
#Let the radius of sheath be rs
#V3 = gC*rc*2.3*m.log10(rs/rc) #kV . Therefore, rs is
rs = rc * 10**(V3/(gC*rc*2.3)) #cm
print "Sheath diameter = ",round(2*rs,2),"cm."
```

In [27]:

```
'''The capacitances per kilometer of a 3-phase cable are 0.63 μF between the three cores bunched and the sheath and 0.37 μF
between one core and the other two connected to sheath. Calculate the charging current taken by eight kilometres of this cable
when connected to a 3-phase, 50-Hz, 6,600-V supply.'''
#According to question 0.63 = 3*Cs
Cs = 0.63/3 #uF/km
#Also 0.37 = 2*C1 + Cs
C1 = (0.37 - Cs)/2 #uF/km
#For 8 km
Cs = Cs*8 #uF
C1 = C1*8 #uF
Cn = Cs + 3*C1 #uF
Vp = 6600.0/1.732 #V
w = 2*3.14*50.0 #rad/s
#Charging current is
Ic = Vp*(w*Cn*1e-6) #A
print "Charging current = ",round(Ic,2),"A."
```

In [23]:

```
'''A 3-core, 3-phase belted cable tested for capacitance between a pair of cores on single phase with the third core earthed,
gave a capacitance of 0.4 mF per km. Calculate the charging current for 1.5 km length of this cable when connected to 22 kV,
3-phase,50-Hz supply.'''
Cl = 0.4 #uF (Capacitance)
Vl = 22000.0 #V (line voltage)
w = 2*3.14*50 #rad/s
#Charging current
Ic = (2.0/1.732)*Vl*Cl*w*1.0e-6 #A/km
#Charging current for 15 km
Ic = 15*Ic #A
print "Charging for 15 km = ",round(Ic),"A."
```

In [24]:

```
'''A 3-core, 3-phase metal-sheathed cable has (i) capacitance of 1 μF between shorted conductors and sheath and (ii) capacitance
between two conductors shorted with the sheath and the third conductor 0.6 μF. Find the capacitance
(a) between any two conductors (b) between any two shorted conductors and the third conductor.'''
#(a)
#(i)As we know 3*Cs = 1.0
Cs = 1.0/3 #uF
#(ii) 2*C1 + Cs = 0.6 #uF
C1 = (0.6 - Cs)/2 #uF
print "Capacitance (i) = ",round(Cs,2),"uF."
print "Capacitance (ii) = ",round(C1,2),"uF."
#(b)
#capacitance between 2 shorted conductors and the other is given by
Cn = 2*C1 + (2.0/3)*Cs #uF
print "capacitance between 2 shorted conductors and the other = ",round(Cn,2),"uF."
```

In [28]:

```
'''A 2-wire a.c. feeder 1 km long supplies a load of 100 A at 0.8 p.f. lag 200 volts
at its far end and a load of 60 A at 0.9 p.f. lag at its mid-point. The resistance and reactance per km
(lead and return) are 0.06 ohm and 0.08 ohm respectively. Calculate the voltage drop along the
distributor from sending end to mid-point and from mid-point to far end.'''
import math as m
import cmath as cm
#Voltage at C
Vc = 200.0 #V
theta = m.acos(0.8)
Ic = 100.0 #A
Icl = cm.rect(Ic,-theta) #A
#Loop impedance of feeder BC is
Z = (0.06 + 1j*0.08)/2 #ohm
#Voltage drop in BC
drop = Icl*Z #V
#Voltage at B is
Vb = Vc + drop #V
#Current at B is
Ib = 60.0 #A
theta = m.acos(0.9)
Ibl = cm.rect(Ib,-theta) #A
#Current in feeder AB is
Iab = Ibl + Icl #A
#Drop in AB is
dropab = Iab*Z #V
print "Voltage drop from A to B = ",complex(round(dropab.real,2),round(dropab.imag,2)),"V."
```

In [26]:

```
'''A single-phase a.c. distributor 500 m long has a total impedance of (0.02 + j 0.04) ohm and is fed from one end at
250V. It is loaded as under :
(i) 50 A at unity power factor 200 m from feeding point.
(ii) 100 A at 0.8 p.f. lagging 300 m from feeding point.
(iii) 50 A at 0.6 p.f. lagging at the far end.
Calculate the total voltage drop and voltage at the far end.'''
#Using 3rd method
import math as m
import cmath as cm
#The center of gravity(C.G) of load is at the following distance from feeding end
cg = (50.0*200 + 100.0*300 + 50.0*500)/(50 + 100 + 50) #m
#Value of resistance upto CG
R = cg*0.02/500 #ohm
#Value of reactance upto CG
X = cg*0.04/500 #ohm
#Average pf
pf = (50*1 + 100.0*0.8 + 50.0*0.6)/200
cosQ = pf
sinQ = m.sqrt(1 - pf*pf)
#Drop is
Itot = 50.0 + 100.0 + 50.0 #A
drop = 200.0*(R*cosQ + X*sinQ) #V
print "drop = ",round(drop),"V."
```

In [29]:

```
'''A single-phase distributor, one km long has resistance and reactance per conductor of 0.2 ohm and 0.3 ohm respectively. At the
far end, the voltage VB = 240 V and the current is 100 A at a power factor of 0.8 lag. At the mid-point A of the distributor
current of 100 A is tapped at a power factor of 0.6 lag with reference to the voltage VA at the mid-point. Calculate the supply
voltage VS for the distributor and the phase angle between VS and VB.'''
import math as m
import cmath as cm
#Given
Vb = 240.0 #V (Voltage at B)
Ib = 100.0 #A (current)
theta = m.acos(0.8)
Ibl = cm.rect(Ib,-theta) #A
X = 0.2 + 1j*0.3 #ohm
#Drop over AB
dropab = Ibl*(X) #V
#Voltage at A
Va = Vb + dropab #V
#Phase angle between A and B
ang = cm.phase(Va)
theta2 = m.acos(0.6)
theta2 = theta2 - ang
Ia = 100.0 #A
Ial = cm.rect(Ia,-theta2) #A
#Total I
I = Ial + Ibl #A
#Drop in section
dropsa = I*X #V
#Voltage at S
Vs = Va + dropsa #V
print "Supply voltage = ",round(abs(Vs)),"V."
print "Supply Voltage lead B by = ",round(cm.phase(Vs)*180/3.14,2),"degrees."
```

In [27]:

```
'''A 1-phase ring distributor ABC is fed at A. The loads at B and C are 20 A at 0.8 p.f. lagging and 15 A at 0.6 p.f.
lagging respectively, both expressed with reference to voltage at A. The total impedances of the sections AB, BC and
CA are (1 + j1), (1 + j2) and (1 + j3) ohm respectively. Find the total current fed at A and the current in each section.'''
import math as m
import cmath as cm
#Current in AB is
theta = m.acos(0.8)
Iab = cm.rect(20,-theta)
#Current in AC is
theta = m.acos(0.6)
Iac = cm.rect(15,-theta)
#Impedances of dif. section
Zab = 1 + 1j #ohm
Zbc = 1 + 1j*2 #ohm
Zca = 1 + 1j*3 #ohm
#Drop over AB is
dropab = Iab*Zab #V
#Drop over AC is
dropac = Iac*Zca #V
#Potential diff. B and C is
pd_bc = dropac - dropab #V
#Equivalent Thevenin's thm impedance across bc
Ztot = Zab + Zca + Zbc #ohm
#Current in BC
Ibc = pd_bc/Ztot #A
#Total current in AB is
Iab2 = Iab + Ibc #A
#Total current in BC is
Ibc2 = Iac - Ibc #A
#Total current fed at point A
Ia = Iab2 + Ibc2 #A
print "Ia = ",Ia,"A."
```

In [28]:

```
'''A 2-wire ring distributor ABC is supplied at A at 400 V. Point loads of 20 A at a p.f. of 0.8 lagging and 30 A at a p.f. 0.6
lagging are tapped off at B and C respectively. Both the power factors refer to the voltage at A. The respective go-and-return
impedances of sections AB,BC and CA are (1 + j2) ohm, (2 + j3) ohm and (1 + j3) ohm. Calculate the current flowing through each
section and the potentials at B and C. Use Superposition theorem.'''
import math as m
import cmath as cm
#Current in AB is
theta = m.acos(0.8)
Iab = cm.rect(20,-theta)
#Current in AC is
theta = m.acos(0.6)
Iac = cm.rect(30,-theta)
#Impedances of dif. section
Zab = 1 + 1j*2 #ohm
Zbc = 2 + 1j*3 #ohm
Zca = 1 + 1j*3 #ohm
#Let the currents in AB and AC is Ia1 and Ia2
Ia1 = Iab*(Zbc + Zca)/(Zbc + Zca + Zab) #A
Ia2 = Iab - Ia1 #A
#Let the currents in AB and AC is Ia11 and Ia22
Ia11 = Iac*(Zca)/(Zbc + Zca + Zab) #A
Ia22 = Iac - Ia11 #A
#As per superposition thm,
I1 = Ia1 + Ia11 #A
I2 = Ia2 + Ia22 #A
I3 = Ia11 - Ia2 #A
#Potential Of B is
Vb = 400.0 - I1*Zab #V
#Potential of C is
Vc = 400.0 - I2*Zca #V
print "I1 = ",I1,"A."
print "I2 = ",I2,"A."
print "I3 = ",I3,"A."
print "Vb = ",Vb,"V."
print "Vc = ",Vc,"V."
```

In [11]:

```
'''A 3-phase ring main ABCD, fed from end A, supplies balanced loads of 50 A at 0.8 p.f. lagging at B, 120 A at u.p.f. at C and
70 A at 0.866 p.f. lagging at D, the load currents being referred to the voltage at point A.The impedance per phase of the various
line sections are :
section AB = (1 + j0.6)ohm ; section BC = (1.2 + j0.9) ohm
section CD = (0.8 + j0.5)ohm ; section DA = (3 + j2) ohm
Determine the currents in the various sections.'''
from sympy import Symbol
import math as m
import cmath as cm
import numpy as np
#Let the current in section AB = (x + jy)A
x = Symbol('x')
y = Symbol('y')
Iab = x + 1j*y #A
#Current in BC
theta = m.acos(0.8)
Icl = cm.rect(50.0,-theta) #A
Ibc = Iab - Icl #A
#Current in CD
Icd = Ibc - 120 #A
#Current in DA
theta = m.acos(0.866)
Idl = cm.rect(70.0,-theta) #A
Ida = Icd - Idl #A
#Applying kirchoff's law
V = (1 + 1j*0.6)*Iab + (1.2 + 1j*0.9)*Ibc + (0.8 + 1j*0.5)*Icd + (3 + 1j*2)*Ida #V
#Equating V to 0 we get following two equations
# 6*x - 4*y + 1009.8 = 0 - 1
# 4*x + 6*y - 302.2 = 0 - 2
a = np.array([[6,-4], [4,6]])
b = np.array([1009.8,302.2])
vec = np.linalg.solve(a, b)
x = vec[0]
y = vec[1]
Iab = x + 1j*y #A
#Current in BC
Ibc = Iab - Icl #A
#Current in CD
Icd = Ibc - 120 #A
#Current in DA
Ida = Icd - Idl #A
print "Iab = ",complex(round(Iab.real,2),round(Iab.imag,2)),"A"
print "Ibc = ",complex(round(Ibc.real,2),round(Ibc.imag,2)),"A"
print "Icd = ",complex(round(Icd.real,2),round(Icd.imag,2)),"A"
print "Ida = ",complex(round(Ida.real,2),round(Ida.imag,2)),"A"
```

In [29]:

```
'''A total load of 12,000 kW at a power factor of 0.8 lagging is transmitted to a substation by two overhead
three-phase lines connected in parallel. One line has a conductor resistance of 2 ohm per conductor and reactance
(line to neutral) of 1.5 ohm, the corresponding values for the other line being 1.5 and 1.2 ohm respectively. Calculate
the power transmitted by each overhead line.'''
import math as m
import cmath as cm
#Let us assume a line voltage of 1000 kV for convinience.
Z1 = 2 + 1j*1.5 #ohm
Z2 = 1.5 + 1j*1.2 #ohm
#Total load current
Il = 12000/(1.732*1000*0.8) #A
theta = m.acos(0.8)
Il1 = cm.rect(Il,-theta) #A
#Now
I1 = Il1*Z2/(Z1 + Z2) #A
#Power transmitted by 1st line
P1 = 1.732*I1.real*1000 #kW
#Now
I2 = Il1*Z1/(Z1 + Z2) #A
#Power transmitted by 1st line
P2 = 1.732*I2.real*1000 #kW
#Total power
power = P1 + P2 #kW
print "Power transmitted by 1st line = ",round(P1,2),"kW."
print "Power transmitted by 2nd line = ",round(P2,2),"kW."
print "Total power(check) = ",round(power,2),"kW."
```

In [30]:

```
'''For a string insulator with four discs, the capacitance of the disc is ten times the capacitance between the pin and earth.
Calculate the voltage across each disc when used on a 66-kV line. Also, calculate the string efficiency.'''
import math as m
from sympy import Symbol,solve,Eq
#Let C be self capacitance and kC be capacitance b/w each link and earth,
#Given
k = 10.0
#Let voltage across 1st disc be
V1 = Symbol('V1')
V2 = (1+k)/k*V1 #V
V3 = (1 + 3/k + 1/k**2)*V1 #V
V4 = (1 + 6/k + 5/k**2 + 1/k**3)*V1 #V
#Voltage V is
Va = V1 + V2 + V3 + V4 #kV
Vb = 66/1.73 #kV
eq = Eq(Va,Vb)
V1 = solve(eq)
V1l = V1[0] #kV
V2 = (1+k)/k*V1l #V
V3 = (1 + 3/k + 1/k**2)*V1l #V
V4 = (1 + 6/k + 5/k**2 + 1/k**3)*V1l #V
print "V1 = ",round(V1l,2),"kV"
print "V2 = ",round(V2,2),"kV"
print "V3 = ",round(V3,2),"kV"
print "V4 = ",round(V4,2),"kV"
#string efficiency
eff = 66.0/(4*1.732*V4)*100 #%
print "string efficiency = ",round(eff,2),"%"
```

In [31]:

```
'''Explain what is meant by string efficiency and how it can be improved. Each line of a 3-phase, 33-kV system is suspended by a
string of 3 identical insulator discs. The capacitance of each disc is 9 times the capacitance to ground. Find voltage distribution
across each insulator and the string efficiency. Suggest a method for improving the string efficiency.'''
import math as m
from sympy import Symbol,solve,Eq
#Let C be self capacitance and kC be mutual capacitance b/w each
#Given
k = 9.0
#Let voltage across 1st disc be
V1 = Symbol('V1')
V2 = (1+k)/k*V1 #V
V3 = (1 + 3/k + 1/k**2)*V1 #V
#Voltage V is
Va = V1 + V2 + V3 #kV
Vb = 33/1.732 #kV
eq = Eq(Va,Vb)
V1 = solve(eq)
V1l = V1[0] #kV
V2 = (1+k)/k*V1l #V
V3 = (1 + 3/k + 1/k**2)*V1l #V
print "V1 = ",round(V1l,2),"kV"
print "V2 = ",round(V2,2),"kV"
print "V3 = ",round(V3,2),"kV"
#string efficiency
eff = 33.0/(3*1.732*V3)*100 #%
print "string efficiency = ",round(eff,2),"%"
```

In [30]:

```
'''The bus-bar voltages of two stations A and B are 33 kV and are in phase. If station A sends 8.5 MW power at u.p.f.
to station B through an interconnector having an impedance of (3 + j4) ohm , determine the bus-bar voltage of station A
and the phase angle shift between the busbar voltages.'''
import cmath as cm
#Voltage of station B is
Vb = 33000.0/1.732 #V/phase
#Power transferred
pin = 8.5 #MW
#Current in interconnector
I = pin*1e+6/(1.732*33000)
#Voltage Va is
Va = Vb + I*(3+1j*4)
#Bus-bar voltage of station A is
Va1 = 1.732*abs(Va)/1000 #kV
print "Bus-bar voltage of station A = ",round(Va1,2),"kV"
print "phase angle = ",round(cm.phase(Va)*180/3.14,2),"degrees"
```

In [32]:

```
'''A transmission line conductor at a river crossing is supported from two towers at heights of 70 m above water level.
The horizontal distance between towers is 300 m. If the tension in conductor is 1,500 kg, find the clearance at a point
midway between the towers. The size of conductor is 0.9 cm2. Density of conductor material is 8.9 g/cm3 and suspension
length of the string is 2 metres.'''
#Given
l = 300.0/2 #m (distance of mid pt from one tower)
T = 1500.0 #kg-wt (tension)
#density = mass/volume. Therefore Weight (W) = rho*l*A
W = (0.9e-4)*(8.9e+3) #kg-wt
#Sag in the line
sag = (W*l**2)/(2*T) #m
#Clearance between conductor and water at mid-way
cler = 70.0 - sag - 2.0 #m
print "Clearance between conductor and water at mid-way = ",round(cler),"m."
```

In [32]:

```
'''The effective diameter of a line is 1.96 cm and it weighs 90 kg per 100 metre length. What would be the additional loading due
to ice of radial thickness 1.25 cm and a horizontal wind pressure of 30 kg/m^2 of projected area? Also, find the total weight
per metre run of the line.Density of ice is 920 kg/m^3.'''
import math as m
#Given
W = 90.0/100 #kg/m (weight of condr)
#Weight due to ice is Wi = 3.14*rho*R*(D+R)
Wi = 3.14*920.0*0.0125*(0.0196 + 0.0125) #kg/m (Weight of ice)
#Weight due to wind is Ww = P*(D + 2*R)
Ww = 30.0*(0.0196 + 2*0.0125) #kg/m
#Total weight is given by
Wt = m.sqrt((W+Wi)**2 + Ww**2) #kg-wt/m
print "Total weight per metre run of line = ",round(Wt,2),"kg-wt/m."
```

In [33]:

```
'''A transmission line has a span of 150 metres between supports, the supports being at the same level. The conductor has a
cross-sectional area of 2 cm^2. The ultimate strength is 5,000 kg/cm^2. The specific gravity of the material is 8.9. If the wind
pressure is 1.5 kg/m length of the conductor, calculate the sag at the centre of the conductor if factor of safety is 5.'''
import math as m
#Safety factor = Ultimate stress/Working stress
sf = 5.0 #Safety factor
wstress = 5000.0/sf #kg/cm^2
#Tension
A = 2.0 #cm^2 (cross-sectional area)
T = wstress*A #kg-wt
#Volume of 1m of conductor
V = A*100.0 #cm^3
#Wt of 1m of material Using density = mass/volume
W = 8.9*200.0/1000.0 #kg-wt
#W is 1.78 and not 1.98
#Total weight per metre
Wt = m.sqrt(W**2 + 1.5**2)
#Sag = W*l^2/2T
l = 150.0/2 #m (length from pole to centre)
sag = Wt*l**2/(2*T) #m
print "sag = ",round(sag,2),"m."
```

In [34]:

```
'''A transmission line has a span of 200 metres between level supports. The conductor has a cross-sectional area of 1.29 cm^2,
weighs 1,170 kg/km and has a breaking stress of 4,218 kg/cm2. Calculate the sag for a factor of safety of 5 allowing a wind pressure
of 122 kg per m^2 of projected area. What is the vertical sag?'''
import math as m
#Safety factor = ultimate stress/working stress
wstress = 4218.0/5 #kg/cm2 (working stress)
#Working tension
A = 1.29 #cm^2 (cross-sectional area)
T = wstress*A #kg-wt
W = 1170.0/1000 #kg-wt/m
#Let us now find diameter of the conductor from the equation
# A = 3.14 * d^2/4
d = m.sqrt(4*A/3.14)/100 #m
#Projected area of the conductor per metre length
proArea = d*1 #m^2
#Weight of wind exerted
Ww = 122*proArea #kg-wt/m
#Total weight
Wt = m.sqrt(W**2 + Ww**2) #kg-wt/m
#Slant sag
l = 200.0/2 #m
sag = Wt*l**2/(2*T) #m
#Now, tan θ = Ww/W
tanQ = Ww/W
#vertical sag
vsag = sag*m.cos(m.atan(tanQ)) #m
print "Verticle Sag = ",round(vsag,2),"m."
```

In [35]:

```
'''A transmission line has a span of 214 metres. The line conductor has a cross-section of 3.225 cm^2 and has an ultimate
breaking strengh of 2,540 kg/cm^2. Assuming that the line is covered with ice and provides a combined copper and ice load of
1.125 kg/m while the wind pressure is 1.5 kg/m run (i) calculate the maximum sag produced. Take a factor of safety of 3
(ii) also determine the vertical sag.'''
import math as m
#(i) Maximum sag
#Here,
W = 1.125 #kg-wt/m
Ww = 1.5 #kg-wt/m
Wt = m.sqrt(1.125**2 + 1.5**2) #kg-wt/m
#Safety factor = ultimate stress/working stress
wstress = 2540.0/3 #kg-wt/cm2
#Permissible tension
A = 3.225 #cm^2 (cross-sectional area)
T = wstress*(3.225) #kg-wt
#Sag is
l = 214.0/2 #m
sag = Wt*l**2/(2*T) #m
#(ii)Verticle Sag
#Now,
tanQ = Ww/W
cosQ = m.cos(m.atan(tanQ))
#vertical sag
vsag = sag*cosQ #m
print "Max. sag produced = ",round(sag,2),"m."
print "Verticle sag = ",round(vsag,2),"m."
```

In [33]:

```
'''Two towers of height 30 and 90 m respectively support a transmission line conductor at water crossing. The horizontal
distance between the towers is 500 m. If the tension in the conductor is 1,600 kg, find the minimum clearance of the
conductor and the clearance of the conductor mid-way between the supports. Weight of the conductor is 1.5 kg/m. Bases of
the towers can be considered to be at the water level.'''
#Given
l = 500.0/2 #m (mid-way of towers)
h = 90.0 - 30.0 #m (height)
T = 1600.0 #kg-wt (tension)
W = 1.5 #kg-wt/m (weight)
#Point of maximum sag is
x1 = l - h*T/(2*W*l)
#Sag is
sag = W*x1**2/(2*T) #m
#Minimum clearance is
cler = 30.0 - sag #m
print "Minimum clearance = ",round(cler,2),"m."
#Taking this point as reference , sag of mid-pt is
sag2 = W*(l-x1)**2/(2*T) #m
#Mid-point Clearance
cler2 = cler + sag2
print "Hence, clearance point = ",round(cler2,2),"m."
```

In [34]:

```
'''An overhead transmission line at a river crossing is supported from two towers at heights of 50 m and 100 m above the
water level, the horizontal distance between the towers being 400 m. If the maximum allowable tension is 1,800 kg and the
conductor weighs 1 kg/m, find the clearance between the conductor and water at a point mid-way between the towers.'''
#Given
h = 100.0 - 50.0 #m (height)
l = 400.0/2 #m (mid-way length)
T = 1800.0 #kg-wt (tension)
W = 1.0 #kg-wt/m (Weigth)
#Point of max sag
x1 = l - h*T/(2*W*l) #m
x2 = l + h*T/(2*W*l) #m
#Distance of mid-pt from the above point is
d1 = (x2 - x1)/2 #m
#Therefore height of P above max sag point is
h1 = W*d1**2/(2*T) #m
h2 = W*x2**2/(2*T) #m
#Therefore point P from top is
Psag = h2 - h1 #m
#Clearance above ground is
cler = 100.0 - Psag #m
print "Clearance of conductor from water surface = ",round(cler,2),"m."
```

In [18]:

```
'''A conductor is strung across a river, being supported at the two ends at heights of 20 m and 16 m respectively, from the bed
of the river. The distance between the supports is 375 m and the weight of the conductor = 1.2 kg/m.If the clearance of the
conductor from the river bed be 9 m, find the horizontal tension in the conductor. Assume a parabolic configuration and that
there is no wind or ice loading.'''
from sympy import Symbol,solve,Eq
#Given
l = 375.0/2 #m (mid-pt of towers)
h = 20.0 - 16.0 #m (height)
W = 1.2 #kg-wt/m
#Let T be the tension in conductor
T = Symbol('T')
x1 = l - h*T/(2*W*l) #m
#Minimum clearance
cler = 9.0 #m
sag = 16.0 - cler #m
#Now ,sag is also
sag2 = (W*x1*x1)/(2*T) #m
#Equating the two equations
eq = Eq(sag,sag2)
T = solve(eq)
T1 = T[0] #kg-wt/m
print "Horizontal Tension = ",round(T1,2),"kg-wt/m."
```