#Variable declaration
l=20;# in m
w=0.5;# weight per meter in kg
T=500;# Tension applied in kg
#Calculations
dell=(w*l**2)/(2*T);
two_S=2*(l+(2./3)*(dell**2/l));
#Result
print "Total Length(m) = %.5f"%two_S
import math
#Variable declaration
l=30;# in meter
w=0.72;# weight per meter in kg
E=640;# in kg/cm^2
d=1;# diameter in cm
#Calculations
T=E*(math.pi/4)*d**2;
dell=((w*l**2)/(2*T))*100;
#Result
print "sag(cm) = %.1f"%dell
#Variable declaration
l=30;# in meter
w1=0.9;# average weight of catenary wire in kg/m
w2=1.2#average weight of trolley wire in kg/m
#Calculations
w3=(20./100)*w2#average weight of dropper and fittings in kg/m
w=w1+w2+w3;
T=1000;#in kg
dell=(w*l**2)/(2*T);
#Result
print "sag(m) = %.3f"%dell
#Variable declaration
I=300;# in A
R=0.08;# in ohm
Vd=6;# voltage drop in volts
#Calculations
I_dash=((R*(I/2))-Vd)/R;
#Result
print "Current(A) = %.f"%I_dash
#Variable declaration
a=7;#far end voltage in volts
i=125;# in A
r=0.02;# in ohm
l=3;# in km
#Calculations
p=(i*r*l**2)/2;
I=((p-a)/(r*l));#
#Results
print "potential of the track at tha far end of the section in volts is %.2f"%p
print "Current carried by -ve feeder,I(A) = %.3f"%I
import sympy
from sympy.solvers import solve
from sympy import Symbol
#Variable declaration
ix=200;#amperes
r=0.02;#in ohms
#Calculations
x = Symbol('x')
y = solve(0*x**2 +12*x + 19, x)
ipx=ix*(3-(-1*y[0]));#in amperes
inx=2*ix;#in amperes
it=ipx+inx;#in amperes
#Result
print "current through negetive booster in amperes is %.2f"%it
import sympy
from sympy.solvers import solve
from sympy import Symbol
#Variable declaration
ix=250;#amperes
vb=2;#in volts
r=0.02;#in ohms
#Calculations
x = Symbol('x')
y = solve(0*x**2 +16*x - 27.6, x)
pc=vb+(ix*r*(1.6)**2)/2;#in volts
pd=((ix*r*(y[0]**2))/2);#in volts
tcurr= (1.6*ix)+((ix*(3.2-y[0])));#in amperes
vnf=r*tcurr;#in volts
bnb=vnf-vb;#in volts
cb=((bnb*tcurr)/1000);#in kw
#Result
print "maximum potential drop on any two points on the rails in volts is %.1f"%pc
print "capacity of booster in kW is %.2f"%cb
import sympy
from sympy.solvers import solve
from sympy import Symbol
#Variable declaration
i=200;# A/km
r=0.01;#in ohms/km
#Calculations
x = Symbol('x')
y = solve(0*x**2 +8*x - 20, x)
i1=400;#in amperes
i2=(4-y[0])*i#in amperes
tc=i1+i2;#in amperes
vcn=r*tc;#in volts
nb=vcn-4;#in volts
rb=(tc*10)/1000;#
#Result
print "rating of the booster in kW is %.f"%rb
#Variable declaration
vw=60;#in volts
vt=12;#in volts
vs=600;#in volts
vr=578;#volts
vn=10;#in volts
#Calculations
tv=vw+vt;#in volts
va=vs-tv;#in volts
vtn=tv-vn;#in volts
vad=vs-vr;#
vp=vtn-vad;#in volts
#Results
print "part (a)"
print "voltage available to trolley when it is at the far end without using boosters in volts is %.f"%va
print "part (b)"
print "positive booster should provide boost of ",(vp)," volts"