In [1]:

```
from scipy.integrate import quad
#Variable declaration
L = 3.0 #Length of section ACB of rail(km)
L_B_A = 2.0 #Distance of B from A(km)
I_load = 350.0 #Loading(A/km)
r_rail = 0.035 #Resistance of rail(ohm/km)
r_feed = 0.03 #Resistance of negative feeder(ohm/km)
#Calculation
def integrand(x):
return (I_load*(L-x))
ans, err = quad(integrand, 0, L_B_A)
I = ans/(L_B_A-0) #Current in negative feeder(A)
x = L-(I/I_load) #Distance from feeding point(km)
def integrand(x):
return (r_rail*I_load*x)
C, err = quad(integrand, 0, x) #Voltage at point P(V)
V = r_feed*L_B_A*I #Voltage produced by negative booster(V)
rating = V*I/1000 #Rating of the booster(kW)
#Result
print('Maximum potential difference between any two points of the rails, C = %.2f V' %C)
print('Rating of the booster = %.1f kW' %rating)
```

In [1]:

```
#Variable declaration
D = 50.0 #Distance between poles(m)
w = 0.5 #Weight of trolley wire per metre(kg)
T = 520.0 #Maximum tension(kg)
#Calculation
l = D/2 #Half distance b/w poles(m)
d = w*l**2/(2*T) #Sag(m)
wire_length = 2*(l+(2*d**2/(3*l))) #Length of wire required(m)
#Result
print('Maximum sag, d = %.4f metres' %d)
print('Length of wire required = %.f metres' %wire_length)
```