summaryrefslogtreecommitdiff
path: root/BASIC_ELECTRICAL_ENGINEERING_by_D_C_KULSHRESHTHA/Chapter12.ipynb
blob: eb96a9e18490e3c7dfcc9d335a1cc1124272b335 (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
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 12: THREE-PHASE CIRCUITS AND SYSTEMS "
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.1,Page number: 347"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the current drawn from the power mains by a balanced three-phase load.\"\"\"\n",
      "\n",
      "from math import sqrt\n",
      "\n",
      "#Variable Declaration:\n",
      "R=32                  #Resistance of the load(in Ohms)\n",
      "X_L=24                #Inductive reactance of the load(in Ohms) \n",
      "V_L=400               #Line Voltage(in Volts) \n",
      "\n",
      "\n",
      "#Calculations:\n",
      "Z=R + X_L *1j\n",
      "Z_mod=abs(Z)\n",
      "V_ph_star=V_L/(sqrt(3))\n",
      "I_ph_star=V_ph_star/Z_mod\n",
      "I_L_star=I_ph_star\n",
      "V_ph_delta=V_L\n",
      "I_ph_delta=V_ph_delta/Z_mod\n",
      "I_L_delta=I_ph_delta*(sqrt(3))\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"(a)For star connection:\"\n",
      "print \"The current drawn from the power mains is %.3f A.\" %(I_L_star)\n",
      "print \"(b)For delta connection:\"\n",
      "print \"The current drawn from the power mains is %.3f A.\" %(I_L_delta)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)For star connection:\n",
        "The current drawn from the power mains is 5.774 A.\n",
        "(b)For delta connection:\n",
        "The current drawn from the power mains is 17.321 A.\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.2,Page number: 347"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the current in each line and the current in the nuetral conductor for a star-connected three-phase system.\"\"\"\n",
      "\n",
      "from math import sqrt,cos,sin,pi\n",
      "\n",
      "#Variable Declaration:\n",
      "V_L=415               #Line voltage(in Volts)\n",
      "P_R=10e03             #Load in Red line(in kilo-Watts)\n",
      "P_Y=8e03              #Load in Yellow line(in kilo-Watts)\n",
      "P_B=5e03              #Load in Blue line(in kilo-Watts)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "Vph=V_L/sqrt(3)\n",
      "I_R=P_R/Vph\n",
      "I_Y=P_Y/Vph\n",
      "I_B=P_B/Vph\n",
      "I_H=(I_Y*cos(pi/6))-(I_B*cos(pi/6))\n",
      "I_V=I_R-(I_Y*sin(pi/6))-(I_B*sin(pi/6))\n",
      "I_N=sqrt((I_H*I_H)+(I_V*I_V))\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"(a)The current taken by the 10-kW load is %.2f A.\" %(I_R) \n",
      "print \"   The current taken by the 8-kW load is %.2f A.\" %(I_Y) \n",
      "print \"   The current taken by the 5-kW load is %.2f A.\" %(I_B)\n",
      "print \"(b)The current in the nuetral conductor is %.2f A.\" %(I_N)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The current taken by the 10-kW load is 41.74 A.\n",
        "   The current taken by the 8-kW load is 33.39 A.\n",
        "   The current taken by the 5-kW load is 20.87 A.\n",
        "(b)The current in the nuetral conductor is 18.19 A.\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.3,Page number: 348"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the phase currents and the line currents.\"\"\"\n",
      "\n",
      "from math import cos,pi,atan,radians,degrees,sqrt\n",
      "\n",
      "#Variable Declaration:\n",
      "f=50                  #Frequency of the source(in Hertz)\n",
      "V_L=415               #Line Voltage(in Volts)\n",
      "R1=100                #Resistance of the first load(in Ohms)\n",
      "R2=20.0               #Resistance of the second load(in Ohms)\n",
      "L2=191e-03            #Self-inductance of the second load(in Henry)\n",
      "R3=0.0                #Resistance of the third load(in Ohms)\n",
      "C3=30e-06             #Capacitance of the third load(in Farads)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "Z1=R1\n",
      "angle_1=0.0\n",
      "X2=2*pi*f*L2\n",
      "Z2=sqrt((R2*R2)+(X2*X2))\n",
      "angle_2=atan(X2/R2)\n",
      "Z3=1/(2*pi*f*C3)\n",
      "angle_3=pi/2\n",
      "Vph=V_L\n",
      "I1=Vph/Z1\n",
      "I2=Vph/Z2\n",
      "I3=Vph/Z3\n",
      "I_R=sqrt((I1*I1)+(I3*I3)+(2*I1*I3*cos(pi/6)))\n",
      "angle_Y=radians(degrees(angle_2)-60)\n",
      "I_Y=sqrt((I1*I1)+(I2*I2)+(2*I1*I2*cos(angle_Y)))\n",
      "angle_B=pi-angle_Y-(pi/6)\n",
      "I_B=sqrt((I2*I2)+(I3*I3)+(2*I2*I3*cos(angle_B)))\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"(a)The phase current I1 in the load RY is %.2f A in phase with V_RY.\" %(I1)   \n",
      "print \"   The phase current I2 in load YB is %.2f A lagging V_YB by %.2f degrees.\" %(I2,degrees(angle_2))   \n",
      "print \"   The phase current I3 in load BR is %.2f A leading V_BR by %.2f degrees.\" %(I3,degrees(angle_3))\n",
      "print \"(b)The line current I_R is %.2f A.\" %(I_R)\n",
      "print \"   The line current I_Y is %.2f A.\" %(I_Y) \n",
      "print \"   The line current I_B is %.2f A.\" %(I_B)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The phase current I1 in the load RY is 4.00 A in phase with V_RY.\n",
        "   The phase current I2 in load YB is 6.56 A lagging V_YB by 71.57 degrees.\n",
        "   The phase current I3 in load BR is 3.91 A leading V_BR by 90.00 degrees.\n",
        "(b)The line current I_R is 7.64 A.\n",
        "   The line current I_Y is 10.51 A.\n",
        "   The line current I_B is 4.47 A.\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.4,Page number: 350"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the line current,the power factor and the total power for a balanced three-phase system.\"\"\"\n",
      "\n",
      "from math import sqrt\n",
      "\n",
      "#Variable Declaration:\n",
      "R_ph=20.0             #Resistance of each phase(in Ohms)\n",
      "X_L_ph=15.0           #Inductive reactance of each phase(in Ohms)\n",
      "V_L=400.0             #Line Voltage(in Volts)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "Z_ph=R_ph + X_L_ph *1j\n",
      "Z_mod=abs(Z_ph)\n",
      "V_ph_star=V_L/(sqrt(3))\n",
      "I_ph_star=V_ph_star/Z_mod\n",
      "I_L_star=I_ph_star\n",
      "pf_star=R_ph/Z_mod\n",
      "P_active_star=sqrt(3)*V_L*I_L_star*pf_star\n",
      "V_ph_delta=V_L\n",
      "I_ph_delta=V_ph_delta/Z_mod\n",
      "I_L_delta=I_ph_delta*(sqrt(3))\n",
      "pf_delta=R_ph/Z_mod\n",
      "P_active_delta=sqrt(3)*V_L*I_L_delta*pf_delta\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"(a)For star connected load:\"\n",
      "print \"(i)The line current is %.2f A.\" %(I_L_star)\n",
      "print \"(ii)The power factor is %.2f lagging.\" %(pf_star)\n",
      "print \"(iii)The total active power is %.2f kW.\" %(P_active_star/1000)\n",
      "print \"\\n(b)For delta connection:\"\n",
      "print \"(i)The line current is %.2f A.\" %(I_L_delta)\n",
      "print \"(ii)The power factor is %.2f lagging.\" %(pf_delta)\n",
      "print \"(iii)The total active power is %.2f kW.\" %(P_active_delta/1000)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)For star connected load:\n",
        "(i)The line current is 9.24 A.\n",
        "(ii)The power factor is 0.80 lagging.\n",
        "(iii)The total active power is 5.12 kW.\n",
        "\n",
        "(b)For delta connection:\n",
        "(i)The line current is 27.71 A.\n",
        "(ii)The power factor is 0.80 lagging.\n",
        "(iii)The total active power is 15.36 kW.\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.5,Page number: 355"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Fidning the total power consumed and the power factor of a balanced three-phase circuit.\"\"\"\n",
      "\n",
      "from math import atan,cos,sqrt\n",
      "\n",
      "#Variable Declaration:\n",
      "W1=3e03               #Reading of wattmeter-1(in Watts)\n",
      "W2=1.5e03             #Reading of wattmeter-2(in Watts)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "P=W1+W2\n",
      "pf_angle=atan(sqrt(3)*((W1-W2)/(W1+W2)))\n",
      "pf=cos(pf_angle)\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The total power consumed is %e W.\" %(P)\n",
      "print \"The power factor of the balanced three-phase circuit is %.3f.\" %(pf)\n",
      "print \"NOTE:From the given data it is impossible to state whether the power factor is leading or lagging.\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The total power consumed is 4.500000e+03 W.\n",
        "The power factor of the balanced three-phase circuit is 0.866.\n",
        "NOTE:From the given data it is impossible to state whether the power factor is leading or lagging.\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.6,Page number: 355"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the total power,the power factor and the line current for a balanced three-phase circuit.\"\"\"\n",
      "\n",
      "from math import atan,cos,sqrt\n",
      "\n",
      "#Variable Declaration:\n",
      "V_L=415               #Line voltage(in Volts)\n",
      "W1=5.2e03             #Reading of wattmeter-1(in Watts)\n",
      "W2=-1.7e03            #Reading of wattmeter-2(in Watts) \n",
      "\n",
      "\n",
      "#Calculations:\n",
      "P=W1+W2\n",
      "pf_angle=atan(sqrt(3)*((W1-W2)/(W1+W2)))\n",
      "pf=cos(pf_angle)\n",
      "I_L=P/(sqrt(3)*V_L*pf)\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The total power consumed is %e W.\\n\" %(P)\n",
      "print \"The power factor of the balanced three-phase circuit is %.3f.\" %(pf)\n",
      "print \"NOTE:From the given data it is impossible to state whether the power factor is leading or lagging.\"\n",
      "print \"\\nThe line current is %.2f A.\" %(I_L)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The total power consumed is 3.500000e+03 W.\n",
        "\n",
        "The power factor of the balanced three-phase circuit is 0.281.\n",
        "NOTE:From the given data it is impossible to state whether the power factor is leading or lagging.\n",
        "\n",
        "The line current is 17.32 A.\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.7,Page number: 356"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the total power consumed in a star-connected three-phase network.\"\"\"\n",
      "\n",
      "from math import sqrt,radians,degrees\n",
      "from cmath import rect,phase\n",
      "\n",
      "#Variable Declaration:\n",
      "R=6.0                 #Resistance per phase(in Ohms)\n",
      "X_L=8.0               #Inductive reactance per phase(in Ohms)\n",
      "V_L=220.0             #Line voltage(in Volts)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "Z=6+ (1j*8)\n",
      "Vph=V_L/sqrt(3.0)\n",
      "V_RN=rect(Vph,0)\n",
      "V_YN=rect(Vph,radians(-120.0))\n",
      "V_BN=rect(Vph,radians(120.0))\n",
      "V_RY=V_RN-V_YN\n",
      "V_YB=V_YN-V_BN\n",
      "V_BR=V_BN-V_RN\n",
      "I_R=V_RN/Z\n",
      "I_Y=V_YN/Z\n",
      "I_B=V_BN/Z\n",
      "P=sqrt(3.0)*V_L*abs(I_R)*cos(phase(Z))\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"(a)The phase voltages are:\"\n",
      "print \"   V_RN=%.2f V at an angle of %.3f degrees.\" %(abs(V_RN),degrees(phase(V_RN))) \n",
      "print \"   V_YN=%.2f V at an angle of %.3f degrees.\" %(abs(V_YN),degrees(phase(V_YN)))\n",
      "print \"   V_BN=%.2f V at an angle of %.3f degrees.\" %(abs(V_BN),degrees(phase(V_BN)))\n",
      "print \"(b)The line voltages are:\"\n",
      "print \"   V_RY=%.2f V at an angle of %.3f degrees.\" %(abs(V_RY),degrees(phase(V_RY))) \n",
      "print \"   V_YB=%.2f V at an angle of %.3f degrees.\" %(abs(V_YB),degrees(phase(V_YB)))\n",
      "print \"   V_BR=%.2f V at an angle of %.3f degrees.\" %(abs(V_BR),degrees(phase(V_BR)))\n",
      "print \"(c)The line currents(same as phase currents) are:\"\n",
      "print \"   I_R=%.2f A at an angle of %.3f degrees.\" %(abs(I_R),degrees(phase(I_R))) \n",
      "print \"   I_Y=%.2f A at an angle of %.3f degrees.\" %(abs(I_Y),degrees(phase(I_Y)))\n",
      "print \"   I_B=%.2f A at an angle of %.3f degrees.\" %(abs(I_B),degrees(phase(I_B)))\n",
      "print \"(d)The total power consumed is %.2f W.\" %(round(P,2)) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The phase voltages are:\n",
        "   V_RN=127.02 V at an angle of 0.000 degrees.\n",
        "   V_YN=127.02 V at an angle of -120.000 degrees.\n",
        "   V_BN=127.02 V at an angle of 120.000 degrees.\n",
        "(b)The line voltages are:\n",
        "   V_RY=220.00 V at an angle of 30.000 degrees.\n",
        "   V_YB=220.00 V at an angle of -90.000 degrees.\n",
        "   V_BR=220.00 V at an angle of 150.000 degrees.\n",
        "(c)The line currents(same as phase currents) are:\n",
        "   I_R=12.70 A at an angle of -53.130 degrees.\n",
        "   I_Y=12.70 A at an angle of -173.130 degrees.\n",
        "   I_B=12.70 A at an angle of 66.870 degrees.\n",
        "(d)The total power consumed is 2904.00 W.\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.8,Page number: 356"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the total power consumed in a delta-connected three-phase network.\"\"\"\n",
      "\n",
      "from math import sqrt,radians,degrees\n",
      "from cmath import rect,phase\n",
      "\n",
      "#Variable Declaration:\n",
      "R=6.0                 #Resistance per phase(in Ohms)\n",
      "X_L=8.0               #Inductive reactance per phase(in Ohms)\n",
      "V_L=220.0             #Line voltage(in Volts)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "Z=6+ (1j*8)\n",
      "Vph=V_L\n",
      "V_RY=rect(Vph,0)\n",
      "V_YB=rect(Vph,radians(-120.0))\n",
      "V_BR=rect(Vph,radians(120.0))\n",
      "I_RY=V_RY/Z\n",
      "I_YB=V_YB/Z\n",
      "I_BR=V_BR/Z\n",
      "I_R=I_RY-I_BR\n",
      "I_Y=I_YB-I_RY\n",
      "I_B=I_BR-I_YB\n",
      "P=sqrt(3.0)*V_L*abs(I_R)*cos(phase(Z))\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"(a)The phase voltages(same as line voltages) are:\"\n",
      "print \"   V_RY=%.2f V at an angle of %.3f degrees.\" %(abs(V_RY),degrees(phase(V_RY))) \n",
      "print \"   V_YB=%.2f V at an angle of %.3f degrees.\" %(abs(V_YB),degrees(phase(V_YB)))\n",
      "print \"   V_BR=%.2f V at an angle of %.3f degrees.\" %(abs(V_BR),degrees(phase(V_BR)))\n",
      "print \"(b)The phase currents in the three load impedances are:\"\n",
      "print \"   I_RY=%.2f A at an angle of %.3f degrees.\" %(abs(I_RY),degrees(phase(I_RY))) \n",
      "print \"   I_YB=%.2f A at an angle of %.3f degrees.\" %(abs(I_YB),degrees(phase(I_YB)))\n",
      "print \"   I_BR=%.2f A at an angle of %.3f degrees.\" %(abs(I_BR),degrees(phase(I_BR)))\n",
      "print \"(c)The line currents are:\"\n",
      "print \"   I_R=%.2f A at an angle of %.3f degrees.\" %(abs(I_R),degrees(phase(I_R))) \n",
      "print \"   I_Y=%.2f A at an angle of %.3f degrees.\" %(abs(I_Y),degrees(phase(I_Y)))\n",
      "print \"   I_B=%.2f A at an angle of %.3f degrees.\" %(abs(I_B),degrees(phase(I_B)))\n",
      "print \"(d)The total power consumed is %.2f W.\" %(round(P,2)) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The phase voltages(same as line voltages) are:\n",
        "   V_RY=220.00 V at an angle of 0.000 degrees.\n",
        "   V_YB=220.00 V at an angle of -120.000 degrees.\n",
        "   V_BR=220.00 V at an angle of 120.000 degrees.\n",
        "(b)The phase currents in the three load impedances are:\n",
        "   I_RY=22.00 A at an angle of -53.130 degrees.\n",
        "   I_YB=22.00 A at an angle of -173.130 degrees.\n",
        "   I_BR=22.00 A at an angle of 66.870 degrees.\n",
        "(c)The line currents are:\n",
        "   I_R=38.11 A at an angle of -83.130 degrees.\n",
        "   I_Y=38.11 A at an angle of 156.870 degrees.\n",
        "   I_B=38.11 A at an angle of 36.870 degrees.\n",
        "(d)The total power consumed is 8712.00 W.\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.9,Page number: 357"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the line current and the total power supplied by a three-phase system.\"\"\"\n",
      "\n",
      "from cmath import rect,phase\n",
      "from math import radians,degrees,sqrt,cos\n",
      "\n",
      "#Variable Declaration:\n",
      "Z_A_delta=rect(12.0,radians(30.0))\n",
      "Z_star=rect(5.0,radians(45.0))\n",
      "V_L=400.0\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "Z_A_star=Z_A_delta/3.0\n",
      "Zeq=(Z_A_star*Z_star)/(Z_A_star+Z_star)\n",
      "Vph=V_L/sqrt(3.0)\n",
      "I_L=Vph/Zeq\n",
      "P=sqrt(3.0)*I_L*V_L*cos(phase(Zeq))\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"(a)The line current is %.3f A.\" %(round((abs(I_L)),3))\n",
      "print \"(b)The power suppiled is %e W.\" %(abs(P))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The line current is 103.045 A.\n",
        "(b)The power suppiled is 5.726843e+04 W.\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.10,Page number: 357"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the constants of the load per phase.\"\"\"\n",
      "\n",
      "from math import pi,sqrt\n",
      "\n",
      "#Variable Declaration:\n",
      "I_L=100.0             #Line current(in Amperes)\n",
      "V_L=1100.0            #Line voltage(in Volts)\n",
      "f=50.0                #Frequency of the supply(in Hertz)\n",
      "P=150e03              #Power delivered by the three-phase system(in Watts)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "R=P/(3*I_L*I_L)\n",
      "Vph=V_L/sqrt(3.0)\n",
      "Iph=I_L\n",
      "Z=Vph/Iph\n",
      "X_C=sqrt((Z*Z)-(R*R))\n",
      "C=1/(2*pi*f*X_C)\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The constants of the load per phase are:\"\n",
      "print \"R=%.3f Ohms and C=%e F.\" %(R,C)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The constants of the load per phase are:\n",
        "R=5.000 Ohms and C=8.128901e-04 F.\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.11,Page number: 358"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the impedance in each branch and the power factor in a balanced delta-connected three-phase circuit.\"\"\"\n",
      "\n",
      "from math import sqrt,cos\n",
      "\n",
      "#Variable Declaration:\n",
      "V_L=400.0             #Line voltage(in Volts)\n",
      "I_L=20.0              #Line current(in Amperes)\n",
      "P=10e03               #Total power absorbed by the load(in Watts)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "V_ph=V_L\n",
      "I_ph=I_L/sqrt(3.0)\n",
      "Z_ph=V_ph/I_ph\n",
      "pf=P/(sqrt(3.0)*V_L*I_L)\n",
      "V_ph_star=V_L/sqrt(3.0)\n",
      "I_L_star=V_ph_star/Z_ph\n",
      "I_ph_star=I_L_star\n",
      "P=sqrt(3.0)*V_L*I_L_star*pf\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"(a)The impedance in each branch is %.2f Ohms.\" %(round(Z_ph,2))\n",
      "print \"(b)The power factor is %.4f lagging.\" %(pf)\n",
      "print \"(c)The total power consumed if the same impedances are star-connected is %.2f kW.\" %(round((P/1000.0),2))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The impedance in each branch is 34.64 Ohms.\n",
        "(b)The power factor is 0.7217 lagging.\n",
        "(c)The total power consumed if the same impedances are star-connected is 3.33 kW.\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.12,Page number: 358"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the total power in the three-phase system.\"\"\"\n",
      "\n",
      "from cmath import rect,phase\n",
      "from math import pi,sin,radians,degrees\n",
      "\n",
      "#Variable Declaration:\n",
      "R1=100.0              #Resistance of the first phase(in Ohms)\n",
      "R2=200.0              #Resistance of the second phase(in Ohms)\n",
      "L3=0.3                #Inductance of the third phase(in Henry)\n",
      "V_L=100.0             #Line voltage(in Volts)\n",
      "f=50.0                #Frequency of the supply(in Hertz)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "Vab=rect(V_L,0)\n",
      "Vbc=rect(V_L,radians(-120))\n",
      "Vca=rect(V_L,radians(120))\n",
      "Zab=R1\n",
      "Zca=R2\n",
      "Zbc=1j*(2*pi*f*L3)\n",
      "Iab=Vab/Zab\n",
      "Ibc=Vbc/Zbc\n",
      "Ica=Vca/Zca\n",
      "Pab=(abs(Vab)*abs(Vab))/R1\n",
      "Pbc=0\n",
      "Pca=(abs(Vca)*abs(Vca))/R2\n",
      "act_P=Pab+Pbc+Pca\n",
      "rea_P=abs(Vbc)*abs(Ibc)*sin(phase(Zbc))\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"(a)The total active power in the system is %.2f W.\" %round(act_P,2)\n",
      "print \"(b)The total reactive power in the system is %.2f VAr.\" %round(rea_P,2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The total active power in the system is 150.00 W.\n",
        "(b)The total reactive power in the system is 106.10 VAr.\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.13,Page number: 359"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the load circuit parameters per phase.\"\"\"\n",
      "\n",
      "from math import pi,sqrt,sin,acos\n",
      "\n",
      "#Variable Declaration:\n",
      "I_L=160.0             #Line current(in Amperes)\n",
      "V_L=1.1e03            #Line voltage(in Volts)\n",
      "P=210e03              #Total power load(in kilo-Watts)\n",
      "f=50.0                #Frequency of the supply voltage(in Hertz)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "pf=P/(sqrt(3.0)*V_L*I_L)\n",
      "V_ph=V_L/sqrt(3.0)\n",
      "I_ph=I_L\n",
      "Z_ph=V_ph/I_ph\n",
      "R_ph=Z_ph*pf\n",
      "X_C=Z_ph*sin(acos(pf))\n",
      "C=1.0/(2*pi*f*X_C)\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The load circuit parameters per phase are:\"\n",
      "print \"R=%.3f Ohms.\" %(round(R_ph,3))\n",
      "print \"C=%e F.\" %(C)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The load circuit parameters per phase are:\n",
        "R=2.734 Ohms.\n",
        "C=1.106310e-03 F.\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.14,Page number: 359"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\"\"\"Finding the resistance and the inductance of the load per phase.\"\"\"\n",
      "\n",
      "from math import pi,sqrt,sin,acos\n",
      "\n",
      "#Variable Declaration:\n",
      "V_L=400.0             #Line voltage(in Volts)\n",
      "f=50.0                #Frequency of the supply(in Hertz)\n",
      "Iph=25.0              #Phase current(in Amperes)\n",
      "P=13.856e03           #Total active power absorbed by the load(in Watts)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "I_L=Iph\n",
      "pf=P/(sqrt(3.0)*V_L*I_L)\n",
      "Vph=V_L/sqrt(3.0)\n",
      "Zph=Vph/Iph\n",
      "Rph=Zph*pf\n",
      "Xph=Zph*sin(acos(pf))\n",
      "L=Xph/(2*pi*f)\n",
      "Q=3*Vph*Iph*sin(acos(pf))\n",
      "S=3*Vph*Iph\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"(a)The resistance of the load per phase is %.3f Ohms and the inductance of the load per phase is %e H.\" %(Rph,L)\n",
      "print \"(b)The total reactive power is %e VAR.\" %(Q)\n",
      "print \"(c)The total apparent power is %e VA.\" %(S)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The resistance of the load per phase is 7.390 Ohms and the inductance of the load per phase is 1.764344e-02 H.\n",
        "(b)The total reactive power is 1.039285e+04 VAR.\n",
        "(c)The total apparent power is 1.732051e+04 VA.\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.15,Page number: 360"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the line current,the power factor and the total kVA.\"\"\"\n",
      "\n",
      "from math import sqrt,pi,cos\n",
      "from cmath import phase\n",
      "\n",
      "#Variable Declaration:\n",
      "Z1=100+(1j*0)         #First impedance(in Ohms)\n",
      "C=32e-06              #Capacitance of the capacitor(in Farads)\n",
      "V_L=415.0             #Line voltage(in Volts)\n",
      "f=50.0                #Frequency of the supply(in Hertz)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "Z2=-(1j*(1/(2*pi*f*C)))\n",
      "Zph=(Z1*Z2)/(Z1+Z2)\n",
      "Vph=V_L/sqrt(3.0)\n",
      "Iph=Vph/Zph\n",
      "I_L=Iph\n",
      "pf=cos(phase(Zph))\n",
      "P=sqrt(3.0)*V_L*I_L*pf\n",
      "kVA=sqrt(3.0)*V_L*I_L\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"(a)The line current is %.3f A.\" %(abs(I_L))\n",
      "print \"(b)The power factor is %.4f leading.\" %(pf)\n",
      "print \"(c)The power absorbed is %e W.\" %(abs(P))\n",
      "print \"(d)The total kVA is %e kVA.\" %(abs(kVA))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The line current is 3.397 A.\n",
        "(b)The power factor is 0.7052 leading.\n",
        "(c)The power absorbed is 1.722250e+03 W.\n",
        "(d)The total kVA is 2.442104e+03 kVA.\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.16,Page number: 360"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the line current,input and output power in a three-phase motor.\"\"\"\n",
      "\n",
      "from math import sqrt,atan,cos\n",
      "\n",
      "#Variable Declaration:\n",
      "effi=0.86             #Efficiency of the motor\n",
      "W1=255e03             #Reading of the first wattmeter(in Watts)\n",
      "W2=85e03             #Reading of the second wattmeter(in Watts)\n",
      "V_L=1.6e03            #Line voltage(in Volts)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "P=W1+W2\n",
      "phi=atan(sqrt(3.0)*((W1-W2)/(W1+W2)))\n",
      "pf=cos(phi)\n",
      "I_L=P/(sqrt(3.0)*V_L*pf)\n",
      "Po=P*effi\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"(a)The input power is %.2f kW.\" %(round((P/1000.0),2))\n",
      "print \"(b)The power factor is %.3f lagging.\" %(round(pf,3))\n",
      "print \"(c)The line current is %.2f A.\" %(round(I_L,2))\n",
      "print \"(d)The output power is %.2f kW.\" %(round((Po/1000.0),2)) \n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The input power is 340.00 kW.\n",
        "(b)The power factor is 0.756 lagging.\n",
        "(c)The line current is 162.30 A.\n",
        "(d)The output power is 292.40 kW.\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.17,Page number: 360"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the readings of the two wattmeters.\"\"\"\n",
      "\n",
      "from math import sqrt,acos,tan \n",
      "\n",
      "#Variable Declaration:\n",
      "P=25e03               #Total input power(in Watts)\n",
      "pf=0.8                #Power factor\n",
      "V_L=400.0             #Line voltage(in Volts)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "\"\"\"W1-W2=(1.0/sqrt(3.0))*(W1+W2)*tan(phi);\"\"\"\n",
      "eq_1=P\n",
      "eq_2=(1.0/sqrt(3.0))*P*tan(acos(pf))\n",
      "W1=(eq_1+eq_2)/2.0\n",
      "W2=P-W1\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The readings of the wattmeters are:\" \n",
      "print \"W1=%.4f kW.\" %(round((W1/1000.0),4))\n",
      "print \"W2=%.4f kW.\" %(round((W2/1000.0),4))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The readings of the wattmeters are:\n",
        "W1=17.9127 kW.\n",
        "W2=7.0873 kW.\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.18,Page number: 361"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the total active power consumed by the load.\"\"\"\n",
      "\n",
      "from cmath import phase,rect\n",
      "from math import radians\n",
      "\n",
      "#Variable Declaration:\n",
      "V_RY=rect(200,0)                 #Line Voltage V_RY(in Volts)\n",
      "V_YB=rect(200,radians(-120))     #Line Voltage V_YB(in Volts)\n",
      "V_BR=rect(200,radians(120))      #Line Voltage V_BR(in Volts)\n",
      "Z1=rect(10,radians(60))          #Impedance of the first phase(in Ohms)   \n",
      "Z2=rect(10,radians(0))           #Impedance of the second phase(in Ohms)\n",
      "Z3=rect(10,radians(60))          #Impedance of the third phase(in Ohms)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "I1=V_RY/Z1\n",
      "I2=V_YB/Z2\n",
      "I3=V_BR/Z3\n",
      "IR=I1-I3\n",
      "IB=I3-I2\n",
      "W1=abs(V_RY)*abs(IR)*cos(phase(IR))\n",
      "W2=-abs(V_YB)*abs(IB)*cos(phase(IB)-phase(V_YB))\n",
      "P=W1+W2\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"(a)The readings of the wattmeters are: W1=%.2f W and W2=%.2f W.\" %(W1,W2)\n",
      "print \"(b)The total active power consumed by the load is %.2f W.\" %(P)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The readings of the wattmeters are: W1=0.00 W and W2=8000.00 W.\n",
        "(b)The total active power consumed by the load is 8000.00 W.\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.19,Page number: 361"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the total active power consumed by the load.\"\"\"\n",
      "\n",
      "from cmath import phase,rect\n",
      "from math import radians\n",
      "\n",
      "#Variable Declaration:\n",
      "V_RY=rect(200,0)                 #Line Voltage V_RY(in Volts)\n",
      "V_YB=rect(200,radians(-120))     #Line Voltage V_YB(in Volts)\n",
      "V_BR=rect(200,radians(120))      #Line Voltage V_BR(in Volts)\n",
      "Z1=rect(10,radians(60))          #Impedance of the first phase(in Ohms)   \n",
      "Z2=rect(10,radians(0))           #Impedance of the second phase(in Ohms)\n",
      "Z3=rect(10,radians(60))          #Impedance of the third phase(in Ohms)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "I1=V_RY/Z1\n",
      "I2=V_YB/Z2\n",
      "I3=V_BR/Z3\n",
      "IR=I1-I3\n",
      "IY=I2-I1\n",
      "W1=-abs(V_BR)*abs(IR)*cos(phase(IR)-phase(V_BR))\n",
      "W2=abs(V_YB)*abs(IY)*cos(phase(IY)-phase(V_YB))\n",
      "P=W1+W2\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"(a)The readings of the wattmeters are: W1=%.2f W and W2=%.2f W.\" %(W1,W2)\n",
      "print \"(b)The total active power consumed by the load is %.2f W.\" %(P)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The readings of the wattmeters are: W1=6000.00 W and W2=2000.00 W.\n",
        "(b)The total active power consumed by the load is 8000.00 W.\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.20,Page number: 362"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the reading of the wattmeter.\"\"\"\n",
      "\n",
      "from cmath import rect,phase\n",
      "from math import radians,cos\n",
      "\n",
      "#Variable Declaration:\n",
      "V_RY=rect(440.0,0)             #Line voltage in RY line(in Volts)\n",
      "V_YB=rect(440.0,radians(-120)) #Line voltage in YB line(in Volts)\n",
      "V_BR=rect(440.0,radians(120))  #Line voltage in BR line(in Volts)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "V_RB=rect(440.0,radians(120-180)) \n",
      "I1=V_RY/(60.0+(1j*45.0))\n",
      "I2=V_RB/(-(1j*56.0))\n",
      "I_AB=I1+I2\n",
      "V_CD=V_YB\n",
      "P=abs(I_AB)*abs(V_CD)*cos(phase(V_CD))\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The reading of the wattmeter is %.4f W.\" %(round(P,4))\n",
      "print \"Note: There is a calculation error in the textbook.\"\n",
      "print \"I_AB=11.50 A at an angle of 2.035 degrees and not 11.05 A. Therefore P=-2531.1166 W.\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The reading of the wattmeter is -2531.1166 W.\n",
        "Note: There is a calculation error in the textbook.\n",
        "I_AB=11.50 A at an angle of 2.035 degrees and not 11.05 A. Therefore P=-2531.1166 W.\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 12.21,Page number: 363"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Question:\n",
      "\"\"\"Finding the line and phase current in a motor.\"\"\"\n",
      "\n",
      "from cmath import phase,rect\n",
      "from math import acos,sqrt,radians,cos\n",
      "\n",
      "#Variable Declaration:\n",
      "V_RY=rect(440,0)       #Line voltage in RY line(in Volts)\n",
      "Zph=3+1j*4             #Phase Impedance(in Ohms)\n",
      "pf=0.8                 #Lagging power factor\n",
      "P=75e03                #Total active power(in Watts)\n",
      "V_L=440.0              #Line voltage(in Volts)\n",
      "\n",
      "\n",
      "#Calculations:\n",
      "I_L_mod=P/(sqrt(3.0)*V_L*pf)\n",
      "phi=acos(pf)\n",
      "I_L_delta=rect(I_L_mod,(radians(-30-degrees(phi))))\n",
      "Iph=rect((I_L_mod/sqrt(3.0)),-phi)\n",
      "Vph=rect((V_L/sqrt(3.0)),radians(-30))\n",
      "I_L_star=Vph/Zph\n",
      "I_L=I_L_delta+I_L_star\n",
      "P1=sqrt(3.0)*abs(V_L)*abs(I_L_delta)*pf\n",
      "P2=sqrt(3.0)*abs(V_L)*abs(I_L_star)*cos(phase(Zph))\n",
      "P_tot=P1+P2\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"(a)The line current in the motor is %.2f A at a phase angle of %.2f degrees.\" %(abs(I_L_delta),degrees(phase(I_L_delta)))\n",
      "print \"   The phase current in the motor is %.2f A at a phase angle of %.2f degrees.\" %(abs(Iph),degrees(phase(Iph)))\n",
      "print \"(b)The line current and phase current in the load is %.2f A at a phase angle of %.2f degrees.\" %(abs(I_L_star),degrees(phase(I_L_star)))\n",
      "print \"(c)The total line current is %.2f A at a phase angle of %.2f degrees.\" %(abs(I_L),degrees(phase(I_L)))\n",
      "print \"(d)The total power consumed is %.3f W.\" %(P_tot) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)The line current in the motor is 123.01 A at a phase angle of -66.87 degrees.\n",
        "   The phase current in the motor is 71.02 A at a phase angle of -36.87 degrees.\n",
        "(b)The line current and phase current in the load is 50.81 A at a phase angle of -83.13 degrees.\n",
        "(c)The total line current is 172.38 A at a phase angle of -71.60 degrees.\n",
        "(d)The total power consumed is 98232.000 W.\n"
       ]
      }
     ],
     "prompt_number": 19
    }
   ],
   "metadata": {}
  }
 ]
}