In [1]:

```
#Variable declaration
capital_cost_group = 8000.0 #Capital cost of group drive(Rs)
n_single = 5.0 #Number of individual drive
capital_cost_single = 2500.0 #Capital cost of individual drive(Rs)
energy_cons_group = 40000.0 #Annual energy consumption of group drive(kWh)
energy_cons_single = 30000.0 #Annual energy consumption of group drive(kWh)
cost_energy = 8.0/100 #Cost of energy per kWh(Rs)
dmo_group = 12.0 #Depreciation,maintenance & other fixed charges for group drive(%)
dmo_single = 18.0 #Depreciation,maintenance & other fixed charges for individual drive(%)
#Calculation
#Case(a)
annual_cost_energy_a = energy_cons_group*cost_energy #Annual cost of energy(Rs)
dmo_cost_a = capital_cost_group*dmo_group/100 #Depreciation,maintenance & other fixed charges per year for group drive(Rs)
yearly_cost_a = annual_cost_energy_a+dmo_cost_a #Total yearly cost(Rs)
#Case(b)
total_cost = capital_cost_single*n_single #Capital cost of individual drive(Rs)
annual_cost_energy_b = energy_cons_single*cost_energy #Annual cost of energy(Rs)
dmo_cost_b = total_cost*dmo_single/100 #Depreciation,maintenance & other fixed charges per year for individual drive(Rs)
yearly_cost_b = annual_cost_energy_b+dmo_cost_b #Total yearly cost(Rs)
#Result
print('Total annual cost of group drive = Rs. %.f ' %yearly_cost_a)
print('Total annual cost of individual drive = Rs. %.f ' %yearly_cost_b)
```

In [1]:

```
#Variable declaration
I_sc = 6.0 #Short circuit current = 6 times full load current
s_fl = 5.0 #Full load slip(%)
tap = 60.0 #Auto-tranformer tapping(%)
#Calculation
#Case(a)
I_s_fl_a = I_sc/3.0 #I_s/I_fl
T_s_fl_a = I_s_fl_a**2*s_fl/100 #Starting torque in terms of full-load torque
#Case(b)
I_s_fl_b = tap/100*I_sc #I_s/I_fl
T_s_fl_b = I_s_fl_b**2*s_fl/100 #Starting torque in terms of full-load torque
#Result
print('Case(a): Starting torque in terms of full-load torque, I_s/I_fl = %.1f ' %T_s_fl_a)
print('Case(b): Starting torque in terms of full-load torque, I_s/I_fl = %.3f ' %T_s_fl_b)
```

In [1]:

```
#Variable declaration
V = 400.0 #IM voltage(V)
s_fl = 5.0 #Full-load slip(%)
I_fl = 20.0 #Full load current drawn from supply by IM(A)
Z = 2.5 #Impedance per phase(ohm)
I_max = 50.0 #Maximum current drawn(A)
#Calculation
V_phase = V/3**0.5 #Normal phase voltage(V)
P = (100**2*I_max*Z/V_phase)**0.5 #Tapping to be provided to auto-transformer(%)
I_s = I_max/(P/100) #Starting current taken by motor(A)
T_s_fl = (I_s/I_fl)**2*s_fl/100 #Starting torque in terms of full-load torque
T_s_fl_R = (I_max/I_fl)**2*s_fl/100 #Starting torque in terms of full-load torque when a resistor is used
#Result
print('Tapping to be provided on an auto-transformer, P = %.1f percent' %P)
print('Starting torque in terms of full-load torque, T_s = %.3f*T_fl ' %T_s_fl)
print('Starting torque in terms of full-load torque if a resistor were used in series, T_s/T_fl = %.4f ' %T_s_fl_R)
```

In [1]:

```
import math
#Variable declaration
hp = 30.0 #Power of cage IM(hp)
V = 500.0 #Cage IM voltage(V)
P = 4.0 #Number of poles
f = 50.0 #Frequency(Hz)
I_fl = 33.0 #Full load current(A)
s = 4.0/100 #Slip
Z = 3.5 #Impedance per phase(ohm)
tap = 60.0 #Auto-transformer tap setting(%)
#Calculation
#Case(1)
I_s_1 = 3**0.5*(V/Z) #Starting current taken from line(A)
N_s = 120*f/P #Speed(rpm)
N_fl = N_s-N_s*s #Full load speed of motor(rpm)
T_fl = hp*746*60/(2*math.pi*N_fl) #Full load torque(N-m)
T_s_1 = (I_s_1/I_fl)**2*s*T_fl #Starting torque(N-m)
#Case(2)
V_ph = V/3**0.5 #Phase voltage in star(V)
I_s_2 = V_ph/Z #Starting current(A/phase)
T_s_2 = (I_s_2/(I_fl/3**0.5))**2*s*T_fl #Starting torque(N-m)
#Case(3)
V_ph_at = V*tap/(3**0.5*100) #Phase voltage of auto-transformer secondary(V)
V_impressed = V_ph_at*3**0.5 #Volatage impressed on delta-connected stator(V)
I_s_3 = V_impressed/Z #Starting current(A/phase)
I_s_line = 3**0.5*I_s_3 #Motor starting line current from auto-transformer secondary(A)
I_s_line_3 = tap/100*I_s_line #Starting current taken from supply(A)
T_s_3 = (I_s_3/(I_fl/3**0.5))**2*s*T_fl #Starting torque(N-m)
#Case(4)
I_s_4 = 3**0.5*V/Z #Starting current from line(A)
T_s_4 = T_fl*s*(I_s_4/I_fl)**2 #Starting torque(N-m)
#Result
print('Case(1): Starting torque for direct switching, T_s = %.f N-m' %T_s_1)
print(' Starting current taken from supply line for direct switching, I_s = %.f A' %I_s_1)
print('Case(2): Starting torque for star-delta starting, T_s = %.f N-m' %T_s_2)
print(' Starting current taken from supply line for star-delta starting, I_s = %.1f A per phase' %I_s_2)
print('Case(3): Starting torque for auto-transformer starting, T_s = %.f N-m' %T_s_3)
print(' Starting current taken from supply line for auto-transformer starting, I_s = %.f A' %I_s_line_3)
print('Case(4): Starting torque for series-parallel switch, T_s = %.f N-m' %T_s_4)
print(' Starting current taken from supply line for series-parallel switch, I_s = %.f A' %I_s_4)
print('\nNOTE: ERROR: Calculation mistakes and more approximation in textbook solution')
```

In [1]:

```
#Variable declaration
V = 400.0 #IM voltage(V)
f = 50.0 #Frequency(Hz)
I_s = 5.0 #Full voltage starting current in terms of full load current
T_s = 2.0 #Full voltage starting torque in terms of full load torque
tap = 65.0 #Auto-tranformer tapping(%)
#Calculation
V_ph = V/3**0.5 #Phase voltage(V)
V_ph_motor = tap/100*V_ph #Motor phase voltage when auto-transformer is used(V)
I_ph_motor = tap/100*I_s #Motor phase current in terms of full load current
I_1 = tap/100*I_ph_motor #Line current from supply in terms of full load current
T = (tap/100)**2*T_s #Starting torque in terms of full load current
V_applied = V_ph/2**0.5 #Voltage to be applied to develop full-load torque(V)
I_line = V_applied/V_ph*I_s #Line current in terms of full load current
#Result
print('Case(i): Motor current per phase = %.2f*I_fl ' %I_ph_motor)
print('Case(ii): Current from the supply, I_1 = %.2f*I_fl ' %I_1)
print('Case(iii): Starting torque with auto-transformer starter, T = %.3f*T_fl ' %T)
print('Voltage to be applied if motor has to develop full-load torque at starting, V = %.f V' %V_applied)
print('Line current from the supply to develop full-load torque at starting = %.2f*I_fl ' %I_line)
```

In [1]:

```
#Variable declaration
hp = 10.0 #IM rating(hp)
V = 400.0 #IM voltage(V)
pf = 0.8 #Lagging power factor
n = 0.9 #Efficiency of IM
I_sc = 7.2 #Short-circuit current at 160V(A)
V_sc = 160.0 #Voltage at short-circuit(V)
#Calculation
I_fl = hp*746/(3**0.5*V*pf*n) #Full-load line current(A)
I_sc_fv = V/V_sc*I_sc #Short-circuit current at full voltage(A)
I_s = I_sc_fv/3.0 #Starting current with star-delta starter(A)
I_s_fl = I_s/I_fl #Ratio of starting current to full load current
#Result
print('Ratio of starting current to full-load current, I_s/I_fl = %.1f ' %I_s_fl)
print('\nNOTE: ERROR: Calculation mistake in final answer in textbook solution')
```

In [1]:

```
#Variable declaration
V = 230.0 #Voltage of DC shunt motor(V)
N_1 = 1000.0 #No load speed(rpm)
R_sh = 40.0 #Shunt resistance(ohm)
N_2 = 1200.0 #Speed with series resistance(rpm)
#Calculation
phi_2 = N_1/N_2 #Flux_2 in terms flux_1
I_N1 = V/R_sh #Exciting current at 1000 rpm(A)
phi_1 = 11.9 #Flux corresponding to I_N1(mWb)
phi_N2 = phi_1*phi_2 #Flux at 1200 rpm(mWb)
I_phi_N2 = 3.25 #Exciting current corresponding to phi_N2(A)
R = V/I_phi_N2 #Resistance in field circuit(ohm)
R_extra = R-R_sh #Resistance to be placed in series with shunt field(ohm)
#Result
print('Resistance to be placed in series with shunt field = %.1f ohm' %R_extra)
```

In [1]:

```
from sympy import Symbol,solve
#Variable declaration
V = 250.0 #Voltage of DC shunt motor(V)
I = 22.5 #Current drawn from supply(A)
N_1 = 400.0 #Speed(rpm)
N_2 = 600.0 #Speed(rpm)
R_sh = 100.0 #Shunt resistance(ohm)
R_a = 0.5 #Armature resistance(ohm)
#Calculation
I_f = V/R_sh #Shunt field current(A)
I_a = I-I_f #Armature current(A)
E_b1 = V-I_a*R_a #Back emf(V)
I_f2 = Symbol('I_f2') #Shunt field current for N_2(A)
E_b1_b2 = I_f*N_1/(I_f2*N_2) #Ratio of E_b1/E_b2
E_b2 = V-(R_a*I_f*I_a/I_f2) #emf
solving = (E_b1/E_b2)-(E_b1_b2) #Solving the equated equation
I_f2_sol = solve(solving) #Solved I_f2
I_f2_solution = I_f2_sol[1] #Shunt field current for N_2(A)
R_f = (V/I_f2_solution)-R_sh #Additional resistance placed in shunt field circuit(ohm)
#Result
print('Additional resistance placed in the shunt field circuit, R_f = %.1f ohm' %R_f)
print('\nNOTE: ERROR: Calculation mistake in the finding quadratic equation solution for I_f2 in textbook')
```

In [1]:

```
#Variable declaration
I_f1 = 25.0 #Current without diverter(A)
N_1 = 500.0 #Speed of dc series motor without diverter(rpm)
#Calculation
I_a2 = ((3.0/2)**0.5*I_f1**2*3/2)**0.5 #Field current with diverter(A)
N_2 = I_f1*N_1*3/(2*I_a2) #Speed with diverter(rpm)
#Result
print('Speed when field winding is shunted by a diverter, N_2 = %.f rpm' %N_2)
print('Current when field winding is shunted by a diverter, I_a2 = %.1f A' %I_a2)
```

In [1]:

```
#Variable declaration
V = 220.0 #DC shunt motor voltage(V)
I_a1 = 50.0 #Armature current at 800rpm(A)
N_1 = 800.0 #Speed of dc shunt motor(rpm)
N_2 = 1000.0 #Speed of dc shunt motor with additional resistance(rpm)
I_a2 = 75.0 #Armature current with additional resistance(A)
R_a = 0.15 #Armature resistance(ohm)
R_f = 250.0 #Field resistance(ohm)
#Calculation
E_b1 = V-R_a*I_a1 #Back emf at 800 rpm(V)
I_f1 = V/R_f #Shunt field current(A)
E_b2 = V-R_a*I_a2 #Back emf at 1000 rpm(V)
I_f2 = E_b2*N_1*I_f1/(E_b1*N_2) #Shunt field current at 1000 rpm(A)
R_f2 = V/I_f2 #Field resistance at 1000 rpm(ohm)
R_add = R_f2-R_f #Additional resistance required(ohm)
#Result
print('Additional resistance to be inserted in the field circuit to raise the speed = %.1f ohm' %R_add)
print('\nNOTE: ERROR: Calculation mistake in E_b2 in the textbook solution. Hence, changes in the obtained answer from textbook')
```

In [1]:

```
#Variable declaration
V = 220.0 #DC series motor voltage(V)
I_1 = 20.0 #Armature current at 800rpm(A)
N_1 = 800.0 #Speed of dc series motor(rpm)
R_div = 0.4 #Diverter resistance(ohm)
R_a = 0.5 #Armature resistance(ohm)
R_f = 0.2 #Series field resistance(ohm)
#Calculation
E_b1 = V-(R_a+R_f)*I_1 #Back emf at 800 rpm(V)
I_2 = I_1*R_div/(R_div+R_f) #Series field current at new speed(A)
E_b2 = V-(R_a*I_1+R_f*I_2) #Back emf at new speed(V)
N_2 = I_1*N_1*E_b2/(I_2*E_b1) #New speed with diverter(rpm)
#Result
print('Speed of motor with a diverter connected in parallel with series field, N_2 = %.f rpm' %N_2)
```

In [1]:

```
#Variable declaration
speed_per = 15.0 #Motor speed increased by(%)
#Calculation
N_2 = (100+speed_per)/100 #New speed N_2(rpm)
phi_2 = 1/N_2*100 #Flux_2 in terms of full load flux
I_sc1 = 0.75 #New series field current in terms of I_a1
I_a2 = N_2 #Armature current in terms of I_a1
R_d = I_sc1/(I_a2-I_sc1)*100 #Diverter resistance in terms of series field resistance(%)
#Result
print('Diverter resistance, R_d = %.1f percent of field resistance' %R_d)
```

In [1]:

```
#Variable declaration
V = 250.0 #Voltage of DC shunt motor(V)
N_1 = 400.0 #No load speed(rpm)
R_a = 0.5 #Armature resistance(ohm)
N_2 = 200.0 #Speed with additional resistance(rpm)
I_a = 20.0 #Armature current(A)
#Calculation
k_phi = (V-I_a*R_a)/N_1 #kΦ
R = (V-k_phi*N_2)/I_a #Resistance(ohm)
R_add = R-R_a #Additional resistance to be placed in armature circuit(ohm)
#Result
print('Resistance to be placed in the armature circuit = %.f ohm' %R_add)
print('\nNOTE: ERROR: The data doesnt match with example 1.7 as mentioned in problem statement')
```

In [1]:

```
#Variable declaration
V = 400.0 #Voltage of DC shunt motor(V)
hp = 20.0 #Power of DC shunt motor(hp)
I = 44.0 #Current drawn by motor(A)
N_1 = 1000.0 #Speed(rpm)
N_2 = 800.0 #Speed with additional resistance(rpm)
R_sh = 200.0 #Shunt field resistance(ohm)
#Calculation
output = hp*746 #Motor output(W)
I_f1 = V/R_sh #Shunt field current(A)
I_a1 = I-I_f1 #Armature current(A)
E_b1 = output/I_a1 #Back emf(V)
R_a = (V-E_b1)/I_a1 #Armature resistance(ohm)
I_a2 = I_a1*(N_2/N_1)**2 #Armature current at N2(A)
E_b2 = N_2/N_1*E_b1 #Back emf at N2(V)
r = ((V-E_b2)/I_a2)-R_a #Resistance connected in series with armature(ohm)
#Result
print('Resistance to be connected in series with armature to reduce speed, r = %.2f ohm' %r)
```

In [1]:

```
#Variable declaration
hp = 15.0 #Power of DC shunt motor(hp)
V = 400.0 #Voltage of DC shunt motor(V)
N_reduce = 20.0 #Speed is to be reduced by(%)
I_f = 3.0 #Field current(A)
R_a = 0.5 #Armature resistance(ohm)
n = 0.85 #Efficiency of motor
#Calculation
motor_input = hp*746/n #Motor input(W)
I = motor_input/V #Motor current(A)
I_a1 = I-I_f #Armature current(A)
I_a2 = I_a1 #Armature current at new speed(A)
E_b1 = V-I_a1*R_a #Back emf(V)
E_b2 = E_b1*(100-N_reduce)/100 #Back emf at new speed(V)
r = ((V-E_b2)/I_a2)-R_a #Ohmic value of resistor connected in the armature circuit(ohm)
#Result
print('Ohmic value of resistor connected in the armature circuit, r = %.2f ohm' %r)
```

In [1]:

```
#Variable declaration
p = 6.0 #Number of poles
f = 50.0 #Frequency(Hz)
R_2 = 0.3 #Rotor resistance per phase(ohm)
N_1 = 960.0 #Rotor speed(rpm)
N_2 = 800.0 #New rotor speed with external resistance(rpm)
#Calculation
N_s = 120*f/p #Synchronous speed(rpm)
S_1 = (N_s-N_1)/N_s #Slip at full load
S_2 = (N_s-N_2)/N_s #New slip
R = (S_2/S_1*R_2)-R_2 #External resistance per phase added in rotor circuit to reduce speed(ohm)
#Result
print('External resistance per phase added in rotor circuit to reduce speed, R = %.1f ohm' %R)
```

In [1]:

```
import math
#Variable declaration
hp = 50.0 #DC shunt motor rating(hp)
V = 440.0 #Voltage(V)
I_b = 150.0 #Breaking current(A)
N_reduce = 40.0 #Speed of motor fallen by(%)
R_a = 0.1 #Armature resistance(ohm)
I_a_fl = 100.0 #Full-load armature current(A)
N_fl = 600.0 #Full-load speed(rpm)
#Calculation
E_b = V-I_a_fl*R_a #Back emf of motor(V)
V_a = V+E_b #Voltage across armature when braking starts(V)
R_b = V_a/I_b #Resistance required(ohm)
R_extra = R_b-R_a #Extra resistance required(ohm)
T_fl = hp*746*60/(2*math.pi*N_fl) #Full-load torque(N-m)
T_initial_b = T_fl*I_b/I_a_fl #Initial breaking torque(N-m)
E_b2 = E_b*(100-N_reduce)/100 #Back emf at new speed(V)
I = (V+E_b2)/R_b #Current(A)
EBT = T_fl*I/I_a_fl #Torque when motor speed reduced by 40%(N-m)
#Result
print('Braking torque = %.1f N-m' %T_initial_b)
print('Torque when motor speed has fallen, E.B.T = %.1f N-m' %EBT)
print('\nNOTE: ERROR: Calculation mistakes in the textbook solution')
```

In [1]:

```
import math
#Variable declaration
V = 400.0 #Voltage of IM(V)
p = 4.0 #Number of poles
f = 50.0 #Frequency(Hz)
hp = 25.0 #Power developed(hp)
S = 0.04 #Slip
R_X_2 = 1.0/4 #Ratio of rotor resistance to standstill reactance i.e R2/X2
#Calculation
N_s = 120*f/p #Synchronous speed(rpm)
N_fl = N_s*(1-S) #Full load speed(rpm)
T_fl = hp*735.5*60/(2*math.pi*N_fl*9.81) #Full-load torque(kg-m)
S_1 = 1.0 #Slip at standstill
X_R_2 = 1.0/R_X_2 #Ratio of standstill reactance to rotor resistance
T_s_fl = S_1/S*((1+(S*X_R_2)**2)/(1+(S_1*X_R_2)**2)) #T_standstill/T_fl
T_standstill = T_s_fl*T_fl #Standstill torque(kg-m)
S_instant = (N_s+N_fl)/N_s #Slip at instant of plugging
T_initial = (S_instant/S)*((1+(S*X_R_2)**2)/(1+(S_instant*X_R_2)**2))*T_fl #Initial plugging torque(kg-m)
#Result
print('Initial plugging torque = %.1f kg-m' %T_initial)
print('Torque at standstill = %.f kg-m' %T_standstill)
print('\nNOTE: ERROR: Calculation mistake from full-load torque onwards. Hence, change in obtained answer from that of textbook')
```

In [1]:

```
import math
#Variable declaration
T = 312.5 #Load torque(N-m)
N = 500.0 #Speed limit(rpm)
R_total = 1.0 #Total resistance of armature & field(ohm)
#Calculation
input_load = 2*math.pi*N*T/60 #Input from load(W)
E = 345.0 #Voltage from magnetization curve(V). From Fig E1.5 page no 701
I = 47.5 #Current from magnetization curve(A). From Fig E1.5 page no 701
R = E/I #Resistance(ohm)
R_add = R-R_total #Additional resistance required(ohm)
#Result
print('Value of resistance to be connected in motor circuit = %.2f ohm' %R_add)
```

In [1]:

```
#Variable declaration
V = 500.0 #Shunt motor voltage(V)
load = 400.0 #Hoist load(kg)
speed = 2.5 #Hoist raised speed(m/sec)
n_motor = 0.85 #Efficiency of motor
n_hoist = 0.75 #Efficiency of hoist
#Calculation
P_output = load*speed*9.81 #Power output from motor(W)
P_input = P_output/(n_motor*n_hoist) #Motor input(W)
I = P_input/V #Current drawn from supply(A)
output_G = load*speed*9.81*n_motor*n_hoist #Generator output(W)
R = V**2/output_G #Resistance required in the armature circuit for rheostatic braking(ohm)
#Result
print('Current drawn by the motor from supply = %.1f A' %I)
print('Resistance required in the armature circuit for rheostatic braking, R = %.f ohm' %R)
```

In [1]:

```
import math
#Variable declaration
t = 1.0 #Time(hour)
hp = 15.0 #Motor rating(hp)
T = 2.0 #Time constant(hour)
theta_f = 40.0 #Temperature rise(°C)
#Calculation
P = (1.0/(1-math.exp(-t/T)))**0.5*hp #One-hour rating of motor(hp)
#Result
print('One-hour rating of motor, P = %.f hp' %P)
print('\nNOTE: Changes in the obtained answer from that of textbook is due to more approximation in the textbook solution')
```

In [1]:

```
import math
#Variable declaration
hp = 10.0 #Motor rating(hp)
d = 0.7 #Diameter of cylinder(m)
l = 1.0 #Length of cylinder(m)
w = 380.0 #Weight of motor(kgm)
heat_specific = 700.0 #Specific heat(J/kg/1°C)
heat_dissipation = 15.0 #Outer surface heat dissipation rate(W/sq.cm/°C)
n = 0.88 #Efficiency
#Calculation
output = hp*735.5 #Output of motor(W)
loss = (1-n)/n*output #Losses(W)
area_cooling = math.pi*d*l #Cooling surface area(sq.m)
theta_m = loss/(area_cooling*heat_dissipation) #Final temperature rise(°C)
T_sec = w*heat_specific/(area_cooling*heat_dissipation) #Thermal time constant(sec)
T_hour = T_sec/3600 #Thermal time constant(hours)
#Result
print('Final temperature rise, θ_m = %.1f °C' %theta_m)
print('Thermal time constant of the motor = %.2f hours' %T_hour)
print('\nNOTE: ERROR: Mistake in calculating thermal time constant in the textbook solution')
```

In [1]:

```
import math
#Variable declaration
hp = 25.0 #Motor rating(hp)
T = 100.0/60 #Heating time constant(hour)
theta = 40.0 #Temperature rise(°C)
t = 0.5 #Time(hour)
n = 0.85 #Motor maximum efficiency
#Calculation
output = hp*735.5/1000 #Output of motor(kW)
output_max = output*n #Power at maximum efficiency(kW)
theta_f2 = theta/(1-math.exp(-t/T)) #θ_f2(°C)
loss = 1+(output/output_max)**2 #Losses at 18.4 kW output in terms of W
P = ((theta_f2/theta*loss)-1)**0.5*output_max #Half-hour rating of motor(kW)
P_hp = P*1000/735.5 #Half-hour rating of motor(hp)
#Result
print('Half-hour rating of motor, P = %.f kW = %.1f hp (metric)' %(P,P_hp))
print('\nNOTE: ERROR: Calculation mistake from final temperature rise onwards in textbook')
```

In [1]:

```
import math
#Variable declaration
theta_f1 = 40.0 #Temperature rise(°C)
T = 100.0 #Heating time constant(min)
rated_2 = 2.0 #Motor at twice the continuously rating
#Calculation
loss_cu = 2.0**2 #Copper loss at twice full load in terms of W
loss_total = loss_cu+1 #Total losses at full load in terms of W
theta_f2 = theta_f1*loss_total/rated_2 #θ_f2(°C)
t = math.log(1-(theta_f1/theta_f2))*(-T) #Time for which motor can run at twice the continuously rated output without overheating(min)
#Result
print('Motor can run at twice the continuously rated output without overheating for time, t = %.f min' %t)
```

In [1]:

```
#Variable declaration
kW = 20.0 #Motor output(kW)
theta_1 = 50.0 #Temperature rise not to be exceeded on overload(°C)
t_1 = 1.0 #Time on overload(hour)
theta_2 = 30.0 #Temperature rise on full-load(°C)
t_2 = 1.0 #Time on full-load(hour)
theta_3 = 40.0 #Temperature rise on full-load(°C)
t_3 = 2.0 #Time on full-load(hour)
#Calculation
e_lambda = 1.0/3 #Obtained directly from textbook
theta_f = theta_2/(1-e_lambda) #θ_f(°C)
theta_f1 = theta_1/(1-e_lambda) #θ'_f(°C)
P = (theta_f1/theta_f)**0.5*kW #Maximum overload that can be carried by the motor(kW)
#Result
print('Maximum overload that can be carried by the motor, P = %.1f kW' %P)
```

In [1]:

```
#Variable declaration
hp_1 = 100.0 #Motor load(hp)
t_1 = 10.0 #Time of operation(min)
hp_2 = 0 #Motor load(hp)
t_2 = 5.0 #Time of operation(min)
hp_3 = 60.0 #Motor load(hp)
t_3 = 8.0 #Time of operation(min)
hp_4 = 0 #Motor load(hp)
t_4 = 4.0 #Time of operation(min)
#Calculation
t_total = t_1+t_2+t_3+t_4 #Total time of operation(min)
rms = ((hp_1**2*t_1+hp_2**2*t_2+hp_3**2*t_3+hp_4**2*t_4)/t_total)**0.5 #rms horsepower
#Result
print('Required size of continuously rated motor = %.f H.P' %rms)
print('\nNOTE: ERROR: Calculation mistake in the textbook')
print(' Actual value is written here instead of standard values')
```

In [1]:

```
from scipy.integrate import quad
#Variable declaration
hp_1 = 200.0 #Motor load(hp)
t_1 = 5.0 #Time of operation(min)
hp_2 = 100.0 #Motor load(hp)
t_2 = 10.0 #Time of operation(min)
hp_3 = 0 #Motor load(hp)
t_3 = 3.0 #Time of operation(min)
#Calculation
m = hp_1/t_1 #Slope of uniform rise power
t_total = t_1+t_2+t_3 #Total time of operation(min)
def integrand(x):
return (m*x)**2
ans, err = quad(integrand, 0, t_1) #Integarted uniform area upto 5 min
rms = ((ans+hp_2**2*t_2+hp_3**2*t_3)/t_total)**0.5 #rms horsepower
#Result
print('rms horsepower = %.1f HP. Therefore, a motor of %.f H.P should be selected' %(rms,rms+4))
```

In [1]:

```
import math
#Variable declaration
V = 440.0 #DC shunt motor voltage(V)
hp = 50.0 #Motor rating(hp)
N = 600.0 #Speed(rpm)
I = 80.0 #Current at full-load(A)
I_1 = 1.1 #Lower current limit in terms of full current
I_2 = 1.5 #Upper current limit in terms of full current
J = 20.0 #Moment of inertia(kg-m^2)
#Calculation
T = hp*746*60/(2*math.pi*N) #Full load torque of motor(N-m)
T_avg_start = (I_1+I_2)/2*T #Average starting torque(N-m)
T_g = ((I_1+I_2)/2-1)*T #Torque available for acceleration(N-m)
alpha = T_g/J #Angular acceleration(rad/sec^2)
t = 2*math.pi*N/(60*alpha) #Time taken to accelerate the motor(sec)
#Result
print('Time taken to accelerate the motor to rated speed against full load torque, t = %.2f sec' %t)
print('\nNOTE: ERROR: Calculation mistake in the textbook solution')
```

In [1]:

```
import math
#Variable declaration
hp = 50.0 #Motor rating(hp)
N = 600.0 #Speed(rpm)
energy = 276.0 #Stored energy(kg-m/hp)
#Calculation
g = 9.81
T = hp*746*60/(2*math.pi*N*g) #Full load torque of motor(kg-m)
J = hp*energy*2*g/(2*math.pi*N/60)**2 #Moment of inertia(kg-m^2)
alpha = T*g/J #Angular acceleration(rad/sec^2)
t = 2*math.pi*N/(60*alpha) #Time taken to accelerate the motor to rated speed(sec)
#Result
print('Time taken to accelerate the motor to rated speed, t = %.2f sec' %t)
```

In [1]:

```
import math
#Variable declaration
J = 1270.0 #Moment of inertia of fly-wheel(kg-m^2)
N = 500.0 #Speed(rpm)
hp = 50.0 #Motor rating(hp)
#Calculation
g = 9.81
T = hp*746*60/(2*math.pi*N*g) #Full load torque of motor(kg-m)
T_m = 2*T #Accelerating torque(kg-m)
alpha = T_m*g/J #Angular acceleration(rad/sec^2)
t = 2*math.pi*N/(60*alpha) #Time taken to accelerate a fly-wheel(sec)
#Result
print('Time taken to accelerate a fly-wheel, t = %.1f sec' %t)
```

In [7]:

```
import math
#Variable declaration
N_1 = 1000.0 #Speed of dc shunt motor(rpm)
N_2 = 400.0 #Speed of dc shunt motor(rpm)
R = 14.0 #Resistance connected across armature(ohm)
E_1 = 210.0 #EMF induced in armature at 1000 rpm(V)
J = 17.0 #Moment of inertia(kg-m^2)
T_F = 1.0 #Frictional torque(kg-m)
#Calculation
g = 9.81
output = E_1**2/R #Motor output(W)
T_E = output*60/(2*math.pi*N_1*g) #Electric braking torque(kg-m)
w_1 = 2*math.pi*N_1/60 #ω_1(rad/sec)
k = T_E/w_1
t = J/(g*k)*math.log(N_1/N_2) #Time taken for dc shunt motor to fall in speed with constant excitation(sec)
kw = T_E*N_2/N_1 #kω
t_F = J/(g*k)*math.log((1+T_E)/(1+kw)) #Time for the same fall if frictional torque exists(sec)
#Result
print('Time taken for dc shunt motor to fall in speed with constant excitation, t = %.1f sec' %t)
print('Time for the same fall if frictional torque exists, t = %.1f sec' %t_F)
```

In [1]:

```
import math
from scipy.integrate import quad
#Variable declaration
V = 400.0 #Voltage of synchronous motor(V)
p = 8.0 #Number of poles
J = 630.0 #Moment of inertia(kg-m^2)
T_E = 165.0 #Braking torque(kg-m)
kw_1 = 690.0 #Electric braking torque(kg-m)
T_F = 1.4 #Frictional torque(kg-m)
f = 50.0 #Frequency(Hz). Assumed normal supply frequency
#Calculation
g = 9.81
#Case(a) Plugging
T_B = T_E+T_F #Torque(kg-m)
beta = T_B*g/J #Retardation(rad/sec^2)
N_s = 120*f/p #Synchronous speed(rad/sec)
w = 2*math.pi*N_s/60 #ω(rad/sec)
def integrand(w):
return (-1.0/beta)
t_a, err = quad(integrand, w, 0) #Time taken to stop the motor(sec)
def integrand(w):
return (-w/(2*math.pi*beta))
n_a, err = quad(integrand, w, 0) #Number of revolutions
#Case(b) Rheostatic braking
k = kw_1/w
t_b = J/(g*k)*math.log((T_F+kw_1)/T_F) #Time taken to stop the motor(sec)
n_b = 1.0/(2*math.pi*k)*(J/(g*k)*(T_F+kw_1)*(1-math.exp(-k*g*t_b/J))-T_F*t_b) #Number of revolutions
#Result
print('Case(a): Time taken to come to standstill by plugging, t = %.1f sec' %t_a)
print(' Number of revolutions made to come to standstill by plugging, n = %.f revolutions' %n_a)
print('Case(b): Time taken to come to standstill by rheostatic braking, t = %.1f sec' %t_b)
print(' Number of revolutions made to come to standstill by rheostatic braking, n = %.f revolutions' %n_b)
print('\nNOTE: ERROR: Calculation mistake in finding number of revolution in case(a) in textbook solution')
```

In [1]:

```
import math
#Variable declaration
hp = 500.0 #Rating of IM(hp)
N_nl = 40.0 #No-load speed(rpm)
S_fl = 0.12 #Slip at full-load
T_l = 41500.0 #Load torque(kg-m)
t = 10.0 #Duration of each rolling period(sec)
#Calculation
g = 9.81
T_fl = hp*746*60/(2*math.pi*N_nl*g*(1-S_fl)) #Torque at full-load(kg-m)
T_m = 2.0*T_fl #Motor torque at any instant(kg-m)
slip = S_fl*N_nl #Slip(rpm)
slip_rad = slip*2*math.pi/60 #Slip(rad/sec)
k = slip_rad/T_fl
J = -g*t/(k*math.log(1-(T_m/T_l))) #Inertia of flywheel(kg-m^2)
#Result
print('Inertia of flywheel required, J = %.3e kg-m^2' %J)
print('\nNOTE: ERROR : J = 2.93*10^6 kg-m^2 and not 2.93*10^5 as mentioned in the textbook solution')
```

In [1]:

```
import math
#Variable declaration
T_l = 150.0 #Load torque(kg-m)
t = 15.0 #Duration of load torque(sec)
T_m = 85.0 #Motor torque(kg-m)
N = 500.0 #Speed(rpm)
s_fl = 0.1 #Full-load slip
#Calculation
g = 9.81
slip = N*s_fl*2*math.pi/60 #Slip(rad/sec)
k = slip/T_m
T_0 = 0 #No-load torque(kg-m)
J = -g*t/(k*math.log((T_l-T_m)/(T_l-T_0))) #Moment of inertia of flywheel(kg-m^2)
#Result
print('Inertia of flywheel required, J = %.f kg-m^2' %J)
print('\nNOTE: ERROR : Calculation mistake in the textbook solution')
```