In [14]:

```
from __future__ import division
import cmath
#variable declaration
#ratings of the synchronous motor
Pm1=500*1000 # power rating in W
f=50 # frequency in HZ
Vl=3.3*1000 # line voltage in V
pf=0.8 # power factor lagging
P=4 # number of poles
I=10 # field current in A
Xs=15 # reactance of the windings in ohm
Rs=0 # resistance of the windings in ohm
Wms=50*math.pi # synchronous speed in rad/sec
Pm=Pm1/2 # power at half the rated torque when the losses are neglected
#calculation
V=Vl/math.sqrt(3) #phase voltage
Is=Pm1/(math.sqrt(3)*Vl*pf) #rated current
rad=math.acos(pf)
Is=cmath.rect(Is,-rad) #rated current in vector form
V=cmath.rect(V,0) #rated phase voltage in rectangular form
E=V-Is*1j*Xs #back emf
#(i) when field current has not changed
sin_delta=Pm*Xs/(3*abs(V)*abs(E))
delta=math.asin(sin_delta) #angle delta
Is=(V-cmath.rect(abs(E),-delta))/(1j*Xs) #armature current
Is1=cmath.polar(Is)
x=math.degrees(Is1[1]) #where x=Is which is the required armature current
power_factor=math.cos(Is1[1]) #power factor
#(ii) At unity power factor and rated torque
cos_phi=1
Is=Pm1/(3*V) #since Pm1=3*V*Is
E1=V-Is*1j*Xs
If=abs(E1)/abs(E)*I #field current
#(iii) At the field current of 12.5 A
If1=12.5 #field current
E2=If1/I*abs(E)
Is=math.sqrt(E2**2-abs(V)**2)/Xs #since E2=abs(V-Is*1j*Xs)
Pm=3*abs(V)*Is*cos_phi #power output at the given field current
T=Pm/Wms #required torque
#results
print"i)armature current :",round(Is1[0],2),round(x),"°","A"
print" power factor",round(power_factor,2),"lagging"
print"\nii)field current at unity power factor at rated torque:",round(If,2),"A"
print"\niii)Required torque is:",round(T,1),"N-m"
print"Note: there is a slight difference in the answer due to the decimal place"
```

In [66]:

```
import math
from __future__ import division
import cmath
#variable declaration
#ratings of the synchronous motor is same as that of Example-7.1
Pm1=500*1000 # power rating in W
f=50 # frequency in HZ
Vl=3.3*1000 # line voltage in V
pf=0.8 # power factor lagging
P=4 # number of poles
I=10 # field current in A
Xs=15 # reactance of the windings in ohm
Rs=0 # resistance of the windings in ohm
Pm=Pm1/2 # power at half the rated torque when the losses are neglected
#calculation
Wms=50*math.pi # synchronous speed in rad/sec
V=Vl/math.sqrt(3) # phase voltage
Is=Pm1/(math.sqrt(3)*Vl*pf) #rated current
rad=math.acos(pf)
Is=cmath.rect(Is,-rad) #rated current in vector form
V=cmath.rect(V,0)
E=V-Is*1j*Xs #back emf
#(i) at rated current and unity power factor
E1=V-abs(Is)*1j*Xs
delta=cmath.phase(E1) #phase angle of E1
Pm=3*abs(V)*abs(E1)*math.sin(delta)/Xs #mechanical power developed
T=Pm/Wms #braking torque
If=abs(E1)/abs(E)*I #field current
#(ii) at field current of 15A and 500kW output
If1=15 #field current
Pm=-500*1000 #output power
E2=If1/I*abs(E)
sin_delta=Pm*Xs/(3*abs(V)*abs(E2))
delta=math.asin(sin_delta) #angle delta
Is=(cmath.rect(E2,abs(delta))-V)/(1j*Xs) #armature current
Is=cmath.polar(Is)
x=(Is[1])*180/math.pi #phase angle of Is
power_factor=math.cos(Is[1]) #power factor
#results
print"i)braking torque :",round(T,1),"N-m"
print" Field current",round(If,2),"A"
print"\nii)armature current :",round(Is[0],2),round(x,2),"°","A"
print" power factor",round(power_factor,3),"lagging"
print"\nNote :There is a slight difference in the answers due to the decimal place"
```

In [8]:

```
import math
from __future__ import division
import cmath
from sympy import Symbol
#variable declaration
#ratings of the synchronous motor
Pm1=6*10**6 # power rating in W
f=50 # frequency in HZ
Vl=11*1000 # line voltage in V
pf=0.9 # power factor leading
P=6 # number of poles
I=10 # rated field current in A
Xs=9 # reactance of the windings in ohm
Rs=0 # resistance of the windings in ohm
N=120*f/P # synchronous speed
#calculation
V=Vl/math.sqrt(3) #phase voltage
Is=Pm1/(math.sqrt(3)*Vl*pf) #rated current
rad=math.acos(pf)
#(i)to find torque and field current at rated armature current
# at 750 rpm and 0.8 leading power factor
Is=cmath.rect(Is,rad) #rated current in vector form
V=cmath.rect(V,0)
E=V-Is*1j*Xs #back emf
N1=750 #speeed in rpm
pf1=0.8 #given leading power factor
f1=N1/N*f #required frequency
V1=abs(V)*f1/f #required voltage
Xs1=Xs*f1/f #required field resistance
E1=V1-Xs1*1j*cmath.rect(abs(Is),math.acos(pf1)) #rated back emf in complex form
E1_polar=cmath.polar(E1) #rated back emf in rectangular form
#at rated field current and 750 rpm
E2=abs(E)*N1/N #back emf at the given speed N1
If=abs(E1)/E2*f #field current at the given speed N1
Pm=3*abs(V1)*abs(Is)*pf1 #power input at the given speed N1
Wm1=2*math.pi*N1/60 #angular motor speed in rad/s
T=Pm/Wm1
#(ii) at half the rated motor torque and 1500 rpm and rated field current
Pm=6*10**6 #rated power rating in W
N1=1500 #speeed in rpm
f1=N1/N*f #required frequency
Xs1=f1/f*Xs #required field resistance
E1=abs(E)*f1/f #back emf at rated field current
Wms = Symbol('Wms') #rated speed in rad/sec
T_rated = Symbol('T_rated') #rated torque
Wms=Pm/T_rated
Wms_=N1/N*Wms
Pm_= (0.5*T_rated)*Wms_ #required power developed at N1=1500 rpm
sin_delta=Pm_*Xs1/(3*abs(V)*abs(E1)) #since Pm=3*abs(V)*abs(E1)*math.sin(delta)/Xs
delta=math.asin(sin_delta) #angle delta
Is=(abs(V)-cmath.rect(E1,-delta))/(1j*Xs1) #armature current
Is1=cmath.polar(Is) #aramture current in rectangular form
x1=math.degrees(Is1[1])
power_factor1=math.cos(Is1[1]) #power factor
#(iii) at 750 rpm and rated field current from part(i)
N1=750 #speeed in rpm
pf1=0.8 #given leading power factor
f1=N1/N*f #required frequency at N1=750 rpm
V1=abs(V)*f1/f #required voltage at N1=750 rpm
Xs1=Xs*f1/f #required field resistance
E2=abs(E)*N1/N
Pm=-4.2*10**6 #braking power output
sin_delta=Pm*Xs1/(3*abs(V1)*abs(E2)) #since Pm=3*abs(V)*abs(E1)*math.sin(delta)/Xs
delta=math.asin(sin_delta) #angle delta
Is=(cmath.rect(E2,abs(delta))-V1)/(1j*Xs1) #armature current
Is2=cmath.polar(Is) #aramture current in rectangular form
x2=math.degrees(Is2[1])
power_factor2=math.cos(Is2[1]) #power factor
#(iv)from part (ii) at 1500 rpm and from part(iii) the armature current of 349.9 A is taken
Is=Pm1/(math.sqrt(3)*Vl*pf) #armature current as given from (i)
N1=1500 #speeed in rpm
f1=N1/N*f #required frequency at N1=1500 rpm
Xs1=f1/f*Xs #required field resistance
E1=abs(E)*f1/f #at rated field current
E2=V-1j*Xs1*Is
E2=cmath.polar(E2)
If1=E2[0]/abs(E1)*f #required field current
Pm=3*abs(V)*E2[0]*math.sin(abs(E2[1]))/Xs1 #power input
Wm1=2*math.pi*N1/60 #motor speed in rad/sec
T1=Pm/Wm1
#results
print"\ni)Required torque is:",round(T,1),"N-m"
print" Field current :",round(If,2),"A"
print"\nii)armature current :",round(Is1[0],1),round(x1,2),"°","A"
print" power factor :",round(power_factor1,1),"leading"
print"\niii)armature current :",round(Is2[0],2),round(x2,2),"°","A"
print" power factor :",round(power_factor2,3),"lagging"
print"\niv)Field current :",round(If1,2),"A"
print" Required torque is:",round(T1),"N-m"
print"\nNote :There is a slight difference in the answers due to the decimal place"
```

In [65]:

```
import math
from __future__ import division
import cmath
#variable declaration
#ratings of the synchronous motor
Pm=8*10**6 # power rating in W
f=50 # frequency in HZ
Vl=6600 # line voltage in V
pf=1 # unity power factor
P=6 # number of poles
I=10 # rated field current in A
Xs=2.8 # reactance of the windings in ohm
Rs=0 # resistance of the windings in ohm
Rd=0.1 # Dc link inductor resistance
alpha=140 # constant firing angle in degrees
#calculation
N=120*f/P #synchronous speed
V=Vl/math.sqrt(3) #phase voltage
Is=Pm/(math.sqrt(3)*Vl*pf) #rated current
Id=math.pi/math.sqrt(6)*Is #Dc line current
phi=180-alpha #phase angle between Is and V in degrees
#(i) when motor operates at rated current and 500rpm
N1=500 #motor speed in rpm
f1=N1/N*f #frequency at N1
V1=f1/f*V #voltge at N1
Pm1=3*V1*Is*math.cos(math.radians(phi)) #power developed by the motor
#for the 3-phase load commutated inverter
Vdl=(3*math.sqrt(6)/math.pi)*V1*math.cos(math.radians(alpha))
Vds=-Vdl+Id*Rd
cos_alpha_s=Vds/(3*math.sqrt(6)/math.pi*V)
alpha_s=math.acos(cos_alpha_s) #in radian
alpha_s1=math.degrees(alpha_s) #in degrees
#(ii) regenerative braking at 500rpm and at rated motor current
alpha=0 #firing angle
#when firng angle is zero then power factor is unity
pf=1
Pm2=3*V1*Is*pf #power developed by the motor
Ps=Pm2-Id**2*Rd #power supplied to the source
Vdl=(3*math.sqrt(6)/math.pi)*V1*math.cos(math.radians(alpha))
Vds=-Vdl+Id*Rd
cos_alpha_s=Vds/(3*math.sqrt(6)/math.pi*V)
alpha_s=math.acos(cos_alpha_s) #in radian
alpha_s2=math.degrees(alpha_s) #in degrees
#results
print"i)power developed by the motor is:",round(Pm1/10**6,3),"MW"
print" Source side converter firing angle is",round(alpha_s1,2),"°"
print"\nii)power supplied to the source is:",round(Ps/10**6,3),"MW"
print" Source side converter firing angle is",round(alpha_s2,2),"°"
#answer for firing angle in the book is wrong
```