In [1]:

```
# Given Data
P = 2. #number of poles
Z = 400. #number of conducters
n = 300. #speed in rpm
E = 200. #voltage of generator
A = 2. #number of parallel paths
N = 1200. #number of turns in each field coil
# Calculations and Results
phi = (E*60*A)/(Z*n*P) #flux at the end of 0.15sec
t = 0.15 #time
print "magnitude of flux at the end of 15sec is %f wb"%(phi)
e = N*(phi/t)
print "induced emf in the field coil = %d volts"%(e)
```

In [2]:

```
# Given Data
P = 8. #number of poles
A = 8. #number of parallel paths in the armature
Z = 960. #number of conductors
N = 400. #speed in rpm
phi = 0.04 #flux per pole
# Calculations
E = (phi*Z*N*P)/(60*A) #emf generated onopen circuit condition
# Results
print "emf generated on open circuit condition, E = %d volts"%(E)
```

In [3]:

```
# Given Data
E = 180.; #induced emf at 500rpm
N = 500.; #speed in rpm
# Calculations and Results
K1 = (E/N)
print "K1 = %f"%(K1)
E1 = (K1*600) #induced emf at 600rpm
print " induced emf at 600rpm is = %d V"%(E1)
```

In [4]:

```
# Given Data
E1 = 220.; #induced emf at N1 speed in volts
N1 = 750.; # speed
K1 = (E1/N1)
E2 = 250.; #induced emf at speed N2
N2 = E2/K1
print "speed at induced emf of 250V = %d rpm"%(N2)
print ("when induced emf is 250V and speed 700 rpm")
E3 = 250.; #induced emf at N3 speed
N3 = 700.; #speed
ratio = (E3*N1)/(E1*N3)
Pi = (ratio-1)*100
print "percentage increase in flux is %f percent"%(Pi)
```

In [5]:

```
# Given Data
E = 200. #emf induced
I = 15. #armature current
n = 1200. #speed in rpm
# Calculations and Results
omega = (2*3.14*n)/60;
print "omega = %f "%(omega)
T = (E*I)/omega;
print "electromagnetic torque = %f Nm"%(T)
```

In [6]:

```
# Given Data
n = 10.; #number of turns in 1 coil
l = 0.2;
d = 0.2; #diameter in metres
B = 1.; #uniform magnetic field density in weber per m**2
N = 1500.; #speed in rpm
# Calculations and Results
r = (d/2); #radius in metres
E = (B*l*((2*3.14*N)/60)*r*2*n);
print "total induced emf = %f V"%(E)
R = 4; #total resistance in ohms
I = E/R;
print "The current through the armature coil when connected to the load, I = %f A"%(I)
T = (E*I)/((2*3.14*N)/60)
print "torque = %f Nm"%(T)
```

In [7]:

```
# Given Data
V = 230.; #armature voltage supply in volts
Ia = 12.; #armature current in amperes
Ra = 0.8; #armature resistance in ohms
N = 100.; #speed in radian per second
# Calculations and Results
E = (V-(Ia*Ra))
print "induced emf, E = %fV"%(E)
Te = (E*Ia)/N
print "the electromagnetic torque = %fNm"%(Te)
Pi = V*Ia
print "electrical input to the armature, Pinput = %dW"%(Pi)
Pd = Te*N
print "mechanical developed = %fW"%(Pd)
loss = (Ia**2*Ra)
print "armature copper loss = %fW"%(loss)
```

In [10]:

```
# Given Data
P = 50000.; #power delivered in watts
V = 250.; #voltage in volts
Ra = 0.02; #armature resistance in ohms
Rf = 50.; #field resistance in ohms
# Calculations and Results
If = V/Rf #field current in amperes
Ng = 400.; #speed in generating condition in rpm
print "field current, If = %dA"%(If)
Il = P/V #load current in amperes
print "Load current, If = %dA"%(Il)
Ia = If+Il #armature current in amperes
print "Aramture current, If = %dA"%(Ia)
Eg = (V+(Ia*Ra))
print ("At motor condition")
Ia = (Il-If)
print "Aramture current, If = %dA"%(Ia)
Em = (V-(Ia*Ra))
print "Em = %fV"%(Em)
Nm = (Ng*Em)/Eg
print "Speed of the motor = %drpm"%(Nm)
```

In [11]:

```
# Given Data
V = 250.; #voltage supply in volts
Ra = 0.12; #armature resistance in ohms
Rf = 100.; #field resistance in ohms
Il = 80.; #load current in amperes
# Calculations and Results
If = V/Rf
print "Field current, If = %f"%(If)
print ("When machine is generating")
Ia = Il+If
Eg = (V+(Ia*Ra))
print "Ia = %fA"%(Ia)
print "Eg = %fV"%(Eg)
print ("When machine is motoring")
Ia = Il-If
Em = (V-(Ia*Ra))
print "Ia = %fA"%(Ia)
print "Eg = %fV"%(Em)
ratio = Eg/Em
print "Ratio of speeds = %f"%(ratio)
```

In [12]:

```
# Given Data
V = 550.; #voltage supply in volts
P = 16.; #number of poles
N = 150.; #speed in rpm
Z = 2500.; #number of armature conductors
A = 16.;
Power = 1500000.; #power in watt
Cl = 25000.; #full-load copper loss
B = 0.9; #flux density in the pole
# Calculations and Results
Ia = Power/V
print "Full load current = %fA"%(Ia)
Ra = Cl/(Ia**2)
print "Ra = %fohms"%(Ra)
E = V+(Ia*Ra)
print "Induced emf = %fvolts"%(E)
phi = (E*60*A)/(Z*N*P)
print "flux density = %fWb/m**2"%(B)
print "flux = %fWb"%(phi)
area = (phi/B)
print " Area of pole shoe = %fcm**2"%(area*10000)
```

In [13]:

```
# Given Data
Cd = 0.76; #commutator diameter in metres
Cr = .38; #commutator radius in metres
bw = 1.5*10**(-2); #brush width in metres
N = 600.; #speed in rpm
n = 10.; #speed in rps
# Calculations and Results
V = Cr*(2*3.14*n);
print "peripheral speed of commutator, V = %fm/sec"%(V);
Tc = bw/V;
print "Time of commutation = %fseconds"%(Tc)
```

In [14]:

```
# Given Data
V = 240.; #supply voltage in volts
N = 800.; #speed in rpm
Ia = 2.; #armeture current in amperes
Ra = 0.4; #armature resistance in ohms
Rf = 160.; #field resistance in ohms
Il1 = 30.; #line current in amperes
# Calculations and Results
E = V-(Ia*Ra); #induced emf in volts
print ("At no-load")
print "E = %fV"%(E)
If = V/Rf; #field current in amperes
print "If = %fA"%(If)
K1 = E/(If*N);
print "K1 = %f"%(K1)
print ("At a load of 30A")
Ia1 = (Il1-If);
E1 = V-(Ia1*Ra);
N1 = 950; #speed in rpm
If1 = E1/(K1*N1);
print "If1 = %fA"%(If1);
Rr = V/If1;
R = (Rr-Rf);
print "Extra resistance required in the field circuit, R = %fohms"%(R)
```

In [15]:

```
# Given Data
V = 230.; #voltage supply in volts
Ia = 20.; #armature current in amperes
Ra = 0.5; #armature resistance in ohms
# Calculations and Results
E = V-(Ia*Ra);
print "E = %dV"%(E)
print ("when extra resistance is added in the armature circuit,the speed is halved")
E2 = E/2;
R = ((V-E2)/Ia)-Ra;
print ("The load torque is conmath.atant")
print "extra resistance in the armature circui, R = %fohms"%(R)
print ("The load torque directly proportional to square of speed")
print ("if N is halfed, Iais one-fourthed")
Ia2 = Ia/4;
R = ((V-E2)/Ia2)-Ra;
print "extra resistance in the armature circui, R = %fohms"%(R)
```

In [17]:

```
# Given Data
V = 250.; #voltage supply in volts
Ia = 50.; #armature current in amperes
Ra = 0.3; #armature resistance in ohms
N = 1000.;
# Calculations and Results
E = V-(Ia*Ra);
print "E = %dV"%(E)
print ("when extra resistance is added in the armature circuit when the speed is 800rpm")
N2 = 800.;
E2 = (E*N2)/N;
print "E at 800rpm = %dV"%(E2)
R = ((V-E2)/Ia)-Ra;
print "extra resistance in the armature circui, R = %fohms"%(R)
print ("if load is halfed,Ia will be halfed")
Ia2 = Ia/2;
E1 = V-(Ia2*(Ra+R));
print "E1 = %dV"%(E1)
N1 = (N2*E1)/E2;
print "N1 = %frpm"%(N1)
```

In [18]:

```
# Given Data
Il = 5.; #current in amperes al no-load
V = 250.; #voltage in volts
Rf = 250.; #field resistance in ohms
# Calculations and Results
If1 = V/Rf; #field current in amperes
Ia1 = Il-If1; #armature current
Ra = 0.2; #armature resistance in ohms
print ("at a load current of 50A")
Il2 = 50; #load current in amperes
#armature reaction weakens by 3percent
If2 = 0.97; #current in amperes
Ia2 = Il2-If2;
N1 = 1000;
E1 = (V-(Ia1*Ra));
E2 = (V-(Ia2*Ra));
N2 = (N1*E2)/(0.97*E1);
print "N2 = %frpm"%(N2)
```

In [19]:

```
# Given Data
P = 4; #pole
V = 500; #shunt motor in volts
Ia = 60; #armature current in amperes
Ra = 0.2; #armature resistance in ohms
# Calculations and Results
E = V-(Ia*Ra)-2;
print "voltage drop across each brush = %fV"%(E)
phi = 0.03; #flux per pole in Wb
Z = 720.; #total armature current in volts
A = 2;
N = (E*60*A)/(phi*Z*P)
print "full load speed of the motor = %frpm"%(N)
```

In [21]:

```
import math
# Given Data
V = 440; #primary voltage in volts
Ia = 50; #armature current in amperes
Ra = 0.2; #armature resistance in ohms
N = 600; #speed in rpm
E = V-(Ia*Ra); #emf induced in volts before adding extra resistance
#E = K*phi*N = K1*Ia*N
K1 = E/(Ia*N);
# Calculations and Results
#we have the relation T = Kt1*Ia**2, T1 = Kt1*Ia1**2
#when torque is half, say torque be T1
#T1 = T/2. r = T/T1
r = 2;
Ia1 = math.sqrt(Ia**2/r);
print "Ia1 = %fA"%(Ia1);
#extra resistance R is introduced in the circuit
N1 = 400;
E1 = (K1*Ia1*N1);
R = ((V-E1)/Ia1)-Ra;
print "value of extra resistance added = %fohms"%(R)
```

In [22]:

```
# Given Data
V = 200.; #voltage in volts
Ia = 20.; #armature current in amperes
Ra = 0.5; #armature resistance in ohms
Rse = 0.2; #field winding resistance in ohms
# Calculations and Results
E = V-(Ia*(Ra+Rse));
print "In first case, E = %fV"%(E)
#E = k*phi*N
N = 1000; #speed in rpm
Kphi = E/N;
#a resistance R is connected in parallel with the series field which is called diverter
print ("when resistace R is added and new conditions")
I = 20; #total current flowing
#current is equally devided between series field and diverter
Ise2 = I/2;
#flux at 10A current is 20percent of flux at 20A current
p = 0.70; #percentage of flux
Kpih1 = p*Kphi;
E1 = (V-((Ia*Ra)+(Ise2*Rse)));
print "Induced emf = %fV"%(E1)
#new speed is N1
N1 = E1/(p*Kphi)
print "N1 = %frpm"%(N1)
```

In [23]:

```
# Given Data
V = 200.; #motor runs in volts
Ia = 15.; #current taken in amperes
Ra = 1.; #motor resistance in ohms
# Calculations and Results
E1 = V-(Ia*Ra);
print "resistance when 1ohm = %fV"%(E1)
R = 5; #resistance
E2 = V-(Ia*(Ra+R))
print "resistance when 5ohms connected in series = %fV"%(E2)
N1 = 800; #speed of motor in rpm
N2 = N1*(E2/E1);
print "speed at which motor will run when resistance is 5ohms = %frpm"%(N2)
```

In [24]:

```
# Given Data
P = 8.; #pole
Z = 107.; #generator with slots
Ia = 1000.; #current containing in amperes
Bag = 0.32; #gap flux density in Wb/m**2
lg = 0.012; #interpole air gap in meters
pi = 3.14;
# Calculations
Mu = (4*pi*10**-7)
AT = (((Ia*Z)/(2*P))+((Bag*lg)/Mu));
# Results
print "current for each commutating pole = %f"%(AT)
```

In [25]:

```
# Given Data
Bag = 0.3; #flux density in the interpole air gap in Wb/m**2
# Calculations and Results
Ia = 200000./200; #armature current in amperes
print "Armature current = %f"%(Ia)
Z = 540.; #Number of armature conductors
Zt = 540./2; #Number armature winding turns
print "Number armature winding turns = %f"%(Zt)
A = 6.; #the winding lap
Ap = Zt/A; #Number of armature turns per parallel path
print "Number of armature turns per parallel path = %f"%(Ap)
P = 6; #pole
Np = ((Ia*Ap)/P);
print "Number of armature ampere turns per pole = %f"%(Np)
lg = 0.01; #inter pole air gap in meters
pi = 3.14;
Mu = (4*pi*10**-7)
Nipg = ((Bag*lg)/Mu); #Air gap
print "ampere turns for the air gap = %f"%(Nipg)
NipI = (Np+Nipg); #total interpole ampere
print "Total interpole ampere turns = %f"%(NipI)
Nip = (NipI/Ia);
print "Number of turns needed on each commutating pole = %f"%(Nip)
```

In [26]:

```
# Given Data
N = 960.; #speed in rpm
F = 23.; #effictive load in kgf
# Calculations and Results
r = 45./2; #radius of the drum
print "radius of the drum = %fcm"%(r)
pi = 3.14;
OP = (2*pi*N*F*r*9.81)/(60*100);
print "output power = %fW"%(OP)
Vi = 230.; #motor input in volts
Ci = 28.; #input current in amperes
IP = (Vi*Ci);
print "input power = %fW"%(IP)
Effi = (OP/IP)*100;
print "Efficiency of the motor = %fpercent"%(Effi)
```

In [27]:

```
# Given Data
I = 440.; #input at no-load in watt
V = 220.; #voltage in volts
Ic = I/V; #input current at no-load in amperes
i = 1; #input current in amperes
A = 2; #current in amperes
C = A-i; #armature current at no-load in amperes
L = I-((((C)**2)*0.5)+(V*C)); #iron,friction and windage losses in watt
a = 40; #motor current in amperes
OP = (V*a);
Ra = 0.5;
# Calculations and Results
Effi = (OP*100)/(OP+(((a+i)**2)*Ra)+(V*i)+L)
print "Efficiency as a generator when delivering 40A at 220V = %fpercent"%(Effi)
Eff = ((OP-(((a-i)**2)*Ra)-(V*C)-L)/OP)*100;
print "Efficiency as a motor when taking 40A from at 220V = %fpercent"%(Eff)
```

In [29]:

```
# Given Data
V = 400.; #motor in volts
Rf = 200.; #field resistance in ohms
If = V/Rf; #current in amperes
i = 5; #current at no load in amperes
IP = V*i; #motor input at no load
Ia = 3; #aramture current in amperes
Ra = 0.5; #armature resistance in ohms
# Calculations and Results
L = IP-(((Ia)**2)*Ra)-(V*If); #iron,friction and windage in losses in watt
print "iron, friction and windage in losses = %fW"%(L)
At = 50.; #armature total current in amperes
A = At-2; #armature current in amperes
Ls = (((A)**2)*Ra)+(V*If)+L; #Losses
Eff = (((V*At)-Ls)/(V*At))*100;
print "Efficiency of full load = %fpercent"%(Eff)
#flux is consmath.tant
E1 = V-(Ia*Ra); #induced emf in the armature at no load
E2 = V-(A*Ra); #induced emf in the armature at full load
# math.since N1/N2 = E1/E2
percentload = (1-(E2/E1))*100;
print "Percentage change in speed from no load to full load = %fpercent"%(percentload)
```

In [30]:

```
# Given Data
Ra = 0.5; #armature resistance in ohms
Rf = 750.; #field circuit resistance in ohms
V = 500.; #voltage in volts
# Calculations
If = V/Rf; #current in amperes
l = 3.; #line current in amperes
i = 2.33; #current in motor in amperes
I = 0.67; #current i amperes
L = (V*l)-(((i)**2)*Ra)-(V*I); #Iron,friction and windage losses
O = 20.; #generator
OP = (O*1000)/V; #output current of the generator under loaded condition in amperes
Ia = I+OP; #output in amperes
Effi = (O*1000*100)/((O*1000)+(((Ia)**2)*Ra)+(V*I)+L);
# Results
print "efficiency of the machine = %fpercent"%(Effi)
```

In [31]:

```
# Given Data
Ig = 25.; #current of generator in amperes
I = 30.; #current in motor in amperes
Il = I-Ig; #current in amperes
Ra = 0.25; #resistance in ohms
Gl = ((Ig)**2)*Ra; #loss in generator in watt
M = ((I)**2)*Ra; #loss in motor in watt
T = Gl+M; #total loss in watt
V = 100.; #voltage in volts
P = V*Il; #power supplied from mains in watt
L = P-T; #iron,friction and windages losses in the two machines in ohms
l = L/2; #iron,friction and windages losses in each machines in ohms
IP = I*V; #input
# Calculations and Results
Eff = ((IP-M-l)/IP)*100;
print "Efficiency of the motor = %fpercent"%(Eff)
OP = Ig*V; #output
Effi = ((OP)/(OP+Gl+l))*100;
print "Efficiency of the generator = %fpercent"%(Effi)
```

In [32]:

```
# Given Data
V = 440.; #voltage in volts
P = 200.*1000; #power in watt
Ig = P/V; #rated current of each machine in amperes
# Calculations
#assume losses to be equal
I = 90; #addition currnet supply
Effi = math.sqrt(Ig/(Ig+I))*100;
# Results
print "approximate efficiency = %fpercent"%(Effi)
```

In [33]:

```
# Given Data
Ig = 2000.; #output current of generator in amperes
I = 380.; #Input current from supply mains in amperes
# Calculations and Results
Effi = math.sqrt(Ig/(Ig+I))*100; #Efficiency of generator assuming equal efficiencies of the two machines
print "Efficiences of the generator at full load assuming equal efficiencies = %fpercent"%(Effi)
S = 22.; #Shunt field current of generator
G = Ig+S; #Armature current of generator in amperes
R = 0.01; #resistance of the armature circuit of each machine in ohms
Gc = ((G)**2)*R; #copper loss in arrmature circuit of generator in W
V = 500.; #Voltage in volts
L = V*S; #loss in the field circuit of the generator in W
T = Ig+I; #total current suuply in amperes
Sf = 17.; #shunt field current of motor in amperes
A = T-Sf; #armature current in motor in amperes
Lc = ((A)**2)*R; #loss in armature circuit of motor in amperes
Lf = V*Sf; #loss in the shunt field circuit of motor in W
Tin = V*I; #total input to motor and generator in W
Ml = Tin-(Gc+L+Lc+Lf); #iron,friction and windage loss in both machines in W
Me = Ml/2; #iron,friction and windage loss in each machine in W
p = 1000.; #power in kW
OP = (Ig*V)/p; #full load output of the generator
Eff = (p*100)/(p+((Gc+L+Me)/1000));
print "Efficiency of the generator at full load = %fpercent"%(Eff)
```