# CHAPTER 12: POWER, ENERGY, AND EFFICIENCY RELATIONS OF DC AND AC DYNAMOS¶

## Example 12.1, Page number 412¶

In :
#Variable declaration
P = 10000.0      #Power rating of the shunt generator(W)
V = 230.0        #Voltage rating of the shunt generator(V)
S = 1750.0       #Speed of the shunt generator(rpm)
V_a = 245.0      #Voltage across armature(V)
I_a = 2.0        #Armature current(A)
R_f = 230.0      #Field resistance(ohm)
R_a = 0.2        #Armature resistance(ohm)

#Calculation
#Case(a)
Rotational_loss = V_a*I_a-(I_a**2*R_a)    #Rotational losses at full load(W)
#Case(b)
V_t = V
I_L = P/V_t                               #Line current(A)
I_f = V/R_f                               #Field current(A)
Ia = I_f+I_L                              #Armature current(A)
armature_loss = Ia**2*R_a                 #Full-load armature loss(W)
V_f = V
field_loss = V_f*I_f                      #Full-load field loss(W)
#Case(c)
n = P/(P+Rotational_loss+(armature_loss+field_loss))*100 #Efficiency of the generator at rated load(%)

#Result
print('Case(a): Rotational losses at full load , Rotational losses = %.1f W' %Rotational_loss)
print('Case(b): Full-load armature circuit loss , I_a^2*R_a = %.f W' %armature_loss)
print('         Field loss , V_f*I_f = %.f W' %field_loss)
print('Case(c): Efficiency of the generator at rated load , η = %.1f percent' %n)

Case(a): Rotational losses at full load , Rotational losses = 489.2 W
Case(b): Full-load armature circuit loss , I_a^2*R_a = 396 W
Field loss , V_f*I_f = 230 W
Case(c): Efficiency of the generator at rated load , η = 90.0 percent


## Example 12.2, Page number 412¶

In :
#Variable declaration
P = 10000.0               #Power rating of the shunt generator(W)
Rotational_loss = 489.2   #Rotational loss at full load(W)
armature_loss = 396.0     #Full-load armature loss(W)
field_loss = 230.0        #Full-load field loss(W)
x1 = 1.0/4                #Fraction of full-load
x2 = 1.0/2                #Fraction of full-load
x3 = 3.0/4                #Fraction of full-load
x4 = 5.0/4                #Fraction of full-load

#Calculation
n_a = (P*x1)/((P*x1)+Rotational_loss+(armature_loss*(x1**2)+field_loss))*100   #Efficiency of generator(%)
n_b = (P*x2)/((P*x2)+Rotational_loss+(armature_loss*(x2**2)+field_loss))*100   #Efficiency of generator(%)
n_c = (P*x3)/((P*x3)+Rotational_loss+(armature_loss*(x3**2)+field_loss))*100   #Efficiency of generator(%)
n_d = (P*x4)/((P*x4)+Rotational_loss+(armature_loss*(x4**2)+field_loss))*100   #Efficiency of generator(%)

#Result
print('Case(a): Efficiency of the generator at 1/4 load , η = %.1f percent' %n_a)
print('Case(b): Efficiency of the generator at 1/2 load , η = %.1f percent' %n_b)
print('Case(c): Efficiency of the generator at 3/4 load , η = %.1f percent' %n_c)
print('Case(d): Efficiency of the generator at 5/4 load , η = %.1f percent' %n_d)

Case(a): Efficiency of the generator at 1/4 load , η = 77.1 percent
Case(b): Efficiency of the generator at 1/2 load , η = 85.9 percent
Case(c): Efficiency of the generator at 3/4 load , η = 88.8 percent
Case(d): Efficiency of the generator at 5/4 load , η = 90.3 percent


## Example 12.3, Page number 413¶

In :
#Variable declaration
V = 240.0     #Voltage rating of the dc shunt motor(V)
hp = 25.0     #Power rating of the dc shunt motor(hp)
S = 1800.0    #Speed of the shunt generator(rpm)
I_L = 89.0    #Full-load line current(A)
R_a = 0.05    #Armature resistance(ohm)
R_f = 120.0   #Field circuit resistance(ohm)

#Calculation
#Case(a)
V_f = V            #Field voltage(V)
I_f = V_f/R_f      #Field current(A)
I_a = I_L-I_f      #Armature current(A)
V_a = V
E_c = V_a-I_a*R_a  #Armature voltage to be applied to the motor(V)
#Case(b)
Ia = 4.2           #Armature current produced by E_c(A)
Va = E_c           #Armature voltage(V)
P_r = Va*Ia        #Stray power(W)

#Result
print('Case(a): Armature voltage to be applied to the motor when motor is run light at 1800 rpm during stray power test , E_c = %.2f V' %E_c)
print('Case(b): Stray power when voltage in part(a) produces an armature current of 4.2 A at 1800 rpm , P_r = %.1f W' %P_r)

Case(a): Armature voltage to be applied to the motor when motor is run light at 1800 rpm during stray power test , E_c = 235.65 V
Case(b): Stray power when voltage in part(a) produces an armature current of 4.2 A at 1800 rpm , P_r = 989.7 W


## Example 12.4, Page number 415¶

In :
#Variable declaration
V = 600.0    #Voltage rating of the compound motor(V)
hp = 150.0   #Power rating of the compound motor(hp)
I_L = 205.0  #Full-load rated line current(A)
S = 1500.0   #Full-load speed of the compound generator(rpm)
R_sh = 300.0 #Shunt field resistance(ohm)
R_a = 0.05   #Armature resistance(ohm)
R_s = 0.1    #Series field resistance(ohm)
V_a  = 570.0 #Applied voltage(V)
I_a = 6.0    #Armature current(A)
S_o = 1800.0 #No-load speed of the compound generator(rpm)
x1 = 1.0/4                #Fraction of full-load
x2 = 1.0/2                #Fraction of full-load
x3 = 3.0/4                #Fraction of full-load
x4 = 5.0/4                #Fraction of full-load

#Calculation
#Case(a)
Rot_losses = V_a*I_a                        #Rotational loss(W)
S_1 = S_o-300*x1                            #Speed at 1/4 load(rpm)
Rot_losses_S_1 = (S_1/S)*Rot_losses         #Rotational loss at speed S_1(W)
S_2 = S_o-300*x2                            #Speed at 1/2 load(rpm)
Rot_losses_S_2 = (S_2/S)*Rot_losses         #Rotational loss at speed S_2(W)
S_3 = S_o-300*x3                            #Speed at 3/4 load(rpm)
Rot_losses_S_3 = (S_3/S)*Rot_losses         #Rotational loss at speed S_3(W)
S_4 = S_o-300*x4                            #Speed at 5/4 load(rpm)
Rot_losses_S_4 = (S_4/S)*Rot_losses         #Rotational loss at speed S_4(W)
#Case(b)
I_sh = V/R_sh                               #Full-load shunt field current(A)
Ia = I_L-I_sh                               #Full-load armature current(A)
FL_variable_loss = Ia**2*(R_a+R_s)          #Full-load variable electric loss(W)
x1_variable_loss = FL_variable_loss*x1**2   #Variable losses at 1/4 load(W)
x2_variable_loss = FL_variable_loss*x2**2   #Variable losses at 1/2 load(W)
x3_variable_loss = FL_variable_loss*x3**2   #Variable losses at 3/4 load(W)
x4_variable_loss = FL_variable_loss*x4**2   #Variable losses at 5/4 load(W)
#Case(c)
Input_FL = V*I_L                            #Input at full load(W)
Input_x1 = V*I_L*x1                         #Input at 1/4 load(W)
Input_x2 = V*I_L*x2                         #Input at 1/2 load(W)
Input_x3 = V*I_L*x3                         #Input at 3/4 load(W)
Input_x4 = V*I_L*x4                         #Input at 5/4 load(W)
Field_loss = V*I_sh                         #Field loss for each of the conditions of load(W)
Losses_FL = Field_loss+Rot_losses+FL_variable_loss     #Total losses for full load(W)
Losses_1 = Field_loss+Rot_losses_S_1+x1_variable_loss  #Total losses for 1/4 load(W)
Losses_2 = Field_loss+Rot_losses_S_2+x2_variable_loss  #Total losses for 1/2 load(W)
Losses_3 = Field_loss+Rot_losses_S_3+x3_variable_loss  #Total losses for 3/4 load(W)
Losses_4 = Field_loss+Rot_losses_S_4+x4_variable_loss  #Total losses for 5/4 load(W)
n_FL = (Input_FL-Losses_FL)/Input_FL*100               #Efficiency for full load(%)
n_1 = (Input_x1-Losses_1)/Input_x1*100                 #Efficiency for 1/4 load(%)
n_2 = (Input_x2-Losses_2)/Input_x2*100                 #Efficiency for 1/2 load(%)
n_3 = (Input_x3-Losses_3)/Input_x3*100                 #Efficiency for 3/4 load(%)
n_4 = (Input_x4-Losses_4)/Input_x4*100                 #Efficiency for 5/4 load(%)

#Result
print('Case(a): Rotational loss at full load = %.f W' %Rot_losses)
print('         Rotational loss at 1/4 times rated load = %.f W' %Rot_losses_S_1)
print('         Rotational loss at 1/2 times rated load = %.f W' %Rot_losses_S_2)
print('         Rotational loss at 3/4 times rated load = %.f W' %Rot_losses_S_3)
print('         Rotational loss at 5/4 times rated load = %.f W' %Rot_losses_S_4)
print('Case(b): Full-load variable electric losses = %.f W' %FL_variable_loss)
print('         Variable electric losses at 1/4 load = %.f W' %x1_variable_loss)
print('         Variable electric losses at 1/2 load = %.f W' %x2_variable_loss)
print('         Variable electric losses at 3/4 load = %.f W' %x3_variable_loss)
print('         Variable electric losses at 5/4 load = %.f W' %x4_variable_loss)
print('Case(c): Efficiency of motor at full load = %.1f percent' %n_FL)
print('         Efficiency of motor at 1/4 load = %.1f percent' %n_1)
print('         Efficiency of motor at 1/2 load = %.1f percent' %n_2)
print('         Efficiency of motor at 3/4 load = %.1f percent' %n_3)
print('         Efficiency of motor at 5/4 load = %.1f percent' %n_4)
print('Case(d): Table 12-2 Losses and Efficiencies for Ex. 12-4')
print('______________________________________________________________________________________________________________')
print('\t Item \t\t\t At 1/4 load \t At 1/2 load \t At 3/4 load \t At Full load \t At 5/4 load')
print('______________________________________________________________________________________________________________')
print('Input(watts)\t\t\t %d \t\t %d \t\t %d \t\t %d \t\t %d' %(Input_x1,Input_x2,Input_x3,Input_FL,Input_x4))
print('Field loss(watts)\t\t %d \t\t %d \t\t %d \t\t %d \t\t %d' %(Field_loss,Field_loss,Field_loss,Field_loss,Field_loss))
print('Rotational losses,')
print(' From part(a) (watts)\t\t %d \t\t %d \t\t %d \t\t %d \t\t %d' %(Rot_losses_S_1,Rot_losses_S_2,Rot_losses_S_3,Rot_losses,Rot_losses_S_4))
print('Variable electric losses,')
print(' From part(b) (watts)\t\t %d \t\t %d \t\t %d \t\t %d \t\t %d' %(x1_variable_loss,x2_variable_loss,x3_variable_loss,FL_variable_loss,x4_variable_loss))
print('Total of all losses(watts)\t %d \t\t %d \t\t %d \t\t %d \t\t %d' %(Losses_1,Losses_2,Losses_3,Losses_FL,Losses_4))
print('______________________________________________________________________________________________________________')
print('Efficiency η(percent)\t\t %.1f \t\t %.1f \t\t %.1f \t\t %.1f \t\t %.1f' %(n_1,n_2,n_3,n_FL,n_4))
print('______________________________________________________________________________________________________________')
print('\nNOTE: Changes in obtained answer from that of textbook is due to more precision')

Case(a): Rotational loss at full load = 3420 W
Rotational loss at 1/4 times rated load = 3933 W
Rotational loss at 1/2 times rated load = 3762 W
Rotational loss at 3/4 times rated load = 3591 W
Rotational loss at 5/4 times rated load = 3249 W
Case(b): Full-load variable electric losses = 6181 W
Variable electric losses at 1/4 load = 386 W
Variable electric losses at 1/2 load = 1545 W
Variable electric losses at 3/4 load = 3477 W
Variable electric losses at 5/4 load = 9658 W
Case(c): Efficiency of motor at full load = 91.2 percent
Efficiency of motor at 1/4 load = 82.1 percent
Efficiency of motor at 1/2 load = 89.4 percent
Efficiency of motor at 3/4 load = 91.0 percent
Efficiency of motor at 5/4 load = 90.8 percent
Case(d): Table 12-2 Losses and Efficiencies for Ex. 12-4
______________________________________________________________________________________________________________
Item 			 At 1/4 load 	 At 1/2 load 	 At 3/4 load 	 At Full load 	 At 5/4 load
______________________________________________________________________________________________________________
Input(watts)			 30750 		 61500 		 92250 		 123000 		 153750
Field loss(watts)		 1200 		 1200 		 1200 		 1200 		 1200
Rotational losses,
From part(a) (watts)		 3932 		 3762 		 3591 		 3420 		 3249
Variable electric losses,
From part(b) (watts)		 386 		 1545 		 3477 		 6181 		 9658
Total of all losses(watts)	 5519 		 6507 		 8268 		 10801 		 14107
______________________________________________________________________________________________________________
Efficiency η(percent)		 82.1 		 89.4 		 91.0 		 91.2 		 90.8
______________________________________________________________________________________________________________

NOTE: Changes in obtained answer from that of textbook is due to more precision


## Example 12.5, Page number 415¶

In :
#Variable declaration
P = 10000.0      #Power rating of the shunt generator(W)
V = 230.0        #Voltage rating of the shunt generator(V)
S = 1750.0       #Speed of the shunt generator(rpm)
V_a = 245.0      #Voltage across armature(V)
I_a = 2.0        #Armature current(A)
R_a = 0.2        #Armature resistance(ohm)
P_r = 489.2      #Shunt generator rotational losses(W)
Vf_If = 230.0    #Shunt field circuit loss(W)
I_a_rated = 44.5 #Rated armature current(A)

#Calculation
I_a = ((Vf_If+P_r)/R_a)**0.5             #Armature current at which max efficiency occurs(A)
LF = I_a/I_a_rated                       #Load fraction
LF_percent = LF*100                      #Load fraction(%)
P_k = Vf_If+P_r
n_max = P*LF/(P*LF+(Vf_If+P_r)+P_k)*100  #Maximum efficiency(%)
LF_d = (P_k/(I_a_rated**2*R_a))**0.5     #Load fraction from fixed losses and rated variable losses

#Result
print('Case(a): Armature current at which maximum efficiency occurs , I_a = %.f A' %I_a)
print('Case(b): Load fraction , L.F = %.1f percent = %.3f*rated' %(LF_percent,LF))
print('Case(c): Maximum efiiciency , η_max = %.2f percent' %n_max)
print('Case(d): Load fraction from fixed losses and rated variable losses , L.F = %.3f*rated' %LF_d)

Case(a): Armature current at which maximum efficiency occurs , I_a = 60 A
Case(b): Load fraction , L.F = 134.8 percent = 1.348*rated
Case(c): Maximum efiiciency , η_max = 90.36 percent
Case(d): Load fraction from fixed losses and rated variable losses , L.F = 1.348*rated


## Example 12.6, Page number 418¶

In :
#Variable declaration
V = 240.0      #Voltage rating of dc shunt motor(V)
hp = 25.0      #Power rating of dc shunt motor(hp)
S = 1100.0     #Speed of the dc shunt motor(rpm)
R_a = 0.15     #Armture resistance(ohm)
R_f = 80.0     #Field resistance(ohm)
I_L = 89.0     #Rated line current(A)

#Calculation
V_f = V               #Voltage across field winding(V)
I_f = V_f/R_f         #Field current(A)
I_a = I_L-I_f         #Armature current(A)
P_o = hp*746          #Power rating of dc shunt motor(W)
V_a = V               #Voltage across armature(V)
E_c_fl = V_a-I_a*R_a  #Back EMF(V)
E_c = E_c_fl
P_d = E_c*I_a         #Power developed by the armature(W)
P_r = P_d-P_o         #Full-load rotational losses(W)
P_in = V*I_L          #Input power(W)
n = P_o/P_in*100      #Full-load efficiency(%)
P_k = V_f*I_f+P_r     #Total constant losses(W)
Ia = (P_k/R_a)**0.5   #Armature current for maximum efficiency(A)
I_a_rated = I_a
LF = Ia/I_a_rated     #Load fraction at which max efficiency is produced
rated_input = V*I_L
n_max = ((LF*rated_input)-2*P_k)/(LF*rated_input)*100  #Maximum efficiency(%)

#Result
print('Case(a): Power developed by the armature , P_d = %.1f W' %P_d)
print('Case(b): Full-load rotational losses , P_r = %.1f W' %P_r)
print('Case(c): Full-laod efficiency , η = %.1f percent' %n)
print('Case(d): Total constant losses , P_k = %.1f W' %P_k)
print('Case(e): Armature current from maximum efficiency , I_a = %.1f A' %Ia)
print('Case(f): Load fraction at which maximum efficiency is produced , L.F = %.1f ' %LF)
print('Case(g): Maximum efficiency , η_max = %.1f percent' %n_max)

Case(a): Power developed by the armature , P_d = 19530.6 W
Case(b): Full-load rotational losses , P_r = 880.6 W
Case(c): Full-laod efficiency , η = 87.3 percent
Case(d): Total constant losses , P_k = 1600.6 W
Case(e): Armature current from maximum efficiency , I_a = 103.3 A
Case(f): Load fraction at which maximum efficiency is produced , L.F = 1.2
Case(g): Maximum efficiency , η_max = 87.5 percent


## Example 12.7, Page number 420¶

In :
#Variable declaration
V = 240.0      #Voltage rating of dc shunt motor(V)
hp = 25.0      #Power rating of dc shunt motor(hp)
S = 1100.0     #Speed of the dc shunt motor(rpm)
R_a = 0.15     #Armture resistance(ohm)
R_f = 80.0     #Field resistance(ohm)
I_L = 89.0     #Rated line current(A)

#Calculation
V_f = V               #Voltage across field winding(V)
I_f = V_f/R_f         #Field current(A)
I_a = I_L-I_f         #Armature current(A)
P_o = hp*746          #Power rating of dc shunt motor(W)
V_a = V               #Voltage across armature(V)
E_c_fl = V_a-I_a*R_a  #Back EMF(V)
E_c = E_c_fl
P_d = E_c*I_a         #Power developed by the armature(W)
P_r = P_d-P_o         #Full-load rotational losses(W)
P_in = V*I_L          #Input power(W)
n = P_o/P_in*100      #Full-load efficiency(%)
P_k = V_f*I_f+P_r     #Total constant losses(W)
Ia = (P_k/R_a)**0.5   #Armature current for maximum efficiency(A)
I_a_rated = I_a
LF = Ia/I_a_rated     #Load fraction at which max efficiency is produced
rated_input = V*I_L
n_max = ((LF*rated_input)-2*P_k)/(LF*rated_input)*100  #Maximum efficiency(%)

#Result
print('Case(a): Power developed by the armature , P_d = %.1f W' %P_d)
print('Case(b): Full-load rotational losses , P_r = %.1f W' %P_r)
print('Case(c): Full-laod efficiency , η = %.1f percent' %n)
print('Case(d): Total constant losses , P_k = %.1f W' %P_k)
print('Case(e): Armature current from maximum efficiency , I_a = %.1f A' %Ia)
print('Case(f): Load fraction at which maximum efficiency is produced , L.F = %.1f ' %LF)
print('Case(g): Maximum efficiency , η_max = %.1f percent' %n_max)

Case(a): Power developed by the armature , P_d = 19530.6 W
Case(b): Full-load rotational losses , P_r = 880.6 W
Case(c): Full-laod efficiency , η = 87.3 percent
Case(d): Total constant losses , P_k = 1600.6 W
Case(e): Armature current from maximum efficiency , I_a = 103.3 A
Case(f): Load fraction at which maximum efficiency is produced , L.F = 1.2
Case(g): Maximum efficiency , η_max = 87.5 percent


## Example 12.8, Page number 420¶

In :
#Variable declaration
V = 240.0      #Voltage rating of dc shunt motor(V)
hp = 5.0       #Power rating of dc shunt motor(hp)
S_fl = 1100.0  #Speed of the dc shunt motor(rpm)
R_a = 0.4      #Armture resistance(ohm)
R_f = 240.0    #Field resistance(ohm)
n = 0.75       #Full-load efficiency

#Calculation
#Case(a)
V_L = V                    #Load voltage(V)
P_o = hp*746               #Power rating of dc shunt motor(W)
I_L = P_o/(n*V_L)          #Rated input line current(A)
V_f = V                    #Voltage across field winding(V)
I_f = V_f/R_f              #Field current(A)
I_a = I_L-I_f              #Armature current(A)
#Case(b)
V_a = V                    #Voltage across armature(V)
E_c_fl = V_a-I_a*R_a       #Back EMF(V)
E_c = E_c_fl
P_d = E_c*I_a              #Power developed in the armature at rated load(W)
#Case(c)
P_r = P_d-P_o              #Rotational losses at rated load(W)
#Case(d)
P_o_nl = 0                 #At no-load
P_r_nl = P_r               #Rotational losses at no load(W)
P_d_nl = P_r_nl
#Case(e)
I_a_nl = P_d_nl/V_a        #No-load armature current(A)
#Case(f)
E_c_nl = V                 #No-load voltage(V)
E_c_fl = E_c               #Full-load voltage(V)
S_nl = E_c_nl/E_c_fl*S_fl  #No-load speed(rpm)
#Case(g)
SR = (S_nl-S_fl)/S_fl*100  #Speed regulation(%)

#Result
print('Case(a): Rated input line current , I_L = %.2f A' %I_L)
print('         Rated armature current , I_a = %.2f A' %I_a)
print('Case(b): Power developed in the armature at rated load , P_d = %d W' %P_d)
print('Case(c): Rotational losses at rated load , P_r = %d W' %P_r)
print('Case(d): Rotational losses at no load , P_r = %d W' %P_r_nl)
print('Case(e): No-load armature current , I_a(nl) = %.2f A' %I_a_nl)
print('Case(f): No-load speed , S_nl = %.f rpm' %S_nl)
print('Case(g): Speed regulation of the motor , SR = %.1f percent' %SR)

Case(a): Rated input line current , I_L = 20.72 A
Rated armature current , I_a = 19.72 A
Case(b): Power developed in the armature at rated load , P_d = 4577 W
Case(c): Rotational losses at rated load , P_r = 847 W
Case(d): Rotational losses at no load , P_r = 847 W
Case(e): No-load armature current , I_a(nl) = 3.53 A
Case(f): No-load speed , S_nl = 1137 rpm
Case(g): Speed regulation of the motor , SR = 3.4 percent


## Example 12.9, Page number 421¶

In :
#Variable declaration
V = 240.0      #Voltage rating of dc shunt motor(V)
I_L = 55.0     #Rated line current(A)
S = 1200.0     #Speed of the dc shunt motor(rpm)
P_r = 406.4    #Rotational losses at rated load(W)
R_f = 120.0    #Field resistance(ohm)
R_a = 0.4      #Armture resistance(ohm)

#Calculation
#Case(a)
V_f = V                    #Voltage across field winding(V)
I_f = V_f/R_f              #Field current(A)
I_a = I_L-I_f              #Armature current(A)
V_a = V                    #Voltage across armature(V)
E_c = V_a-I_a*R_a          #Back EMF(V)
P_d = E_c*I_a              #Power developed by the armature at rated load(W)
#Case(b)
P_o = P_d-P_r              #Rated output power(W)
P_o_hp = P_o/746           #Rated output power(hp)
#Case(c)
T_o = P_o_hp*5252/S        #Rated output torque(lb-ft)
T_o_Nm = T_o*1.356         #Rated output torque(N-m)
#Case(d)
P_in = V*I_L               #Input power(W)
n = (P_o/P_in)*100         #Efficiency at rated load(%)
#Case(e)
P_o_nl = 0                 #At no-load
P_r_nl = P_r               #Rotational losses at no load(W)
P_d_nl = P_r_nl
I_a_nl = P_r_nl/V_a        #No-load armature current(A)
E_c_nl = V                 #No-load voltage(V)
E_c_fl = E_c               #Full-load voltage(V)
S_fl = S                   #Full-load speed(rpm)
S_nl = E_c_nl/E_c_fl*S_fl  #No-load speed(rpm)
#Case(f)
SR = (S_nl-S_fl)/S_fl*100  #Speed regulation(%)

#Result
print('Case(a): Counter EMF , E_c = %.1f V' %E_c)
print('         Power developed at rated load , P_d = %.1f W' %P_d)
print('Case(b): Rated output power , P_o = %d W' %P_o)
print('         Rated output power , P_o = %d hp' %P_o_hp)
print('Case(c): Rated output torque , T_o = %.2f lb-ft' %T_o)
print('         Rated output torque , T_o = %d N-m' %T_o_Nm)
print('Case(d): Efficiency at rated load , η = %.1f percent' %n)
print('Case(e): No-load armature current , I_a(nl)  = %.3f A' %I_a_nl)
print('         No-load speed , S_nl = %.f rpm' %S_nl)
print('Case(e): Speed regulation , SR = %.1f percent' %SR)

Case(a): Counter EMF , E_c = 218.8 V
Power developed at rated load , P_d = 11596.4 W
Case(b): Rated output power , P_o = 11190 W
Rated output power , P_o = 15 hp
Case(c): Rated output torque , T_o = 65.65 lb-ft
Rated output torque , T_o = 89 N-m
Case(d): Efficiency at rated load , η = 84.8 percent
Case(e): No-load armature current , I_a(nl)  = 1.693 A
No-load speed , S_nl = 1316 rpm
Case(e): Speed regulation , SR = 9.7 percent


## Example 12.10, Page number 422¶

In :
#Variable declaration
V = 125.0        #Voltage rating of generator(V)
P_o = 12500.0    #Power rating of generator(W)
P_hp = 20.0      #Power rating of motor(hp)
R_a = 0.1        #Armature resistance(ohm)
R_f = 62.5       #Field resistance(ohm)
P_var = 1040.0   #Rated variable electric loss(W)

#Calculation
#Case(a)
P_in = P_hp*746         #Power input to generator(W)
n = P_o/P_in*100        #Efficiency(%)
#Case(b)
V_f = V                 #Voltage across shunt field winding(V)
P_sh_loss = V_f**2/R_f  #Shunt field loss(W)
#Case(c)
V_L = V
I_L = P_o/V_L           #Line current(A)
I_f = V_f/R_f           #Field current(A)
I_a = I_L+I_f           #Armature current(A)
E_g = V_L+I_a*R_a       #Generated EMF(V)
P_d1 = E_g*I_a          #Generated electric power(W)
P_f = V_f*I_f
P_d2 = P_o+P_var+P_f    #Generated electric power(W)
#Case(d)
P_d = P_d1
P_r = P_in-P_d          #Rotational power loss(W)
#Case(e)
P_k = P_r+V_f*I_f       #Constant losses(W)
Ia = (P_k/R_a)**0.5     #Armature current for max efficiency(A)
#Case(f)
I_a_rated = I_a         #Rated armature current(A)
LF = Ia/I_a_rated       #Load fraction
#Case(g)
rated_output = 12500    #Rated output(W)
n_max = (LF*rated_output)/((LF*rated_output)+(2*P_k))*100 #Maximum efficiency

#Result
print('Case(a): Efficiency , η = %.f percent' %n)
print('Case(b): Shunt field loss  = %d W' %P_sh_loss)
print('Case(c): Generated electric power , P_d = %d W (Method 1)' %P_d1)
print('         Generated electric power , P_d = %d W (Method 2)' %P_d2)
print('Case(d): Rotational power loss , P_r = %.f W' %P_r)
print('Case(e): Armature current for maximum efficiency , I_a = %.1f A' %Ia)
print('Case(f): Load fraction for maximum efficiency , L.F = %.2f ' %LF)
print('Case(g): Maximum efficiency , η = %.2f percent' %n_max)

Case(a): Efficiency , η = 84 percent
Case(b): Shunt field loss  = 250 W
Case(c): Generated electric power , P_d = 13790 W (Method 1)
Generated electric power , P_d = 13790 W (Method 2)
Case(d): Rotational power loss , P_r = 1130 W
Case(e): Armature current for maximum efficiency , I_a = 117.5 A
Case(f): Load fraction for maximum efficiency , L.F = 1.15
Case(g): Maximum efficiency , η = 83.91 percent


## Example 12.11, Page number 422¶

In :
#Variable declaration
V = 125.0        #Voltage rating of generator(V)
P_o = 12500.0    #Power rating of generator(W)
P_hp = 20.0      #Power rating of motor(hp)
R_a = 0.1        #Armature resistance(ohm)
R_f = 62.5       #Field resistance(ohm)
P_var = 1040.0   #Rated variable electric loss(W)
P_k = 1380.0     #Constant losses(W)
LF_a = 25.0/100  #At rated output
LF_b = 50.0/100  #At rated output
LF_c = 75.0/100  #At rated output
LF_d = 125.0/100 #At rated output

#Calculation
output = P_o
P_a_rated = P_var
n_a = output*LF_a/(output*LF_a+P_k+(LF_a**2)*P_a_rated)*100   #Efficiency of dc shunt generator(%)
n_b = output*LF_b/(output*LF_b+P_k+(LF_b**2)*P_a_rated)*100   #Efficiency of dc shunt generator(%)
n_c = output*LF_c/(output*LF_c+P_k+(LF_c**2)*P_a_rated)*100   #Efficiency of dc shunt generator(%)
n_d = output*LF_d/(output*LF_d+P_k+(LF_d**2)*P_a_rated)*100   #Efficiency of dc shunt generator(%)

#Result
print('Case(a): Efficiency of dc generator at 25 percent rated output , η = %.1f percent' %n_a)
print('Case(b): Efficiency of dc generator at 50 percent rated output , η = %.1f percent' %n_b)
print('Case(c): Efficiency of dc generator at 75 percent rated output , η = %.1f percent' %n_c)
print('Case(d): Efficiency of dc generator at 125 percent rated output , η = %.2f percent' %n_d)
print('\nNOTE: Calculation error in textbook for case(b)')

Case(a): Efficiency of dc generator at 25 percent rated output , η = 68.4 percent
Case(b): Efficiency of dc generator at 50 percent rated output , η = 79.2 percent
Case(c): Efficiency of dc generator at 75 percent rated output , η = 82.7 percent
Case(d): Efficiency of dc generator at 125 percent rated output , η = 83.87 percent

NOTE: Calculation error in textbook for case(b)


## Example 12.12, Page number 426¶

In :
#Variable declaration
kVA = 100.0           #Rating of the alternator(kVA)
V  = 1100.0           #Rated voltage of the alternator(V)
I_a_nl = 8.0          #No-load armature current(A)
P_in_nl = 6000.0      #No-load Power input to the armature(W)
V_oc = 1350.0         #Open-circuit line voltage(V)
I_f = 18.0            #Field current(A)
V_f = 125.0           #Voltage across field winding(V)
R_a = 0.45            #Armature resistance(ohm/phase)
I_a_rated = 52.5      #Rated armature current(A)

#Calculation
#Case(a)
P_r = P_in_nl-3*(I_a_nl)**2*R_a   #Rotational loss of synchronous dynamo(W)
#Case(b)
P_f = V_f*I_f                     #Field copper loss(W)
#Case(c)
P_k = P_r+P_f                     #Fixed losses at rated synchronous speed(W)
#Case(d)
P_cu = 3*(I_a_rated)**2*R_a       #Electric armature copper loss at rated load(W)
LF1 = 1.0/4                       #Load fraction
LF2 = 1.0/2                       #Load fraction
LF3 = 3.0/4                       #Load fraction
P_cu_LF1 = P_cu*(LF1)**2          #Electric armature copper loss at 1/4 load(W)
P_cu_LF2 = P_cu*(LF2)**2          #Electric armature copper loss at 1/2 load(W)
P_cu_LF3 = P_cu*(LF3)**2          #Electric armature copper loss at 3/4 load(W)
#Case(e)
PF = 0.9                          #Power factor lagging
n_1 = (LF1*kVA*1000*PF)/((LF1*kVA*1000*PF)+P_k+P_cu_LF1)*100   #Efficiency at 1/4 load
n_2 = (LF2*kVA*1000*PF)/((LF2*kVA*1000*PF)+P_k+P_cu_LF2)*100   #Efficiency at 1/2 load
n_3 = (LF3*kVA*1000*PF)/((LF3*kVA*1000*PF)+P_k+P_cu_LF3)*100   #Efficiency at 3/4 load
n_fl = (kVA*1000*PF)/((kVA*1000*PF)+P_k+P_cu)*100              #Efficiency at rated load
#Case(f)
I_a_max = (P_k/(3*R_a))**0.5       #Armature current for max efficiency at 0.9 PF lagging(A)
LF = I_a_max/I_a_rated             #Load fraction for max efficiency
n_max = (LF*kVA*1000*PF)/((LF*kVA*1000*PF)+2*P_k)*100          #Max Efficiency 0.9 PF lagging(%)
#Case(g)
P_o = kVA*PF                       #Output power at 0.9 PF lagging(kW)
I_a = I_a_rated
P_d = P_o+(3*(I_a)**2*R_a/1000)+(V_f*I_f/1000)  #Armature power developed at 0.9 PF lagging at full-load(kW)

#Result
print('Case(a): Rotational loss of the synchronous dynamo , P_r = %.f W' %P_r)
print('Case(b): Field copper loss , P_f = %.f W' %P_f)
print('Case(c): Fixed losses at rated synchronous speed , P_k = %.f W' %P_k)
print('Case(d): Electric armature copper loss at 1/4 rated load , P_cu = %.1f W' %P_cu_LF1)
print('         Electric armature copper loss at 1/2 rated load , P_cu = %.1f W' %P_cu_LF2)
print('         Electric armature copper loss at 3/4 rated load , P_cu = %.f W' %P_cu_LF3)
print('         Electric armature copper loss at rated load , P_cu = %.f W' %P_cu)
print('Case(e): Efficiency at 1/4 rated load , η = %.1f percent' %n_1)
print('         Efficiency at 1/2 rated load , η = %.1f percent' %n_2)
print('         Efficiency at 3/4 rated load , η = %.1f percent' %n_3)
print('         Efficiency at rated load , η = %.1f percent' %n_fl)
print('Case(f): Maximum efficiency at 0.9 PF lagging , η_max = %.1f percent' %n_max)
print('Case(g): Armature power developed at 0.9 PF lagging at full load , P_d = %.2f kW' %P_d)

Case(a): Rotational loss of the synchronous dynamo , P_r = 5914 W
Case(b): Field copper loss , P_f = 2250 W
Case(c): Fixed losses at rated synchronous speed , P_k = 8164 W
Case(d): Electric armature copper loss at 1/4 rated load , P_cu = 232.6 W
Electric armature copper loss at 1/2 rated load , P_cu = 930.2 W
Electric armature copper loss at 3/4 rated load , P_cu = 2093 W
Electric armature copper loss at rated load , P_cu = 3721 W
Case(e): Efficiency at 1/4 rated load , η = 72.8 percent
Efficiency at 1/2 rated load , η = 83.2 percent
Efficiency at 3/4 rated load , η = 86.8 percent
Efficiency at rated load , η = 88.3 percent
Case(f): Maximum efficiency at 0.9 PF lagging , η_max = 89.1 percent
Case(g): Armature power developed at 0.9 PF lagging at full load , P_d = 95.97 kW


## Example 12.13, Page number 430¶

In :
#Variable declaration
kVA = 1000.0       #Rating of the alternator(kVA)
V  = 2300.0        #Rated voltage of the alternator(V)
hp = 100.0         #Power rating of the dc motor(hp)
V_motor  = 240.0   #Rated voltage of the motor(V)
P_1 = 7.5          #Motor output(kW). TEST 1
P_2 = 16.0         #Motor output(kW). TEST 2
VfIf = 14.0        #Field losses(kW)
P_f = VfIf         #Field losses(kW)
P_3 = 64.2         #Motor output(kW). TEST 3
I_sc = 251.0       #Short circuit current(A)
V_L = 1443.0       #Line voltage(V). TEST 4
R_a = 0.3          #Armature resistance(ohm)

#Calculation
#Case(a)
P_r = P_2                      #Rotational losses(kW). From TEST 2
#Case(b)
P_cu = P_3-P_1                 #Full-load armature copper loss(kW)
#Case(c)
E_gL = V_L                     #Generated line voltage(V)
Z_s = (E_gL/3**0.5)/I_sc       #Synchronous impedance of the armature(ohm)
#Case(d)
X_s = (Z_s**2-R_a**2)**0.5     #Synchronous reactance of the armature(ohm)
#Case(e)
PF = 0.8                       #Lagging power factor
sin_theta = (1-PF**2)**0.5     #Sinθ
V_p = V/3**0.5                 #Phase voltage(V)
I_a = I_sc                     #Armature current(A)
E_gp = complex((V_p*PF+I_a*R_a),(V_p*sin_theta+I_a*X_s)) #Generated phase voltage(V)
V_nl = abs(E_gp)                #No-load voltage(V)
V_fl = V_p                      #Full-load voltage(V)
VR = (V_nl-V_fl)/V_fl*100       #Alternator voltage regulation(%)
#Case(f)
LF = 1.0                        #Load fraction
n_rated = (LF*kVA*PF)/((LF*kVA*PF)+(P_f+P_r)+P_cu)*100   #Efficiency at 0.8 lagging PF(%)
#Case(g)
P_k = (P_f+P_r)                 #Constant losses(kW)
L_F = (P_k/P_cu)**0.5           #Load fraction for max efficiency
n_max = (L_F*kVA*PF)/((L_F*kVA*PF)+2*P_k)*100            #Max Efficiency at 0.8 lagging PF(%)
#Case(h)
PF_h = 1.0                      #Unity PF
P_o = kVA*PF_h                  #Output power(kW)
P_d = P_o+(3*(I_a)**2*R_a/1000)+(VfIf)                   #Armature power developed at rated-load unity PF(kW)

#Result
print('Case(a): Rotational losses , P_r = %.1f kW' %P_r)
print('Case(b): Full-load armature copper loss , P_cu = %.1f kW' %P_cu)
print('Case(c): Synchronous impedance of the armature , Z_s = %.2f Ω' %Z_s)
print('Case(d): Synchronous reactance of the armature , jX_s = %.2f Ω' %X_s)
print('Case(e): Alternator voltage regulation at 0.8 PF lagging , VR = %.2f percent' %VR)
print('Case(f): Alternator efficiency at 0.8 PF lagging at rated load , η_rated = %.1f percent' %n_rated)
print('Case(g): Maximum efficiency at 0.8 PF lagging , η_max = %.2f percent' %n_max)
print('Case(h): Power developed by the alternator armature at rated load, unity PF , P_d = %.f kW' %P_d)

Case(a): Rotational losses , P_r = 16.0 kW
Case(b): Full-load armature copper loss , P_cu = 56.7 kW
Case(c): Synchronous impedance of the armature , Z_s = 3.32 Ω
Case(d): Synchronous reactance of the armature , jX_s = 3.31 Ω
Case(e): Alternator voltage regulation at 0.8 PF lagging , VR = 49.47 percent
Case(f): Alternator efficiency at 0.8 PF lagging at rated load , η_rated = 90.2 percent
Case(g): Maximum efficiency at 0.8 PF lagging , η_max = 90.65 percent
Case(h): Power developed by the alternator armature at rated load, unity PF , P_d = 1071 kW


## Example 12.14, Page number 434¶

In :
#Variable declaration
P = 4.0       #Number of poles in Induction motor
f = 60.0      #Frequency(Hz)
V = 220.0     #Rated voltage of IM(V)
hp_IM = 5.0   #Power rating of IM(hp)
PF = 0.9      #Power factor
I_L = 16.0    #Line current(A)
S = 1750.0    #Speed of IM(rpm)
I_nl = 6.5    #No-load line current(A)
V_nl = 220.0  #No-load line voltage(V)
P_nl = 300.0  #No-load power reading(W)
I_br = 16.0   #Blocked rotor line current(A)
V_br = 50.0   #Blocked rotor voltage(V)
P_br = 800.0  #Blocked rotor power reading(W)

#Calculation
#Case(a)
P_cu = P_br                   #Full-load equivalent copper loss(W)
I_1 = I_br                    #Primary current(A)
R_e1 = P_cu/(3.0/2*I_1**2)    #Equivalent total resistance of IM(ohm)
#Case(b)
P_in = P_nl                   #Input power to IM(W)
I1 = I_nl                     #Input current(A)
P_r = P_in-(3.0/2*I1**2*R_e1) #Rotational losses(W)
#Case(c)
LF1 = 1.0/4                   #Load fraction
LF2 = 1.0/2                   #Load fraction
LF3 = 3.0/4                   #Load fraction
LF4 = 5.0/4                   #Load fraction
P_cu_LF1 = LF1**2*P_cu        #Equivalent copper loss at 1/4 rated-load(W)
P_cu_LF2 = LF2**2*P_cu        #Equivalent copper loss at 1/2 rated-load(W)
P_cu_LF3 = LF3**2*P_cu        #Equivalent copper loss at 3/4 rated-load(W)
P_cu_LF4 = LF4**2*P_cu        #Equivalent copper loss at 5/4 rated-load(W)
#Case(d)
Full_load_input = 3**0.5*V*I_L*PF #Full-load input(W)
n_rated = (Full_load_input-(P_r+P_cu))/(Full_load_input)*100              #Efficiency at rated load(%)
n_LF1 = (Full_load_input*LF1-(P_r+P_cu_LF1))/(Full_load_input*LF1)*100    #Efficiency at 1/4 rated load(%)
n_LF2 = (Full_load_input*LF2-(P_r+P_cu_LF2))/(Full_load_input*LF2)*100    #Efficiency at 1/2 rated load(%)
n_LF3 = (Full_load_input*LF3-(P_r+P_cu_LF3))/(Full_load_input*LF3)*100    #Efficiency at 3/4 rated load(%)
n_LF4 = (Full_load_input*LF4-(P_r+P_cu_LF4))/(Full_load_input*LF4)*100    #Efficiency at 5/4 rated load(%)
#Case(e)
P_o = (Full_load_input*n_rated/100)/746          #Output hp at 1/4 rated load
P_o_LF1 = (Full_load_input*LF1*n_LF1/100)/746    #Output hp at 1/4 rated load
P_o_LF2 = (Full_load_input*LF2*n_LF2/100)/746    #Output hp at 1/2 rated load
P_o_LF3 = (Full_load_input*LF3*n_LF3/100)/746    #Output hp at 3/4 rated load
P_o_LF4 = (Full_load_input*LF4*n_LF4/100)/746    #Output hp at 5/4 rated load
#Case(f)
hp = P_o                                         #Rated output(hp)
T_o = P_o*5252/S                                 #Output torque at full-load(lb-ft)
T_o_Nm = T_o*1.356                               #Output torque at full-load(N-m)

#Result
print('Case(a): Equivalent total resistance of IM between lines , R_e1 = %.3f Ω' %R_e1)
print('Case(b): Rotational losses , P_r = %.f W' %P_r)
print('Case(c): Equivalent copper loss at full-load , P_cu = %d W' %P_cu)
print('         Equivalent copper loss at 1/4 rated load , P_cu = %d W' %P_cu_LF1)
print('         Equivalent copper loss at 1/2 rated load , P_cu = %d W' %P_cu_LF2)
print('         Equivalent copper loss at 3/4 rated load , P_cu = %d W' %P_cu_LF3)
print('         Equivalent copper loss at 5/4 rated load , P_cu = %d W' %P_cu_LF4)
print('Case(d): Efficiency at rated load , η = %.1f percent' %n_rated)
print('         Efficiency at 1/4 rated load , η = %.1f percent' %n_LF1)
print('         Efficiency at 1/2 rated load , η = %.1f percent' %n_LF2)
print('         Efficiency at 3/4 rated load , η = %.1f percent' %n_LF3)
print('         Efficiency at 5/4 rated load , η = %.1f percent' %n_LF4)
print('Case(e): Output horsepower at rated load , P_o = %.2f hp' %P_o)
print('         Output horsepower at 1/4 rated load , P_o = %.3f hp' %P_o_LF1)
print('         Output horsepower at 1/2 rated load , P_o = %.3f hp' %P_o_LF2)
print('         Output horsepower at 3/4 rated load , P_o = %.2f hp' %P_o_LF3)
print('         Output horsepower at 5/4 rated load , P_o = %.2f hp' %P_o_LF4)
print('Case(f): Output torque at full-load , T_o = %.1f lb-ft' %T_o)
print('         Output torque at full-load , T_o = %.2f N-m' %T_o_Nm)

Case(a): Equivalent total resistance of IM between lines , R_e1 = 2.083 Ω
Case(b): Rotational losses , P_r = 168 W
Case(c): Equivalent copper loss at full-load , P_cu = 800 W
Equivalent copper loss at 1/4 rated load , P_cu = 50 W
Equivalent copper loss at 1/2 rated load , P_cu = 200 W
Equivalent copper loss at 3/4 rated load , P_cu = 450 W
Equivalent copper loss at 5/4 rated load , P_cu = 1250 W
Case(d): Efficiency at rated load , η = 82.4 percent
Efficiency at 1/4 rated load , η = 84.1 percent
Efficiency at 1/2 rated load , η = 86.6 percent
Efficiency at 3/4 rated load , η = 85.0 percent
Efficiency at 5/4 rated load , η = 79.3 percent
Case(e): Output horsepower at rated load , P_o = 6.06 hp
Output horsepower at 1/4 rated load , P_o = 1.547 hp
Output horsepower at 1/2 rated load , P_o = 3.184 hp
Output horsepower at 3/4 rated load , P_o = 4.69 hp
Output horsepower at 5/4 rated load , P_o = 7.29 hp
Case(f): Output torque at full-load , T_o = 18.2 lb-ft
Output torque at full-load , T_o = 24.65 N-m


## Example 12.15, Page number 438¶

In :
#Variable declaration
pole = 4.0    #Number of poles in Induction motor
f = 60.0      #Frequency(Hz)
V = 220.0     #Rated voltage of IM(V)
hp_IM = 5.0   #Power rating of IM(hp)
PF = 0.9      #Power factor
I_L = 16.0    #Line current(A)
S_r = 1750.0  #Speed of IM(rpm)
I_nl = 6.5    #No-load line current(A)
V_nl = 220.0  #No-load line voltage(V)
P_nl = 300.0  #No-load power reading(W)
I_br = 16.0   #Blocked rotor line current(A)
V_br = 50.0   #Blocked rotor voltage(V)
P_br = 800.0  #Blocked rotor power reading(W)
R_dc = 1.0    #DC resistance between lines(ohm)
V = 220.0     #Voltage rating(V)
P_input = 5500.0 #Power drawn(W)

#Calculation
R_e1 = 1.25*R_dc                    #Equivalent total resistance of IM(ohm)
P_in = P_nl                         #Input power to IM(W)
I1 = I_nl                           #Input current(A)
P_r = P_in-(3.0/2*(I1)**2*R_e1)     #Rotational losses(W)
I_1 = I_L
SCL_fl = 3.0/2*(I_1)**2*R_e1        #Stator copper loss at full-load(W)
SPI = P_input                       #Stator power input(W)
RPI = SPI-SCL_fl                    #Rotor power input(W)
S = (120*f/pole)                    #Speed of synchronous magnetic field(rpm)
s = (S-S_r)/S                       #Slip
RPD_fl = RPI*(1-s)                  #Rotor power developed(W)
RPO_fl = RPD_fl-P_r                 #Rotor power output(W)
#Case(a)
P_o = RPO_fl
n_fl = (P_o/P_input)*100            #Full-load efficiency(%)
#Case(b)
hp = P_o/746                        #Output horsepower at full load
T_o = hp*5252/S_r                   #Output torque(lb-ft)
T_o_Nm = T_o*1.356                  #Output torque(N-m)

#Result
print('Case(a): Full-load efficiency , η_fl = %.1f percent' %n_fl)
print('Case(b): Output horsepower , hp = %.2f hp at full load' %hp)
print('         Output torque , T_o = %.1f lb-ft = %.1f N-m' %(T_o,T_o_Nm))
print('Case(c): Comparison of results')
print('\t\t\t\t Ex. 12-14 \t\t Ex. 12-15')
print('________________________________________________________________________')
print('η_fl(percent)\t\t\t 82.4 \t\t\t %.1f' %n_fl)
print('Rated output(hp)\t\t 6.06 \t\t\t %.2f' %hp)
print('Rated output torque(lb-ft)\t 18.2 \t\t\t %.1f' %T_o)

Case(a): Full-load efficiency , η_fl = 84.7 percent
Case(b): Output horsepower , hp = 6.25 hp at full load
Output torque , T_o = 18.7 lb-ft = 25.4 N-m
Case(c): Comparison of results
Ex. 12-14 		 Ex. 12-15
________________________________________________________________________
η_fl(percent)			 82.4 			 84.7
Rated output(hp)		 6.06 			 6.25
Rated output torque(lb-ft)	 18.2 			 18.7


## Example 12.16, Page number 440¶

In :
import math
import cmath
import numpy

#Variable declaration
P = 6.0            #Number of poles in SCIM
S_r = 1176.0       #Rated rotor speed(rpm)
V = 220.0          #Voltage rating of SCIM(V)
f = 60.0           #Frequency(Hz)
P_hp = 7.5         #Power rating of SCIM(hp)
R_ap = 0.3         #Armature resistance(ohm)
R_r = 0.144        #Rotor resistance(ohm)
jXm = 13.5         #Reactance(ohm)
jXs = 0.5          #Synchronous reactance(ohm)
jXlr = 0.2         #Locked rotor reactance(ohm)
P_r = 300.0        #Total rotational losses(W)

#Calculation
#Case(a)
S = 120*f/P        #Speed of the rotating magnetic field(rpm)
s = (S-S_r)/S      #Slip
R_r_s = R_r/s
V_p = V/3**0.5     #Voltage per phase(V)
I1_1 = complex(R_ap,jXm+jXs)
I1_2 = complex(0,-jXm)
I2_1 = complex(0,-jXm)
I2_2 = complex(R_r/s,jXm+jXlr)
V_1 = V_p
V_2 = 0
A = [[I1_1,I2_1],[I1_2,I2_2]]        #Matrix containing above mesh eqns array
delta = numpy.linalg.det(A)          #Determinant of A
#Case(b)
I_p = numpy.linalg.det([[V_1,I2_1],[V_2,I2_2]])/delta #Stator armature current(A)
I_1 = I_p
#Case(c)
I_r = numpy.linalg.det([[I1_1,V_1],[I1_2,V_2]])/delta #Rotor armature current(A)
I_2 = I_r
#Case(d)
theta_1 = cmath.phase(I_p)*180/math.pi           #Motor PF angle(degrees)
cos_theta1 = math.cos(theta_1*math.pi/180)       #Motor PF
#Case(e)
SPI = V_p*abs(I_p)*cos_theta1                    #Stator power input(W)
#Case(f)
SCL = abs(I_p)**2*R_ap                           #Stator Copper Loss(W)
#Case(g)
RPI = SPI-SCL                                    #Rotor power input(W) Method 1
RPI_2 = abs(I_r)**2*(R_r/s)                      #Rotor power input(W) Method 2
#Case(h)
RCL = s*RPI                                      #Rotor copper losses(W)
#Case(i)
RPD_1 = RPI-RCL                                  #Rotor power developed(W) Method 1
RPD_2 = RPI*(1-s)                                #Rotor power developed(W) Method 2
#Case(j)
RPO = 3*RPD_1-P_r                                #Total three-phase rotor power output(W)
#Case(k)
P_to = RPO                                       #Total rotor power at the motor pulley(W)
T_o = 7.04*(P_to/S_r)                            #Total 3-phase torque(lb-ft)
#Case(l)
hp = P_to/746.0                                  #Output horsepower(hp)
#Case(m)
P_in = 3*SPI                                     #Input power to stator(W)
n = P_to/P_in*100                                #Motor efficiency at rated load(%)

#Result
print('Case(a): Slip , s = %.2f' %s)
print('         R_r/s = %.1f Ω' %R_r_s)
print('Case(b): Stator armature current per phase , I_p = %.2f∠%.2f° A' %(abs(I_p),cmath.phase(I_p)*180/math.pi))
print('Case(c): Rotor current per phase , I_r = %.1f∠%.2f° A' %(abs(I_r),cmath.phase(I_r)*180/math.pi))
print('Case(d): Motor power factor , cosӨ = %.3f' %cos_theta1)
print('Case(e): Stator power input per phase , SPI = %d W' %SPI)
print('Case(f): Stator copper loss per phase , SCL = %.1f W' %SCL)
print('Case(g): Rotor power input per phase , RPI = %.2f W (Method 1)' %RPI)
print('         Rotor power input per phase , RPI = %.2f W (Method 2)' %RPI_2)
print('Case(h): Rotor copper loss per phase , RCL = %.1f W' %RCL)
print('Case(i): Rotor power developed per phase , RPD = %.1f W (Method 1)' %RPD_1)
print('         Rotor power developed per phase , RPD = %.1f W (Method 2)' %RPD_2)
print('Case(j): Total three-phase rotor power output at shaft , RPO = %.1f W' %RPO)
print('Case(k): Total torque developed at output , T_o = %.2f lb-ft' %T_o)
print('Case(l): Horsepower output , hp = %.2f hp' %hp)
print('Case(m): Efficiency at rated load , η = %.2f percent' %n)
print('Case(n): Power flow diagram is shown in textbook Fig. 12-12 page no 441')
print('\nNOTE: Changes in obtained answer from that of textbook is due to more precision i.e more number of decimal places')

Case(a): Slip , s = 0.02
R_r/s = 7.2 Ω
Case(b): Stator armature current per phase , I_p = 18.69∠-31.75° A
Case(c): Rotor current per phase , I_r = 16.3∠-4.03° A
Case(d): Motor power factor , cosӨ = 0.850
Case(e): Stator power input per phase , SPI = 2018 W
Case(f): Stator copper loss per phase , SCL = 104.8 W
Case(g): Rotor power input per phase , RPI = 1913.99 W (Method 1)
Rotor power input per phase , RPI = 1913.99 W (Method 2)
Case(h): Rotor copper loss per phase , RCL = 38.3 W
Case(i): Rotor power developed per phase , RPD = 1875.7 W (Method 1)
Rotor power developed per phase , RPD = 1875.7 W (Method 2)
Case(j): Total three-phase rotor power output at shaft , RPO = 5327.1 W
Case(k): Total torque developed at output , T_o = 31.89 lb-ft
Case(l): Horsepower output , hp = 7.14 hp
Case(m): Efficiency at rated load , η = 87.96 percent
Case(n): Power flow diagram is shown in textbook Fig. 12-12 page no 441

NOTE: Changes in obtained answer from that of textbook is due to more precision i.e more number of decimal places


## Example 12.17, Page number 442¶

In :
#Variable declaration
V = 220.0             #Voltage rating of SCIM(V)
P_hp = 7.5            #Power rating of SCIM(hp)
kVA_up_limit = 7.99   #Upper limit of starting kVA/hp
kVA_low_limit = 7.1   #Lower limit of starting kVA/hp

#Calculation
I_s_u = kVA_up_limit*P_hp*1000/(3**0.5*V)  #Upper limit of starting current(A)
I_s_l = kVA_low_limit*P_hp*1000/(3**0.5*V) #Lower limit of starting current(A)

#Result
print('Case(a): Upper limit of the starting current , I_s = %.1f A' %I_s_u)
print('Case(b): Lower limit of the starting current , I_s = %.1f A' %I_s_l)

Case(a): Upper limit of the starting current , I_s = 157.3 A
Case(b): Lower limit of the starting current , I_s = 139.7 A


## Example 12.18, Page number 442¶

In :
import math
import cmath
import numpy

#Variable declaration
P = 6.0            #Number of poles in SCIM
S_r = 1176.0       #Rated rotor speed(rpm)
V = 220.0          #Voltage rating of SCIM(V)
f = 60.0           #Frequency(Hz)
P_hp = 7.5         #Power rating of SCIM(hp)
R_ap = 0.3         #Armature resistance(ohm)
R_r = 0.144        #Rotor resistance(ohm)
jXm = 13.5         #Reactance(ohm)
jXs = 0.5          #Synchronous reactance(ohm)
jXlr = 0.2         #Locked rotor reactance(ohm)
P_r = 300.0        #Total rotational losses(W)
s = 1.0            #Unity slip

#Calculation
R_r_s = R_r/s
V_p = V/3**0.5     #Voltage per phase(V)
I1_1 = complex(R_ap,jXm+jXs)
I1_2 = complex(0,-jXm)
I2_1 = complex(0,-jXm)
I2_2 = complex(R_r/s,jXm+jXlr)
V_1 = V_p
V_2 = 0
A = [[I1_1,I2_1],[I1_2,I2_2]]        #Matrix containing above mesh eqns array
delta = numpy.linalg.det(A)          #Determinant of A
#Case(a)
I_s = numpy.linalg.det([[V_1,I2_1],[V_2,I2_2]])/delta #Stator armature current(A)
I_1 = I_s
#Case(b)
theta = cmath.phase(I_s)*180/math.pi     #Phase angle of Stator armature current(degree)
cos_theta = math.cos(theta*math.pi/180)  #PF of the motor at starting

#Result
print('Case(a): Starting stator current of the SCIM , I_s = I_1 = %.1f∠%.1f° A' %(abs(I_s),theta))
print('Case(b): Power factor of the motor at starting , cosθ = %.3f ' %cos_theta)

Case(a): Starting stator current of the SCIM , I_s = I_1 = 153.9∠-57.8° A
Case(b): Power factor of the motor at starting , cosθ = 0.533


## Example 12.19, Page number 445¶

In :
#Variable declaration
V = 220.0         #Rated voltage of SCIM(V)
f = 60.0          #Frequency(Hz)
P = 4.0           #Number of poles
PF = 0.85         #Power factor of capacitor-start IM
hp_IM = 5.0       #Power rating of IM(hp)
I_L = 28.0        #Rated line current(A)
S_r = 1620.0      #Rotor speed of IM(rpm)
I_nl = 6.4        #No-load line current(A)
V_nl = 220.0      #No-load line voltage(V)
P_nl = 239.0      #No-load power reading(W)
s_nl = 0.01       #No-load slip
I_br = 62.0       #Blocked rotor line current(A)
V_br = 64.0       #Blocked rotor voltage(V)
P_br = 1922.0     #Blocked rotor power reading(W)
s_br = 1.0        #Blocked rotor slip

#Calculation
#Case(a)
R_els = P_br/I_br**2           #Equivalent total resistance of IM(ohm)
#Case(b)
P_in = P_nl                    #Input power to IM(W)
I_ls = I_nl                    #Input current(A)
P_ro = P_in-(I_ls**2*R_els)    #Rotational losses(W)
#Case(c)
S = (120*f/P)                  #Speed of synchronous magnetic field(rpm)
S_fl = S_r                     #Full-load rotor speed of IM(rpm)
s_fl = (S-S_fl)/S              #Full-load Slip
LF1 = 1.0/4                    #Load fraction
LF2 = 1.0/2                    #Load fraction
LF3 = 3.0/4                    #Load fraction
LF4 = 5.0/4                    #Load fraction
s_LF1 = s_fl*LF1               #slip at 1/4 rated load
s_LF2 = s_fl*LF2               #slip at 1/2 rated load
s_LF3 = s_fl*LF3               #slip at 3/4 rated load
s_LF4 = s_fl*LF4               #slip at 5/4 rated load
#Case(d)
s_o = s_nl                          #No-load slip
P_rs_fl = P_ro*(1-s_fl)/(1-s_o)     #Rotational losses rated load(W)
P_rs_LF1 = P_ro*(1-s_LF1)/(1-s_o)   #Rotational losses at 1/4 rated load(W)
P_rs_LF2 = P_ro*(1-s_LF2)/(1-s_o)   #Rotational losses at 1/2 rated load(W)
P_rs_LF3 = P_ro*(1-s_LF3)/(1-s_o)   #Rotational losses at 3/4 rated load(W)
P_rs_LF4 = P_ro*(1-s_LF4)/(1-s_o)   #Rotational losses at 5/4 rated load(W)
#Case(e)
Ils = I_L                           #Line current(A)
P_cu_fl = Ils**2*R_els              #Equivalent copper loss at full-load slip(W)
P_cu_LF1 = LF1**2*P_cu_fl           #Equivalent copper loss at 1/4 rated load(W)
P_cu_LF2 = LF2**2*P_cu_fl           #Equivalent copper loss at 1/2 rated load(W)
P_cu_LF3 = LF3**2*P_cu_fl           #Equivalent copper loss at 3/4 rated load(W)
P_cu_LF4 = LF4**2*P_cu_fl           #Equivalent copper loss at 5/4 rated load(W)
#Case(f)
Input = V*I_L*PF                    #Input to single phase capacitor start IM(W)
n_LF1 = (Input*LF1-(P_rs_LF1+P_cu_LF1))/(Input*LF1)*100   #Efficiency at 1/4 rated load(%)
n_LF2 = (Input*LF2-(P_rs_LF2+P_cu_LF2))/(Input*LF2)*100   #Efficiency at 1/2 rated load(%)
n_LF3 = (Input*LF3-(P_rs_LF3+P_cu_LF3))/(Input*LF3)*100   #Efficiency at 3/4 rated load(%)
n_LF4 = (Input*LF4-(P_rs_LF4+P_cu_LF4))/(Input*LF4)*100   #Efficiency at 5/4 rated load(%)
n_fl = (Input-(P_rs_fl+P_cu_fl))/(Input)*100              #Efficiency at full load(%)
#Case(g)
P_o_LF1 = (Input*LF1*n_LF1/100)/746                       #Output hp at 1/4 rated load
P_o_LF2 = (Input*LF2*n_LF2/100)/746                       #Output hp at 1/2 rated load
P_o_LF3 = (Input*LF3*n_LF3/100)/746                       #Output hp at 3/4 rated load
P_o_LF4 = (Input*LF4*n_LF4/100)/746                       #Output hp at 5/4 rated load
P_o = (Input*n_fl/100)/746                                #Output hp at rated load
#Case(h)
hp = P_o                                                  #Rated output horsepower
S_fl = S_r                                                #Full-load rotor speed(rpm)
T_o = P_o*5252/S_fl                                       #Output torque at full-load(lb-ft)
T_o_ST = T_o*1.356                                        #Output torque at full-load(N-m)

#Result
print('Case(a): Equivalent total resistance of motor between lines , R_els = %.1f Ω' %R_els)
print('Case(b): Rotational losses at no load , P_ro = %.1f W' %P_ro)
print('Case(c): Slip at rated load , s_fl = %.1f ' %s_fl)
print('         Slip at 1/4 rated load , s = %.3f ' %s_LF1)
print('         Slip at 1/2 rated load , s = %.2f ' %s_LF2)
print('         Slip at 3/4 rated load , s = %.3f ' %s_LF3)
print('         Slip at 5/4 rated load , s = %.3f ' %s_LF4)
print('Case(d): Rotational loss at rated load , P_r = %.1f W' %P_rs_fl)
print('         Rotational loss at 1/4 load , P_r = %.1f W' %P_rs_LF1)
print('         Rotational loss at 1/2 load , P_r = %.2f W' %P_rs_LF2)
print('         Rotational loss at 3/4 load , P_r = %.1f W' %P_rs_LF3)
print('         Rotational loss at 5/4 load , P_r = %.1f W' %P_rs_LF4)
print('Case(e): Equivalent copper loss at rated load , P_cu = %.f W' %P_cu_fl)
print('         Equivalent copper loss at 1/4 load , P_cu = %.1f W' %P_cu_LF1)
print('         Equivalent copper loss at 1/2 load , P_cu = %.f W' %P_cu_LF2)
print('         Equivalent copper loss at 3/4 load , P_cu = %.1f W' %P_cu_LF3)
print('         Equivalent copper loss at 5/4 load , P_cu = %.1f W' %P_cu_LF4)
print('Case(f): Efficiency at rated load , η = %.1f W' %n_fl)
print('         Efficiency at 1/4 rated load , η = %.1f W' %n_LF1)
print('         Efficiency at 1/2 rated load , η = %.1f W' %n_LF2)
print('         Efficiency at 3/4 rated load , η = %.1f W' %n_LF3)
print('         Efficiency at 5/4 rated load , η = %.1f W' %n_LF4)
print('Case(g): Output horsepower at rated load , P_o = %.2f hp' %P_o)
print('         Output horsepower at 1/4 rated load , P_o = %.2f hp' %P_o_LF1)
print('         Output horsepower at 1/2 rated load , P_o = %.2f hp' %P_o_LF2)
print('         Output horsepower at 3/4 rated load , P_o = %.2f hp' %P_o_LF3)
print('         Output horsepower at 5/4 rated load , P_o = %.2f hp' %P_o_LF4)
print('Case(h): Output torque at full load , T_o = %.1f lb-ft' %T_o)
print('         Output torque at full load , T_oST = %.1f N-m' %T_o_ST)
print('\nNOTE: ERROR: Calculation error for efficiency at 3/4 load in textbook')

Case(a): Equivalent total resistance of motor between lines , R_els = 0.5 Ω
Case(b): Rotational losses at no load , P_ro = 218.5 W
Case(c): Slip at rated load , s_fl = 0.1
Slip at 1/4 rated load , s = 0.025
Slip at 1/2 rated load , s = 0.05
Slip at 3/4 rated load , s = 0.075
Slip at 5/4 rated load , s = 0.125
Case(d): Rotational loss at rated load , P_r = 198.7 W
Rotational loss at 1/4 load , P_r = 215.2 W
Rotational loss at 1/2 load , P_r = 209.69 W
Rotational loss at 3/4 load , P_r = 204.2 W
Rotational loss at 5/4 load , P_r = 193.1 W
Case(e): Equivalent copper loss at rated load , P_cu = 392 W
Equivalent copper loss at 1/4 load , P_cu = 24.5 W
Equivalent copper loss at 1/2 load , P_cu = 98 W
Equivalent copper loss at 3/4 load , P_cu = 220.5 W
Equivalent copper loss at 5/4 load , P_cu = 612.5 W
Case(f): Efficiency at rated load , η = 88.7 W
Efficiency at 1/4 rated load , η = 81.7 W
Efficiency at 1/2 rated load , η = 88.2 W
Efficiency at 3/4 rated load , η = 89.2 W
Efficiency at 5/4 rated load , η = 87.7 W
Case(g): Output horsepower at rated load , P_o = 6.23 hp
Output horsepower at 1/4 rated load , P_o = 1.43 hp
Output horsepower at 1/2 rated load , P_o = 3.10 hp
Output horsepower at 3/4 rated load , P_o = 4.69 hp
Output horsepower at 5/4 rated load , P_o = 7.69 hp
Case(h): Output torque at full load , T_o = 20.2 lb-ft
Output torque at full load , T_oST = 27.4 N-m

NOTE: ERROR: Calculation error for efficiency at 3/4 load in textbook