In [1]:

```
#Question:
"""Finding the terminal voltage,output current and total power generated by a dc generator."""
#Variable Declaration:
e=2.1 #Average emf generated in each conductor(in Volts)
full_load_I=200.0 #Full-load current(in Amperes)
Z=480.0 #Number of conductors in armature
P=8.0 #Number of poles
#Calculations:
A_1=P
E_1=e*(Z/A_1)
I_L_1=full_load_I*A_1
Po_1=E_1*I_L_1
A_2=2
E_2=e*(Z/A_2)
I_L_2=full_load_I*A_2
Po_2=E_2*I_L_2
#Result:
print("(a) When the armature is lap wound \n ")
print "The terminal voltage on no load is %.2f V" %(E_1)
print "The output current on full load is %.2f A" %(I_L_1)
print "The total power generated on full load is %e W" %(Po_1)
print("\n(b)When the armature is wave wound \n ")
print "The terminal voltage on no load is %.2f V" %(E_2)
print "The output current on full load is %.2f A" %(I_L_2)
print "The total power generated on full load is %e W" %(Po_2)
```

In [10]:

```
#Question:
"""Finding the emf induced in the armature of a dc generator. """
#Variable Declaration:
slots=65.0 #Number of slots
cond_per_slot=12.0 #Number of conductors per slot
A=4.0 #Number of parallel paths
P=4.0 #Number of poles
flux=0.02 #Flux per pole(in Webers)
N=1200.0 #Speed of operation of the dc generator(in rpm)
#Calculations:
Z=slots*cond_per_slot
E=(flux*Z*N*P)/(60*A)
#Result:
print "The emf induced in the armature is %.2f V" %(E)
```

In [11]:

```
#Question:
""" Finding the induced emf in a dc machine."""
#Variable Declaration:
N1=500.0 #Initial speed of operation of dc machine(in rpm)
E1=180.0 #Induced emf at 500rpm(in Volts)
N2=600.0 #New speed of operation(in rpm)
#Calculations:
E2=(N2/N1)*E1
#Result:
print "The induced emf when the machine runs at 600 rpm is %.2f V" %(E2)
```

In [2]:

```
#Question:
""""Finding the percentage increase in the field flux in a dc generator."""
#Variable Declaration:
N1=750.0 #Initial speed of operation of dc machine(in rpm)
E1=220.0 #Induced emf at 750 rpm(in Volts)
E2_a=250.0 #New emf(in Volts)
#Calculations and Result:
N2_a=(E2_a/E1)*N1
E2_b=250.0
N2_b=600.0
flux_ratio=(E2_b/E1)*(N1/N2_b)
#Result:
print "(a)The speed at which the induced emf is 250V(assuming the flux to be constant) is %d rpm " %(round(N2_a,0))
print "(b)The required percentage increase in the field flux so that the induced emf is 250V,while the speed is only 600rpm is %d percent" %(round(((flux_ratio-1)*100),0))
```

In [15]:

```
#Question:
""" Finding the emf induced in the armature."""
#Variable Declaration:
V=440.0 #Load voltage(in Volts)
Rsh=110.0 #Resistance of shunt field coil(in Ohms)
Ra=0.02 #Armature resistance(in Ohms)
I_L=496.0 #Load current(in Amperes)
#Calculations:
Ish=V/Rsh
Ia=I_L+Ish
Eg=V+(Ia*Ra)
#Result:
print "The emf induced in the armature is %.2f V" %(Eg)
```

In [16]:

```
#Question:
""" Finding the total armature current and the generated emf."""
#Variable Declaration:
no_of_lamps=100.0 #Number of lamps
P=60.0 #Power rating of each lamp(in Watts)
V=200 #Voltage rating of each lamp(in Volts)
Ra=0.2 #Armature resistance(in Ohms)
Rsh=50 #Shunt field resistance(in Ohms)
Poles=4.0 #Number of poles
no_of_brushes=2.0 #Number of brushes
brush_drop_per_brush=1.0 #Brush drop at each brush(in Volts)
#Calculations:
I1=P/V
I_L=no_of_lamps*I1
Ish=V/Rsh
Ia=Ish+I_L
A=Poles
Ic=Ia/A
brush_drop=no_of_brushes*brush_drop_per_brush
Eg=V+(Ia*Ra)+brush_drop
#Result:
print "The total armature current is %.2f A" %(Ia)
print "The current per path is %.2f A" %(Ic)
print "The generated emf is %.2f V" %(Eg)
```

In [3]:

```
#Question:
"""Finding the emf generated in a compound-wound dc generator."""
#Variable Declaration:
V=250.0 #Load voltage(in Volts)
Rsh=130.0 #Shunt field resistance(in Ohms)
Ra=0.1 #Armature resistance(in Ohms)
Rse=0.1 #Series field resistance(in Ohms)
I_L=100.0 #Load current(in Amperes)
no_of_brushes=2 #Number of brushes
brush_drop_per_brush=1.0 #Brush drop at each brush(in Volts)
#Calculations:
Ise=I_L
Vse=Ise*Rse
Vsh=V+Vse
Ish=Vsh/Rsh
Ia=I_L+Ish
brush_drop=no_of_brushes*brush_drop_per_brush
Eg=V+Vse+(Ia*Ra)+brush_drop
#Result:
print "The emf generated is %.2f V." %(Eg)
```

In [18]:

```
#Question:
"""Finding the emf generated,the copper losses,and efficiency of a shunt generator."""
#Variable Declaration:
Po=30e03 #Full-load output power(in Watts)
V=200.0 #Terminal voltage(in Volts)
Ra=0.05 #Armature resistance(in Ohms)
Rsh=50.0 #Shunt field resistance(in Ohms)
loss=1000.0 #Friction losses(in Watts)
#Calculations:
I_L=Po/V
Ish=V/Rsh
Ia=Ish+I_L
Eg=V+(Ia*Ra)
copper_loss=(pow(Ish,2)*Rsh)+(pow(Ia,2)*Ra)
effi=Po/(Po+copper_loss+loss)
#Result:
print "(a)The emf generated is %.2f V" %(Eg)
print "(b)The copper loss is %.2f W" %(copper_loss)
print "(c)The efficiency is %.2f percent" %(effi*100)
```

In [19]:

```
#Question:
"""Finding armature resistance and the load-current corresponding to maximum efficiency of dc shunt generator."""
from math import sqrt,pow
#Variable Declaration:
V=210.0 #Full-load voltage(in Volts)
I_L=195.0 #Full-load current(in Amperes)
Rsh=52.5 #Shunt field resistance(in Ohms)
effi=0.90 #Full-load efficiency
stray_loss=710.0 #Stray losses(in Watts)
#Calculations:
Po=V*I_L
Pin=Po/effi
total_loss=Pin-Po
Ish=V/Rsh
Ia=I_L+Ish
sh_copp_loss=pow(Ish,2)*Rsh
const_loss=sh_copp_loss+stray_loss
arma_copp_loss=total_loss-const_loss
Ra=arma_copp_loss/(pow(Ia,2))
Ia_max_effi=sqrt(const_loss/Ra)
I_L_max_effi=Ia_max_effi-Ish
#Result:
print "The armature resistance is %.5f ohm " %(Ra)
print "The load current corresponding to maximum efficiency is %.2f A" %(I_L_max_effi)
```

In [20]:

```
#Question:
"""Finding the number of series turns required per pole for a level-compounded generator."""
#Variable Declaration:
I_full_load=100.0 #Full-load current(in Amperes)
sh_turns=1500.0 #Number of turns in the shunt winding
Ish_no_load=4.0 #Shunt current at no-load(in Amperes)
Ish_full_load=6.0 #Shunt current at full-load(in Amperes)
#Calculations:
At_no_load=Ish_no_load*sh_turns
At_full_load=Ish_full_load*sh_turns
At_series=At_full_load-At_no_load
Nse=At_series/I_full_load
#Result:
print "The number of series turns required per pole is %d " %(Nse)
```

In [21]:

```
#Question:
"""Finding the back emf generated in a dc shunt motor."""
#Variable Declaration:
I_L=41.0 #Full-load current(in Amperes)
V=250.0 #Full-load voltage(in Volts)
Ra=0.1 #Armature resistance(in Ohms)
Rsh=250.0 #Shunt field resistance(in Ohms)
#Calculations:
Ish=V/Rsh
Ia=I_L-Ish
Eb=V-(Ia*Ra)
#Result:
print "The back emf generated in the motor is %.2f V" %(Eb)
```

In [23]:

```
#Question:
"""Finding the speed of a dc motor."""
#Variable Declaration:
A=2.0 #Number of parallel paths
P=4.0 #Number of poles
Z=888.0 #Number of conductors
flux=23e-03 #Flux per pole(in Webers)
Ia=50.0 #Armature current(in Amperes)
Ra=0.28 #Armature resistance(in Ohms)
V=440.0 #Rated voltage(in Volts)
#Calculations:
Eb=V-(Ia*Ra)
N=(60*A*Eb)/(flux*Z*P)
#Result:
print "The speed of the motor is %d rpm" %(round(N,0))
```

In [24]:

```
#Question:
"""Finding the speed of a dc motor."""
#Variable Declaration:
V1=460.0 #Initial supply voltage(in Volts)
N1=900.0 #Speed of motor at 460-V(in rpm)
V2=200.0 #Final supply voltage(in Volts)
#Calculations:
kflux=V1/N1
N2=V2/(0.7*kflux)
#Result:
ans_N2="The approximate speed of the motor when the motor is connected across a 200V supply is %d rpm" %(round(N2,0))
print(ans_N2)
```

In [25]:

```
#Question:
"""Finding the speed and the gross torque developed by the armature of a dc motor."""
from math import pi
#Variable Declaration:
V=480.0 #Rated voltage(in Volts)
Ia=110.0 #Armature current at rated voltage(in Amperes)
Ra=0.2 #Armature resistance(in Ohms)
flux=50e-03 #Flux per pole(in Webers)
A=6.0 #Number of parallel paths
P=6.0 #Number of poles
Z=864.0 #Number of conductors
#Calculations:
Eb=V-(Ia*Ra)
N=(60*A*Eb)/(flux*Z*P)
torque=((flux*Z)/(2*pi))*(P/A)*Ia
#Result:
print "(a)The speed of the motor is %d rpm " %(round(N,0))
print "(b)The gross torque developed by the armature is %.2f Nm" %(torque)
```

In [26]:

```
#Question:
"""Finding the power generated in the armature winding of a dc generator."""
from math import pi
#Variable Declaration:
N=900.0 #Operating speed of generator(in rpm)
torque=2e03 #Torque(in N-metre)
P_losses=8e03 #Power losses(in Watts)
#Calculations:
Pin=(2*pi*torque*N)/60.0
Pd=Pin-P_losses
#Result:
print "The power generated in the armature winding is %e W" %(Pd)
```

In [27]:

```
#Question:
"""Finding the speed of a series motor when the current changes."""
#Variable Declaration:
V=230.0 #Supply voltage(in Volts)
Ra=0.12 #Armature resistance(in Ohms)
Rse=0.03 #Series field resistance(in Ohms)
Ia1=110.0 #Current at 230 V(in Amperes)
flux1=24e-03 #Flux per pole at 110 A(in Webers)
N1=600.0 #Speed at 230 V(in rpm)
Ia2=50.0 #Armature current(in Amperes)
flux2=16e-03 #Flux per pole at 50 A(in Webers)
#Calculations:
Eb1=V-Ia1*(Ra+Rse)
k=Eb1/(N1*flux1)
Eb2=V-Ia2*(Ra+Rse)
N2=Eb2/(k*flux2)
#Result:
print "The speed of the motor when the currenthas fallen to 50 A is %d rpm" %(round(N2,0))
```

In [28]:

```
#Question:
"""Finding the current drawn by the machine."""
#Variable Declaration:
V=250.0 #Supply voltage(in Volts)
Ra=0.2 #Armature resistance(in Ohms)
#Calculations:
Eb_1=0
Ia_1=(V-Eb_1)/Ra
Eb_2=200
Ia_2=(V-Eb_2)/Ra
Eb_3=250
Ia_3=(V-Eb_3)/Ra
Eb_4=-250
Ia_4=(V-Eb_4)/Ra
#Result:
print "(a)When the machine is at rest,"
print "The current drawn by the machine is %.2f A" %(Ia_1)
print "(b)When the machine is generating an emf of 200V and is connected to the supply with correct polarities,"
print "The current drawn by the machine is %.2f A" %(Ia_2)
print "(c)When the machine is generating an emf of 250V and is connected to the supply with correct polarities,"
print "The current drawn by the machine is %.2f A" %(Ia_3)
print "(d)When the machine is generating an emf of 250V and is connected to the supply with reversed polarities,"
print "The current drawn by the machine is %.2f A" %(Ia_4)
```

In [29]:

```
#Question:
"""Finding the speed and the gross torque developed by the armature of a dc series motor."""
from math import pi
#Variable Declaration:
P=6.0 #Number of poles
A=6.0 #Number of parallel paths
Z=864.0 #Number of conductors
flux=50e-03 #Flux per pole(in Webers)
Ia=110.0 #Armature current(in Amperes)
V=480.0 #Load voltage(in Volts)
Ra=0.18 #Armature resistance(in Ohms)
Rse=0.02 #Series field resistance(in Ohms)
#Calculations:
Eb=V-Ia*(Ra+Rse)
N=(60*A*Eb)/(flux*Z*P)
torque=(60*Eb*Ia)/(2*pi*N)
#Result:
print "(a)The speed of the motor is %d rpm" %(round(N,0))
print "(b)The gross torque developed by the armature is %.2f Nm " %(torque)
```

In [30]:

```
#Question:
"""Finding the series resistance to reduce the speed of a shunt motor."""
#Variable Declaration:
V=220.0 #Rated voltage of the motor(in Volts)
Ia=22.0 #Armature current(in Amperes)
Ra=0.45 #Armature resistance(in Ohms)
N1=700.0 #Initial speed of motor(in rpm)
N2=450.0 #Final speed of motor(in rpm)
#Calculations:
E1=V-(Ia*Ra)
E2=(N2/N1)*E1
R=((V-E2)/Ia)-Ra
#Result:
print "The resistance that should be placed in series with the armature to reduce the speed to 450 rpm is %.3f ohm " %(R)
```

In [31]:

```
#Question:
"""Finding the speed of a dc series motor."""
#Variable Declaration:
V=230.0 #Rated voltage of the dc series motor(in Volts)
Ra=0.2 #Armature resistance(in Ohms)
Rse=0.1 #Series field resistance(in Ohms)
Ia1=40.0 #Line current at rated voltage(in Amperes)
N1=1000.0 #Speed of motor at rated voltage(in rpm)
Ia2=20.0 #Line current at 230 V(in Amperes)
#Calculations:
Eb1=V-Ia1*(Ra+Rse)
Eb2=V-Ia2*(Ra+Rse)
""" Eb=k*flux*N """
N2=(Eb2*N1)/(Eb1*0.6)
#Result:
print "The speed of the motor for a line current of 20A at 230V is %d rpm" %(round(N2,0))
```

In [36]:

```
#Question:
"""Finding the terminal voltage of a dc shunt generator."""
#Variable Declaration:
P=4 #Number of poles
turns=260 #Number of turns in the armature winding
R=0.006 #Resistance of each turn of armature(in Ohms)
flux=0.08 #Useful flux per pole(in Webers)
I_L=55 #Load current(in Amperes)
N=1000 #Speed of the generator(in rpm)
#Calculations:
Z=2*turns
A=P
Eg=(flux*Z*N*P)/(60.0*A)
Rw=turns*R
R1=Rw/4.0
Ra=R1/4
V=Eg-(I_L*Ra)
#Result:
print "The terminal voltage of the generator when it is running at 1000 rpm and supplying load current of 55 A is %.3f V." %(V)
```

In [43]:

```
#Question:
"""Finding the armature current,the emf induced and the flux per pole for a dc shunt generator."""
#Variable Declaration:
P=8.0 #Number of poles
A=2.0 #Number of parallel paths
Z=778 #Number of conductors
V=250.0 #Load voltage(in Volts)
R_L=12.5 #Load resistance(in Ohms)
Ra=0.24 #Armature resistance(in Ohms)
Rsh=250.0 #Shunt field resistance(in Ohms)
N=500 #Speed of the dc shunt generator(in rpm)
#Calculations:
I_L=V/R_L
Ish=V/Rsh
Ia=I_L+Ish
Eg=V+(Ia*Ra)
flux=(60.0*A*Eg)/(Z*N*P)
#Result:
print "The armature current is %.2f A." %(Ia)
print "The emf induced is %.2f V." %(Eg)
print "The flux per pole is %e Wb." %(flux)
```

In [1]:

```
#Question:
"""Finding the percentage reduction in speed of dynamo."""
#Variable Declaration:
Po_1=500e03 #Initial power output(in Watts)
Po_2=250e03 #Final power output(in Watts)
V=500.0 #Constant excitation voltage(in Volts)
Ra=0.015 #Resistance between the terminals of dynamo(in Ohms)
#Calculations:
Ia_1=Po_1/V
E1=V+(Ia_1*Ra)
Ia_2=Po_2/V
E2=V+(Ia_2*Ra)
""" Since excitation emf remains constant in the two cases,we have
E=(flux*Z*N*P)/(60*A) where E=emf generated;Z=number of conductors;N=speed of motor(in rpm);P=number of poles;A=number of parallel paths;
flux=useful flux per pole(in Wb).
N=KE, where K is a constant.
Hence,fractional reduction in speed is given as,
(N1-N2)/N1=((K*(E1-E2))/(K*E1)). """
fract=((E1-E2)/E1)*100
#Result:
print "The percentage reduction in speed of the dynamo is %.3f percent." %(fract)
```

In [2]:

```
#Question:
"""Finding the voltage between the far end of the feeder and the bus-bar of a dc series generator."""
#Variable Declaration:
Rt=0.3 #Resistance of transmission line(in Ohms)
I_L_1=160.0 #Load current in first case(in Amperes)
I_L_2=50.0 #Load current in second case(in Amperes)
#Calculations:
Vt_1=I_L_1*Rt
Vb_1=(50.0/200.0)*I_L_1
Vd_1=Vt_1-Vb_1
Vt_2=I_L_2*Rt
Vb_2=(50.0/200.0)*I_L_2
Vd_2=Vt_2-Vb_2
#Result:
print "(a)The voltage between far end of the feeder and the bus-bar at a cusrrent of 160 A is %.2f V." %(Vd_1)
print "(b)The voltage between far end of the feeder and the bus-bar at a cusrrent of 50 A is %.2f V." %(Vd_2)
```

In [5]:

```
#Question:
""" Finding the emf generated and the armature current in a dc long-shunt compound generator. """
#Variable Declaration:
I_L=50 #Load current(in Amperes)
V=500 #Terminal voltage(in Volts)
Ra=0.05 #Armature resistance(in Ohms)
Rse=0.03 #Series field resistance(in Ohms)
Rsh=250 #Shunt field resistance(in Ohms)
brush_drop=1.0 #Brush contact drop(in Volts)
#Calculations:
Ish=V/Rsh
Ia=Ish+I_L
Eg=V+(Ia*(Ra+Rse))+brush_drop
#Result:
print "The armature current is %.2f A." %(Ia)
print "The emf generated is %.2f V" %(Eg)
```

In [8]:

```
#Question:
""" Finding the voltage and the power generated by a dc generator."""
#Variable Declaration:
P=8 #Number of poles
Z=500 #Number of conductors on the armature
flux =0.02 #Magnetic flux per pole(in Webers)
N=1800 #Speed of the generator(in rpm)
I=5.0 #Allowable current per path(in Amperes)
#Calculations:
A_1=2
Eg_1=(flux*Z*N*P)/(60*A_1)
A_2=P
Eg_2=(flux*Z*N*P)/(60*A_2)
Ia_1=A_1*I
Pd_1=Eg_1*Ia_1
Ia_2=A_2*I
Pd_2=Eg_2*Ia_2
#Result:
print "When the armature is wave wound:"
print "(a)The generated voltage is %.2f V." %(Eg_1)
print "(b)The kW generated by the machine is %.2f kW." %(Pd_1/1000.0)
print "\nWhen the armature is lap wound:"
print "(a)The generated voltage is %.2f V." %(Eg_2)
print "(b)The kW generated by the machine is %.2f kW." %(Pd_2/1000.0)
```

In [15]:

```
#Question:
"""Finding the emf generated and the copper losses in a dc shunt generator."""
#Variable Declaration:
V=250.0 #Terminal voltage(in Volts)
I_L=195 #Load current(in Amperes)
Ra=0.02 #Armature resistance(in Ohms)
Rsh=50.0 #Shunt-field resistance(in Ohms)
loss=950.0 #Iron and frictional losses(in Watts)
#Calculations:
Ish=V/Rsh
Ia=I_L+Ish
Eg=V+(Ia*Ra)
copp=(Ia*Ia*Ra)+(V*Ish)
Po=V*I_L
tot_loss=copp+loss
Pin=Po+tot_loss
Pe=Pin-loss
mech_effi=Pe/Pin
ele_effi=Po/Pe
comm_effi=Po/Pin
#Result:
print "(a)The emf generated is %.2f V." %(Eg)
print "(b)The copper losses is %.2f W." %(copp)
print "(c)The output of the prime mover is %.3f kW." %(Pin/1000.0)
print "(d)The commercial efficiency is %.2f.\n The mechanical efficiency is %.2f." %((comm_effi*100),(mech_effi*100))
print " The electrical efficiency is %.2f." %(ele_effi*100)
```

In [13]:

```
#Question:
"""Finding the back emf generated by a dc shunt motor."""
#Variable Declaration:
V=250.0 #Terminal Voltage(in Volts)
I_L1=2.0 #No-load current(in Amperes)
N1=1000.0 #No-load speed(in rpm)
Ra=0.2 #Armature resistance(in Ohms)
Rsh=250.0 #Field resistance(in Ohms)
I_L2=51.0 #Current after loading(in Amperes)
#Calculations:
Ish=V/Rsh
Ia1=I_L1-Ish
E1=V-(Ia1*Ra)
Ia2=I_L2-Ish
E2=V-(Ia2*Ra)
"""As the motor is shunt-wound,the flux remains constant.The emf generated is directly proportional to the speed."""
N2=(E2/E1)*N1
speed_drop=(N1-N2)/N1
#Result:
print "(a)The back emf generated at no-load is %.3f V." %(E1)
print "(b)On loading,\n The back emf generated is %.2f V.\n The speed of the motor is %d rpm." %(E2,round(N2,0))
print " The percentage speed drop is %.3f percent." %(speed_drop*100)
```

In [6]:

```
#Question:
"""Finding the value of starting resistance for a shunt motor."""
#Variable Declaration:
Po=14920.0 #Output power(in Watts)
V=240.0 #Supply voltage(in Volts)
Ra=0.25 #Armature resistance(in Ohms)
effi=0.86 #Efficiency at full-load
#Calculations:
Pin=Po/effi
I_L=Pin/V
Ist=1.5*I_L
Rt=V/Ist
Rst=Rt-Ra
#Result:
print "The starting resistance for the shunt motor is %.3f Ohms." %(Rst)
```

In [9]:

```
#Question:
"""Finding the speed and efficiency of a dc shunt motor."""
#Variable Declaration:
I_L1=4.0 #No-load current(in Amperes)
N1=1000 #No-load speed(in rpm)
V=500.0 #Voltage rating of the dc shunt motor(in Volts)
Ra=0.2 #Armature resistance(in Ohms)
Ish=1.0 #Field current(in Amperes)
I_L2=100.0 #Full-load current(in Amperes)
#Calculations:
Ia1=I_L1-Ish
E1=V-(Ia1*Ra)
Ia2=I_L2-Ish
E2=V-(Ia2*Ra)
""" For a shunt motor,the flux remains constant and hence E is directly proportional to speed of the motor(N).
E=kN where k is a constant. """
N2=(E2/E1)*N1
"""At no-load,the power taken by the motor mainly meets the constant losses(iron and frictional losses)."""
Pc=V*I_L1
"""On loading,the copper loss in shunt field winding is negligible compared to the copper loss in armature winding."""
Pv=Ia2*Ia2*Ra
Pin=V*I_L2
effi=(Pin-(Pv+Pc))/Pin
#Result:
print "The speed of the dc shunt motor on loading is %d rpm." %(round(N2,0))
print "The efficiency of the motor is %.2f percent." %(effi*100)
```

In [8]:

```
#Question:
"""Finding the speed of a dc generator running as a shunt motor."""
#Variable Declaration:
Ra=0.02 #Armature resistance(in Ohms)
Rsh=50.0 #Shunt-field resistance(in Ohms)
V=250.0 #Terminal voltage(in Volts)
Po=50e03 #Output power(in Watts)
N1=500.0 #Speed of the dc generator(in rpm)
#Calculations:
Ish=V/Rsh
""" When working as a generator,the machine supplies a load of 50 kW at 250 V. """
I_L=Po/V
Ia1=I_L+Ish
E1=V+(Ia1*Ra)
"""When working as a motor,the machine takes a power of 50 kW at 250 V. """
Ia2=I_L-Ish
E2=V-(Ia2*Ra)
N2=(E2/E1)*N1
""" NOTE: The field current and the flux per pole is same in both cases."""
#Result:
print "The speed of the machine running as a shunt motor is %d rpm." %(round(N2,0))
```

In [16]:

```
#Question:
"""Finding the applied voltage and the current to run the motor."""
#Variable Declaration:
Ra=0.6 #Resistance of the armature(in Ohms)
Rse=0.4 #Series field resistance(in Ohms)
Ia1=20.0 #Initial armature current(in Amperes)
V1=400.0 #Initial terminal voltage(in Volts)
N1=250.0 #Initial speed of the motor(in rpm)
N2=350.0 #Final speed of the motor(in rpm)
#Calculations:
""" In a series motor,torque is directly proprtional to the square of the armature current(Ia).
Given: Torque is directly proprtional to the square of the speed(N).
Therefore, Ia is directly proportional to N. Ia=kN where k is a constant. """
Ia2=(N2/N1)*Ia1
E1=V1-(Ia1*(Ra+Rse))
"""In a series motor,as the flux is directly proportional to Ia,the back emf is proportional to (Ia*N). """
E2=E1*((Ia2*N2)/(Ia1*N1))
V2=E2+(Ia2*(Ra+Rse))
#Result:
print "The applied voltage is %.2f V and the current is %.2f A to run the motor at 350 rpm." %(V2,Ia2)
```