summaryrefslogtreecommitdiff
path: root/Electric_Machinery_and_Transformers/CHAP_12.ipynb
blob: 429927d2e23aa22fd3b5680c51b40ce9f77f93d8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "CHAPTER 12: POWER, ENERGY, AND EFFICIENCY RELATIONS OF DC AND AC DYNAMOS"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.1, Page number 412"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "P = 10000.0      #Power rating of the shunt generator(W)\n",
      "V = 230.0        #Voltage rating of the shunt generator(V)\n",
      "S = 1750.0       #Speed of the shunt generator(rpm)\n",
      "V_a = 245.0      #Voltage across armature(V)\n",
      "I_a = 2.0        #Armature current(A)\n",
      "R_f = 230.0      #Field resistance(ohm)\n",
      "R_a = 0.2        #Armature resistance(ohm)\n",
      "\n",
      "#Calculation\n",
      "#Case(a)\n",
      "Rotational_loss = V_a*I_a-(I_a**2*R_a)    #Rotational losses at full load(W) \n",
      "#Case(b)\n",
      "V_t = V\n",
      "I_L = P/V_t                               #Line current(A)\n",
      "I_f = V/R_f                               #Field current(A)\n",
      "Ia = I_f+I_L                              #Armature current(A)\n",
      "armature_loss = Ia**2*R_a                 #Full-load armature loss(W)\n",
      "V_f = V\n",
      "field_loss = V_f*I_f                      #Full-load field loss(W)\n",
      "#Case(c)\n",
      "n = P/(P+Rotational_loss+(armature_loss+field_loss))*100 #Efficiency of the generator at rated load(%) \n",
      "\n",
      "#Result\n",
      "print('Case(a): Rotational losses at full load , Rotational losses = %.1f W' %Rotational_loss)\n",
      "print('Case(b): Full-load armature circuit loss , I_a^2*R_a = %.f W' %armature_loss)\n",
      "print('         Field loss , V_f*I_f = %.f W' %field_loss)\n",
      "print('Case(c): Efficiency of the generator at rated load , \u03b7 = %.1f percent' %n)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Rotational losses at full load , Rotational losses = 489.2 W\n",
        "Case(b): Full-load armature circuit loss , I_a^2*R_a = 396 W\n",
        "         Field loss , V_f*I_f = 230 W\n",
        "Case(c): Efficiency of the generator at rated load , \u03b7 = 90.0 percent\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.2, Page number 412"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "P = 10000.0               #Power rating of the shunt generator(W)\n",
      "Rotational_loss = 489.2   #Rotational loss at full load(W)\n",
      "armature_loss = 396.0     #Full-load armature loss(W)\n",
      "field_loss = 230.0        #Full-load field loss(W)\n",
      "x1 = 1.0/4                #Fraction of full-load\n",
      "x2 = 1.0/2                #Fraction of full-load\n",
      "x3 = 3.0/4                #Fraction of full-load\n",
      "x4 = 5.0/4                #Fraction of full-load\n",
      "\n",
      "#Calculation\n",
      "n_a = (P*x1)/((P*x1)+Rotational_loss+(armature_loss*(x1**2)+field_loss))*100   #Efficiency of generator(%)\n",
      "n_b = (P*x2)/((P*x2)+Rotational_loss+(armature_loss*(x2**2)+field_loss))*100   #Efficiency of generator(%)\n",
      "n_c = (P*x3)/((P*x3)+Rotational_loss+(armature_loss*(x3**2)+field_loss))*100   #Efficiency of generator(%)\n",
      "n_d = (P*x4)/((P*x4)+Rotational_loss+(armature_loss*(x4**2)+field_loss))*100   #Efficiency of generator(%)\n",
      "\n",
      "#Result\n",
      "print('Case(a): Efficiency of the generator at 1/4 load , \u03b7 = %.1f percent' %n_a)\n",
      "print('Case(b): Efficiency of the generator at 1/2 load , \u03b7 = %.1f percent' %n_b)\n",
      "print('Case(c): Efficiency of the generator at 3/4 load , \u03b7 = %.1f percent' %n_c)\n",
      "print('Case(d): Efficiency of the generator at 5/4 load , \u03b7 = %.1f percent' %n_d)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Efficiency of the generator at 1/4 load , \u03b7 = 77.1 percent\n",
        "Case(b): Efficiency of the generator at 1/2 load , \u03b7 = 85.9 percent\n",
        "Case(c): Efficiency of the generator at 3/4 load , \u03b7 = 88.8 percent\n",
        "Case(d): Efficiency of the generator at 5/4 load , \u03b7 = 90.3 percent\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.3, Page number 413"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "V = 240.0     #Voltage rating of the dc shunt motor(V)\n",
      "hp = 25.0     #Power rating of the dc shunt motor(hp)\n",
      "S = 1800.0    #Speed of the shunt generator(rpm)\n",
      "I_L = 89.0    #Full-load line current(A)\n",
      "R_a = 0.05    #Armature resistance(ohm)\n",
      "R_f = 120.0   #Field circuit resistance(ohm)\n",
      "\n",
      "#Calculation\n",
      "#Case(a)\n",
      "V_f = V            #Field voltage(V)\n",
      "I_f = V_f/R_f      #Field current(A)\n",
      "I_a = I_L-I_f      #Armature current(A)\n",
      "V_a = V\n",
      "E_c = V_a-I_a*R_a  #Armature voltage to be applied to the motor(V)\n",
      "#Case(b)\n",
      "Ia = 4.2           #Armature current produced by E_c(A)\n",
      "Va = E_c           #Armature voltage(V)\n",
      "P_r = Va*Ia        #Stray power(W)\n",
      "\n",
      "#Result\n",
      "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)\n",
      "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)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "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\n",
        "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\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.4, Page number 415"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "V = 600.0    #Voltage rating of the compound motor(V)\n",
      "hp = 150.0   #Power rating of the compound motor(hp)\n",
      "I_L = 205.0  #Full-load rated line current(A)\n",
      "S = 1500.0   #Full-load speed of the compound generator(rpm)\n",
      "R_sh = 300.0 #Shunt field resistance(ohm)\n",
      "R_a = 0.05   #Armature resistance(ohm)\n",
      "R_s = 0.1    #Series field resistance(ohm)\n",
      "V_a  = 570.0 #Applied voltage(V)\n",
      "I_a = 6.0    #Armature current(A)\n",
      "S_o = 1800.0 #No-load speed of the compound generator(rpm)\n",
      "x1 = 1.0/4                #Fraction of full-load\n",
      "x2 = 1.0/2                #Fraction of full-load\n",
      "x3 = 3.0/4                #Fraction of full-load\n",
      "x4 = 5.0/4                #Fraction of full-load\n",
      "\n",
      "#Calculation\n",
      "#Case(a)\n",
      "Rot_losses = V_a*I_a                        #Rotational loss(W)\n",
      "S_1 = S_o-300*x1                            #Speed at 1/4 load(rpm)\n",
      "Rot_losses_S_1 = (S_1/S)*Rot_losses         #Rotational loss at speed S_1(W)\n",
      "S_2 = S_o-300*x2                            #Speed at 1/2 load(rpm)\n",
      "Rot_losses_S_2 = (S_2/S)*Rot_losses         #Rotational loss at speed S_2(W)\n",
      "S_3 = S_o-300*x3                            #Speed at 3/4 load(rpm)\n",
      "Rot_losses_S_3 = (S_3/S)*Rot_losses         #Rotational loss at speed S_3(W)\n",
      "S_4 = S_o-300*x4                            #Speed at 5/4 load(rpm)\n",
      "Rot_losses_S_4 = (S_4/S)*Rot_losses         #Rotational loss at speed S_4(W)\n",
      "#Case(b)\n",
      "I_sh = V/R_sh                               #Full-load shunt field current(A)\n",
      "Ia = I_L-I_sh                               #Full-load armature current(A)\n",
      "FL_variable_loss = Ia**2*(R_a+R_s)          #Full-load variable electric loss(W)\n",
      "x1_variable_loss = FL_variable_loss*x1**2   #Variable losses at 1/4 load(W)\n",
      "x2_variable_loss = FL_variable_loss*x2**2   #Variable losses at 1/2 load(W)\n",
      "x3_variable_loss = FL_variable_loss*x3**2   #Variable losses at 3/4 load(W)\n",
      "x4_variable_loss = FL_variable_loss*x4**2   #Variable losses at 5/4 load(W)\n",
      "#Case(c)\n",
      "Input_FL = V*I_L                            #Input at full load(W)\n",
      "Input_x1 = V*I_L*x1                         #Input at 1/4 load(W)\n",
      "Input_x2 = V*I_L*x2                         #Input at 1/2 load(W)\n",
      "Input_x3 = V*I_L*x3                         #Input at 3/4 load(W)\n",
      "Input_x4 = V*I_L*x4                         #Input at 5/4 load(W)\n",
      "Field_loss = V*I_sh                         #Field loss for each of the conditions of load(W)\n",
      "Losses_FL = Field_loss+Rot_losses+FL_variable_loss     #Total losses for full load(W)\n",
      "Losses_1 = Field_loss+Rot_losses_S_1+x1_variable_loss  #Total losses for 1/4 load(W)\n",
      "Losses_2 = Field_loss+Rot_losses_S_2+x2_variable_loss  #Total losses for 1/2 load(W)\n",
      "Losses_3 = Field_loss+Rot_losses_S_3+x3_variable_loss  #Total losses for 3/4 load(W)\n",
      "Losses_4 = Field_loss+Rot_losses_S_4+x4_variable_loss  #Total losses for 5/4 load(W)\n",
      "n_FL = (Input_FL-Losses_FL)/Input_FL*100               #Efficiency for full load(%)\n",
      "n_1 = (Input_x1-Losses_1)/Input_x1*100                 #Efficiency for 1/4 load(%)\n",
      "n_2 = (Input_x2-Losses_2)/Input_x2*100                 #Efficiency for 1/2 load(%)\n",
      "n_3 = (Input_x3-Losses_3)/Input_x3*100                 #Efficiency for 3/4 load(%)\n",
      "n_4 = (Input_x4-Losses_4)/Input_x4*100                 #Efficiency for 5/4 load(%) \n",
      "\n",
      "#Result\n",
      "print('Case(a): Rotational loss at full load = %.f W' %Rot_losses)\n",
      "print('         Rotational loss at 1/4 times rated load = %.f W' %Rot_losses_S_1)\n",
      "print('         Rotational loss at 1/2 times rated load = %.f W' %Rot_losses_S_2)\n",
      "print('         Rotational loss at 3/4 times rated load = %.f W' %Rot_losses_S_3)\n",
      "print('         Rotational loss at 5/4 times rated load = %.f W' %Rot_losses_S_4)\n",
      "print('Case(b): Full-load variable electric losses = %.f W' %FL_variable_loss)\n",
      "print('         Variable electric losses at 1/4 load = %.f W' %x1_variable_loss)\n",
      "print('         Variable electric losses at 1/2 load = %.f W' %x2_variable_loss)\n",
      "print('         Variable electric losses at 3/4 load = %.f W' %x3_variable_loss)\n",
      "print('         Variable electric losses at 5/4 load = %.f W' %x4_variable_loss)\n",
      "print('Case(c): Efficiency of motor at full load = %.1f percent' %n_FL)\n",
      "print('         Efficiency of motor at 1/4 load = %.1f percent' %n_1)\n",
      "print('         Efficiency of motor at 1/2 load = %.1f percent' %n_2)\n",
      "print('         Efficiency of motor at 3/4 load = %.1f percent' %n_3)\n",
      "print('         Efficiency of motor at 5/4 load = %.1f percent' %n_4)\n",
      "print('Case(d): Table 12-2 Losses and Efficiencies for Ex. 12-4')\n",
      "print('______________________________________________________________________________________________________________')\n",
      "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')\n",
      "print('______________________________________________________________________________________________________________')\n",
      "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))\n",
      "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))\n",
      "print('Rotational losses,')\n",
      "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))\n",
      "print('Variable electric losses,')\n",
      "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))\n",
      "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))\n",
      "print('______________________________________________________________________________________________________________')\n",
      "print('Efficiency \u03b7(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))\n",
      "print('______________________________________________________________________________________________________________')\n",
      "print('\\nNOTE: Changes in obtained answer from that of textbook is due to more precision')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Rotational loss at full load = 3420 W\n",
        "         Rotational loss at 1/4 times rated load = 3933 W\n",
        "         Rotational loss at 1/2 times rated load = 3762 W\n",
        "         Rotational loss at 3/4 times rated load = 3591 W\n",
        "         Rotational loss at 5/4 times rated load = 3249 W\n",
        "Case(b): Full-load variable electric losses = 6181 W\n",
        "         Variable electric losses at 1/4 load = 386 W\n",
        "         Variable electric losses at 1/2 load = 1545 W\n",
        "         Variable electric losses at 3/4 load = 3477 W\n",
        "         Variable electric losses at 5/4 load = 9658 W\n",
        "Case(c): Efficiency of motor at full load = 91.2 percent\n",
        "         Efficiency of motor at 1/4 load = 82.1 percent\n",
        "         Efficiency of motor at 1/2 load = 89.4 percent\n",
        "         Efficiency of motor at 3/4 load = 91.0 percent\n",
        "         Efficiency of motor at 5/4 load = 90.8 percent\n",
        "Case(d): Table 12-2 Losses and Efficiencies for Ex. 12-4\n",
        "______________________________________________________________________________________________________________\n",
        "\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\n",
        "______________________________________________________________________________________________________________\n",
        "Input(watts)\t\t\t 30750 \t\t 61500 \t\t 92250 \t\t 123000 \t\t 153750\n",
        "Field loss(watts)\t\t 1200 \t\t 1200 \t\t 1200 \t\t 1200 \t\t 1200\n",
        "Rotational losses,\n",
        " From part(a) (watts)\t\t 3932 \t\t 3762 \t\t 3591 \t\t 3420 \t\t 3249\n",
        "Variable electric losses,\n",
        " From part(b) (watts)\t\t 386 \t\t 1545 \t\t 3477 \t\t 6181 \t\t 9658\n",
        "Total of all losses(watts)\t 5519 \t\t 6507 \t\t 8268 \t\t 10801 \t\t 14107\n",
        "______________________________________________________________________________________________________________\n",
        "Efficiency \u03b7(percent)\t\t 82.1 \t\t 89.4 \t\t 91.0 \t\t 91.2 \t\t 90.8\n",
        "______________________________________________________________________________________________________________\n",
        "\n",
        "NOTE: Changes in obtained answer from that of textbook is due to more precision\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.5, Page number 415"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "P = 10000.0      #Power rating of the shunt generator(W)\n",
      "V = 230.0        #Voltage rating of the shunt generator(V)\n",
      "S = 1750.0       #Speed of the shunt generator(rpm)\n",
      "V_a = 245.0      #Voltage across armature(V)\n",
      "I_a = 2.0        #Armature current(A)\n",
      "R_a = 0.2        #Armature resistance(ohm)\n",
      "P_r = 489.2      #Shunt generator rotational losses(W)\n",
      "Vf_If = 230.0    #Shunt field circuit loss(W)\n",
      "I_a_rated = 44.5 #Rated armature current(A)\n",
      "\n",
      "#Calculation\n",
      "I_a = ((Vf_If+P_r)/R_a)**0.5             #Armature current at which max efficiency occurs(A)\n",
      "LF = I_a/I_a_rated                       #Load fraction\n",
      "LF_percent = LF*100                      #Load fraction(%)\n",
      "P_k = Vf_If+P_r\n",
      "n_max = P*LF/(P*LF+(Vf_If+P_r)+P_k)*100  #Maximum efficiency(%)\n",
      "LF_d = (P_k/(I_a_rated**2*R_a))**0.5     #Load fraction from fixed losses and rated variable losses\n",
      "\n",
      "#Result\n",
      "print('Case(a): Armature current at which maximum efficiency occurs , I_a = %.f A' %I_a)\n",
      "print('Case(b): Load fraction , L.F = %.1f percent = %.3f*rated' %(LF_percent,LF))\n",
      "print('Case(c): Maximum efiiciency , \u03b7_max = %.2f percent' %n_max)\n",
      "print('Case(d): Load fraction from fixed losses and rated variable losses , L.F = %.3f*rated' %LF_d)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Armature current at which maximum efficiency occurs , I_a = 60 A\n",
        "Case(b): Load fraction , L.F = 134.8 percent = 1.348*rated\n",
        "Case(c): Maximum efiiciency , \u03b7_max = 90.36 percent\n",
        "Case(d): Load fraction from fixed losses and rated variable losses , L.F = 1.348*rated\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.6, Page number 418"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "V = 240.0      #Voltage rating of dc shunt motor(V)\n",
      "hp = 25.0      #Power rating of dc shunt motor(hp)\n",
      "S = 1100.0     #Speed of the dc shunt motor(rpm)\n",
      "R_a = 0.15     #Armture resistance(ohm)\n",
      "R_f = 80.0     #Field resistance(ohm)\n",
      "I_L = 89.0     #Rated line current(A)\n",
      "\n",
      "#Calculation\n",
      "V_f = V               #Voltage across field winding(V)\n",
      "I_f = V_f/R_f         #Field current(A)\n",
      "I_a = I_L-I_f         #Armature current(A)\n",
      "P_o = hp*746          #Power rating of dc shunt motor(W)\n",
      "V_a = V               #Voltage across armature(V)\n",
      "E_c_fl = V_a-I_a*R_a  #Back EMF(V)\n",
      "E_c = E_c_fl\n",
      "P_d = E_c*I_a         #Power developed by the armature(W)\n",
      "P_r = P_d-P_o         #Full-load rotational losses(W)\n",
      "P_in = V*I_L          #Input power(W)\n",
      "n = P_o/P_in*100      #Full-load efficiency(%)  \n",
      "P_k = V_f*I_f+P_r     #Total constant losses(W)\n",
      "Ia = (P_k/R_a)**0.5   #Armature current for maximum efficiency(A)\n",
      "I_a_rated = I_a\n",
      "LF = Ia/I_a_rated     #Load fraction at which max efficiency is produced\n",
      "rated_input = V*I_L \n",
      "n_max = ((LF*rated_input)-2*P_k)/(LF*rated_input)*100  #Maximum efficiency(%)\n",
      "\n",
      "#Result\n",
      "print('Case(a): Power developed by the armature , P_d = %.1f W' %P_d)\n",
      "print('Case(b): Full-load rotational losses , P_r = %.1f W' %P_r)\n",
      "print('Case(c): Full-laod efficiency , \u03b7 = %.1f percent' %n)\n",
      "print('Case(d): Total constant losses , P_k = %.1f W' %P_k)\n",
      "print('Case(e): Armature current from maximum efficiency , I_a = %.1f A' %Ia)\n",
      "print('Case(f): Load fraction at which maximum efficiency is produced , L.F = %.1f ' %LF)\n",
      "print('Case(g): Maximum efficiency , \u03b7_max = %.1f percent' %n_max)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Power developed by the armature , P_d = 19530.6 W\n",
        "Case(b): Full-load rotational losses , P_r = 880.6 W\n",
        "Case(c): Full-laod efficiency , \u03b7 = 87.3 percent\n",
        "Case(d): Total constant losses , P_k = 1600.6 W\n",
        "Case(e): Armature current from maximum efficiency , I_a = 103.3 A\n",
        "Case(f): Load fraction at which maximum efficiency is produced , L.F = 1.2 \n",
        "Case(g): Maximum efficiency , \u03b7_max = 87.5 percent\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.7, Page number 420"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "V = 240.0      #Voltage rating of dc shunt motor(V)\n",
      "hp = 25.0      #Power rating of dc shunt motor(hp)\n",
      "S = 1100.0     #Speed of the dc shunt motor(rpm)\n",
      "R_a = 0.15     #Armture resistance(ohm)\n",
      "R_f = 80.0     #Field resistance(ohm)\n",
      "I_L = 89.0     #Rated line current(A)\n",
      "\n",
      "#Calculation\n",
      "V_f = V               #Voltage across field winding(V)\n",
      "I_f = V_f/R_f         #Field current(A)\n",
      "I_a = I_L-I_f         #Armature current(A)\n",
      "P_o = hp*746          #Power rating of dc shunt motor(W)\n",
      "V_a = V               #Voltage across armature(V)\n",
      "E_c_fl = V_a-I_a*R_a  #Back EMF(V)\n",
      "E_c = E_c_fl\n",
      "P_d = E_c*I_a         #Power developed by the armature(W)\n",
      "P_r = P_d-P_o         #Full-load rotational losses(W)\n",
      "P_in = V*I_L          #Input power(W)\n",
      "n = P_o/P_in*100      #Full-load efficiency(%)  \n",
      "P_k = V_f*I_f+P_r     #Total constant losses(W)\n",
      "Ia = (P_k/R_a)**0.5   #Armature current for maximum efficiency(A)\n",
      "I_a_rated = I_a\n",
      "LF = Ia/I_a_rated     #Load fraction at which max efficiency is produced\n",
      "rated_input = V*I_L \n",
      "n_max = ((LF*rated_input)-2*P_k)/(LF*rated_input)*100  #Maximum efficiency(%)\n",
      "\n",
      "#Result\n",
      "print('Case(a): Power developed by the armature , P_d = %.1f W' %P_d)\n",
      "print('Case(b): Full-load rotational losses , P_r = %.1f W' %P_r)\n",
      "print('Case(c): Full-laod efficiency , \u03b7 = %.1f percent' %n)\n",
      "print('Case(d): Total constant losses , P_k = %.1f W' %P_k)\n",
      "print('Case(e): Armature current from maximum efficiency , I_a = %.1f A' %Ia)\n",
      "print('Case(f): Load fraction at which maximum efficiency is produced , L.F = %.1f ' %LF)\n",
      "print('Case(g): Maximum efficiency , \u03b7_max = %.1f percent' %n_max)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Power developed by the armature , P_d = 19530.6 W\n",
        "Case(b): Full-load rotational losses , P_r = 880.6 W\n",
        "Case(c): Full-laod efficiency , \u03b7 = 87.3 percent\n",
        "Case(d): Total constant losses , P_k = 1600.6 W\n",
        "Case(e): Armature current from maximum efficiency , I_a = 103.3 A\n",
        "Case(f): Load fraction at which maximum efficiency is produced , L.F = 1.2 \n",
        "Case(g): Maximum efficiency , \u03b7_max = 87.5 percent\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.8, Page number 420"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "V = 240.0      #Voltage rating of dc shunt motor(V)\n",
      "hp = 5.0       #Power rating of dc shunt motor(hp)\n",
      "S_fl = 1100.0  #Speed of the dc shunt motor(rpm)\n",
      "R_a = 0.4      #Armture resistance(ohm)\n",
      "R_f = 240.0    #Field resistance(ohm)\n",
      "n = 0.75       #Full-load efficiency\n",
      "\n",
      "#Calculation\n",
      "#Case(a)\n",
      "V_L = V                    #Load voltage(V)\n",
      "P_o = hp*746               #Power rating of dc shunt motor(W)\n",
      "I_L = P_o/(n*V_L)          #Rated input line current(A)\n",
      "V_f = V                    #Voltage across field winding(V)\n",
      "I_f = V_f/R_f              #Field current(A)\n",
      "I_a = I_L-I_f              #Armature current(A)\n",
      "#Case(b)\n",
      "V_a = V                    #Voltage across armature(V)\n",
      "E_c_fl = V_a-I_a*R_a       #Back EMF(V)\n",
      "E_c = E_c_fl\n",
      "P_d = E_c*I_a              #Power developed in the armature at rated load(W)\n",
      "#Case(c)\n",
      "P_r = P_d-P_o              #Rotational losses at rated load(W)\n",
      "#Case(d)\n",
      "P_o_nl = 0                 #At no-load\n",
      "P_r_nl = P_r               #Rotational losses at no load(W)\n",
      "P_d_nl = P_r_nl\n",
      "#Case(e)\n",
      "I_a_nl = P_d_nl/V_a        #No-load armature current(A)\n",
      "#Case(f)\n",
      "E_c_nl = V                 #No-load voltage(V)\n",
      "E_c_fl = E_c               #Full-load voltage(V)\n",
      "S_nl = E_c_nl/E_c_fl*S_fl  #No-load speed(rpm)\n",
      "#Case(g)\n",
      "SR = (S_nl-S_fl)/S_fl*100  #Speed regulation(%)\n",
      "\n",
      "#Result\n",
      "print('Case(a): Rated input line current , I_L = %.2f A' %I_L)\n",
      "print('         Rated armature current , I_a = %.2f A' %I_a)\n",
      "print('Case(b): Power developed in the armature at rated load , P_d = %d W' %P_d)\n",
      "print('Case(c): Rotational losses at rated load , P_r = %d W' %P_r)\n",
      "print('Case(d): Rotational losses at no load , P_r = %d W' %P_r_nl)\n",
      "print('Case(e): No-load armature current , I_a(nl) = %.2f A' %I_a_nl)\n",
      "print('Case(f): No-load speed , S_nl = %.f rpm' %S_nl)\n",
      "print('Case(g): Speed regulation of the motor , SR = %.1f percent' %SR)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Rated input line current , I_L = 20.72 A\n",
        "         Rated armature current , I_a = 19.72 A\n",
        "Case(b): Power developed in the armature at rated load , P_d = 4577 W\n",
        "Case(c): Rotational losses at rated load , P_r = 847 W\n",
        "Case(d): Rotational losses at no load , P_r = 847 W\n",
        "Case(e): No-load armature current , I_a(nl) = 3.53 A\n",
        "Case(f): No-load speed , S_nl = 1137 rpm\n",
        "Case(g): Speed regulation of the motor , SR = 3.4 percent\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.9, Page number 421"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "V = 240.0      #Voltage rating of dc shunt motor(V)\n",
      "I_L = 55.0     #Rated line current(A) \n",
      "S = 1200.0     #Speed of the dc shunt motor(rpm)\n",
      "P_r = 406.4    #Rotational losses at rated load(W)\n",
      "R_f = 120.0    #Field resistance(ohm)\n",
      "R_a = 0.4      #Armture resistance(ohm)\n",
      "\n",
      "#Calculation\n",
      "#Case(a)\n",
      "V_f = V                    #Voltage across field winding(V)\n",
      "I_f = V_f/R_f              #Field current(A)\n",
      "I_a = I_L-I_f              #Armature current(A)\n",
      "V_a = V                    #Voltage across armature(V)\n",
      "E_c = V_a-I_a*R_a          #Back EMF(V)\n",
      "P_d = E_c*I_a              #Power developed by the armature at rated load(W)\n",
      "#Case(b)\n",
      "P_o = P_d-P_r              #Rated output power(W)\n",
      "P_o_hp = P_o/746           #Rated output power(hp)\n",
      "#Case(c)\n",
      "T_o = P_o_hp*5252/S        #Rated output torque(lb-ft)\n",
      "T_o_Nm = T_o*1.356         #Rated output torque(N-m)\n",
      "#Case(d)\n",
      "P_in = V*I_L               #Input power(W)\n",
      "n = (P_o/P_in)*100         #Efficiency at rated load(%)\n",
      "#Case(e)\n",
      "P_o_nl = 0                 #At no-load\n",
      "P_r_nl = P_r               #Rotational losses at no load(W)\n",
      "P_d_nl = P_r_nl\n",
      "I_a_nl = P_r_nl/V_a        #No-load armature current(A)\n",
      "E_c_nl = V                 #No-load voltage(V)\n",
      "E_c_fl = E_c               #Full-load voltage(V)\n",
      "S_fl = S                   #Full-load speed(rpm)\n",
      "S_nl = E_c_nl/E_c_fl*S_fl  #No-load speed(rpm)\n",
      "#Case(f)\n",
      "SR = (S_nl-S_fl)/S_fl*100  #Speed regulation(%)\n",
      "\n",
      "#Result\n",
      "print('Case(a): Counter EMF , E_c = %.1f V' %E_c)\n",
      "print('         Power developed at rated load , P_d = %.1f W' %P_d)\n",
      "print('Case(b): Rated output power , P_o = %d W' %P_o)\n",
      "print('         Rated output power , P_o = %d hp' %P_o_hp)\n",
      "print('Case(c): Rated output torque , T_o = %.2f lb-ft' %T_o)\n",
      "print('         Rated output torque , T_o = %d N-m' %T_o_Nm)\n",
      "print('Case(d): Efficiency at rated load , \u03b7 = %.1f percent' %n)\n",
      "print('Case(e): No-load armature current , I_a(nl)  = %.3f A' %I_a_nl)\n",
      "print('         No-load speed , S_nl = %.f rpm' %S_nl)\n",
      "print('Case(e): Speed regulation , SR = %.1f percent' %SR)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Counter EMF , E_c = 218.8 V\n",
        "         Power developed at rated load , P_d = 11596.4 W\n",
        "Case(b): Rated output power , P_o = 11190 W\n",
        "         Rated output power , P_o = 15 hp\n",
        "Case(c): Rated output torque , T_o = 65.65 lb-ft\n",
        "         Rated output torque , T_o = 89 N-m\n",
        "Case(d): Efficiency at rated load , \u03b7 = 84.8 percent\n",
        "Case(e): No-load armature current , I_a(nl)  = 1.693 A\n",
        "         No-load speed , S_nl = 1316 rpm\n",
        "Case(e): Speed regulation , SR = 9.7 percent\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.10, Page number 422"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "V = 125.0        #Voltage rating of generator(V)\n",
      "P_o = 12500.0    #Power rating of generator(W)\n",
      "P_hp = 20.0      #Power rating of motor(hp)\n",
      "R_a = 0.1        #Armature resistance(ohm)\n",
      "R_f = 62.5       #Field resistance(ohm)\n",
      "P_var = 1040.0   #Rated variable electric loss(W)\n",
      "\n",
      "#Calculation\n",
      "#Case(a)\n",
      "P_in = P_hp*746         #Power input to generator(W)\n",
      "n = P_o/P_in*100        #Efficiency(%)\n",
      "#Case(b)\n",
      "V_f = V                 #Voltage across shunt field winding(V)\n",
      "P_sh_loss = V_f**2/R_f  #Shunt field loss(W)\n",
      "#Case(c)\n",
      "V_L = V\n",
      "I_L = P_o/V_L           #Line current(A)\n",
      "I_f = V_f/R_f           #Field current(A)\n",
      "I_a = I_L+I_f           #Armature current(A)\n",
      "E_g = V_L+I_a*R_a       #Generated EMF(V)\n",
      "P_d1 = E_g*I_a          #Generated electric power(W)\n",
      "P_f = V_f*I_f\n",
      "P_d2 = P_o+P_var+P_f    #Generated electric power(W)\n",
      "#Case(d)\n",
      "P_d = P_d1\n",
      "P_r = P_in-P_d          #Rotational power loss(W)\n",
      "#Case(e)\n",
      "P_k = P_r+V_f*I_f       #Constant losses(W)\n",
      "Ia = (P_k/R_a)**0.5     #Armature current for max efficiency(A)\n",
      "#Case(f)\n",
      "I_a_rated = I_a         #Rated armature current(A)\n",
      "LF = Ia/I_a_rated       #Load fraction\n",
      "#Case(g)\n",
      "rated_output = 12500    #Rated output(W)\n",
      "n_max = (LF*rated_output)/((LF*rated_output)+(2*P_k))*100 #Maximum efficiency\n",
      "\n",
      "#Result\n",
      "print('Case(a): Efficiency , \u03b7 = %.f percent' %n)\n",
      "print('Case(b): Shunt field loss  = %d W' %P_sh_loss)\n",
      "print('Case(c): Generated electric power , P_d = %d W (Method 1)' %P_d1)\n",
      "print('         Generated electric power , P_d = %d W (Method 2)' %P_d2)\n",
      "print('Case(d): Rotational power loss , P_r = %.f W' %P_r)\n",
      "print('Case(e): Armature current for maximum efficiency , I_a = %.1f A' %Ia)\n",
      "print('Case(f): Load fraction for maximum efficiency , L.F = %.2f ' %LF)\n",
      "print('Case(g): Maximum efficiency , \u03b7 = %.2f percent' %n_max)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Efficiency , \u03b7 = 84 percent\n",
        "Case(b): Shunt field loss  = 250 W\n",
        "Case(c): Generated electric power , P_d = 13790 W (Method 1)\n",
        "         Generated electric power , P_d = 13790 W (Method 2)\n",
        "Case(d): Rotational power loss , P_r = 1130 W\n",
        "Case(e): Armature current for maximum efficiency , I_a = 117.5 A\n",
        "Case(f): Load fraction for maximum efficiency , L.F = 1.15 \n",
        "Case(g): Maximum efficiency , \u03b7 = 83.91 percent\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.11, Page number 422"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "V = 125.0        #Voltage rating of generator(V)\n",
      "P_o = 12500.0    #Power rating of generator(W)\n",
      "P_hp = 20.0      #Power rating of motor(hp)\n",
      "R_a = 0.1        #Armature resistance(ohm)\n",
      "R_f = 62.5       #Field resistance(ohm)\n",
      "P_var = 1040.0   #Rated variable electric loss(W)\n",
      "P_k = 1380.0     #Constant losses(W)\n",
      "LF_a = 25.0/100  #At rated output\n",
      "LF_b = 50.0/100  #At rated output\n",
      "LF_c = 75.0/100  #At rated output\n",
      "LF_d = 125.0/100 #At rated output\n",
      "\n",
      "#Calculation\n",
      "output = P_o\n",
      "P_a_rated = P_var\n",
      "n_a = output*LF_a/(output*LF_a+P_k+(LF_a**2)*P_a_rated)*100   #Efficiency of dc shunt generator(%)\n",
      "n_b = output*LF_b/(output*LF_b+P_k+(LF_b**2)*P_a_rated)*100   #Efficiency of dc shunt generator(%)\n",
      "n_c = output*LF_c/(output*LF_c+P_k+(LF_c**2)*P_a_rated)*100   #Efficiency of dc shunt generator(%)\n",
      "n_d = output*LF_d/(output*LF_d+P_k+(LF_d**2)*P_a_rated)*100   #Efficiency of dc shunt generator(%)\n",
      "\n",
      "#Result\n",
      "print('Case(a): Efficiency of dc generator at 25 percent rated output , \u03b7 = %.1f percent' %n_a)\n",
      "print('Case(b): Efficiency of dc generator at 50 percent rated output , \u03b7 = %.1f percent' %n_b)\n",
      "print('Case(c): Efficiency of dc generator at 75 percent rated output , \u03b7 = %.1f percent' %n_c)\n",
      "print('Case(d): Efficiency of dc generator at 125 percent rated output , \u03b7 = %.2f percent' %n_d)\n",
      "print('\\nNOTE: Calculation error in textbook for case(b)')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Efficiency of dc generator at 25 percent rated output , \u03b7 = 68.4 percent\n",
        "Case(b): Efficiency of dc generator at 50 percent rated output , \u03b7 = 79.2 percent\n",
        "Case(c): Efficiency of dc generator at 75 percent rated output , \u03b7 = 82.7 percent\n",
        "Case(d): Efficiency of dc generator at 125 percent rated output , \u03b7 = 83.87 percent\n",
        "\n",
        "NOTE: Calculation error in textbook for case(b)\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.12, Page number 426"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "kVA = 100.0           #Rating of the alternator(kVA)\n",
      "V  = 1100.0           #Rated voltage of the alternator(V)\n",
      "I_a_nl = 8.0          #No-load armature current(A)\n",
      "P_in_nl = 6000.0      #No-load Power input to the armature(W)\n",
      "V_oc = 1350.0         #Open-circuit line voltage(V)\n",
      "I_f = 18.0            #Field current(A)\n",
      "V_f = 125.0           #Voltage across field winding(V)\n",
      "R_a = 0.45            #Armature resistance(ohm/phase)\n",
      "I_a_rated = 52.5      #Rated armature current(A)\n",
      "\n",
      "#Calculation\n",
      "#Case(a)\n",
      "P_r = P_in_nl-3*(I_a_nl)**2*R_a   #Rotational loss of synchronous dynamo(W)\n",
      "#Case(b)\n",
      "P_f = V_f*I_f                     #Field copper loss(W)\n",
      "#Case(c)\n",
      "P_k = P_r+P_f                     #Fixed losses at rated synchronous speed(W)\n",
      "#Case(d)\n",
      "P_cu = 3*(I_a_rated)**2*R_a       #Electric armature copper loss at rated load(W)\n",
      "LF1 = 1.0/4                       #Load fraction\n",
      "LF2 = 1.0/2                       #Load fraction\n",
      "LF3 = 3.0/4                       #Load fraction\n",
      "P_cu_LF1 = P_cu*(LF1)**2          #Electric armature copper loss at 1/4 load(W)\n",
      "P_cu_LF2 = P_cu*(LF2)**2          #Electric armature copper loss at 1/2 load(W)\n",
      "P_cu_LF3 = P_cu*(LF3)**2          #Electric armature copper loss at 3/4 load(W)\n",
      "#Case(e)\n",
      "PF = 0.9                          #Power factor lagging\n",
      "n_1 = (LF1*kVA*1000*PF)/((LF1*kVA*1000*PF)+P_k+P_cu_LF1)*100   #Efficiency at 1/4 load\n",
      "n_2 = (LF2*kVA*1000*PF)/((LF2*kVA*1000*PF)+P_k+P_cu_LF2)*100   #Efficiency at 1/2 load\n",
      "n_3 = (LF3*kVA*1000*PF)/((LF3*kVA*1000*PF)+P_k+P_cu_LF3)*100   #Efficiency at 3/4 load\n",
      "n_fl = (kVA*1000*PF)/((kVA*1000*PF)+P_k+P_cu)*100              #Efficiency at rated load\n",
      "#Case(f)\n",
      "I_a_max = (P_k/(3*R_a))**0.5       #Armature current for max efficiency at 0.9 PF lagging(A)\n",
      "LF = I_a_max/I_a_rated             #Load fraction for max efficiency\n",
      "n_max = (LF*kVA*1000*PF)/((LF*kVA*1000*PF)+2*P_k)*100          #Max Efficiency 0.9 PF lagging(%) \n",
      "#Case(g)\n",
      "P_o = kVA*PF                       #Output power at 0.9 PF lagging(kW)\n",
      "I_a = I_a_rated\n",
      "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)\n",
      "\n",
      "#Result\n",
      "print('Case(a): Rotational loss of the synchronous dynamo , P_r = %.f W' %P_r)\n",
      "print('Case(b): Field copper loss , P_f = %.f W' %P_f)\n",
      "print('Case(c): Fixed losses at rated synchronous speed , P_k = %.f W' %P_k)\n",
      "print('Case(d): Electric armature copper loss at 1/4 rated load , P_cu = %.1f W' %P_cu_LF1)\n",
      "print('         Electric armature copper loss at 1/2 rated load , P_cu = %.1f W' %P_cu_LF2)\n",
      "print('         Electric armature copper loss at 3/4 rated load , P_cu = %.f W' %P_cu_LF3)\n",
      "print('         Electric armature copper loss at rated load , P_cu = %.f W' %P_cu)\n",
      "print('Case(e): Efficiency at 1/4 rated load , \u03b7 = %.1f percent' %n_1)\n",
      "print('         Efficiency at 1/2 rated load , \u03b7 = %.1f percent' %n_2)\n",
      "print('         Efficiency at 3/4 rated load , \u03b7 = %.1f percent' %n_3)\n",
      "print('         Efficiency at rated load , \u03b7 = %.1f percent' %n_fl)\n",
      "print('Case(f): Maximum efficiency at 0.9 PF lagging , \u03b7_max = %.1f percent' %n_max)\n",
      "print('Case(g): Armature power developed at 0.9 PF lagging at full load , P_d = %.2f kW' %P_d)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Rotational loss of the synchronous dynamo , P_r = 5914 W\n",
        "Case(b): Field copper loss , P_f = 2250 W\n",
        "Case(c): Fixed losses at rated synchronous speed , P_k = 8164 W\n",
        "Case(d): Electric armature copper loss at 1/4 rated load , P_cu = 232.6 W\n",
        "         Electric armature copper loss at 1/2 rated load , P_cu = 930.2 W\n",
        "         Electric armature copper loss at 3/4 rated load , P_cu = 2093 W\n",
        "         Electric armature copper loss at rated load , P_cu = 3721 W\n",
        "Case(e): Efficiency at 1/4 rated load , \u03b7 = 72.8 percent\n",
        "         Efficiency at 1/2 rated load , \u03b7 = 83.2 percent\n",
        "         Efficiency at 3/4 rated load , \u03b7 = 86.8 percent\n",
        "         Efficiency at rated load , \u03b7 = 88.3 percent\n",
        "Case(f): Maximum efficiency at 0.9 PF lagging , \u03b7_max = 89.1 percent\n",
        "Case(g): Armature power developed at 0.9 PF lagging at full load , P_d = 95.97 kW\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.13, Page number 430"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "kVA = 1000.0       #Rating of the alternator(kVA)\n",
      "V  = 2300.0        #Rated voltage of the alternator(V)\n",
      "hp = 100.0         #Power rating of the dc motor(hp)\n",
      "V_motor  = 240.0   #Rated voltage of the motor(V)\n",
      "P_1 = 7.5          #Motor output(kW). TEST 1\n",
      "P_2 = 16.0         #Motor output(kW). TEST 2\n",
      "VfIf = 14.0        #Field losses(kW)\n",
      "P_f = VfIf         #Field losses(kW)\n",
      "P_3 = 64.2         #Motor output(kW). TEST 3\n",
      "I_sc = 251.0       #Short circuit current(A)\n",
      "V_L = 1443.0       #Line voltage(V). TEST 4\n",
      "R_a = 0.3          #Armature resistance(ohm)\n",
      "\n",
      "#Calculation\n",
      "#Case(a)\n",
      "P_r = P_2                      #Rotational losses(kW). From TEST 2\n",
      "#Case(b)\n",
      "P_cu = P_3-P_1                 #Full-load armature copper loss(kW)\n",
      "#Case(c)\n",
      "E_gL = V_L                     #Generated line voltage(V)\n",
      "Z_s = (E_gL/3**0.5)/I_sc       #Synchronous impedance of the armature(ohm)\n",
      "#Case(d)\n",
      "X_s = (Z_s**2-R_a**2)**0.5     #Synchronous reactance of the armature(ohm)\n",
      "#Case(e)\n",
      "PF = 0.8                       #Lagging power factor\n",
      "sin_theta = (1-PF**2)**0.5     #Sin\u03b8\n",
      "V_p = V/3**0.5                 #Phase voltage(V)\n",
      "I_a = I_sc                     #Armature current(A)\n",
      "E_gp = complex((V_p*PF+I_a*R_a),(V_p*sin_theta+I_a*X_s)) #Generated phase voltage(V)\n",
      "V_nl = abs(E_gp)                #No-load voltage(V)\n",
      "V_fl = V_p                      #Full-load voltage(V)\n",
      "VR = (V_nl-V_fl)/V_fl*100       #Alternator voltage regulation(%)\n",
      "#Case(f)\n",
      "LF = 1.0                        #Load fraction\n",
      "n_rated = (LF*kVA*PF)/((LF*kVA*PF)+(P_f+P_r)+P_cu)*100   #Efficiency at 0.8 lagging PF(%)\n",
      "#Case(g)\n",
      "P_k = (P_f+P_r)                 #Constant losses(kW)\n",
      "L_F = (P_k/P_cu)**0.5           #Load fraction for max efficiency\n",
      "n_max = (L_F*kVA*PF)/((L_F*kVA*PF)+2*P_k)*100            #Max Efficiency at 0.8 lagging PF(%)\n",
      "#Case(h)\n",
      "PF_h = 1.0                      #Unity PF\n",
      "P_o = kVA*PF_h                  #Output power(kW)\n",
      "P_d = P_o+(3*(I_a)**2*R_a/1000)+(VfIf)                   #Armature power developed at rated-load unity PF(kW) \n",
      "\n",
      "#Result\n",
      "print('Case(a): Rotational losses , P_r = %.1f kW' %P_r)\n",
      "print('Case(b): Full-load armature copper loss , P_cu = %.1f kW' %P_cu)\n",
      "print('Case(c): Synchronous impedance of the armature , Z_s = %.2f \u03a9' %Z_s)\n",
      "print('Case(d): Synchronous reactance of the armature , jX_s = %.2f \u03a9' %X_s)\n",
      "print('Case(e): Alternator voltage regulation at 0.8 PF lagging , VR = %.2f percent' %VR)\n",
      "print('Case(f): Alternator efficiency at 0.8 PF lagging at rated load , \u03b7_rated = %.1f percent' %n_rated)\n",
      "print('Case(g): Maximum efficiency at 0.8 PF lagging , \u03b7_max = %.2f percent' %n_max)\n",
      "print('Case(h): Power developed by the alternator armature at rated load, unity PF , P_d = %.f kW' %P_d)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Rotational losses , P_r = 16.0 kW\n",
        "Case(b): Full-load armature copper loss , P_cu = 56.7 kW\n",
        "Case(c): Synchronous impedance of the armature , Z_s = 3.32 \u03a9\n",
        "Case(d): Synchronous reactance of the armature , jX_s = 3.31 \u03a9\n",
        "Case(e): Alternator voltage regulation at 0.8 PF lagging , VR = 49.47 percent\n",
        "Case(f): Alternator efficiency at 0.8 PF lagging at rated load , \u03b7_rated = 90.2 percent\n",
        "Case(g): Maximum efficiency at 0.8 PF lagging , \u03b7_max = 90.65 percent\n",
        "Case(h): Power developed by the alternator armature at rated load, unity PF , P_d = 1071 kW\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.14, Page number 434"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "P = 4.0       #Number of poles in Induction motor\n",
      "f = 60.0      #Frequency(Hz)\n",
      "V = 220.0     #Rated voltage of IM(V)\n",
      "hp_IM = 5.0   #Power rating of IM(hp)\n",
      "PF = 0.9      #Power factor\n",
      "I_L = 16.0    #Line current(A)\n",
      "S = 1750.0    #Speed of IM(rpm)\n",
      "I_nl = 6.5    #No-load line current(A)\n",
      "V_nl = 220.0  #No-load line voltage(V)\n",
      "P_nl = 300.0  #No-load power reading(W)\n",
      "I_br = 16.0   #Blocked rotor line current(A)\n",
      "V_br = 50.0   #Blocked rotor voltage(V)\n",
      "P_br = 800.0  #Blocked rotor power reading(W)\n",
      "\n",
      "#Calculation\n",
      "#Case(a)\n",
      "P_cu = P_br                   #Full-load equivalent copper loss(W)\n",
      "I_1 = I_br                    #Primary current(A)\n",
      "R_e1 = P_cu/(3.0/2*I_1**2)    #Equivalent total resistance of IM(ohm) \n",
      "#Case(b)\n",
      "P_in = P_nl                   #Input power to IM(W)\n",
      "I1 = I_nl                     #Input current(A)\n",
      "P_r = P_in-(3.0/2*I1**2*R_e1) #Rotational losses(W)\n",
      "#Case(c)\n",
      "LF1 = 1.0/4                   #Load fraction\n",
      "LF2 = 1.0/2                   #Load fraction\n",
      "LF3 = 3.0/4                   #Load fraction\n",
      "LF4 = 5.0/4                   #Load fraction\n",
      "P_cu_LF1 = LF1**2*P_cu        #Equivalent copper loss at 1/4 rated-load(W)\n",
      "P_cu_LF2 = LF2**2*P_cu        #Equivalent copper loss at 1/2 rated-load(W)\n",
      "P_cu_LF3 = LF3**2*P_cu        #Equivalent copper loss at 3/4 rated-load(W)\n",
      "P_cu_LF4 = LF4**2*P_cu        #Equivalent copper loss at 5/4 rated-load(W)\n",
      "#Case(d)\n",
      "Full_load_input = 3**0.5*V*I_L*PF #Full-load input(W)\n",
      "n_rated = (Full_load_input-(P_r+P_cu))/(Full_load_input)*100              #Efficiency at rated load(%)\n",
      "n_LF1 = (Full_load_input*LF1-(P_r+P_cu_LF1))/(Full_load_input*LF1)*100    #Efficiency at 1/4 rated load(%)\n",
      "n_LF2 = (Full_load_input*LF2-(P_r+P_cu_LF2))/(Full_load_input*LF2)*100    #Efficiency at 1/2 rated load(%)\n",
      "n_LF3 = (Full_load_input*LF3-(P_r+P_cu_LF3))/(Full_load_input*LF3)*100    #Efficiency at 3/4 rated load(%)\n",
      "n_LF4 = (Full_load_input*LF4-(P_r+P_cu_LF4))/(Full_load_input*LF4)*100    #Efficiency at 5/4 rated load(%)\n",
      "#Case(e)\n",
      "P_o = (Full_load_input*n_rated/100)/746          #Output hp at 1/4 rated load\n",
      "P_o_LF1 = (Full_load_input*LF1*n_LF1/100)/746    #Output hp at 1/4 rated load\n",
      "P_o_LF2 = (Full_load_input*LF2*n_LF2/100)/746    #Output hp at 1/2 rated load\n",
      "P_o_LF3 = (Full_load_input*LF3*n_LF3/100)/746    #Output hp at 3/4 rated load\n",
      "P_o_LF4 = (Full_load_input*LF4*n_LF4/100)/746    #Output hp at 5/4 rated load\n",
      "#Case(f)\n",
      "hp = P_o                                         #Rated output(hp)\n",
      "T_o = P_o*5252/S                                 #Output torque at full-load(lb-ft)\n",
      "T_o_Nm = T_o*1.356                               #Output torque at full-load(N-m)\n",
      "\n",
      "#Result\n",
      "print('Case(a): Equivalent total resistance of IM between lines , R_e1 = %.3f \u03a9' %R_e1)\n",
      "print('Case(b): Rotational losses , P_r = %.f W' %P_r)\n",
      "print('Case(c): Equivalent copper loss at full-load , P_cu = %d W' %P_cu)\n",
      "print('         Equivalent copper loss at 1/4 rated load , P_cu = %d W' %P_cu_LF1)\n",
      "print('         Equivalent copper loss at 1/2 rated load , P_cu = %d W' %P_cu_LF2)\n",
      "print('         Equivalent copper loss at 3/4 rated load , P_cu = %d W' %P_cu_LF3)\n",
      "print('         Equivalent copper loss at 5/4 rated load , P_cu = %d W' %P_cu_LF4)\n",
      "print('Case(d): Efficiency at rated load , \u03b7 = %.1f percent' %n_rated)\n",
      "print('         Efficiency at 1/4 rated load , \u03b7 = %.1f percent' %n_LF1)\n",
      "print('         Efficiency at 1/2 rated load , \u03b7 = %.1f percent' %n_LF2)\n",
      "print('         Efficiency at 3/4 rated load , \u03b7 = %.1f percent' %n_LF3)\n",
      "print('         Efficiency at 5/4 rated load , \u03b7 = %.1f percent' %n_LF4)\n",
      "print('Case(e): Output horsepower at rated load , P_o = %.2f hp' %P_o)\n",
      "print('         Output horsepower at 1/4 rated load , P_o = %.3f hp' %P_o_LF1)\n",
      "print('         Output horsepower at 1/2 rated load , P_o = %.3f hp' %P_o_LF2)\n",
      "print('         Output horsepower at 3/4 rated load , P_o = %.2f hp' %P_o_LF3)\n",
      "print('         Output horsepower at 5/4 rated load , P_o = %.2f hp' %P_o_LF4)\n",
      "print('Case(f): Output torque at full-load , T_o = %.1f lb-ft' %T_o)\n",
      "print('         Output torque at full-load , T_o = %.2f N-m' %T_o_Nm)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Equivalent total resistance of IM between lines , R_e1 = 2.083 \u03a9\n",
        "Case(b): Rotational losses , P_r = 168 W\n",
        "Case(c): Equivalent copper loss at full-load , P_cu = 800 W\n",
        "         Equivalent copper loss at 1/4 rated load , P_cu = 50 W\n",
        "         Equivalent copper loss at 1/2 rated load , P_cu = 200 W\n",
        "         Equivalent copper loss at 3/4 rated load , P_cu = 450 W\n",
        "         Equivalent copper loss at 5/4 rated load , P_cu = 1250 W\n",
        "Case(d): Efficiency at rated load , \u03b7 = 82.4 percent\n",
        "         Efficiency at 1/4 rated load , \u03b7 = 84.1 percent\n",
        "         Efficiency at 1/2 rated load , \u03b7 = 86.6 percent\n",
        "         Efficiency at 3/4 rated load , \u03b7 = 85.0 percent\n",
        "         Efficiency at 5/4 rated load , \u03b7 = 79.3 percent\n",
        "Case(e): Output horsepower at rated load , P_o = 6.06 hp\n",
        "         Output horsepower at 1/4 rated load , P_o = 1.547 hp\n",
        "         Output horsepower at 1/2 rated load , P_o = 3.184 hp\n",
        "         Output horsepower at 3/4 rated load , P_o = 4.69 hp\n",
        "         Output horsepower at 5/4 rated load , P_o = 7.29 hp\n",
        "Case(f): Output torque at full-load , T_o = 18.2 lb-ft\n",
        "         Output torque at full-load , T_o = 24.65 N-m\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.15, Page number 438"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "pole = 4.0    #Number of poles in Induction motor\n",
      "f = 60.0      #Frequency(Hz)\n",
      "V = 220.0     #Rated voltage of IM(V)\n",
      "hp_IM = 5.0   #Power rating of IM(hp)\n",
      "PF = 0.9      #Power factor\n",
      "I_L = 16.0    #Line current(A)\n",
      "S_r = 1750.0  #Speed of IM(rpm)\n",
      "I_nl = 6.5    #No-load line current(A)\n",
      "V_nl = 220.0  #No-load line voltage(V)\n",
      "P_nl = 300.0  #No-load power reading(W)\n",
      "I_br = 16.0   #Blocked rotor line current(A)\n",
      "V_br = 50.0   #Blocked rotor voltage(V)\n",
      "P_br = 800.0  #Blocked rotor power reading(W)\n",
      "R_dc = 1.0    #DC resistance between lines(ohm)\n",
      "V = 220.0     #Voltage rating(V)\n",
      "P_input = 5500.0 #Power drawn(W)\n",
      "\n",
      "#Calculation\n",
      "R_e1 = 1.25*R_dc                    #Equivalent total resistance of IM(ohm)\n",
      "P_in = P_nl                         #Input power to IM(W)\n",
      "I1 = I_nl                           #Input current(A)\n",
      "P_r = P_in-(3.0/2*(I1)**2*R_e1)     #Rotational losses(W)\n",
      "I_1 = I_L\n",
      "SCL_fl = 3.0/2*(I_1)**2*R_e1        #Stator copper loss at full-load(W)\n",
      "SPI = P_input                       #Stator power input(W)\n",
      "RPI = SPI-SCL_fl                    #Rotor power input(W)\n",
      "S = (120*f/pole)                    #Speed of synchronous magnetic field(rpm)\n",
      "s = (S-S_r)/S                       #Slip\n",
      "RPD_fl = RPI*(1-s)                  #Rotor power developed(W)\n",
      "RPO_fl = RPD_fl-P_r                 #Rotor power output(W)\n",
      "#Case(a)\n",
      "P_o = RPO_fl\n",
      "n_fl = (P_o/P_input)*100            #Full-load efficiency(%)\n",
      "#Case(b)\n",
      "hp = P_o/746                        #Output horsepower at full load\n",
      "T_o = hp*5252/S_r                   #Output torque(lb-ft)\n",
      "T_o_Nm = T_o*1.356                  #Output torque(N-m)\n",
      "\n",
      "#Result\n",
      "print('Case(a): Full-load efficiency , \u03b7_fl = %.1f percent' %n_fl)\n",
      "print('Case(b): Output horsepower , hp = %.2f hp at full load' %hp)\n",
      "print('         Output torque , T_o = %.1f lb-ft = %.1f N-m' %(T_o,T_o_Nm))\n",
      "print('Case(c): Comparison of results')\n",
      "print('\\t\\t\\t\\t Ex. 12-14 \\t\\t Ex. 12-15')\n",
      "print('________________________________________________________________________')\n",
      "print('\u03b7_fl(percent)\\t\\t\\t 82.4 \\t\\t\\t %.1f' %n_fl)\n",
      "print('Rated output(hp)\\t\\t 6.06 \\t\\t\\t %.2f' %hp)\n",
      "print('Rated output torque(lb-ft)\\t 18.2 \\t\\t\\t %.1f' %T_o)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Full-load efficiency , \u03b7_fl = 84.7 percent\n",
        "Case(b): Output horsepower , hp = 6.25 hp at full load\n",
        "         Output torque , T_o = 18.7 lb-ft = 25.4 N-m\n",
        "Case(c): Comparison of results\n",
        "\t\t\t\t Ex. 12-14 \t\t Ex. 12-15\n",
        "________________________________________________________________________\n",
        "\u03b7_fl(percent)\t\t\t 82.4 \t\t\t 84.7\n",
        "Rated output(hp)\t\t 6.06 \t\t\t 6.25\n",
        "Rated output torque(lb-ft)\t 18.2 \t\t\t 18.7\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.16, Page number 440"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "import cmath\n",
      "import numpy\n",
      "\n",
      "#Variable declaration\n",
      "P = 6.0            #Number of poles in SCIM \n",
      "S_r = 1176.0       #Rated rotor speed(rpm)\n",
      "V = 220.0          #Voltage rating of SCIM(V)\n",
      "f = 60.0           #Frequency(Hz)\n",
      "P_hp = 7.5         #Power rating of SCIM(hp)\n",
      "R_ap = 0.3         #Armature resistance(ohm)\n",
      "R_r = 0.144        #Rotor resistance(ohm)\n",
      "jXm = 13.5         #Reactance(ohm)\n",
      "jXs = 0.5          #Synchronous reactance(ohm)\n",
      "jXlr = 0.2         #Locked rotor reactance(ohm)\n",
      "P_r = 300.0        #Total rotational losses(W)\n",
      "\n",
      "#Calculation\n",
      "#Case(a)\n",
      "S = 120*f/P        #Speed of the rotating magnetic field(rpm)\n",
      "s = (S-S_r)/S      #Slip\n",
      "R_r_s = R_r/s\n",
      "V_p = V/3**0.5     #Voltage per phase(V)\n",
      "I1_1 = complex(R_ap,jXm+jXs)\n",
      "I1_2 = complex(0,-jXm)\n",
      "I2_1 = complex(0,-jXm)\n",
      "I2_2 = complex(R_r/s,jXm+jXlr)\n",
      "V_1 = V_p\n",
      "V_2 = 0\n",
      "A = [[I1_1,I2_1],[I1_2,I2_2]]        #Matrix containing above mesh eqns array\n",
      "delta = numpy.linalg.det(A)          #Determinant of A\n",
      "#Case(b)\n",
      "I_p = numpy.linalg.det([[V_1,I2_1],[V_2,I2_2]])/delta #Stator armature current(A)\n",
      "I_1 = I_p\n",
      "#Case(c)\n",
      "I_r = numpy.linalg.det([[I1_1,V_1],[I1_2,V_2]])/delta #Rotor armature current(A)\n",
      "I_2 = I_r\n",
      "#Case(d)\n",
      "theta_1 = cmath.phase(I_p)*180/math.pi           #Motor PF angle(degrees)\n",
      "cos_theta1 = math.cos(theta_1*math.pi/180)       #Motor PF\n",
      "#Case(e)\n",
      "SPI = V_p*abs(I_p)*cos_theta1                    #Stator power input(W)\n",
      "#Case(f)\n",
      "SCL = abs(I_p)**2*R_ap                           #Stator Copper Loss(W)\n",
      "#Case(g)\n",
      "RPI = SPI-SCL                                    #Rotor power input(W) Method 1\n",
      "RPI_2 = abs(I_r)**2*(R_r/s)                      #Rotor power input(W) Method 2\n",
      "#Case(h)\n",
      "RCL = s*RPI                                      #Rotor copper losses(W)\n",
      "#Case(i)\n",
      "RPD_1 = RPI-RCL                                  #Rotor power developed(W) Method 1\n",
      "RPD_2 = RPI*(1-s)                                #Rotor power developed(W) Method 2\n",
      "#Case(j)\n",
      "RPO = 3*RPD_1-P_r                                #Total three-phase rotor power output(W)\n",
      "#Case(k)\n",
      "P_to = RPO                                       #Total rotor power at the motor pulley(W)\n",
      "T_o = 7.04*(P_to/S_r)                            #Total 3-phase torque(lb-ft)\n",
      "#Case(l)\n",
      "hp = P_to/746.0                                  #Output horsepower(hp)\n",
      "#Case(m)\n",
      "P_in = 3*SPI                                     #Input power to stator(W)\n",
      "n = P_to/P_in*100                                #Motor efficiency at rated load(%)\n",
      "\n",
      "#Result\n",
      "print('Case(a): Slip , s = %.2f' %s)\n",
      "print('         R_r/s = %.1f \u03a9' %R_r_s)\n",
      "print('Case(b): Stator armature current per phase , I_p = %.2f\u2220%.2f\u00b0 A' %(abs(I_p),cmath.phase(I_p)*180/math.pi))\n",
      "print('Case(c): Rotor current per phase , I_r = %.1f\u2220%.2f\u00b0 A' %(abs(I_r),cmath.phase(I_r)*180/math.pi))\n",
      "print('Case(d): Motor power factor , cos\u04e8 = %.3f' %cos_theta1)\n",
      "print('Case(e): Stator power input per phase , SPI = %d W' %SPI)\n",
      "print('Case(f): Stator copper loss per phase , SCL = %.1f W' %SCL)\n",
      "print('Case(g): Rotor power input per phase , RPI = %.2f W (Method 1)' %RPI)\n",
      "print('         Rotor power input per phase , RPI = %.2f W (Method 2)' %RPI_2)\n",
      "print('Case(h): Rotor copper loss per phase , RCL = %.1f W' %RCL)\n",
      "print('Case(i): Rotor power developed per phase , RPD = %.1f W (Method 1)' %RPD_1)\n",
      "print('         Rotor power developed per phase , RPD = %.1f W (Method 2)' %RPD_2)\n",
      "print('Case(j): Total three-phase rotor power output at shaft , RPO = %.1f W' %RPO)\n",
      "print('Case(k): Total torque developed at output , T_o = %.2f lb-ft' %T_o)\n",
      "print('Case(l): Horsepower output , hp = %.2f hp' %hp)\n",
      "print('Case(m): Efficiency at rated load , \u03b7 = %.2f percent' %n)\n",
      "print('Case(n): Power flow diagram is shown in textbook Fig. 12-12 page no 441')\n",
      "print('\\nNOTE: Changes in obtained answer from that of textbook is due to more precision i.e more number of decimal places')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Slip , s = 0.02\n",
        "         R_r/s = 7.2 \u03a9\n",
        "Case(b): Stator armature current per phase , I_p = 18.69\u2220-31.75\u00b0 A\n",
        "Case(c): Rotor current per phase , I_r = 16.3\u2220-4.03\u00b0 A\n",
        "Case(d): Motor power factor , cos\u04e8 = 0.850\n",
        "Case(e): Stator power input per phase , SPI = 2018 W\n",
        "Case(f): Stator copper loss per phase , SCL = 104.8 W\n",
        "Case(g): Rotor power input per phase , RPI = 1913.99 W (Method 1)\n",
        "         Rotor power input per phase , RPI = 1913.99 W (Method 2)\n",
        "Case(h): Rotor copper loss per phase , RCL = 38.3 W\n",
        "Case(i): Rotor power developed per phase , RPD = 1875.7 W (Method 1)\n",
        "         Rotor power developed per phase , RPD = 1875.7 W (Method 2)\n",
        "Case(j): Total three-phase rotor power output at shaft , RPO = 5327.1 W\n",
        "Case(k): Total torque developed at output , T_o = 31.89 lb-ft\n",
        "Case(l): Horsepower output , hp = 7.14 hp\n",
        "Case(m): Efficiency at rated load , \u03b7 = 87.96 percent\n",
        "Case(n): Power flow diagram is shown in textbook Fig. 12-12 page no 441\n",
        "\n",
        "NOTE: Changes in obtained answer from that of textbook is due to more precision i.e more number of decimal places\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.17, Page number 442"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "V = 220.0             #Voltage rating of SCIM(V)\n",
      "P_hp = 7.5            #Power rating of SCIM(hp)\n",
      "kVA_up_limit = 7.99   #Upper limit of starting kVA/hp\n",
      "kVA_low_limit = 7.1   #Lower limit of starting kVA/hp\n",
      "\n",
      "#Calculation\n",
      "I_s_u = kVA_up_limit*P_hp*1000/(3**0.5*V)  #Upper limit of starting current(A)\n",
      "I_s_l = kVA_low_limit*P_hp*1000/(3**0.5*V) #Lower limit of starting current(A)\n",
      "\n",
      "#Result\n",
      "print('Case(a): Upper limit of the starting current , I_s = %.1f A' %I_s_u)\n",
      "print('Case(b): Lower limit of the starting current , I_s = %.1f A' %I_s_l)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Upper limit of the starting current , I_s = 157.3 A\n",
        "Case(b): Lower limit of the starting current , I_s = 139.7 A\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.18, Page number 442"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "import cmath\n",
      "import numpy\n",
      "\n",
      "#Variable declaration\n",
      "P = 6.0            #Number of poles in SCIM \n",
      "S_r = 1176.0       #Rated rotor speed(rpm)\n",
      "V = 220.0          #Voltage rating of SCIM(V)\n",
      "f = 60.0           #Frequency(Hz)\n",
      "P_hp = 7.5         #Power rating of SCIM(hp)\n",
      "R_ap = 0.3         #Armature resistance(ohm)\n",
      "R_r = 0.144        #Rotor resistance(ohm)\n",
      "jXm = 13.5         #Reactance(ohm)\n",
      "jXs = 0.5          #Synchronous reactance(ohm)\n",
      "jXlr = 0.2         #Locked rotor reactance(ohm)\n",
      "P_r = 300.0        #Total rotational losses(W)\n",
      "s = 1.0            #Unity slip\n",
      "\n",
      "#Calculation\n",
      "R_r_s = R_r/s\n",
      "V_p = V/3**0.5     #Voltage per phase(V)\n",
      "I1_1 = complex(R_ap,jXm+jXs)\n",
      "I1_2 = complex(0,-jXm)\n",
      "I2_1 = complex(0,-jXm)\n",
      "I2_2 = complex(R_r/s,jXm+jXlr)\n",
      "V_1 = V_p\n",
      "V_2 = 0\n",
      "A = [[I1_1,I2_1],[I1_2,I2_2]]        #Matrix containing above mesh eqns array\n",
      "delta = numpy.linalg.det(A)          #Determinant of A\n",
      "#Case(a)\n",
      "I_s = numpy.linalg.det([[V_1,I2_1],[V_2,I2_2]])/delta #Stator armature current(A)\n",
      "I_1 = I_s\n",
      "#Case(b)\n",
      "theta = cmath.phase(I_s)*180/math.pi     #Phase angle of Stator armature current(degree)\n",
      "cos_theta = math.cos(theta*math.pi/180)  #PF of the motor at starting\n",
      "\n",
      "#Result\n",
      "print('Case(a): Starting stator current of the SCIM , I_s = I_1 = %.1f\u2220%.1f\u00b0 A' %(abs(I_s),theta))\n",
      "print('Case(b): Power factor of the motor at starting , cos\u03b8 = %.3f ' %cos_theta)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Starting stator current of the SCIM , I_s = I_1 = 153.9\u2220-57.8\u00b0 A\n",
        "Case(b): Power factor of the motor at starting , cos\u03b8 = 0.533 \n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.19, Page number 445"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Variable declaration\n",
      "V = 220.0         #Rated voltage of SCIM(V)\n",
      "f = 60.0          #Frequency(Hz)\n",
      "P = 4.0           #Number of poles\n",
      "PF = 0.85         #Power factor of capacitor-start IM\n",
      "hp_IM = 5.0       #Power rating of IM(hp)\n",
      "I_L = 28.0        #Rated line current(A)\n",
      "S_r = 1620.0      #Rotor speed of IM(rpm)\n",
      "I_nl = 6.4        #No-load line current(A)\n",
      "V_nl = 220.0      #No-load line voltage(V)\n",
      "P_nl = 239.0      #No-load power reading(W)\n",
      "s_nl = 0.01       #No-load slip\n",
      "I_br = 62.0       #Blocked rotor line current(A)\n",
      "V_br = 64.0       #Blocked rotor voltage(V)\n",
      "P_br = 1922.0     #Blocked rotor power reading(W)\n",
      "s_br = 1.0        #Blocked rotor slip\n",
      "\n",
      "#Calculation\n",
      "#Case(a)\n",
      "R_els = P_br/I_br**2           #Equivalent total resistance of IM(ohm)\n",
      "#Case(b)\n",
      "P_in = P_nl                    #Input power to IM(W)\n",
      "I_ls = I_nl                    #Input current(A)\n",
      "P_ro = P_in-(I_ls**2*R_els)    #Rotational losses(W)\n",
      "#Case(c)\n",
      "S = (120*f/P)                  #Speed of synchronous magnetic field(rpm)\n",
      "S_fl = S_r                     #Full-load rotor speed of IM(rpm) \n",
      "s_fl = (S-S_fl)/S              #Full-load Slip \n",
      "LF1 = 1.0/4                    #Load fraction\n",
      "LF2 = 1.0/2                    #Load fraction\n",
      "LF3 = 3.0/4                    #Load fraction\n",
      "LF4 = 5.0/4                    #Load fraction\n",
      "s_LF1 = s_fl*LF1               #slip at 1/4 rated load\n",
      "s_LF2 = s_fl*LF2               #slip at 1/2 rated load\n",
      "s_LF3 = s_fl*LF3               #slip at 3/4 rated load\n",
      "s_LF4 = s_fl*LF4               #slip at 5/4 rated load\n",
      "#Case(d)\n",
      "s_o = s_nl                          #No-load slip\n",
      "P_rs_fl = P_ro*(1-s_fl)/(1-s_o)     #Rotational losses rated load(W)\n",
      "P_rs_LF1 = P_ro*(1-s_LF1)/(1-s_o)   #Rotational losses at 1/4 rated load(W)\n",
      "P_rs_LF2 = P_ro*(1-s_LF2)/(1-s_o)   #Rotational losses at 1/2 rated load(W)\n",
      "P_rs_LF3 = P_ro*(1-s_LF3)/(1-s_o)   #Rotational losses at 3/4 rated load(W)\n",
      "P_rs_LF4 = P_ro*(1-s_LF4)/(1-s_o)   #Rotational losses at 5/4 rated load(W)\n",
      "#Case(e)\n",
      "Ils = I_L                           #Line current(A)\n",
      "P_cu_fl = Ils**2*R_els              #Equivalent copper loss at full-load slip(W)\n",
      "P_cu_LF1 = LF1**2*P_cu_fl           #Equivalent copper loss at 1/4 rated load(W)\n",
      "P_cu_LF2 = LF2**2*P_cu_fl           #Equivalent copper loss at 1/2 rated load(W)\n",
      "P_cu_LF3 = LF3**2*P_cu_fl           #Equivalent copper loss at 3/4 rated load(W)\n",
      "P_cu_LF4 = LF4**2*P_cu_fl           #Equivalent copper loss at 5/4 rated load(W)\n",
      "#Case(f)\n",
      "Input = V*I_L*PF                    #Input to single phase capacitor start IM(W)\n",
      "n_LF1 = (Input*LF1-(P_rs_LF1+P_cu_LF1))/(Input*LF1)*100   #Efficiency at 1/4 rated load(%)\n",
      "n_LF2 = (Input*LF2-(P_rs_LF2+P_cu_LF2))/(Input*LF2)*100   #Efficiency at 1/2 rated load(%)\n",
      "n_LF3 = (Input*LF3-(P_rs_LF3+P_cu_LF3))/(Input*LF3)*100   #Efficiency at 3/4 rated load(%)\n",
      "n_LF4 = (Input*LF4-(P_rs_LF4+P_cu_LF4))/(Input*LF4)*100   #Efficiency at 5/4 rated load(%)\n",
      "n_fl = (Input-(P_rs_fl+P_cu_fl))/(Input)*100              #Efficiency at full load(%)\n",
      "#Case(g)\n",
      "P_o_LF1 = (Input*LF1*n_LF1/100)/746                       #Output hp at 1/4 rated load\n",
      "P_o_LF2 = (Input*LF2*n_LF2/100)/746                       #Output hp at 1/2 rated load\n",
      "P_o_LF3 = (Input*LF3*n_LF3/100)/746                       #Output hp at 3/4 rated load\n",
      "P_o_LF4 = (Input*LF4*n_LF4/100)/746                       #Output hp at 5/4 rated load\n",
      "P_o = (Input*n_fl/100)/746                                #Output hp at rated load\n",
      "#Case(h)\n",
      "hp = P_o                                                  #Rated output horsepower\n",
      "S_fl = S_r                                                #Full-load rotor speed(rpm)\n",
      "T_o = P_o*5252/S_fl                                       #Output torque at full-load(lb-ft)\n",
      "T_o_ST = T_o*1.356                                        #Output torque at full-load(N-m)\n",
      "\n",
      "#Result\n",
      "print('Case(a): Equivalent total resistance of motor between lines , R_els = %.1f \u03a9' %R_els)\n",
      "print('Case(b): Rotational losses at no load , P_ro = %.1f W' %P_ro)\n",
      "print('Case(c): Slip at rated load , s_fl = %.1f ' %s_fl)\n",
      "print('         Slip at 1/4 rated load , s = %.3f ' %s_LF1)\n",
      "print('         Slip at 1/2 rated load , s = %.2f ' %s_LF2)\n",
      "print('         Slip at 3/4 rated load , s = %.3f ' %s_LF3)\n",
      "print('         Slip at 5/4 rated load , s = %.3f ' %s_LF4)\n",
      "print('Case(d): Rotational loss at rated load , P_r = %.1f W' %P_rs_fl)\n",
      "print('         Rotational loss at 1/4 load , P_r = %.1f W' %P_rs_LF1)\n",
      "print('         Rotational loss at 1/2 load , P_r = %.2f W' %P_rs_LF2)\n",
      "print('         Rotational loss at 3/4 load , P_r = %.1f W' %P_rs_LF3)\n",
      "print('         Rotational loss at 5/4 load , P_r = %.1f W' %P_rs_LF4)\n",
      "print('Case(e): Equivalent copper loss at rated load , P_cu = %.f W' %P_cu_fl)\n",
      "print('         Equivalent copper loss at 1/4 load , P_cu = %.1f W' %P_cu_LF1)\n",
      "print('         Equivalent copper loss at 1/2 load , P_cu = %.f W' %P_cu_LF2)\n",
      "print('         Equivalent copper loss at 3/4 load , P_cu = %.1f W' %P_cu_LF3)\n",
      "print('         Equivalent copper loss at 5/4 load , P_cu = %.1f W' %P_cu_LF4)\n",
      "print('Case(f): Efficiency at rated load , \u03b7 = %.1f W' %n_fl)\n",
      "print('         Efficiency at 1/4 rated load , \u03b7 = %.1f W' %n_LF1)\n",
      "print('         Efficiency at 1/2 rated load , \u03b7 = %.1f W' %n_LF2)\n",
      "print('         Efficiency at 3/4 rated load , \u03b7 = %.1f W' %n_LF3)\n",
      "print('         Efficiency at 5/4 rated load , \u03b7 = %.1f W' %n_LF4)\n",
      "print('Case(g): Output horsepower at rated load , P_o = %.2f hp' %P_o)\n",
      "print('         Output horsepower at 1/4 rated load , P_o = %.2f hp' %P_o_LF1)\n",
      "print('         Output horsepower at 1/2 rated load , P_o = %.2f hp' %P_o_LF2)\n",
      "print('         Output horsepower at 3/4 rated load , P_o = %.2f hp' %P_o_LF3)\n",
      "print('         Output horsepower at 5/4 rated load , P_o = %.2f hp' %P_o_LF4)\n",
      "print('Case(h): Output torque at full load , T_o = %.1f lb-ft' %T_o)\n",
      "print('         Output torque at full load , T_oST = %.1f N-m' %T_o_ST)\n",
      "print('\\nNOTE: ERROR: Calculation error for efficiency at 3/4 load in textbook')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Case(a): Equivalent total resistance of motor between lines , R_els = 0.5 \u03a9\n",
        "Case(b): Rotational losses at no load , P_ro = 218.5 W\n",
        "Case(c): Slip at rated load , s_fl = 0.1 \n",
        "         Slip at 1/4 rated load , s = 0.025 \n",
        "         Slip at 1/2 rated load , s = 0.05 \n",
        "         Slip at 3/4 rated load , s = 0.075 \n",
        "         Slip at 5/4 rated load , s = 0.125 \n",
        "Case(d): Rotational loss at rated load , P_r = 198.7 W\n",
        "         Rotational loss at 1/4 load , P_r = 215.2 W\n",
        "         Rotational loss at 1/2 load , P_r = 209.69 W\n",
        "         Rotational loss at 3/4 load , P_r = 204.2 W\n",
        "         Rotational loss at 5/4 load , P_r = 193.1 W\n",
        "Case(e): Equivalent copper loss at rated load , P_cu = 392 W\n",
        "         Equivalent copper loss at 1/4 load , P_cu = 24.5 W\n",
        "         Equivalent copper loss at 1/2 load , P_cu = 98 W\n",
        "         Equivalent copper loss at 3/4 load , P_cu = 220.5 W\n",
        "         Equivalent copper loss at 5/4 load , P_cu = 612.5 W\n",
        "Case(f): Efficiency at rated load , \u03b7 = 88.7 W\n",
        "         Efficiency at 1/4 rated load , \u03b7 = 81.7 W\n",
        "         Efficiency at 1/2 rated load , \u03b7 = 88.2 W\n",
        "         Efficiency at 3/4 rated load , \u03b7 = 89.2 W\n",
        "         Efficiency at 5/4 rated load , \u03b7 = 87.7 W\n",
        "Case(g): Output horsepower at rated load , P_o = 6.23 hp\n",
        "         Output horsepower at 1/4 rated load , P_o = 1.43 hp\n",
        "         Output horsepower at 1/2 rated load , P_o = 3.10 hp\n",
        "         Output horsepower at 3/4 rated load , P_o = 4.69 hp\n",
        "         Output horsepower at 5/4 rated load , P_o = 7.69 hp\n",
        "Case(h): Output torque at full load , T_o = 20.2 lb-ft\n",
        "         Output torque at full load , T_oST = 27.4 N-m\n",
        "\n",
        "NOTE: ERROR: Calculation error for efficiency at 3/4 load in textbook\n"
       ]
      }
     ],
     "prompt_number": 1
    }
   ],
   "metadata": {}
  }
 ]
}