# CHAPTER 43: ELECTRIC TRACTION¶

## EXAMPLE 43.1 , PAGE NO :- 1716¶

In :
#A suburban train runs with an average speed of 36 km/h between two stations 2 km apart.Values of acceleration
#and retardation are 1.8 km/h/s and 3.6 km/h/s.Compute the maximum speed of the train assuming trapezoidal
#speed/time curve
################################################################################################################
import math

#Given

Va = 36.0*5/18.0     #m/s   (average speed)
alpha = 1.8*5/18.0   #m/s^2 (acc.)
beta = 3.6*5/18.0   #m/s^2  (ret.)
D = 2000.0            #m      (distance )
t = D/Va              #s      (time)
K = (alpha + beta)/(2*alpha*beta)  #(constant)
Vm = (t-math.sqrt(t*t-4*K*D))/(2*K)    #m/s   (max speed)
Vm = Vm*18/5.0         #km/h
print "Max speed of train is = ",round(Vm,2),"km/h."

Max speed of train is =  39.2 km/h.


## EXAMPLE 43.2 , PAGE NO :- 1716¶

In :
#A train is required to run between two stations 1.5 km apart at a schedule speed of 36 km/h,the duration of stops being
#25 seconds.The braking retardation is 3 km/h/s.Assuming a trapezoidal speed/time curve,calculate the acceleration if the
#ratio of maximum speed to average speed is to be 1.25
##########################################################################################################################

#Given
D = 1500.0          #m      (distance)
Vsch = 36.0*5/18.0  #m/s    (scheduled speed)
beta = 3.0*5/18.0   #km/h/s (ret.)

time = D/Vsch       #s      (scheduled time)
t_stop = 25.0       #s      (stopping time)
t = time-t_stop     #s      (actual time of run)
Va = D/t            #m/s    (average speed)
Vm = 1.25*Va        #m/s    (max speed)

#The value of K is
K = (D/(Vm*Vm))*(Vm/Va-1)
#We know that K = 1/2*(1/alpha + 1/beta).Therefore,value of alpha is
alpha = beta/(2*K*beta-1)       #m/s^2
alpha = alpha*18/5.0            #km/h/s
print "The acceleration is =",round(alpha,1),"km/h/s."

The acceleration is = 1.7 km/h/s.


## EXAMPLE 43.3 , PAGE NO :- 1716¶

In :
#Find the scheduled speed of an electric train for a run of 1.5km if the ratio of its maximum to average speed is
#1.25.It has a braking retardation of 3.6 km/h/s,acceleration of 1.8km/h/s and stop time of 21 seconds.Assume
#trapezoidal speed/time curve.
##################################################################################################################
import math

#Given
alpha = 1.8*5/18.0    #m/s^2  (acceleration)
beta  = 3.6*5/18.0    #m/s^2  (retardation)
D = 1500.0            #m      (distance)
ratio = 1.25                  #(Vm/Va)
t_stop = 21           #s       (stopping time)
K = 0.5*(1/alpha + 1/beta)

#Also constant K = (D/Vm^2)*(Vm/Va-1)
#Therefore Vm^2 = (D/K)*((Vm/Va)-1).
Vm = math.sqrt(D/K*(ratio-1))     #m/s   (Max. speed)
Va = Vm/ratio                     #m/s   (Avg. speed)
t = D/Va                          #s     (travel time)

tsch = t + t_stop                 #s     (schedule time)
Vsch = D/tsch                     #m/s   (scheduled speed)
Vsch = Vsch*18/5.0                #km/h
print "Schedule speed of train is",round(Vsch,1),"Km/h."

Schedule speed of train is 38.7 Km/h.


## EXAMPLE 43.4 , PAGE NO :- 1717¶

In :
#A train runs between two stations 1.6km apart at an average speed of 36 km/h.If the maximum speed is to be limited
#to 72km/h,acceleration to 2.7km/h/s,coasting retardation to 0.18 km/h/s and braking retardation to 3.2 km/h/s,compute
#the duration of acceleration,coasting and braking periods.Assume a simplified speed/time curve.
########################################################################################################################

from sympy import Eq,Symbol, solve
#Given
D = 1600          #m      (distance)
Va = 36.0*5/18.0  #m/s    (avg speed)
V1 = 72.0*5/18.0  #m/s    (max speed)
alpha = 2.7*5/18.0       #m/s^2 (acceleration)
beta =  3.6*5/18.0       #m/s^2 (braking retardation)
beta_c = 0.18*5/18.0      #m/s^2 (coasting retardation)
#Duration of acceleration
t1 = V1/alpha    #s

#Actual time of run
t = D/Va         #s
#Let us assume V2 be the speed at start of braking.

V2 = Symbol('V2')
t3 = V2/beta         #(braking period)
t2 = (V1-V2)/beta_c  #(coasting period)

eq = Eq(t1+t2+t3,t)
V2 =  solve(eq)
Ve2 = V2

#Now we know the value of V2 that is Ve2.
t3 = Ve2/beta         #(braking period)
t2 = (V1-Ve2)/beta_c  #(coasting period)
print "Duration of acceleration  = ",round(t1,1),"s."
print "Duration of coasting      = ",round(t2,1),"s."
print "Duration of braking       = ",round(t3,1),"s."
print "Total duration            = ",round(t,0),"s."

Duration of acceleration  =  26.7 s.
Duration of coasting      =  119.3 s.
Duration of braking       =  14.0 s.
Total duration            =  160.0 s.


## EXAMPLE 43.5 , PAGE NO :- 1724¶

In :
#The peripheral speed of a railway traction motor cannot be allowed to exceed 44m/s.If gear ratio is 18/75,motor armature
#diameter 42cm and wheel diameter 91cm,calculate the limiting value of the train speed.
###########################################################################################################################

#Given
gratio = 18/75.0           #(gear ratio)
Vmot = 44.0          #m/s    (speed of traction motor)
wdia = 0.91          #m     (wheel diameter)
mdia = 0.42          #m      (motor armature diameter)

#Maximum number of revolutions by armature (in 1s)
mrev = Vmot/(3.14*mdia)    #rps
#Maximum number of revolutions by driving wheel(in 1s)
wrev = mrev*gratio         #rps
#Maximum distance travelled by driving wheel (in 1s)
dist = wrev*(3.14*wdia)    #m
#Therefore,limiting speed is
vel = dist*18/5.0            #km/h
print "The limiting value of train speed = ",round(vel),"km/h."

The limiting value of train speed =  82.0 km/h.


## EXAMPLE 43.6 , PAGE NO :- 1724¶

In :
#A 250-tonne motor coach driven by four motors takes 20 seconds to attain a speed of 42 km/h,starting from rest on an ascending
#gradient of 1 in 80.The gear ratio is 3.5,gear efficiency 92%,wheel diameter 92cm train resistance 40N/t and rotational inertia
#10 percent of the dead weight.Find the torque developed by each motor.
##################################################################################################################################

#Given
M = 250.0        #tonne  (mass of motor)
Me = 1.1*250.0   #tonne  (mass of rotating motor)
Vm = 42.0        #km/h   (speed)
t1 = 20.0        #s      (time)
G = 1/80.0*100       #       (% gradient)
r = 40.0         #N/tonne(train reistance)
D = 0.92         #m      (wheel diameter)
gratio = 3.5     #       (gear ratio)
geff = 0.92      #       (gear efficiency)

a = Vm/t1        #        (acceleration)
#Now,tractive force is given by
Ft =  277.8*Me*a + 98*M*G + M*r   #N
#Now Ft = 2*gratio*geff*T/D.Therefore torque 'T' is
T = Ft*D/(2*gratio*geff)     #N-m
#There are  motors.so,torque by each motor is
torque = T/4      #N-m
print "Torque developed by each motor = ",round(torque),"N-m."

Torque developed by each motor =  7181.0 N-m.


## EXAMPLE 43.7 , PAGE NO :- 1724¶

In :
#A 250-tonne motor coach having 4 motors,each developing a torque of 8000 N-m during acceleration,starts from rest.If
#up-gradient is 30 in 1000,gear ratio 3.5,gear transmission efficiency 90%,wheel diameter 90cm,train resistance 50N/t,
#rotational inertia effect 10%,compute the time taken by the coach to attain a speed of 80km/h.
#If supply voltage is 3000V and motor efficiency 85%,calculate the current taken during the acceleration period.
#########################################################################################################################

#Given
M = 250.0    #tonne (mass of motor)
Me = 1.1*250 #tonne (mass of rotating motor)
r = 50.0     #N/t   (train resistance)
G = 30.0/1000*100  #  (% gradient)
torque = 8000 #N-m  (torque of each motor)
D = 0.90     #m     (wheel diameter)
gratio = 3.5 #      (gear ratio)
geff = 0.90  #      (gear efficiency)
Vm = 80      #km/h  (speed)
meff = 0.85  #      (Motor efficiency)
V = 3000.0   #      (Voltage)

T = 4*torque #      (total torque)
#Now,we Know that
Ft = 2*gratio*geff*T/D     #N
#Also,we know that Ft = 277.8*Me*a + 98MG + Mr
a = (Ft-98*M*G-M*r)/(277.8*Me)    #km/h/s(acceleration)
#Time taken to attain the speed
t1 = Vm/a       #s
#Power taken by motor is given by
Power = Ft*(5.0/18*Vm)/meff   #W
#Total current drawn is (using P = VI)
I = Power/V     #A
#Current drawn/motor is
cur = I/4       #A

print "Time taken to achieve speed of 80km/h is =",round(t1,1),"s."
print "Current drawn per motor is",round(cur,1),"A."

Time taken to achieve speed of 80km/h is = 44.3 s.
Current drawn per motor is 488.0 A.


## EXAMPLE 43.8 , PAGE NO :- 1725¶

In :
#A goods train weighing 500 tonne is to be hauled by a locomotive up an ascending gradient of 2% with an
#acceleation of 1 km/h/s.If the coefficient of adhesion is 0.25,train resistance 40N/t and effect of rotational
#inertia 10%,find the weight of locomotive and number of axles if load is not to increase beyond 21 tonne/axle.
###############################################################################################################

from sympy import Eq,Symbol, solve
#Given
mass = 500.0  #tonne      (mass of goods train)
a = 1         #km/h/s     (acceleration)
r = 40.0      #N/t        (train resistance)
G = 2.0       #           (% gradient)
w_axle = 21.0 #tonne/axle (weight per axle)
#Let Ml be  mass of locomotive
Ml = Symbol('Ml')
#Total mass is given by
M = mass + Ml
#Now,tractive force is given by
Ft1 = M*(277.8*1.1*a + 98*G + r)        #N
#Also,Maximum tractive force is given by
#As both Ft1 and Ft2 are same, therefore equating
eq = Eq(Ft1,Ft2)
Ml = solve(eq)
#Mass of locomotive 'M_l' is
M_l = Ml
#No of axles required are
no_axle = round(M_l)/w_axle
print "Weight of locomotive is =",round(M_l),"tonne."
print "Number of axles required are = ",round(no_axle)

Weight of locomotive is = 142.0 tonne.
Number of axles required are =  7.0


## EXAMPLE 43.9 , PAGE NO :- 1725¶

In :
#An electric locomotive weighing 100 tonne can just accelerate a train of 500 tonne(trailing weight) with an acceleration of
#1 km/h/s on an up-gradient of 0.1%.Train resistance is 45N/t and rotational inertia is 10%.If this locomotive is helped by another
#locomotive of 120 tonne,find:
#(i)the trailing weight that can now be hauled up the same gradient under the same conditions.
#Assume adhesive weight expressed as percentage of total dead weight as 0.8 for both locomotives.'''
#############################################################################################################################

#Given
Ml1 = 100.0  #tonne  (locomotive 1)
Ml2 = Ml1 + 120.0  #tonne  (locomotive 1&2)
mass = 500.0 #tonne  (trailing part)
r = 45.0     #N/t    (train resistance)
G = 0.1      #       (% gradient)
a = 1.0      #km/h/s (acceleration)

#Total mass of train and locomotive
M = Ml1 + mass   #tonne
Me = 1.1*M       #tonne
#Traction Force is
Ft = 277.8*Me*a + 98*M*G + M*r     #N
#Let coefficient_of_adhesion be 'ua'.Then the maximium tractive effort by locomotive 1 is Ft = 1000*ua*Ml1*9.8
ua = Ft/(1000*9.8*Ml1)

#Maximum tractive effort by locomotive 1&2 is
Ft2 = 1000*ua*Ml2*9.8           #N
#Also,Ft2 = M2*(277.8*1.1*a + G + r).Therefore,
M2 = Ft2/(277.8*1.1*a + 98*G + r)     #tonne
#(i)The trailing weight that can be hauled up is
wtrail = M2-Ml2   #tonne
#(ii)Now, in this case the total weight of train & locomotive is
M3 = mass + Ml2
#Tractive force Ft2 = M3*(277.8*1.1*a + 98G2 + r).Therefore,for max gradient 'G2'
G2 = (Ft2/M3-277.8*1.1*a-r)/98

print "The trailing weight that can now be hauled up =",round(wtrail,2),"tonne."

The trailing weight that can now be hauled up = 1100.0 tonne.


## EXAMPLE 43.10 , PAGE NO :- 1726¶

In :
#The average distance between stops on a level section of a railway is 1.25km.Motor-coach train weighing 200 tonne has a
#schedule speed of 30 km/h,the duration of stops being 30 seconds.The acceleration is 1.9 km/h/s and the braking retardation
#is 3.2 km/h/s.Train resistance to traction is 45 N/t.Allowance for rotational inertia is 10%.Calculate the specific energy
#output in Wh/t-km.Assume a trapezoidal speed/time curve.
##############################################################################################################################
import math as m
#Given
alpha = 1.9*5/18.0      #km/h/s    (acceleration)
beta = 3.2*5/18.0       #km/h/s    (retardation)
D = 1.25*1000.0         #m         (distance)
tstop = 30.0            #s         (stop time)
Vsch = 30*5/18.0        #m/s       (schedule speed)
r = 45.0                #N/t       (train resistance)
K = round((alpha + beta)/(2*alpha*beta),1)  #(constant K)

tsch = D/Vsch           #s          (schedule time)
t = tsch-tstop          #s          (running time)
#Now,max speed is given by
Vm = (t - m.sqrt(t*t-4*K*D))/(2*K)   #m/s
#Braking distance is given by(using newton's III equation of motion)
dist = Vm*Vm/(2*beta)   #m
#Therefore non-braking distance
D2 = (D - dist)/1000                 #km
Vm = Vm*18/5.0                     #km/h
D = D/1000                         #km
#Specific energy output is
spengy = 0.01072*(Vm*Vm/D)*1.1 + 0.2778*r*(D2/D)

print "Max speed = ",round(Vm,2),"km/h."
print "Specific energy output = ",round(spengy,2)," Wh/t-km."

Max speed =  44.32 km/h.
Specific energy output =  30.18  Wh/t-km.


## EXAMPLE 43.11 , PAGE NO :- 1726¶

In :
#A 300-tonne EMU is started with a uniform acceleration and reaches a speed of 40 Km/h in 24 seconds on a level track.
#Assuming trapezoidal speed/time curve,find specific energy consumption if rotational inertia is 8%,retardation is 3 km/h/s,
#distance between stops is 3 km,motor efficiency is 0.9 and train resistance is 49N/tonne.
#############################################################################################################################

#Given
M = 300.0     #tonne     (mass of train)
Mratio = 1.08 #          (Me/M)
Vm = 40.0     #km/h      (speed)
beta = 3.0    #km/h/s    (retardation)
r = 49.0      #N/t       (train resistance)
meff = 0.9    #          (motor efficiency)
D = 3.0       #km        (distance)

#Braking time is(using Newton's Ist eqn)
t3 = Vm/beta
#Distance travelled in braking time(using Newton's IInd eqn)
dist = 0.5*beta*t3*t3/3600   #km
#Non braking distance D2 is
D2 = D - dist    #km
#Specific energy consumption is given by,
spengy = 0.01072*(Vm*Vm/(meff*D))*Mratio + 0.2778*r/meff*(D2/D)   #Wh/t-km
print "The value of specific energy consumption is",round(spengy,1),"Wh/t-km."

The value of specific energy consumption is 21.6 Wh/t-km.


## EXAMPLE 43.12 , PAGE NO :- 1726¶

In :
#An electric train accelerates uniformly from rest to a speed of 50km/h in 25 seconds.It then coasts for 70 seconds
#against a constant resistance of 60N/t and is then braked to rest with uniform retardation of 3.0km/h/s in 12 seconds.
#Compute :-      (i)uniform acceleration                         (ii)coasting retardation
#(iii)schedule speed if station stops are of 20-second duration
#Allow 10% for rotational inertia.How will the scedule speed be affected if duration of stops is reduced to 15 seconds,
#other factors remaining the same?
##########################################################################################################################

#Given
V1 = 50.0    #km/h    (Max speed)
t1 = 25.0    #s       (accelerating time)
t2 = 70.0    #s       (coasting time)
r = 60.0     #N/t     (train resistance)
beta = 3.0   #km/h/s  (retardation)
t3 = 12.0    #s       (braking time)

#(i) Uniform acceleration is (using Newton's 1st eqn.)
alpha = V1/t1           #km/h/s
print "acceleration = ",round(alpha,1),"km/h/s."
#Now in braking period (using Newton's 1st eqn.)-> 0 = V2 - beta*t3
V2 = beta*t3            #km/h
#(ii)Now in coasting period (using Newton's 1st eqn.)-> V2 = V1 - beta_c*t2
beta_c = (V1-V2)/t2     #km/h/s
print "coasting retardation = ",round(beta_c,1),"km/h/s."
#distance travelled in accelerating period (using Newton's 2nd eqn.)
dis1 = 0.5*alpha*t1*t1/3600      #km
#distance travelled in coasting period (using Newton's 3rd eqn.)
dis2 = -(V2*V2 - V1*V1)/(2*beta_c*3600) #km
#distance travelled in braking period (using Newton's 2nd eqn.)
dis3 = 0.5*beta*t3*t3/3600       #km
#Total distance
D = dis1 + dis2 + dis3        #km
#Total time
T = t1 + t2 + t3 + 20.0       #s
#Scheduled Speed Vsch is
Vsch = D/T*3600      #km/h
print "The schedule speed = ",round(Vsch,1),"km/h."
#New Total time
T = t1 + t2 + t3 + 15.0
#New scheduled speed is
Vsch = D/T*3600      #km/h
print "The new schedule speed = ",round(Vsch,1),"km/h."

acceleration =  2.0 km/h/s.
coasting retardation =  0.2 km/h/s.
The schedule speed =  30.3 km/h.
The new schedule speed =  31.6 km/h.


## EXAMPLE 43.13 , PAGE NO :- 1727¶

In :
#A 350-tonne electric train runs up an ascending gradient of 1% with the following speed/time curves:
# 1.uniform acceleration of 1.6km/h/s for 25 seconds                 2.constant speed for 50 seconds
# 3.coasting for 30 seconds                                          4.braking at 2.56 km/h/s to rest.
#Compute the specific energy consumption if train resistance is 50N/t,effect of rotational inertia 10%,overall efficiency of
#transmission gear and motor,75%.
#############################################################################################################################

#Given
M = 350.0   #tonne      (weight of train)
Me = 1.1*M  #tonne      (effect of rot. inertia)
G = 1.0     #           (% gradient)
alpha = 1.6 #km/h/s     (acceleration)
t1 = 25.0   #s          (acceleration time)
t2 = 50     #s          (constant speed time)
t3 = 30     #s          (coasting time)
beta = 2.56 #km/h/s     (braking retardation)
r = 50.0    #N/t        (train resistance)
meff = 0.75 #           (motor efficiency)

V1 = alpha*t1  #km/h    (Max speed attained)
#Tractive force during coasting is
Ft = 98*M*G + M*r        #N
#Also,Tractive force during coasting is given by
#Ft = 277.8*Me*beta_c . Therefore beta_c is
beta_c = Ft/(277.8*Me)   #km/h/s

#During Coasting period.(Using Newton's 1st eqn.) . "V2" is given by
V2 = V1 - beta_c*t3      #km/h
t4 = V2/beta             #s    (braking time)

#Distance travelled during acceleration period.
dis1 = 0.5*alpha*t1*t1/3600     #km
#Distance travelled during constant speed period.
dis2 = V1*t2/3600      #km
#Distance travelled during coasting period.
dis3 = (V1+V2)/2*t3/3600    #km
#Distance travelled during braking period.
dis4 = 0.5*V2*t4/3600       #km
#Total distance between stops
D = dis1 + dis2 + dis3 + dis4     #km
#Distance travelled during acceleration and constant speed period
D2 = dis1 + dis2                  #km
#Specific energy consumption is given by
spengy = (0.01072*(V1*V1/D)*(Me/M) + 27.25*G*(D2/D) + 0.2778*r*(D2/D))/meff #Wh/t-km

print "The specific energy consumption is =",round(spengy,1),"Wh/t-km."

The specific energy consumption is = 63.1 Wh/t-km.


## EXAMPLE 43.14 , PAGE NO :- 1728¶

In :
#An ore-carrying train weighing 5000 tonne is to be hauled down a gradient of 1:50 at a maximum speed of 30km/h
#and started on a level track at an acceleration of 0.29 km/h/s.How many locomotives,each weighing 75 tonne,will
#have to be employed?
#Train resistance during starting = 29.4 N,Train resistance at 30km/h = 49N/t,Coefficient of adhesion = 0.3
#Rotational inertia = 10%
################################################################################################################################

#Given
M = 5000.0       #tonne         (Mass of train)
Ml = 75.0        #tonne         (Mass of locomotive)
Vm = 30.0        #km/h          (Max speed)
a = 0.29         #km/h/s        (acceleration)
r1 = 49.0        #              (Train resistance at 30km/h)
r2 = 29.4        #              (Train resistance at starting)
ua = 0.3         #              (coefficient of adhesion)

#Downward force due to gravity
F = M*G*9.8*1000     #N
#Train resistance
Fres = r1*M          #N
#Braking force required is
Fbrk = F-Fres        #N
#Max. braking force which one locomotive can produce.
#F = 1000*ua*M*g
Fbrk_1 = 1000*ua*Ml*9.8   #N
#Therefore, Number of locomotives required for braking
num1 = Fbrk/Fbrk_1
num1 = round(num1)+ 1
#Considering the starting case.Tractive force required is
Ft = 277.8*a*M*1.1 + M*r2
#Therefore, Number of locomotives required for starting
num2 = Ft/Fbrk_1
#Number of locomotives required
if num1>num2:
num = num1
else:
num = num2
print "Total number of locomotives required are = ",round(num)

Total number of locomotives required are =  4.0


## EXAMPLE 43.15 , PAGE NO :- 1729¶

In :
#A 200-tonne electric train runs according to the following quadrilateral speed/time curve:
# 1. uniform acceleration from rest at 2 km/h/s for 30 seconds.
# 2. coasting for 50 seconds
# 3. duration of braking:15 seconds
#If up-gradient is =1%,train resistance = 40N/t,rotational inertia effect = 10%,duration of stops = 15s and overall
#efficiency of gear and motor = 75%,find
#(i)schedule speed (ii)specific energy consumption (iii)how will the value of specific energy consumption change if
########################################################################################################################

#Given
M = 200.0    #tonne   (Mass of train)
Me = 1.1*200.0    #tonne   (rotational inertia effect on mass)
alpha = 2.0  #km/h/s  (acceleration)
t1 = 30.0    #s       (acceleration time)
t2 = 50.0    #s       (coasting time)
t3 = 15.0    #s       (braking time)
G = 1.0      #        (% gradient)
r = 40.0     #N/t     (train resistance)
tstop = 15.0 #s       (stop time)
meff = 0.75  #        (motor efficiency)

V1 = alpha*t1   #km/h  (Max speed)
#During coasting retardation force is
Fr = 98*M*G + M*r      #N
#Also this retardation force in terms of coasting retardation beta_c is
#Fr = 277.8*Me*beta_c.Therefore,
beta_c = Fr/(277.8*Me) #km/h/s
#Using newton's Ist eqn in coasting period
V2 = V1-beta_c*t2      #km/h

#Braking retardation is
beta = V2/t3
#Distance travelled during acceleration
dist1 = 0.5*alpha*t1*t1/3600    #m
#Distance travelled during coasting
dist2 =  (V1+V2)/2*t2/3600  #m
#Distance travelled during braking
dist3 = 0.5*beta*t3*t3/3600    #m
#Total distance travelled
D = dist1 + dist2 + dist3      #km
#Total schedule time
T = t1 + t2 + t3 + tstop       #s
#(i)Schedule speed
Vsch = D/T*3600                     #km/h
print "Scheduled speed = ",round(Vsch,1),"Km/h."
#(ii)Specific energy consumption is given by
spengy = (0.01072*(V1*V1/D)*(Me/M) + 27.25*G*(dist1/D)+ 0.2778*r*(dist1/D))/meff  #Wh/t-km
print  "Specific energy consumption for up-gradient is = ",round(spengy,2),"Wh/t-km."
#If there is a down gradient then during coasting accelerative force is
Fa = 98*M*(-G) + M*r
#Also this accelerative force in terms of coasting acceleration alpha_c is
#Fa = 277.8*Me*alpha_c.Therefore,
alpha_c = Fa/(277.8*Me) #km/h/s
#Using newton's Ist eqn in coasting period
V2 = V1 - alpha_c*t2      #km/h
#Braking retardation is
beta = V2/t3
#Distance travelled during acceleration
dist1 = 0.5*alpha*t1*t1/3600    #m
#Distance travelled during coasting
dist2 =  (V1+V2)/2*t2/3600  #m
#Distance travelled during braking
dist3 = 0.5*beta*t3*t3/3600    #m
#Total distance travelled
D = dist1 + dist2 + dist3      #km
#(iii)Specific energy consumption is given by
spengy = (0.01072*(V1*V1/D)*(Me/M) - 27.25*G*(dist1/D)+ 0.2778*r*(dist1/D))/meff  #Wh/t-km
print  "Specific energy consumption for down-gradient is = ",round(spengy,2),"Wh/t-km"

Scheduled speed =  32.9 Km/h.
Specific energy consumption for up-gradient is =  69.08 Wh/t-km.
Specific energy consumption for down-gradient is =  39.58 Wh/t-km


## EXAMPLE 43.16 , PAGE NO :- 1730¶

In :
#An electric train has an average speed of 45 kmph on a level track between stops 1500m apart.It is accelerated at
#1.8km/h/s and is braked at 3 km/h/s.Draw the speed-time curve for the run.
####################################################################################################################

import math as m
import matplotlib.pyplot as plt
%matplotlib inline

#Given
alpha = 1.8         #km/h/s   (acceleration)
beta  = 3.0         #km/h/s   (retardation)
S = 1.5             #km       (Distance of run)
Va = 45.0           #km/h     (Average speed)

T = S/Va*3600       #s        (Time of run)

#Constant K is given by
K = 0.5*(1/alpha + 1/beta)
#Max speed is given by
Vm = T/(2*K)-m.sqrt(T*T/(4*K*K) - 3600*S/K)    #km/h
#Acceleration time
t1 = Vm/alpha       #s
#Braking time
t3 = Vm/beta       #s
#Free running time
t2 = T - (t1+t3)       #s

#SPEED TIME CURVE

plt.plot([0,t1,t1+t2,t1+t2+t3], [0,Vm,Vm,0])
plt.ylabel('Speed(in km/h)')
plt.xlabel('Time(in seconds)')
plt.show() ## EXAMPLE 43.17 , PAGE NO :- 1731¶

In :
#A train has schedule speed of 60 km per hour between the stops which are 9 km apart.Determine the crest speed over
#the run,assuming trapezoidal speed-time curve.The train accelerates at 3km/h/s and retards at 4.5 km/h/s.Duration
#of stops is 75 seconds.
#########################################################################################################################
import math as m

#Given
alpha = 3.0    #km/h/s    (acceleration)
beta = 4.5     #Km/h/s    (retardation)
S = 9.0        #km        (distance)
Vsch = 60.0    #km/h      (schedule speed)

Tsch = S/Vsch*3600  #s         (schedule time)
T = Tsch - 75.0     #s         (time of run)
#Constant K is
K = 0.5*(1/alpha + 1/beta)

#Maximum speed Vm is
Vm = (T/(2*K)) - m.sqrt(T*T/(4*K*K) - 3600*S/K)

print "Maximum Speed is",round(Vm,2),"Km/h."

Maximum Speed is 72.85 Km/h.


## EXAMPLE 43.18 , PAGE NO :- 1732¶

In :
#An electric train is to have acceleration and braking retardation of 1.2 km/h/s and 4.8 km/h/s respectively.If the ratio of
#maximum to average speed is 1.6 and time for stop is 35 seconds,find schedule speed for a run of 3km.Assume simplified
#trapezoidal speed-time curve.
#############################################################################################################################
import math as m
alpha = 1.2    #km/h/s       (acceleration)
beta =  4.8    #km/h/s       (retardation)
S = 3.0        #km           (distance)

#Constant K is
K = 0.5*(1/alpha + 1/beta)

#The average speed is Va  = S/T . Therefore Va*T = S*3600
Va_T = S*3600
#Now Vm/Va = 1.6 .Therefore,
Vm_T = Va_T*1.6

#Since, Vm^2*K - Vm*T + 3600*S = 0, Therefore
#Vm^2 = Vm*T - 3600*S
Vm = m.sqrt((Vm_T - 3600*S)/K)   #km/h
#Average Speed is
Va = Vm/1.5                  #km/h
#Actual Time of Run
T = 3600*S/Va              #s
#Schedule Time
Tsch = T + 35.0              #s
#Schedule Speed
Vsch = S/Tsch*3600                #km/h
print "Schedule speed is",round(Vsch),"km/h."

Schedule speed is 60.0 km/h.


## EXAMPLE 43.19 , PAGE NO :- 1732¶

In :
#An electric train has a schedule speed of 25 kmph between stations 800m apart.The duration of stop is 20 seconds,the
#maximum speed is 20 percent higher than the average running speed and the braking retardation is 3 km/h/s.Calculate
#the rate of acceleration required to operate this service.
###################################################################################################################

#Given
Vsch = 25.0  #km/h       (Schedule speed)
S = 0.8      #km         (Distance)
beta = 3.0   #km/h/s     (Retardation)

Tsch = S/Vsch*3600 #s

#Actual time of run = Tsch - (time of stop)
T = Tsch - 20.0  #s
Va = S/T*3600    #km/h   (Average speed)
Vm = 1.2*Va     #km/h   (Maximum speed)

#Since, Vm^2*K -Vm*T + 3600*S = 0
#Constant K = (Vm*T - 3600*S)/(Vm^2)
K = (Vm*T - 3600*S)/(Vm*Vm)

#Also,K = 0.5*(1/alpha + 1/beta).Therefore,
alpha = 1/(2*K - 1/beta)     #km/h/s

print "The rate of acceleration required to operate this service =",round(alpha,2),"km/h/s."

The rate of acceleration required to operate this service = 1.85 km/h/s.


## EXAMPLE 43.20 , PAGE NO :- 1733¶

In :
#A suburban electric train has a maximum speed of 80 kmph.The schedule speed including a station stop of 35 seconds is 50kmph.
#If the acceleration is 1.5 km/h/s,find the value of retardation when the average distance between stops is 5 km.
################################################################################################################################

#Given
Vsch = 50.0    #km/h       (schedule speed)
S = 5.0        #km         (distance)
alpha = 1.5    #km/h/s     (acceleration)
Vm = 80.0      #km/h       (Max speed)
tstop = 30.0   #s          (Time of stop)

Tsch = S/Vsch*3600    #s   (Schedule time)
T = Tsch - tstop      #s   (Actual time of run)

#Since, Vm^2*K -Vm*T + 3600*S = 0
#Constant K = (Vm*T - 3600*S)/(Vm^2)
K = (Vm*T - 3600*S)/(Vm*Vm)

#Also,K = 0.5*(1/alpha + 1/beta).Therefore,
beta = 1/(2*K - 1/alpha)     #km/h/s

print "Retardation =",round(beta,2),"km/h/s."

Retardation = 0.51 km/h/s.


## EXAMPLE 43.21 , PAGE NO :- 1733¶

In :
#A train is required to run between two stations 1.6 km apart at the average speed of 40 kmph.The run is to be made to a
#simplified quadrilateral speed-time curve.If the maximum speed is to be limited to 64 kmph,accelerating to 2 km/h/s and
#coasting and braking retardation to 0.16 km/h/s and 3.2 km/h/s respectively,determine the duration of acceleration,coasting
#and braking periods.
#################################################################################################################################
from sympy import Eq,Symbol,solve
#Given
S = 1.6       #km         (Distance)
Va = 40.0     #km/h       (Average speed)
Vm = 64.0     #km/h       (Maximum speed)
alpha = 2.0   #km/h/s     (Acceleration)
beta_c = 0.16 #km/h/s     (Coasting retardation)
beta = 3.2    #km/h/s     (braking retardation)

T = S/Va*3600      #s          (Actual time of run)
t1 = Vm/alpha #s          (acceleration time)
#Let us assume the speed at starting of braking be V2
V2 = Symbol('V2')
t2 = (Vm-V2)/beta_c    #s   (coasting period)
t3 = V2/beta           #s   (braking period)
eq = Eq(t1+t2+t3,T)
V2 = solve(eq)
Ve2 = V2
#Therfore coasting and braking periods are
t2 = (Vm-Ve2)/beta_c    #s   (coasting period)
t3 = Ve2/beta           #s   (braking period)

print "Duration of acceleration = ",round(t1,2),"s."
print "Duration of coasting retardation = ",round(t2,2),"s."
print "Duration of braking retardation = ",round(t3,2),"s."

Duration of acceleration =  32.0 s.
Duration of coasting retardation =  96.84 s.
Duration of braking retardation =  15.16 s.


## EXAMPLE 43.22 , PAGE NO :- 1737¶

In :
#The torque-armature current characteristics of a series traction motor are given as:
#Armature Current(amp): 5        10          15         20        25        30        35        40
#Torque(N-m):           20       50          100        155       215       290       360       430
#The motor resistance is 0.3 ohm.If this motor is connected across 230V,deduce the speed armature current characteristics.
############################################################################################################################

import matplotlib.pyplot as plt
%matplotlib inline
#Given
V = 230    #V          (Supply voltage)
r = 0.3   #ohm         (Motor resistance)

#Current Data Ia
i1 = 5.0   #A
i2 = 10.0   #A
i3 = 15.0   #A
i4 = 20.0   #A
i5 = 25.0   #A
i6 = 30.0   #A
i7 = 35.0   #A
i8 = 40.0   #A

#Torque Data
tau1 = 20.0   #N-m
tau2 = 50.0   #N-m
tau3 = 100.0  #N-m
tau4 = 155.0  #N-m
tau5 = 215.0  #N-m
tau6 = 290.0  #N-m
tau7 = 360.0  #N-m
tau8 = 430.0  #N-m

#Back EMF Eb = V - Ia*r
e1 = V - i1*r        #V
e2 = V - i2*r        #V
e3 = V - i3*r        #V
e4 = V - i4*r        #V
e5 = V - i5*r        #V
e6 = V - i6*r        #V
e7 = V - i7*r        #V
e8 = V - i8*r        #V

#Speed Na = 9.55*Eb*Ia/T
N1 = 9.55*e1*i1/tau1      #rpm
N2 = 9.55*e2*i2/tau2      #rpm
N3 = 9.55*e3*i3/tau3      #rpm
N4 = 9.55*e4*i4/tau4      #rpm
N5 = 9.55*e5*i5/tau5      #rpm
N6 = 9.55*e6*i6/tau6      #rpm
N7 = 9.55*e7*i7/tau7      #rpm
N8 = 9.55*e8*i8/tau8      #rpm

print "Speed-Armature current graph"

plt.plot([i1,i2,i3,i4,i5,i6,i7,i8], [N1,N2,N3,N4,N5,N6,N7,N8])
plt.axis([0,40,0,600])
plt.ylabel('Speed(in r.p.m)')
plt.xlabel('Armature current Ia(in A)')
plt.show()

Speed-Armature current graph ## EXAMPLE 43.23 , PAGE NO :- 1737¶

In :
#The following figures give the magnetization curve of d.c. series motor when working as a seperately excited generator at 600 rpm.
#Field Current(amperes) :   20          40         60         80
#E.M.F(volts):              215         381        485        550
#The total resistance of the motor is 0.8 ohm.Deduce the speed-torque curve for this motor when operating at a constant voltage of
#600 volts.
################################################################################################################################

#Given
V = 600.0   #V       (Supply voltage)
r = 0.8     #ohm     (total motor resistance)

#Field Current Data(If=Ia)
i1 = 20.0    #A
i2 = 40.0    #A
i3 = 60.0    #A
i4 = 80.0    #A

#E.M.F data at 600 rpm(E)
e1 = 215.0    #V
e2 = 381.0    #V
e3 = 485.0    #V
e4 = 550.0    #V

#At constant voltage of 600V. EMF are Eb = V - Ia*Rm
eb1 = V - i1*r   #V
eb2 = V - i2*r   #V
eb3 = V - i3*r   #V
eb4 = V - i4*r   #V

#For DC series motor  N1/E1 = N2/E2 . Therefore N2 = N/E*Eb
n1 = 600/e1*eb1     #rpm
n2 = 600/e2*eb2     #rpm
n3 = 600/e3*eb3     #rpm
n4 = 600/e4*eb4     #rpm

#Now, Torque T = 9.55*Eb*Ia/N2
tau1 = 9.55*eb1*i1/n1    #N-m
tau2 = 9.55*eb2*i2/n2    #N-m
tau3 = 9.55*eb3*i3/n3    #N-m
tau4 = 9.55*eb4*i4/n4    #N-m

print "Speed - Torque Curve"

plt.plot([tau1,tau2,tau3,tau4], [n1,n2,n3,n4])
#plt.axis([0,40,0,600])
plt.ylabel('Speed(in r.p.m)')
plt.xlabel('Torque T(in N-m)')
plt.show()

Speed - Torque Curve ## EXAMPLE 43.24 , PAGE NO :- 1738¶

In :
#Two d.c. traction motors run at a speed of 900 r.p.m and 950 r.p.m respectively when each takes a current of 50A from 500V mains.
#Each motor has an effective resistance of 0.3 ohm . Calculate the speed and voltage across each machine when mechanically coupled
#and electrically connected in series and taking a current of 50A from 500V mains,the resistance of each motor being unchanged.
#################################################################################################################################
from sympy import Eq,Symbol,solve
#Let the two motors be A and B .
Na = 900.0    #rpm       (speed of motor A)
Nb = 950.0    #rpm       (speed of motor B)
r =  0.3      #ohm       (resistance of each motor)
V = 500.0     #V         (applied voltage)
I = 50.0     #A         (current)

#Back emf of motor A when taking current of 50A,
Eb_a = V - I*r      #V
#Back emf of motor B when taking current of 50A,
Eb_b = V - I*r      #V

#As the machines are mechanically coupled and are connected in series. Therefore,
#speed will be same. Say 'N'
#current will be same and equal to 50A
#summation of voltage drop is 500V

N = Symbol('N')    #rpm
#Let the voltage drop across motors be Va & Vb .Therefore,for Va & Vb we will find back emf of both motors
eb_A = Eb_a*N/Na           #V            (using  N1/N2 = E1/E2)
eb_B= Eb_b*N/Nb            #V            (using  N1/N2 = E1/E2)

#For Va & Vb
Va =  eb_A + I*r          #V            (using Eb = V - Ia*r)
Vb =  eb_B + I*r          #V            (using Eb = V - Ia*r)

#We know that Va + Vb = 500 . Therefore,
eq = Eq(Va+Vb,V)
N = solve(eq)
Ne = N

#As we know the speed N . Therefore, Va & Vb are
eb_A = Eb_a*Ne/Na           #V            (using  N1/N2 = E1/E2)
eb_B= Eb_b*Ne/Nb            #V            (using  N1/N2 = E1/E2)

Va =  eb_A + I*r          #V            (using Eb = V - Ia*r)
Vb =  eb_B + I*r          #V            (using Eb = V - Ia*r)

print "Speed of both motors is = ",round(Ne,2),"rpm."
print "Voltage across motor A is = ",round(Va,2),"V."
print "Voltage across motor B is = ",round(Vb,2),"V."

Speed of both motors is =  447.87 rpm.
Voltage across motor A is =  256.35 V.
Voltage across motor B is =  243.65 V.


## EXAMPLE 43.25 , PAGE NO :- 1739¶

In :
#A tram  car is equipped with two motors which are operating in parallel.Calculate the current drawn from the supply main at 500 V
#when the car is running at steady speed of 50kmph and each motor is developing a tractive effort of 2100 N.The resistance of each
#motor is 0.4 ohm.The friction,windage and other losses may be assumed as 3500 watts per motor.
#################################################################################################################################
from sympy import Eq,Symbol,solve

V = 500.0      #V         (applied voltage)
Vm = 50.0      #km/h      (max. speed)
Ft = 2100      #N         (tractive effort)
Rm = 0.4       #ohm       (motor resistance)
mloss = 3500.0 #W       (losses per motor)

#Power output of each motor
Pout = Ft*Vm*5.0/18  #W
#Copper loss = I^2*Rm
I = Symbol('I')
cu_loss = (I*I)*Rm   #W
#Input power = Output power + constant losses + Copper losses
Pin = V*I            #W
eq = Eq(Pin,Pout+mloss+cu_loss)
I = solve(eq)        #A
#current drawn by motor is
Ie = I            #A
#Therefore,current drawn by supply mains
Ie = 2*Ie            #A
print "Current drawn by supply mains is =",round(Ie,2),"A."

Current drawn by supply mains is = 138.32 A.


## EXAMPLE 43.26 , PAGE NO :- 1740¶

In :
#A motor coach is being driven by two identical d.c. series motors.First motor is geared to driving wheel having diameter of 90cm and
#other motor to driving wheel having diameter of 86cm.The speed of the first motor is 500 rpm when connected in parallel with the other
#across 600V supply.Find the motor speeds when connected in series across the same supply.Assume armature current to remain same and
#armature voltage drop of 10% at this current.
###############################################################################################################################
from sympy import Eq,Symbol,solve
#Given
V = 600.0     #V         (applied voltage)
d1= 0.90      #m         (diameter 1)
d2 = 0.86     #m         (diameter 2)
N1 = 500.0    #rpm       (Speed of first motor)

Eb1 = V-0.1*V #V         (Back emf)

#Let the supply voltage across motor 1 & 2 be V1 and V2 respectively
#Therefore, V1 + V2 = 600
V1 = Symbol('V1')        #V
V2 = V - V1              #V

#Now , N is directly propotional to (V - IR).Therefore, ratio (N1/N2) is

Nratio1 = (V1 - 0.1*V)/(V2 - 0.1*V)

#Also, we know that N1*d1 = N2*d2 . Therefore (N1/N2) is
Nratio2 = d2/d1

#As, N1/N2 = Nratio1 = Nratio2
eq = Eq(Nratio1,Nratio2)
V1 = solve(eq)
Ve1 = V1            #V
Ve2 = V - Ve1           #V
#Now , for the speed of motor 1, we know that for N1 ,back emf is Eb1 and for Ne1 ,back emf is (Ve1-0.1*Ve1)
Ne1 = N1*(Ve1 - 0.1*V)/Eb1         #rpm     (using N1/N2 = E1/E2)
#Nratio is Ne1/Ne2 .Therefore,
Ne2 = Ne1/Nratio2                    #rpm

print "Speed of first motor is =",round(Ne1,2),"rpm."
print "Speed of second motor is =",round(Ne2,2),"rpm."

Speed of first motor is = 217.17 rpm.
Speed of second motor is = 227.27 rpm.


## EXAMPLE 43.27 , PAGE NO :- 1741¶

In :
#Two similar series type motors are used to drive a locomotive.The supply fed to their parallel connection is 650V.If the first
#motor 'A' is geared to drive wheels of radius 45 cms and other motor 'B' to 43 cms.And if the speed of first motor 'A' when
#connected in parallel to 2nd motor 'B' across the main supply lines is 400 rpm,find voltages and speeds of motors when connected
#in series.Assume Ia to be constant and armature voltage drop of 10% at this current.
################################################################################################################################

from sympy import Eq,Symbol,solve
#Given
V  = 650.0     #V         (applied voltage)
r1 = 0.45      #m         (radius 1)
r2 = 0.43      #m         (radius 2)
Na = 400.0     #rpm       (Speed of first motor)

Eb_a = V-0.1*V #V         (Back emf)

#Let the supply voltage across motor A & B be Va and Vb respectively
#Therefore, Va + Vb = 650.0 V
Va = Symbol('Va')        #V
Vb = V - Va              #V

#Now , N is directly propotional to (V - IR).Therefore, ratio (N1/N2) is

Nratio1 = (Va - 0.1*V)/(Vb - 0.1*V)

#Also, we know that N1*r1 = N2*r2 . Therefore (N1/N2) is
Nratio2 = r2/r1

#As, N1/N2 = Nratio1 = Nratio2
eq = Eq(Nratio1,Nratio2)
Va = solve(eq)
Vea = Va            #V
Veb = V - Vea           #V

#Now , for the speed of motor A, we know that for Na ,back emf is Eb_a and for Nea ,back emf is (Vea-0.1*Vea)
Nea = Na*(Vea - 0.1*V)/Eb_a         #rpm     (using N1/N2 = E1/E2)
#Nratio is Ne1/Ne2 .Therefore,
Neb = Nea/Nratio2                    #rpm

print "Speed of first motor is =",round(Nea,2),"rpm."
print "Speed of second motor is =",round(Neb,2),"rpm."

Speed of first motor is = 173.74 rpm.
Speed of second motor is = 181.82 rpm.


## EXAMPLE 43.28 , PAGE NO :- 1744¶

In :
#Two motors of a motor coach are started on series-parallel system,the current per motor being 350A during the starting period
#which is 18 sec.If the acceleration during starting period is uniform,the line voltage is 600V and resistance of each motor is
#0.1W.Find (a)the time during which the motors are operated in series. (b)the energy loss in the rheostat during starting period.
#####################################################################################################################################

#Given
V = 600.0    #V     (line voltage)
I = 350.0    #A     (current)
R = 0.1      #ohm   (resistance)
T = 18.0     #s     (starting period)

#time for which motors are in series
ts = 0.5*(V-2*I*R)/(V-I*R)*T   #s

#time for which motors are in parallel
tp = T - ts                    #s

#back emf of 1 motor during series operation
Eb_s = V/2 - I*R               #V
#total back emf
Eb_s = 2*Eb_s                  #V
#Emf during parallel operation
Eb_p = V - I*R              #V

#Energy lost during series connection
enrgy_s = 0.5*(Eb_s)*I*ts/3600          #W-h
#Energy lost during parallel connection
enrgy_p = 0.5*(Eb_p/2)*(2*I)*tp/3600    #W-h

#Total energy lost
enrgy_t = enrgy_s + enrgy_p        #W-h

print "Time for which motors are operated in series = ",round(ts,2),"s."
print "Energy loss during starting period = ",round(enrgy_t,2),"W-h."

Time for which motors are operated in series =  8.44 s.
Energy loss during starting period =  480.01 W-h.


## EXAMPLE 43.29 , PAGE NO :- 1749¶

In :
#Two 750V D.C. series motors each having a resistance of 0.1 ohm are started on series-parallel system.Mean current through-out
#the starting period is 300A.Starting period is 15 sec. and train speed at the end of this period is 25 km/hr.Calculate
#(i)Rheostatic losses during series and parallel combination of motors
#(ii)Energy lost in motor
#(iii)Motor output
#(iv)Starting eff
#(v)Train speed at which transition from series to parallel must be made.
##############################################################################################################################

V = 750.0           #V   (applied voltage)
R = 0.1             #ohm (resistance)
I = 300.0           #A   (current)
T = 15.0            #s   (starting time)
S = 25.0            #km/h(speed after staring period)

#Time when motors are in series
ts = 0.5*(V-2*I*R)/(V-I*R)*T          #s
#Time when motors are in parallel
tp = T - ts                           #s

#(i)Energy lost in rheostat
enrgy_lostr = 0.5*(2*(V/2-I*R))*I*ts + 0.5*(V-I*R)/2*2*I*tp       #W-s
enrgy_lostr = enrgy_lostr/3600                                          #W-h

#(ii)Total energy supplied
enrgy_supp = V*I*ts + 2*V*I*tp     #W-s
enrgy_supp = enrgy_supp/3600       #W-h

#Energy lost in armature of 2 motors
enrgy_losta = 2*(I*I*R)*T
enrgy_losta = enrgy_losta/3600      #W-h

#Motor output is
outp = enrgy_supp - enrgy_lostr - enrgy_losta    #W-h

#Efficiency at starting
eff_s = (enrgy_supp-enrgy_lostr)/(enrgy_supp)*100

#Acceleraton is uniform during starting period .Therefore,
speed = S/T*ts                 #km/h
print "Energy lost in rheostat = ",round(enrgy_lostr,2),"W-h."
print "Energy lost in motor = ",round(enrgy_losta,2),"W-h."
print "Motor output =",round(outp,2),"W-h."
print "Efficiency at starting =",round(eff_s,2),"%."
print "Train speed at which transition from series to parallel = ",round(speed,2),"km/h."

Energy lost in rheostat =  441.02 W-h.
Energy lost in motor =  75.0 W-h.
Motor output = 909.77 W-h.
Efficiency at starting = 69.07 %.
Train speed at which transition from series to parallel =  11.98 km/h.


## EXAMPLE 43.30 , PAGE NO :- 1750¶

In :
#Two 600V motors each having a resistance of 0.1 ohm are started on the series-parallel system,the mean current per motor throughout
#the starting period being 300A.The starting period is 20 seconds and the train speed at the end of this period is 30km per hour.
Calculate
#(i)the rheostatic losses during (a)the series and (b) the parallel combination of motors
#(ii)the train speed at which transition from series to parallel must be made.
###############################################################################################################################

num_m = 2          #            (number of motors)
V = 600.0          #V           (line voltage)
I = 300.0          #A           (current per motor)
Ts = 20.0          #s           (starting period)
R = 0.1            #ohm         (motor resistance)
Vm = 30.0          #km/h        (maximum speed)

#Back emf of each motor in series position,
Eb_s = V/2 - I*R   #V
#Back emf of each motor in parallel position,
Eb_p = V - I*R     #V
#time for which motors were in series
ts = Ts*Eb_s/Eb_p  #s
#time for which motors are in parallel
tp = Ts - ts       #s

#(a) Voltage drop in the starting rheostat in series combination
V_s = V - 2*I*R                  #V
#Energy loss in  series is
enrgy_s = (V_s/2)*I*(ts/3600)      #W-h
#(b) Voltage drop in the starting rheostat in parallel combination
V_p = V/2                        #V
#Energy loss in  parallel is
enrgy_p = (V_p/2)*(2*I)*(tp/3600)

#Acceleration is
acc = Vm/Ts                #km/h/s
#Speed at the end of series period
speed = acc*ts             #km/h

print "Energy loss in series =",round(enrgy_s,2),"W-h."
print "Energy loss in parallel =",round(enrgy_p,2),"W-h."
print "The transition speed = ",round(speed,2),"km/h."

Energy loss in series = 213.16 W-h.
Energy loss in parallel = 263.16 W-h.
The transition speed =  14.21 km/h.


## EXAMPLE 43.31 , PAGE NO :- 1751¶

In :
#Two d.c. series motors of a motor coach have resistance of 0.1ohm each.These motors draw a current of 500A from 600V mains during
#series-parallel starting period of 25 seconds.If the acceleration during starting period remains uniform,determine:
#(i)time during which the motors operate in (a)series (b)parallel.
#(ii)the speed at which the series connections are to be changed if the speed just after starting period is 80kmph.
####################################################################################################################################

num_m = 2          #            (number of motors)
V = 600.0          #V           (line voltage)
I = 500.0          #A           (current per motor)
Ts = 25.0          #s           (starting period)
R = 0.1            #ohm         (motor resistance)
Vm = 80.0          #km/h        (maximum speed)

#Back emf of each motor in series position,
Eb_s = V/2 - I*R   #V
#Back emf of each motor in parallel position,
Eb_p = V - I*R     #V
#time for which motors were in series
ts = Ts*Eb_s/Eb_p  #s
#time for which motors are in parallel
tp = Ts - ts       #s

#(ii) Speed at which series connection are to be changed = acc*ts and acc = Vm/Ts.Therefore,
speed = Vm/Ts*ts   #km/h

print "Period of series operation = ",round(ts,2),"s."
print "Period of parallel operation = ",round(tp,2),"s."
print "Speed at which series connection are to be changed = ",round(speed,2),"km/h."

Period of series operation =  11.36 s.
Period of parallel operation =  13.64 s.
Speed at which series connection are to be changed =  36.36 km/h.


## EXAMPLE 43.32 , PAGE NO :- 1751¶

In :
#The following figures refer to the speed-current and torque-current characteristics of a 600V d.c. series traction motor.
#Current(A) : 50        100        150        200        250
#Speed(Kmph): 73.6      48         41.1       37.3       35.2
#Torque(N-m): 150       525        930        1335       1750
#Determine the braking torque at a speed of 48kmph when operating as self excited d.c. generator.Assume resistance of motor and
#braking rheostat to be 0.6 ohm and 3.0 ohm respectively.
#############################################################################################################################

Rm = 0.6          #ohm(resistance of motor)
Rrh = 3.0         #ohm(braking rheostat)

#As a motor
V = 600.0         #V  (terminal voltage)
#From speed-current characteristics . For a speed of 48kmph,
I = 100.0         #A  (current)
Eb = V - I*Rm     #V  (back emf)

#As a generator

#At instant of applying rheostatic braking ,the terminal voltage will be equal to emf developed by  machine i.e
V2 = Eb           #V
Rt = Rm + Rrh     #ohm     (total resistance)

#Using V=IR
I2 = V2/Rt          #A     (current)

if (I2==50):
tau = 150.0     #N-m
elif (I2==100):
tau = 525.0     #N-m
elif (I2==150):
tau = 930.0     #N-m
elif (I2==200):
tau = 1335.0     #N-m
elif (I2==250):
tau = 1750.0     #N-m

print "Braking torque = ",round(tau,2),"N-m."

Braking torque =  930.0 N-m.