In [10]:

```
import math
from __future__ import division
from sympy import Symbol
#variable declaration
#motor ratings
V1=200 #rated voltage
Ia1=10.5 #rated current
N1=2000 #speed in rpm
Ra=0.5 #armature resistance
Rs=400 #field resistance
V2=175 #drop in source voltage
#calculation
flux1 = Symbol('flux1')
flux2=V2/V1*flux1
Ia2=flux1/flux2*Ia1 #since load torque
E1=V1-Ia1*Ra
E2=V2-Ia2*Ra
N2=(E2/E1)*(flux1/flux2)*N1
#results
#answer in the book is wrong due to accuracy
print"\nmotor speed is:N2=",round(N2,1),"rpm"
```

In [11]:

```
import math
from __future__ import division
from sympy import Symbol
#variable declaration
V1=220 #rated voltage
Ia1=100 #rated current
N1=1000 #rated speed in rpm clockwise
Ra=0.05 #armature resistance
Rs=0.05 #field resistance
#calculation
#turns is reduced to 80% then flux is also reduced by the same value and hence current is also reduced
Ke = Symbol('Ke')
Ia2 = Symbol('Ia2')
T1=Ke*Ia1**2 #flux is directly proportional to current Ia
T2=Ke*0.8*Ia2**2 #flux is directly proportional to current Ia
Ia2=-Ia1/math.sqrt(0.8) #since T1=T2 and the direction is opposite
E1=V1-Ia1*(Ra+Rs)
Rs=.8*Rs #Rs=80% of the field resistance 0.05ohm since the flux is reduced to 80%
E2=-(V1+Ia2*(Ra+Rs))
N2=(E2/E1)*(Ia1/Ia2)*(N1/0.8) #since E=Kn*flux*N
#results
print"\nmotor speed is:N2=",round(N2,1),"rpm"
```

In [161]:

```
import math
from __future__ import division
#variable declaration
#motor ratings
V1=220 #rated voltage
Ia1=200 #rated current
Ra=0.06 #armature resistance
Rb=0.04 #internal resistance of the variable source
N1=800 #speed in rpm
N2=600 #speed when motor is operatingin regenerative braking
#Calculation
Ia2=0.8*Ia1 #motor is opereting in regenerative braking at 80% of Ia1
E1=V1-Ia1*Ra #back emf at rated operation
E2=(N2/N1)*E1 #back emf at the given speed N2
V2=E2-Ia2*(Ra+Rb) #internal voltage of thevariable source
#results
print"\n internal voltage of thevariable source:",round(V2),"V"
```

In [12]:

```
import math
from __future__ import division
from sympy import Symbol
#variable declaration
#The ratings of the motor is same as that of Ex-5.2
V1=220 #rated voltage
Ia1=100 #rated current
N1=1000 #speed in rpm clockwise
N2=800 #given speed during the dynamic braking
Ra=0.05 #armature resistance
Rs=0.05 #field resistance
#calculation
T1 = Symbol('T1')
T2 = 2*T1 #dynamic torque is twice the rated torque
Ia2=Ia1*math.sqrt(T2/T1) #since T=Kf*Ia**2
E1=V1-Ia1*(Ra+Rs)
E2=(Ia2/Ia1)*(N2/N1)*E1 #since E=Ke*Ia*N
Rb=E2/Ia2-(Ra+Rs) #since E2=Ia2(Rb+Ra+Rs) during braking
#results
print"\n braking current Ia2:",round(Ia2,1),"A"
print"\n required braking resistance Rb:",round(Rb,2),"ohm"
```

In [4]:

```
import math
from __future__ import division
from array import array
import numpy
import matplotlib.pyplot as plt
%matplotlib inline
#variable declaration
#ratings of the DC shunt motor which operated under dynamic braking
Rb=1 #braking resisance
Ra=0.04 #armature resistance
Rf=10 #field resistance
T=400 #load torque in N-m
#magnetisation curve at N1
N1=600 #speed in rpm
If=[2.5,5,7.5,10,12.5,15,17.5,20,22.5,25] #field current
E =[25,50,73.5,90,102.5,110,116,121,125,129] #back emf
#calculation
print"Field current If:",If,"A"
x=(Rb+Rf)/Rb
Ia = [If * x for If in If] #armature current
Wm=2*math.pi*N1/60
Ke_flux=[E / Wm for E in E] #Ke*flux=constant
Ke_flux=[round(Ke_flux,3) for Ke_flux in Ke_flux]
Ke_flux=numpy.array(Ke_flux)
Ia=numpy.array(Ia)
T=numpy.array(Ke_flux)*numpy.array(Ia) #torque
print"\nKe_flux :",Ke_flux
T=[round(T,1) for T in T]
print"\nTorque :",T,"N-m"
#results
#plotting the values of Ke*flux vs If
If=[2.5,5,7.5,10,12.5,15,17.5,20,22.5,25] #field current
plt.subplot(2,1,1)
plt.plot(If,Ke_flux,'y')
plt.xlabel('field current $I_f$')
plt.ylabel('$Ke*flux$')
plt.title('$If vs Ke*flux$')
plt.grid(True)
#plotting the values of T vs If
If=[2.5,5,7.5,10,12.5,15,17.5,20,22.5,25] #field current
plt.subplot(2,1,2)
plt.plot(T,If)
plt.xlabel('Torque $T$')
plt.ylabel('field current $I_f$')
plt.title('$T vs If$')
plt.grid()
plt.tight_layout()
plt.show()
print"\nFrom the plot we can see that when the torque is 400 N-m, "
print"the field current is If=19.3 A, and Ke*flux=1.898 when If=19.3 A"
T=400 # braking torque
If=19.13 # field current
Ke_flux=1.898 # Ke*flux
Ia=x*If
E=If*Rf+Ia*Ra #since E=V+Ia*Ra
N2=(E/Ke_flux)*(60/(2*math.pi)) #required speed
print"Hence the required speed in is :",round(N2),"rpm"
```

In [1]:

```
import math
from __future__ import division
from array import array
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
#variable declaration
#the motor rating is same as that of Ex-5.5
N=600 #value of the speed given from the magnetization curve in Ex-5.5
Ra=0.04 #armature resistance
Rf=10 #field resistance
T=400 #load torque in N-m
N1=1200 #given speed in rpm to hold the overhauling torque
#calculation
Wm=2*math.pi*N1/60 #angular speed at the given speed N1
#magnetisation curve at N=600rpm
If=[2.5,5,7.5,10,12.5,15,17.5,20,22.5,25] #field current
E =[25,50,73.5,90,102.5,110,116,121,125,129] #value of the back emf as given in Ex-5.5 for the speed N
#magnetisation curve at N=1200rpm
If=[2.5,5,7.5,10,12.5,15,17.5,20,22.5,25] #field current
E1=[N1/N*E for E in E] #back emf at the speed N1
print"Hence the magnetization curve at 1200rpm is"
print"Field current If:",If,"A"
print"Back emf is E1:",E1,"V"
Pd=round(T*Wm,2) #power developed
x=round(Pd*Ra,1)
V=[(E1-Pd*Ra/E1) for E1 in E1] #terminal voltage
V=[round(V,2) for V in V]
print"Terminal voltage V:",V,"V"
#results
#plotting the values of V vs If
plt.subplot(2,1,1)
plt.plot(V,If)
plt.xlabel('Terminal voltage $V$')
plt.ylabel('Field current $I_f$')
plt.title('$V vs If$')
plt.grid()
#plotting the values of E vs If
If=[2.5,5,7.5,10,12.5,15,17.5,20,22.5,25] #field current
E =[25,50,73.5,90,102.5,110,116,121,125,129] #value of the back emf as given in Ex-5.5 for the speed N
E1=[N1/N*E for E in E] #back emf at the speed N1
plt.subplot(2,1,2)
plt.plot(E1,If,'y')
plt.xlabel('$E$')
plt.ylabel('Field current $I_f$')
plt.title('$E vs If$')
plt.grid()
plt.tight_layout()
plt.show()
print"\nFrom the plot we can see that when the current If=25 A the terminal voltage is V=250 V with the back emf E=258V"
E=258 #value of the back emf in V at from the plot
V=250 #value of terminal voltage in V from the plot at E=258 V
If=25 #value of If in A from the plot at E=258 V
Ia=(E-V)/Ra #armature current
If=V/Rf #field current
Ir=Ia-If
Rb=V/Ir #braking resistance
print"Hence the rquired braking resistance is ",round(Rb,3),"ohm"
```

In [170]:

```
import math
from __future__ import division
from array import array
import numpy
import matplotlib.pyplot as plt
%matplotlib inline
#variable declaration
#ratings of the DC series motor which operated under dynamic braking
Ra=0.5 #total resistance of armature and field windings
Rf=10 #field resistance
T=500 #overhauling load torque in N-m
N=600 #speed at the overhauling torque T
#magnetisation curve at a speed of 500 rpm
N1=500 #speed in rpm
Ia=[20, 30, 40, 50, 60, 70, 80] #armature current
E =[215,310,381,437,482,519,550] #back emf
#calculation
Wm1=2*math.pi*N1/60
print"\nArmature current :",Ia,"A"
Ke_flux=[E / Wm1 for E in E] #Ke*flux=constant
Ke_flux=[round(Ke_flux,3) for Ke_flux in Ke_flux]
print"\nKe_flux :",Ke_flux
Ke_flux=numpy.array(Ke_flux)
Ia=numpy.array(Ia)
T=numpy.array(Ke_flux)*numpy.array(Ia) #torque
T=[round(T,1) for T in T]
print"\nTorque :",T,"N-m"
#results
#plotting the values of Ke*flux vs Ia and T vs Ia
plt.subplot(2,1,1)
plt.plot(Ia,Ke_flux,'y')
plt.xlabel('Armature current $I_a$')
plt.ylabel('$Ke*flux$')
plt.title('$Ke*flux vs Ia$')
plt.grid()
plt.subplot(2,1,2)
plt.plot(T,Ia)
plt.xlabel('Torque $T$')
plt.ylabel('Armature current $I_a$')
plt.title('$T vs Ia$')
plt.grid(True)
plt.tight_layout()
plt.show()
print"\nFrom the plot we can see that at the given torque T=500 N-m the current Ia is 56 A, and Ke*flux is 8.9 at Ia=56 A"
Ke_flux=8.9 #value of Ke*flux at T=500 N-m from the plot
Ia=56 #value of Ia at at T=500 N-m from the plot
Wm=2*math.pi*N/60
E=Ke_flux*Wm #required emf
x=E/Ia #x=Ra+Rb
Rb=x-Ra #required braking resistance
print"Hence the rquired braking resistance is ",round(Rb,3),"ohm"
```

In [171]:

```
import math
from __future__ import division
#variable declaration
#ratings of the separately excited motor
V=220 # rated voltage
N=970 # rated speed
Ia=100 # rated current
Ra=0.05 # armature resistance
N1=1000 # initial speed of the motor in rpm
#calculation
E=V-Ia*Ra
E1=N1/N*E #value of back emf at the speed N1
#(a)the resistance to be placed
Ia1=2*Ia #value of the braking current is twice the rated current
Rb=(E1+V)/Ia1-Ra #required resistance
#(b)The braking torque
Wm=(2*math.pi*N1)/60
T=E1*Ia1/Wm
#(c)when the speed has fallen to zero the back emf is zero
E2=0
Ia2=V/(Ra+Rb)
T2=Ia2/Ia1*T #since the torque is directly proportional to the current
#results
print"(a)Hence required resistance is :",round(Rb,2),"ohm"
#answer for the resistance in the book is wrong due to accuracy
print"\n(b)Hence the required braking torque is :",round(T,1),"N-m"
print"\n(c)Hence the required torque is :",round(T2,1),"N-m"
```

In [151]:

```
import math
from __future__ import division
import cmath
#variable declaration
#ratings of the separately excited motor which operates under rheostatic braking
V=220 # rated voltage
N=1000 # rated speed
Ia=175 # rated current
Ra=0.08 # armature resistance
N1=1050 # initial speed of the motor in rpm
J=8 # moment of inertia of the motor load system kg-m2
La=0.12 # armature curcuit inductance in H
#calculation
E=V-Ia*Ra
Wm=N*2*math.pi/60 #rated speed in rad/s
#(a)when the braking current is twice the rated current
Ia1=2*Ia
E1=N1/N*E
x=E1/Ia1 #x=Rb+Ra
Rb=x-Ra #required braking resistance
#(b)to obtain the expression for the transient value of speed and current including the effect of armature inductance
Ra=x #total armature current
K1=N1*2*math.pi/60 #initial speed in rad/s
K=E/Wm
B=0
ta=La/Ra #time constant in sec
Trated=E*Ia/Wm #rated torque
Tl=0.15*Trated #load torque is 15% of the rated torque
tm1= float('inf') #tm1=J/B and B=0 which is equal to infinity
tm2=J*Ra/(B*Ra+K**2)
a = ta
b = -(1+ta/tm1)
c = 1/tm2
# calculate the discriminant
d = (b**2) - (4*a*c)
# find two solutions
alpha1 = (-b-cmath.sqrt(d))/(2*a)
alpha2 = (-b+cmath.sqrt(d))/(2*a)
K3=tm2*Tl/J
K4=tm2*K*Tl/J/Ra
#transient value for speed
x1=((J*alpha2-B)*K1-(Tl-J*alpha2*K3))/(J*(alpha2-alpha1))
y1=((J*alpha1-B)*K1-(Tl-J*alpha1*K3))/(J*(alpha1-alpha2))
#transient value for the current
x2=(K*K1+alpha2*La*K4)/(La*(alpha2-alpha1))
y2=(K*K1+alpha1*La*K4)/(La*(alpha1-alpha2))
#(c) to calculate the time taken by braking operation and the maximum value of the armature current
#now Wm=0 for the braking operation and hence 151.5 exp(-0.963*t1)- 8.247 = 0 from the previous answer in (b)
a=K3/x1 #a=exp(-0.963*t1)
t1=-alpha1*math.log(a.real) #take log base e on both sides
#now d/dt(ia)=0 for themaximum current and hence d/dt(26.25-593.1exp(-0.963*t)+566.8exp(-4.19*t) = 0 from the previous answer in (b)
b=abs(alpha2*y2)/abs(alpha1*x2) #b=exp(-0.963*t)/exp(-4.19*t)
t2=math.log(b)/(-alpha1+alpha2) #take log base e on both sides
t2=abs(t2)
ia=K4-x2.real*math.exp(-alpha1.real*t2)-y2.real*math.exp(-alpha2.real*t2)
#results
print"(a)Hence the braking resistance is :",round(Rb,3),"ohm"
print"\nb)The value of alpha1 :",round(alpha1.real,3),"and alpha2 :",round(alpha2.real,3)
print"\nHence the expression for the transient value for the speed is"
print"Wm=",round(x1.real,1),"exp(",-round(alpha1.real,3),"*t)",round(y1.real,1),"exp(",-round(alpha2.real,2),"*t)","-",round(K3,3)
print"\nHence the expression for the transient value for the current is"
print"ia=",round(K4,2),"-",round(x2.real,1),"exp(",-round(alpha1.real,3),"*t) +",-round(y2.real,1),"exp(",-round(alpha2.real,2),"*t)"
print"\n(c)Hence the time taken is :",round(t2,2),"sec"
print" Hence the maximum current is: ",round(ia,2),"A"
print"\n Note : There is a slight difference in the answers due to more number of the decimal place "
```

In [50]:

```
import math
from __future__ import division
import cmath
import numpy as np
#variable declaration
#ratings of the separately excited motor of Ex-5.9 which operates plugging
V=220 # rated voltage
N=1000 # rated speed
Ia=175 # rated current
Ra=0.08 # armature resistance
N1=1050 # initial speed of the motor in rpm
J=8 # moment of inertia of the motor load system kg-m2
La=0.12 # armature curcuit inductance in H
#calculation
E=V-Ia*Ra
Wm=N*2*math.pi/60 #rated speed in rad/s
#(a)when the braking current is twice the rated current
Ia1=2*Ia
E1=N1/N*E
x=(V+E1)/Ia1 #x=Rb+Ra
Rb=x-Ra #required braking resistance
#(b)to obtain the expression for the transient value of speed and current including the effect of armature inductance
#the values given below are taken from Ex-5.9
ta=0.194 #time constant in sec
B=0
tm1= float('inf') #tm1=J/B and B=0 which is equal to infinity
tm2=1.274
K=1.967
Trated=E*Ia/Wm #rated torque
Tl=0.5*Trated #load torque is 50% of the rated torque
Ra=Rb
K1=N1*2*math.pi/60 #initial speed in rad/s
#values of the coefficient of the quadratic equation for Wm
x1=(1+ta/tm1)/ta
x2=1/tm2/ta
x3=-(K*V+Ra*Tl)/J/Ra/ta
#values of the coefficient of the quadratic equation ia
y1=(1+ta/tm1)/ta
y2=1/tm2/ta
y3=-B*V/J/Ra/ta+K*Tl/J/Ra/ta
#solving the quadratic equation
a = 1
b = x1
c = x2
# calculate the discriminant
d = (b**2) - (4*a*c)
# find two solutions
alpha1 = (-b+cmath.sqrt(d))/(2*a)
alpha2 = (-b-cmath.sqrt(d))/(2*a)
K3=x3/x2
K4=y3/y2
Wm_0=K1 ;ia_0=0
d_Wm_dt_0=(K*ia_0-B*Wm-Tl)/J ;d_ia_dt_0=(-V-Ra*ia_0-K*K1)/La #Wm=K1 at t=0 and during braking rated voltage V is equal to -V
A = np.array([[1,1],[alpha1.real,alpha2.real]])
B = np.array([Wm_0,d_Wm_dt_0])
x = np.linalg.solve(A,B)
C = np.array([[1,1],[alpha1.real,alpha2.real]])
D = np.array([-K4,d_ia_dt_0])
y = np.linalg.solve(C,D)
#(c)to calculate the time taken for the speed to fall to zero value
a=-K3/x[0] #a=exp(-0.966*t1)
t1=alpha1*math.log(a) #take log base e on both sides
#results
print"(a)Hence the braking resistance is :",round(Rb,3),"ohm"
print"\n(b)The solution for alpha are ",round(alpha1.real,3),"and",round(alpha2.real,3)
print" Wm=",round(K3,2),"+ A*exp(",round(alpha1.real,3),"*t) +","+ B*exp(",round(alpha2.real,2),"*t)"
print" ia=",round(K4,2),"+ C*exp(",round(alpha1.real,3),"*t) +","+ D*exp(",round(alpha2.real,2),"*t)"
print" We have to find the value of A,B,C and D in the linear equation using the initial condition"
print" A=",round(x[0],2),"B=",round(x[1],2), "C=",round(y[0],2),"D=",round(y[1],2)
print"\nHence the expression for the transient value for the speed is"
print" Wm=",round(K3,2),"+",round(x[0],2),"*exp(",round(alpha1.real,3),"*t)",round(x[1],2),"*exp(",round(alpha2.real,2),"*t)"
print"\nHence the expression for the transient value for the current is"
print" ia=",round(K4,2),round(y[0],2),"*exp(",round(alpha1.real,3),"*t) +",round(y[1],2),"*exp(",round(alpha2.real,2),"*t)"
print"\n(c)Hence the time taken is :",round(t1.real,2),"sec"
print"\n Note :There is slight difference in the answers due to accuracy i.e more number of decimal place"
```

In [67]:

```
import math
from __future__ import division
import cmath
#variable declaration
#ratings of the separately excited motor
V=220 # rated voltage
N=600 # rated speed
Ia=500 # rated current
Ra=0.02 # armature resistance
Rf=10 # field resistance
#calculation
E1=V-Ia*Ra #rated back emf at rated operation
Wm1=2*math.pi*N/60 #angular speed
Trated=E1*Ia1/Wm1 #rated torque
#(i) when the speed of the motor is 450rpm
N1=450 #given speed in rpm
Tl=2000-2*N1 #load torque is a function of the speed as given
Ia2=Tl/Trated*Ia1 #for a torque of Tl as a function of current
E2=N1/N*E1 #for a given speed of 450rpm
V2=E2+Ia2*Ra #terminal voltage for a given speed of 450 rpm
#(ii) when the speed of the motor is 750rpm
N1=750 #given speed in rpm
Tl=2000-2*N1 #load torque is a function of the speed as given
Wm_=2*math.pi*N1/60
Ke_phi1=E1/Wm1
#Since we know that V=Ke*phi*Wm+Ia*Ra by solving we get that 0.02*(Ia_)**2 -220*Ia_ + 39270 = 0"
a = 0.02
b = -220
c = 39270
# calculate the discriminant
d = (b**2) - (4*a*c)
# find two solutions
Ia_1 = (-b-cmath.sqrt(d))/(2*a)
Ia_2 = (-b+cmath.sqrt(d))/(2*a)
Ke_phi=Tl/abs(Ia_1)
V1=V*Ke_phi/Ke_phi1 #required field voltage
#results
print"(i)Hence motor terminal voltage is :",round(V2),"V"
print" And the armature current is :",round(Ia2),"A"
print"\n(ii)The solution for Ia_ are ",round(abs(Ia_1),1),"A and",round(abs(Ia_2)),"A"
print" We ignore ",round(abs(Ia_2)),"A since it is unfeasible,\n Hence armature current is :",round(abs(Ia_1),1),"A"
print" Hence the required field voltage is :",round(V1,1),"V"
```

In [173]:

```
import cmath
from __future__ import division
import numpy
#variable declaration
#ratings of the 2-pole separately excited DC motor with the fields coils connected in parallel
V=220 # rated voltage
N=750 # rated speed
Ia1=100 # rated current
Ra=0.1 # armature resistance
#calculation
E1=V-Ia1*Ra #rated back emf at rated operation
Wm1=2*math.pi*N/60 #angular speed
Trated=E1*Ia1/Wm1 #rated torque
Ke_phi1=E1/Wm1
#(i) when the armature voltage is reduced to 110V
Wm2=2*math.pi*N2/60 #angular speed
E2=Ke_phi1*Wm2
#Now there are two linear equations...that we have to solve
#They are given by 0.3*N2+2.674*Ia2=500 and 0.28*N2+0.1*Ia2=110
a = np.array([[0.3,2.674], [0.28,0.1]])
b = np.array([500,110])
x = np.linalg.solve(a, b)
N2=round(x[0],1) #let the motor speed be N2
Ia2=round(x[1],1) #let the motor current be Ia2
#(ii)when the field coils are connected in series
K=Ke_phi1/2
Wm3=2*math.pi*N3/60 #angular speed
E3=K*Wm3
#Now there are two linear equations...that we have to solve"
#They are given by 0.3*N3+1.337*Ia3=500 and 0.14*N3+0.1*Ia3=220"
a = np.array([[0.3,1.337], [0.14,0.1]])
b = np.array([500,220])
x = np.linalg.solve(a, b)
N3=round(x[0],1) #let the motor speed be N3
Ia3=round(x[1],2) #let the motor current be Ia3
#results
print"(i)Hence the motor armature current is Ia2 :",Ia2,"A"
print" And the required speed is N2 :",N2,"rpm"
print"\n(ii)Hence the motor armature current is Ia3 :",Ia3,"A"
print" And the required speed is N3 :",N3,"rpm"
```

In [81]:

```
import math
from __future__ import division
#variable declaration
#ratings of the separately excited motor
V=200 # rated voltage
N=875 # rated speed
Ia=150 # rated current
Ra=0.06 # armature resistance
Vs=220 # source voltage
f=50 # frequency of the source voltage
#calculation
E=V-Ia*Ra #back emf
Vm=math.sqrt(2)*Vs #peak voltage
#(i)when the speed is 750 rpm and at rated torque
N1=750 #given speed in rpm
E1=N1/N*E #back emf at the given speed N1
Va=E1+Ia*Ra #terminal voltage
cos_alpha=Va*math.pi/2/Vm
alpha=math.acos(cos_alpha) #required firing angle in radian
alpha1=math.degrees(alpha) #required firing angle in degrees
#(ii)when the speed is -500rpm and at rated torque
N1=-500 #given speed in rpm
E1=N1/N*E #back emf at the given speed N1
Va=E1+Ia*Ra #terminal voltage
cos_alpha=Va*math.pi/2/Vm
alpha=math.acos(cos_alpha) #required firing angle in radian
alpha2=math.degrees(alpha) #required firing angle in degrees
#(iii)when the firing angle is 160 degrees
alpha=160 #firing angle in degrees
Va=2*Vm/math.pi*math.cos(math.radians(alpha))
E1=Va-Ia*Ra #since Va=E1+Ia*Ra
N1=E1/E*N #the required speed at the given firing angle
#results
print"(i)Hence the required firing angle is :",round(alpha1,1),"°"
print"\n(ii)Hence the required firing angle is :",round(alpha2),"°"
print"\n(iii)Hence the required speed is :",round(N1,1),"rpm"
```

In [179]:

```
import math
from __future__ import division
#variable declaration
#ratings of the separately excited motor is same as that of Ex-5.13
V=200 # rated voltage
N=875 # rated speed
Ia=150 # rated current
Ra=0.06 # armature resistance
Vs=220 # source voltage
f=50 #frequency of the source voltage
La=0.85e-3 # armature curcuit inductance in H
#calculation
E=V-Ia*Ra #back emf
Vm=math.sqrt(2)*Vs #peak voltage
Wm=2*math.pi*N/60 #synchronous angular speed
#(i)when the speed is 400 rpm and firing angle is 60 degrees
N1=400 #given speed in rpm
alpha=60 #firing angle in degrees
W=2*math.pi*f
x=W*La/Ra
phi=math.atan(x)
cot_phi=1/math.tan(phi)
Z=math.sqrt(Ra**2+(W*La)**2)
K=E/Wm
y=Ra*Vm/Z/K
a=(1+math.exp(-(math.pi*cot_phi)))/(math.exp(-(math.pi*cot_phi))-1)
Wmc=y*math.sin(math.radians(alpha)-phi)*a #required angular speed in rps
Nmc=Wmc*60/2/math.pi #required angular speed in rpm
E1=N1/N*E
#The equation Vm/Z*sin(beta-phi)-E/Ra+(E/Ra-Vm/Z*sin(alpha-phi))*exp(-(beta-alpha)*cot_phi)=0
#can be solved using trial method such that beta=230 degrees
beta=230 #in degrees
beta=math.radians(beta) #in radians
alpha=math.radians(alpha) #in radians
Va=(Vm*(math.cos(alpha)-math.cos(beta))+(math.pi+alpha-beta)*E1)/math.pi
Ia=(Va-E1)/Ra
T1=K*Ia
#(ii)when the speed is -400 rpm and firing angle is 120 degrees
Le=2e-3 #external inductance added to the armature
L=La+Le
N2=-400 #given speed in rpm
alpha=120 #firing angle in degrees
x=W*L/Ra
phi=math.atan(x)
cot_phi=1/math.tan(phi)
Z=math.sqrt(Ra**2+(W*L)**2)
K=E/Wm
y=Ra*Vm/Z/K
a=(1+math.exp(-(math.pi*cot_phi)))/(math.exp(-(math.pi*cot_phi))-1)
Wmc=y*math.sin(math.radians(alpha)-phi)*a #required angular speed in rps
Nmc1=Wmc*60/2/math.pi #required angular speed in rpm
#The motor is operating under discontinous condition"
E2=N2/N*E
#The equation Vm/Z*sin(beta-phi)-E/Ra+(E/Ra-Vm/Z*sin(alpha-phi))*exp(-(beta-alpha)*cot_phi)=0
#can be solved using trial method such that beta=281 degrees
beta=281 #in degrees
beta=math.radians(beta) #in radians
alpha=math.radians(alpha) #in radians
Va=(Vm*(math.cos(alpha)-math.cos(beta))+(math.pi+alpha-beta)*E2)/math.pi
Ia=(Va-E2)/Ra
T2=K*Ia
#(iii)when the speed is -600 rpm and firing angle is 120 degrees
N3=-600 #speed in rpm
alpha=120 #firing angle in degrees
Va=2*Vm/math.pi*math.cos(math.radians(alpha))
E3=N3/N*E #since Va=E1+Ia*Ra
Ia=(Va-E3)/Ra
T3=K*Ia
#results
print"(i)Hence the required torque is :",round(T1),"N-m "
print"\n(ii)Hence the required torque is :",round(T2,1),"N-m"
print"\n(iii)Hence the required torque is :",round(T3),"N-m"
print"\nNote : There is a slight difference in the answers because of accuracy i.e more number of decimal place"
```

In [181]:

```
import math
from __future__ import division
#variable declaration
#ratings of the separately excited motor is same as that of Ex-5.13
V=200 # rated voltage
N=875 # rated speed
Ia=150 # rated current
Ra=0.06 # armature resistance
Vs=220 # source voltage
f=50 #frequency of the source voltage
La=2.85e-3 # armature curcuit inductance in H
#calculation
E=V-Ia*Ra #back emf
Vm=math.sqrt(2)*Vs #peak voltage
Wm=2*math.pi*N/60 #angular speed
W=2*math.pi*f
alpha=120 #firing angle in degrees
x=W*La/Ra
phi=math.atan(x)
cot_phi=1/math.tan(phi)
Z=math.sqrt(Ra**2+(W*La)**2)
K=E/Wm
y=Ra*Vm/Z/K
a=(1+math.exp(-(math.pi*cot_phi)))/(math.exp(-(math.pi*cot_phi))-1)
Wmc=round(y,3)*math.sin(math.radians(alpha)-phi)*a #required angular speed in rps
Nmc=Wmc*60/2/math.pi #required angular speed in rpm
Va=2*Vm/math.pi*math.cos(math.radians(alpha))
E1=Nmc/N*E #value of back emf at the critical speed of Nmc
Ia=(Va-E1)/Ra
Tc=K*Ia
#(i)when the torque is 1200 N-m and firing angle is 120 degrees
T2=1200 #given torque in N-m
Ia2=T2/K #given terminal current for the given torque and the answer in the book is wrong
E2=Va-Ia*Ra
N2=E2/E*N
#(ii)when the torque is 300 N-m and firing angle is 120 degrees
T=300 #required torque in N-m
beta=233.492 #required angle in degrees
beta=math.radians(beta) #in radians
alpha=math.radians(alpha) #in radians
x=beta-alpha
E1=(Vm*(math.cos(alpha)-math.cos(beta)))/x-(math.pi*Ra*T)/(K*x)
N1=E1/E*N #required speed
#results
print"The motor is operating under continuous condition"
print"The torque Tc is :",round(Tc),"N-m"
print"The answer for torque Tc in the book is wrong due to accuracy in the decimal place which leads to subsequent "
print"incorrect answers"
print"\n(i)Hence the required speed is :",round(N2),"rpm"
print"\n(ii)The equation Vm/Z*sin(beta-phi)-sin(alpha-phi))*exp(-(beta-alpha)*cot_phi)="
print" (Vm*(cos(alpha)-cos(beta))/Ra/(beta-alpha)-pi*T/K/(beta-alpha) )*(1-exp(-(beta-alpha)*cot_phi)"
print" can be solved using trial method such that beta=233.492 degrees"
print"\n Hence the required speed is :",round(N1,1),"rpm"
```

In [182]:

```
import math
from __future__ import division
#variable declaration
#ratings of the separately excited motor
V=220 # rated voltage
N=960 # rated speed
Ia=12.8 # rated current
Ra=2 # armature resistance
Vs=230 # source voltage
f=50 #frequency of the source voltage
La=150e-3 # armature curcuit inductance in H
#calculation
E=V-Ia*Ra #back emf
Vm=math.sqrt(2)*Vs #peak voltage
Wm=2*math.pi*N/60 #angular speed
W=2*math.pi*f
#(i)when speed is 600rpm and the firing angle is 60 degrees
alpha=60 #firing angle in degrees
N1=600 #motor speed in rpm
x=W*La/Ra
phi=math.atan(x)
cot_phi=1/math.tan(phi)
Z=math.sqrt(Ra**2+(W*La)**2)
K=E/Wm
y=Ra*Vm/Z/K
b=math.sin(phi)*math.exp(-(math.radians(alpha)*cot_phi))
c=math.sin(math.radians(alpha)-phi)*math.exp(-(math.pi*cot_phi))
a=1-math.exp(-(math.pi*cot_phi))
Wmc=round(y,3)*(b-c)/a #required angular speed in rps
Nmc=Wmc*60/2/math.pi #required angular speed in rpm
Va=Vm/math.pi*(1+math.cos(math.radians(alpha)))
E1=N1/N*E #value of back emf at the speed of N1
Ia=(Va-E1)/Ra
T=K*Ia
#(ii)when the torque is 20 N-m and firing angle is 60 degrees
T1=20 #required torque in N-m
alpha=60 #required firing angle in degrees
Ec=Nmc/N*E #motor back emf at critical speed of Nmc
Tc=K*(Va-Ec)/Ra #torque at the critical speed
Ia=T1/K
E1=Va-Ia*Ra
N1=E1/E*N #required speed
#results
if N1<Nmc :
print"(i)The motor is operating under continuous condition"
print" Hence the required torque is :",round(T,2),"N-m"
if Tc<T1 :
print"\n(ii)The motor is operating under continuous condition"
print" Hence the required speed is :",round(N1,1),"rpm"
```

In [183]:

```
import math
from __future__ import division
#variable declaration
#ratings of the separately excited motor
V=220 # rated voltage
N=1500 # rated speed
Ia=50 # rated current
Ra=0.5 # armature resistance
Vl=440 # line voltage with 3-phase ac supply
f=50 #frequency of the source voltage
#calculation
#(i) tranformer ratio
alpha=0 #firing angle
Va=V #motor terminal voltage is equal to the rated voltage when the firing angle is 0 degrees
Vm=math.pi/3*Va/math.cos(alpha)
Vrms=Vm/math.sqrt(2) #rms value of the converter input voltage
a=(Vl/math.sqrt(3))/Vrms #required transformer ratio
#(ii)value of the firing angle
E=V-Ia*Ra #back emf at the rated speed
#(a)when the speed of the motor is 1200 rpm and rated torque
N1=1200 #speed of the motor
E1=N1/N*E #back emf at the given speed N1
Va=E1+Ia*Ra #terminal voltage at the given speed N1
alpha=math.acos(math.pi/3*Va/Vm) #required firing angle in radians
alpha1=math.degrees(alpha) #required firing angle in degrees
#(b)when the speed of the motor is -800 rpm and twice the rated torque
N1=-800 #speed of the motor
E1=N1/N*E #back emf at the given speed N1
Ia=2*Ia #torque is directly proportional to the current hence twice the rated current
Va=E1+Ia*Ra #terminal voltage at the given speed N1
alpha=math.acos(math.pi/3*Va/Vm) #required firing angle in radians
alpha2=math.degrees(alpha) #required firing angle in degrees
#results
print"(i)Hence the required transformer ratio is :",round(a,3)
print"\n(ii)(a)Hence the required firing angle is :",round(alpha1,2),"°"
print"\n (b)Hence the required firing angle is :",round(alpha2,2),"°"
```

In [184]:

```
import math
from __future__ import division
#variable declaration
#ratings of the separately excited motor is same as that of Ex-5.17 but is fed from a circulating dual converter
V=220 # rated voltage
N=1500 # rated speed
Ia=50 # rated current
Ra=0.5 # armature resistance
Vl=165 # line voltage
f=50 # frequency of the source voltage
#calculation
E=V-Ia*Ra #back emf at the rated speed
Vm=Vl*math.sqrt(2) #peak voltage
#(i)during motoring operation when the speed is 1000 rpm and at rated torque
N1=1000 #speed of the motor
E1=N1/N*E #back emf at the given speed N1
Va=E1+Ia*Ra #terminal voltage at the given speed N1
alpha_A=math.acos(math.pi/3*Va/Vm)
alpha_B=180-math.degrees(alpha_A) #required converter firing angle in degrees
#(ii)during braking operation when the speed is 1000 rpm and at rated torque
N1=1000 #speed of the motor in the book it is given as 100 rpm which is wrong
E1=N1/N*E #back emf at the given speed N1
Va=E1-Ia*Ra #terminal voltage at the given speed N1
alpha_A1=math.acos(math.pi/3*Va/Vm)
alpha_B1=180-math.degrees(alpha_A1) #required converter firing angle in degrees
#(iii)during motoring operation when the speed is -1000 rpm and at rated torque
N1=-1000 #speed of the motor
E1=N1/N*E #back emf at the given speed N1
Va=E1-Ia*Ra #terminal voltage at the given speed N1
alpha_A2=math.acos(math.pi/3*Va/Vm)
alpha_B2=180-math.degrees(alpha_A2) #required converter firing angle in degrees
#(iv)during braking operation when the speed is -1000 rpm and at rated torque
N1=-1000 #speed of the motor in the book it is given as 100 rpm which is wrong
E1=N1/N*E #back emf at the given speed N1
Va=E1+Ia*Ra #terminal voltage at the given speed N1
alpha_A3=math.acos(math.pi/3*Va/Vm)
alpha_B3=180-math.degrees(alpha_A3) #required converter firing angle in degrees
#results
print"\n(i)Hence the required firing angle is :",round(alpha_B,1),"°"
print"\n(ii)Hence the required firing angle is :",round(alpha_B1,1),"°"
print"\n(iii)Hence for negative speed during motoring operation the required firing angle are :"
print" alpha_A :",round(math.degrees(alpha_A2),1),"° and alpha_B :",round(alpha_B2,1),"°"
print"\n(iv)Hence for negative speed during braking operation the required firing angle are :"
print" alpha_A :",round(math.degrees(alpha_A3),1),"° and alpha_B :",round(alpha_B3,1),"°"
```

In [185]:

```
import math
from __future__ import division
#variable declaration
#ratings of the separately excited motor
V=230 # rated voltage
N=960 # rated speed
Ia=200 # rated current
Ra=0.02 # armature resistance
Vs=230 # source voltage
#calculation
E=V-Ia*Ra #back emf
#(i) When the speed of motor is 350 rpm with the rated torque during motoring operation
N1=350 #given speed in rpm
E1=N1/N*E #given back emf at N1
Va=E1+Ia*Ra #motor terminal voltage
delta=Va/V #duty ratio
#(ii) When the speed of motor is 350 rpm with the rated torque during braking operation
Va=E1-Ia*Ra #motor terminal voltage
delta1=Va/V #duty ratio
#(iii)maximum duty ratio is 0.95
delta2=0.95 #maximum duty ratio
Va=delta2*V #terminal voltage
Ia1=2*Ia #maximum permissable current
E1=Va+Ia1*Ra #back emf
N1=E1/E*N #maximum permissible speed
Pa=Va*Ia1 #power fed to the source
#(iv) if the speed of the motor is 1200 rpm and the field of the motor is also controlled
N2=1200 #given speed
#now the field current is directly proportional to the speed of the motor
If=N/N2 #field current as a ratio of the rated current
#results
print"(i) Duty ratio is :",round(delta,3)
print"\n(ii)Duty ratio is :",round(delta1,2)
print"\n(iii)Maximum permissible speed is :",round(N1),"rpm"
print" Power fed to the source is :",round(Pa/1000,1),"kW"
print"\n(iv)Field current as a ratio of the rated current is :",If
```

In [140]:

```
import math
from __future__ import division
#variable declaration
#ratings of the separately excited motor when it is operated in dynamic breaking
V=230 # rated voltage
N=960 # rated speed
Ia=200 # rated current
Ra=0.02 # armature resistance
Vs=230 # source voltage
Rb=2 # braking resistance in ohm
#calculation
#when the motor speed is 600 rpm and the braking torque is twice the rated value
Ia1=2*Ia #torque is directly proportional to current
N1=600 #speed of the motor in rpm
E=V-Ia*Ra #back emf
E1=N1/N*E
x=E1/Ia1-Ra #x=(1-delta)*Rb
y=x/Rb #y=1-delta
delta=1-y #duty ratio
#(ii)if the duty ratio is 0.6 and and the braking torque is twice the rated value
delta1=0.6 #duty ratio
Ia1=2*Ia #torque is directly proportional to current
E1=Ia1*((1-delta1)*Rb+Ra) #back emf
N1=E1/E*N
#results
print"(i)Duty ratio is :",round(delta,2)
print"\n(ii)Hence the motor speed is :",round(N1,1),"rpm"
```

In [186]:

```
import math
from __future__ import division
from array import array
import numpy as np
#variable declaration
#ratings of the series motor
N=600 #speed in rpm
Vs=220 #source voltage
Ra_Rf=0.12 #combine armature resistance field resistance
#magnetisation curve at N
If=[10, 20,30, 40, 50, 60, 70, 80] #field current
E =[64,118,150,170,184,194,202,210] #terminal voltage
#calculation
#(i)when the duty ratio is 0.6 and motor current is 60 A
delta=0.6 #duty ratio
Ia1=60 #motor current
Va1=delta*Vs #terminal voltage for the given duty ratio
E1=Va1-Ia1*Ra_Rf #back emf for the given duty ratio
#for Ia1=60 A the terminal voltage is 194 V as given in the magnetization curve
N1=E1/E[5]*N #motor speed for the given duty ratio
#(ii)when the speed is 400rpm and the duty ratio is 0.65
delta=0.65 #duty ratio
N2=400 #speed in rpm
Va1=delta*Vs #terminal voltage for the given duty ratio
#from the magnetization characteristic for the speed of 400rpm the current Ia=70 A
E1=Va1-If[6]*Ra_Rf #back emf for the given duty ratio
T=(E1*If[6])/N2/(2*math.pi/60) #required torque
#results
print"(i)Hence the motor speed is :",round(N1),"rpm"
print"\n(ii)Hence the required torque is :",round(T),"N-m"
```

In [187]:

```
import math
from __future__ import division
from array import array
import numpy as np
#variable declaration
#ratings of the series motor which is the same as that of Ex-6.21
#The motor is operated using regenarative braking method
N=600 #speed in rpm
Vs=220 #source voltage
Ra_Rf=0.12 #combine armature resistance field resistance
#magnetisation curve at N
If=[10, 20,30, 40, 50, 60, 70, 80] #field current
E =[64,118,150,170,184,194,202,210] #terminal voltage
#calculation
#(i)when the duty ratio is 0.5 and the braking torque is equal to the motor torque
delta=0.5 #duty ratio
Va1=delta*Vs #terminal voltage
Ia1=If[6] #current at rated motor torque
E1=Va1+Ia1*Ra_Rf #back emf for the given duty ratio
N1=E1/E[6]*N #for a current of 70 A E=202 V from the magnetization curve
#(ii)when maximum permisssible duty ratio is 0.95 and current is 70A
delta_max=0.95 #maximum duty ratio
Va1=delta_max*Vs #terminal voltage
Ia1=70 #maximum permissible current
E2=Va1+Ia1*Ra_Rf #back emf for the given duty ratio
N2=E2/E[6]*N #for a current of 70 A E=202 V
#(iii)when the motor speed is 1000rpm and maximum current is 70A with duty ratio in the range of 0.05 to 0.95
Ia1=70 #maximum permissible current
N3=1000 #given speed in rpm
delta_max=0.95 #maximum duty ratio
E3=N3/N*E[6] #terminal voltage
x=(E3-delta_max*Vs)/Ia1 #x=R+Ra_Rf where R is the required external resistance
R=x-Ra_Rf #external resistance
#(iv)when the motor is running at 1000rpm with current at 70
Ia1=70 #maximum permissible current
N4=1000 #given speed in rpm
Ra=Ra_Rf #total value of armature resistance is assumed to be the same
E4=Va1+Ia1*Ra #back emf for the given speed N4
E_=N/N4*E4
ratio=E_/E[6] #fraction of the requuired number of turns to be reduced
#results
print"(i)Hence the motor speed is :",round(N1,1),"rpm"
print"\n(ii)Hence the motor speed is :",round(N2,1),"rpm"
print"\n(iii)Hence the required external resistance is :",round(R,1),"ohm"
print"\n(iv)Hence fraction of the number of turns to be reduced is :",round(ratio,3)
```

In [188]:

```
import math
from __future__ import division
from array import array
import numpy as np
#variable declaration
#ratings of the series motor which is the same as that of Ex-6.21
#The motor is operated using dynamic braking method
N=600 #speed in rpm
Vs=220 #source voltage
Ra=0.12 # armature resistance
delta_min=0.1 #manimum value of duty ratio
delta_max=0.9 #maximum value of duty ratio
#magnetisation curve at N
If=[10, 20,30, 40, 50, 60, 70, 80] #field current
E =[64,118,150,170,184,194,202,210] #terminal voltage
#calculation
#(i) maximum braking speed is 800rpm with armature current of 70 A
N1=800 #maximum braking speed
Ia=70 #armature current
E1=N1/N*E[6] #at 70A motor back emf is 202V
Rbe=E1/Ia-Ra #effective value of braking resistance
Rb=Rbe/(1-delta_min) #required braking resistance
#(ii)when the speed of the motor is 87 rpm
#now torque is maximum when the duty ratio is maximum
N1=87 #speed in rpm
R=Rb*(1-delta_max)+Ra
Ia=If[4] #value of armature current for the given value of E=184V
Ke_phi=E[4]/(2*math.pi*N)*60
T=Ke_phi*Ia #required torque
#results
print"(i)Hence braking resistance is:",round(Rb,2),"ohm"
print"\n(ii)Hence the required torque is :",round(T,1),"N-m"
```