summaryrefslogtreecommitdiff
path: root/Principles_of_Power_System/chapter14.ipynb
blob: 9abb2d75db23d06119174feed13c9f9d29b3eacb (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:0910cfded5ae40d0ea2b9576604d8007ec8328215058593fcec218762063deff"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 14: A.C. Distribution"
     ]
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 14.1, Page Number: 359"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      "#Variable declaration:\n",
      "l = 300                      #line length(m)\n",
      "magI1 = 100                     #current at load 1(A)\n",
      "pf1 = 0.707                  #power factor at load 1\n",
      "l1 = 200                      #line length till load 1(m)\n",
      "magI2 = 200                     #current drawn at load 2(A)\n",
      "pf2 = 0.8                   #power factor at laod 2\n",
      "l2 = 300                    #line length till load 2(m)\n",
      "R = 0.2                      #total resistance of line(ohm/km)\n",
      "X = 0.1                      #total reactance of the line(ohm/km)\n",
      "\n",
      "#Calculation:\n",
      "phy1 = math.acos(pf1)\n",
      "phy2 = math.acos(pf2)\n",
      "Zac = (R+X*1j)*200/1000       #Impedance of section AC(ohm)\n",
      "Zcb = (R+X*1j)*100/1000       #Impedance of section CB(ohm)\n",
      "#Taking voltage at the far end B as the reference vector, we have\n",
      "I2 = magI2*(pf2-1j*math.sin(phy2))         #Load current at point B(A)\n",
      "I1 = magI1*(pf1-1j*math.sin(phy1))         #Load current at point C(A)\n",
      "Icb = I2                                   #A\n",
      "Iac = I1+I2                              #A\n",
      "Vcb = Icb*Zcb                           #V\n",
      "Vac = Iac*Zac                            #V\n",
      "V = Vac+Vcb                            #Voltage drop in the distributor(V)\n",
      "\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"Voltage drop in the distributor is\",round(abs(V),2),\"V\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Voltage drop in the distributor is 17.85 V\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 14.2, Page Number: 359"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      "#Variable declaration:\n",
      "l = 2000                      #line length(m)\n",
      "magI1 = 80                     #current at load 1(A)\n",
      "pf1 = 0.9                 #power factor at load 1\n",
      "l1 = 1000                      #line length till load 1(m)\n",
      "magI2 = 120                     #current drawn at load 2(A)\n",
      "pf2 = 0.8                   #power factor at laod 2\n",
      "l2 = 2000                    #line length till load 2(m)\n",
      "R = 0.05                      #total resistance of line(ohm/km)\n",
      "X = 0.1                      #total reactance of the line(ohm/km)\n",
      "magVb = 230                     #voltage maintained at point B(V)\n",
      "\n",
      "\n",
      "#Calculation:\n",
      "phy1 = math.acos(pf1)\n",
      "phy2 = math.acos(pf2)\n",
      "Zac = (R+X*1j)*1000/1000       #Impedance of section AC(ohm)\n",
      "Zcb = (R+X*1j)*1000/1000       #Impedance of section CB(ohm)\n",
      "#Taking voltage at the far end B as the reference vector, we have\n",
      "I2 = magI2*(pf2-1j*math.sin(phy2))         #Load current at point B(A)\n",
      "I1 = magI1*(pf1-1j*math.sin(phy1))         #Load current at point C(A)\n",
      "Icb = I2                                   #A\n",
      "Iac = I1+I2                              #A\n",
      "Vcb = Icb*Zcb                           #V\n",
      "Vac = Iac*Zac                            #V\n",
      "V = Vac+Vcb+magVb*(1+0j)                            #Voltage drop in the distributor(V)\n",
      "theta = math.atan(V.imag/V.real)\n",
      "\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"(i) Voltage drop in the distributor is\",round(abs(V),2),\"V\"\n",
      "print \"(ii)The phase difference between Va and Vb is \",round(math.degrees(theta),2),\"degrees\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i) Voltage drop in the distributor is 261.67 V\n",
        "(ii)The phase difference between Va and Vb is  3.83 degrees\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 14.3, Page Number: 360"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      "#Variable declaration:\n",
      "magI1 = 100                     #current at load 1(A)\n",
      "pf1 = 0.6                 #power factor at load 1\n",
      "magI2 = 100                     #current drawn at load 2(A)\n",
      "pf2 = 0.8                   #power factor at laod 2\n",
      "R = 0.1                      #total resistance of line(ohm/km)\n",
      "X = 0.15                      #total reactance of the line(ohm/km)\n",
      "magVb = 200                     #voltage maintained at point B(V)\n",
      "\n",
      "\n",
      "#Calculation:\n",
      "phy1 = math.acos(pf1)\n",
      "phy2 = math.acos(pf2)\n",
      "Zam = (R+X*1j)              #Impedance of section AM(ohm)\n",
      "Zmb = (R+X*1j)             #Impedance of section MB(ohm)\n",
      "#Taking voltage at the far end B as the reference vector, we have\n",
      "I2 = magI2*(pf2-1j*math.sin(phy2))         #Load current at point B(A)\n",
      "Imb = I2  \n",
      "Vb = magVb*(1+0j)                       #V\n",
      "Vmb = Imb*Zmb                           #V\n",
      "Vm = Vb+Vmb                              #V\n",
      "alpha = math.atan(Vm.imag/Vm.real)         #V\n",
      "#The load current I1 has a lagging p.f. of 0\u00b76 w.r.t. VM. It lags \n",
      "#behind Vm by an angle phy1.\n",
      "#Phase angle between I1 and Vb\n",
      "phy11 = phy1-alpha\n",
      "I1 = magI1*(math.cos(phy11)-math.sin(phy11)*1j)         #A\n",
      "Iam = I1+I2                              #A\n",
      "Vam = Iam*Zam                            #V\n",
      "Va = Vm+Vam                             #V\n",
      "theta = math.atan(Va.imag/Va.real)\n",
      "\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"(i)Voltage at mid-point is\",round(abs(Vm),1),\"V\"\n",
      "print \"(ii) Sending end voltage Va is\",round(abs(Va),2),\"V\"\n",
      "print \"(iii)The phase difference between Va and Vb is \",round(math.degrees(theta),2),\"degrees\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i)Voltage at mid-point is 217.1 V\n",
        "(ii) Sending end voltage Va is 252.33 V\n",
        "(iii)The phase difference between Va and Vb is  3.07 degrees\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 14.4, Page Number: 362"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      "#Variable declaration:\n",
      "Zab = 1+1j                    #ohm\n",
      "Zbc = 1+2j                    #ohm\n",
      "Zac = 1+3j                    #ohm\n",
      "Ib = 20                       #load current at B(A)\n",
      "pfb = 0.8                      #power factor at A\n",
      "Ic = 15                       #load current at C(A)\n",
      "pfc = 0.6                      #power factor at B\n",
      "\n",
      "\n",
      "#Calculation:\n",
      "Iab = Ib*(pfb-1j*math.sin(math.acos(pfb)))        #Current in section AB(A)\n",
      "Iac = Ic*(pfc-1j*math.sin(math.acos(pfc)))        #Current in section AB(A)\n",
      "Vab = Iab*Zab                     #Voltage drop in section AB(V)\n",
      "Vac = Iac*Zac                     #Voltage drop in section AC(V)\n",
      "#point B is at higher potential than point C. The p.d. between B and C\n",
      "#is Thevenin\u2019s equivalent circuit e.m.f. Eo i.e.\n",
      "Eo = Vac-Vab                     #volt\n",
      "Zo = Zab+Zac                    #Thevenin\u2019s equivalent impedance(ohm)\n",
      "Ibc = Eo/(Zo+Zbc)                #A\n",
      "Iab1 = Iab+Ibc                   #A\n",
      "Iac1 = Iac-Ibc                   #A\n",
      "Ia = Iab+Iac                     #Current fed at A(A)\n",
      "\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The total current fed at A is\",Ia,\"A\"\n",
      "print \"\\nCurrent in AB is\",Iab1.real+round(Iab1.imag,2)*1j,\"A\"\n",
      "print \"\\nCurrent in BC is\",Ibc.real+round(Ibc.imag,2)*1j,\"A\"\n",
      "print \"\\nCurrent in AC is\",Iac1.real+round(Iac1.imag,2)*1j,\"A\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The total current fed at A is (25-24j) A\n",
        "\n",
        "Current in AB is (18.6-13.53j) A\n",
        "\n",
        "Current in BC is (2.6-1.53j) A\n",
        "\n",
        "Current in AC is (6.4-10.47j) A\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 14.5, Page Number: 363"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      "\n",
      "#Variable declaration:\n",
      "l = 1000                      #line length(m)\n",
      "magI1 = 5                     #current at load 1(A)\n",
      "pf1 = 0.8                 #power factor at load 1\n",
      "l1 = 600                      #line length till load 1(m)\n",
      "pf2 = 0.85                   #power factor at motor load B\n",
      "Po = 10                      #power output at B(H.P)\n",
      "n = 0.9                     #efficiency\n",
      "l2 = 400                    #line length till load 2(m)\n",
      "R = 1                      #total resistance of line(ohm/km)\n",
      "X = 0.5                      #total reactance of the line(ohm/km)\n",
      "magVb = 400                     #voltage maintained at point B(V)\n",
      "\n",
      "\n",
      "#Calculation:\n",
      "Zac = (R+X*1j)*l1/l                 #ohm\n",
      "Zcb = (R+X*1j)*l2/l                 #ohm\n",
      "magVbp = magVb/3**0.5               #volt per phase\n",
      "Vbp = magVbp*(1+0j)                 #V\n",
      "magIb = Po*746/(3**0.5*magVb*pf2*n)           #Line current at B(A)\n",
      "magI2p = magIb\n",
      "I2p = magI2p*(pf2-1j*math.sin(math.atan(pf2)))    #A\n",
      "I1p = magI1*(pf1-1j*math.sin(math.atan(pf1)))       #A\n",
      "Iac = I1p+I2p                      #Current in section AC(A)\n",
      "Icb = I2p                          #Current in section CB(A)\n",
      "Vcb = Icb*Zcb                      #V\n",
      "Vac = Iac*Zac                      #V\n",
      "Va = Vbp+Vcb+Vac                    #V\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"Line voltage at A is\",round(abs(Va)*3**0.5),\"V\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Line voltage at A is 434.0 V\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 14.6, Page Number: 364"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "from sympy import *\n",
      "\n",
      "#Variable declaration:\n",
      "magVa = 11000                      #volt\n",
      "magIb = 50                            #load current at B(A)\n",
      "pf2 = 0.8                           #power factor(lagging)\n",
      "magIc = 120                            #load current at C(A)\n",
      "pf3 = 1.0                           #power factor(lagging)\n",
      "magId = 70                             #load current at D(A)\n",
      "pf4 = 0.866                         #power factor(lagging)\n",
      "Zab = 1+0.6j                        #ohm\n",
      "Zbc = 1.2+0.9j                      #ohm\n",
      "Zcd = 0.8+0.5j                        #ohm\n",
      "Zda = 3+2j                          #ohm\n",
      "\n",
      "\n",
      "#Calculation:\n",
      "#Let current in section AB be (x + j*y).\n",
      "x,y = symbols('x,y')\n",
      "Iab = x+1j*y\n",
      "x,y = symbols('x,y')\n",
      "Ibc = Iab-magIb*(pf2-math.sin(math.atan(pf2)))     #A\n",
      "Icd = (x-40+1j*(y+30))-(120+0j)                   #A\n",
      "Ida = ((x-160)+1j*(y+30))-(70*(0.866-0.5j))          #A\n",
      "Vab = Iab*Zab                         #Drop in section AB(V)\n",
      "Vbc = Ibc*Zbc                         #Drop in section BC(V)\n",
      "Vcd = Icd*Zcd                          #Drop in section CD(V)\n",
      "Vda = Ida*Zda                         #Drop in section DA(V)\n",
      "#  Vab+Vbc+Vcd+Vda = 0\n",
      "#  As the real and imaginary parts have to be separately zero,\n",
      "#  6*x-4*y-1009.8 = 0\n",
      "#  4*x+6*y-302.2 = 0\n",
      "x1 = solve(6*x-4*y-1009.8,x)[0]\n",
      "y1 = round(solve(4*x1+6*y-302.2,y)[0],1)\n",
      "x11 = round(solve(6*x-4*y1-1009.8,x)[0],1)\n",
      "#now putting the values of x11 and y1 in above equationa,\n",
      "Iab1 = x11+1j*y1                                     #A\n",
      "Ibc1 = (x11-40)+1j*(y1+30)                           #A\n",
      "Icd1 = (x11-40+1j*(y1+30))-(120+0j)                   #A\n",
      "Ida1 = ((x11-160)+1j*(y1+30))-(70*(0.866-0.5j))          #A\n",
      "magVap = round(magVa/3**0.5)                     #Voltage at supply end A(V)\n",
      "Vb = magVap*(1+0j)-Iab1*Zab               #Voltage at station B(V/phase)\n",
      "Vc = Vb-Ibc1*Zbc               #Voltage at station C(V/phase)\n",
      "Vd = Vc-Icd1*Zcd               #Voltage at station D(V/phase)\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"Current in section AB is\",Iab1,\"A\"\n",
      "print \"Current in section BC is\",Ibc1,\"A\"\n",
      "print \"Current in section CD is\",Icd1,\"A\"\n",
      "print \"Current in section DA is\",Ida1,\"A\"\n",
      "print \"Voltage at A is\",magVap*(1+0j),\"V/phase\"\n",
      "print \"Voltage at B is\",Vb,\"V/phase\"\n",
      "print \"Voltage at C is\",Vc,\"V/phase\"\n",
      "print \"Voltage at D is\",Vd,\"V/phase\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Current in section AB is (139.8-42.8j) A\n",
        "Current in section BC is (99.8-12.8j) A\n",
        "Current in section CD is (-20.2-12.8j) A\n",
        "Current in section DA is (-80.82+22.2j) A\n",
        "Voltage at A is (6351+0j) V/phase\n",
        "Voltage at B is (6185.52-41.08j) V/phase\n",
        "Voltage at C is (6054.24-115.54j) V/phase\n",
        "Voltage at D is (6064-95.2j) V/phase\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 14.7, Page Number: 368"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      "\n",
      "#Variable declaration:\n",
      "Pr = 10                        #load connected to line R(kW)\n",
      "Py = 8                        #load connected to line Y(kW)\n",
      "Pb = 5                        #load connected to line B(kW)\n",
      "Vl = 400                      #line voltage(V)\n",
      "#the loads are non-reactive.\n",
      "\n",
      "#Calculation:\n",
      "Vp = round(Vl/3**0.5)                    #phase voltage(V)\n",
      "Ir = Pr*1000/Vp                 #A\n",
      "Iy = Py*1000/Vp                  #A\n",
      "Ib = Pb*1000/Vp                  #A\n",
      "\n",
      "#Resolving the three currents along x-axis and y-axis, we have,\n",
      "Ih = Iy*math.cos(math.pi/6)-Ib*math.cos(math.pi/6)         #Resultant horizontal component(A)\n",
      "Iv = Ir-Iy*math.cos(math.pi/3)-Ib*math.cos(math.pi/3)       #Resultant vertical component(A)\n",
      "In = (Ih**2+Iv**2)**0.5          #current in neutral wire(A)\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"(i) Ir =\",round(Ir,1),\"A\"\n",
      "print \"    Iy =\",round(Iy,1),\"A\"\n",
      "print \"    Ib =\",round(Ib,2),\"A\"\n",
      "print \"(ii) Current in neutral wire is\",round(In,1),\"A\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(i) Ir = 43.3 A\n",
        "    Iy = 34.6 A\n",
        "    Ib = 21.65 A\n",
        "(ii) Current in neutral wire is 18.9 A\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 14.8, Page Number: 369"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      "#Variable declaration:\n",
      "Vl = 400                          #line voltage(V)\n",
      "Vp = 230                          #voltage across lamp(V)\n",
      "I1 = 70                           #current in load RN(A)\n",
      "I2 = 84                           #current in load YN(A)\n",
      "I3 = 33                           #current in load BN(A)\n",
      "Im = 200                         #current taken by the motor(A)\n",
      "pf = 0.2                        #power factor(lagging)\n",
      "\n",
      "#Calculation:\n",
      "#Lamp load alone:\n",
      "Ih = I2*math.cos(math.pi/6)-I3*math.cos(math.pi/6)         #Resultant H-component(A)\n",
      "Iv = I1-I3*math.cos(math.pi/3)-84*math.cos(math.pi/3)      #Resultant V-component(A)\n",
      "In = math.sqrt(Ih**2+Iv**2)                          #Neutral current(A)\n",
      "\n",
      "\n",
      "#Both lamp load and motor load:\n",
      "Ir = Im*pf                             #Active component of motor current(A)\n",
      "Ix = Im*math.sin(math.acos(pf))        #Reactive component of motor current(A)\n",
      "IR = ((Ir+I1)**2+Ix**2)**0.5          #A\n",
      "IY = ((Ir+I2)**2+Ix**2)**0.5          #A\n",
      "IB = ((Ir+I3)**2+Ix**2)**0.5          #A\n",
      "P = Vp*(I1+I2+I3)*1                   #Watt       #( cos phy_L = 1)\n",
      "Pm = 3**0.5*Vl*Im*pf                  #Power supplied to motor(W)\n",
      "\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"Lamp load alone: neutral curent is\",round(In,2),\"A\"\n",
      "print \"\\nWhen Both lamp load and motor load is present:\"\n",
      "print \"The current components are:\"\n",
      "print \"Neutral current is\",round(In,2),\"A\"\n",
      "print \"IR =\",round(IR,1),\"A;\\tIY =\",round(IY,0),\"A;\\tIB =\",round(IB,2),\"A\"\n",
      "print \"Power supplied to the lamp is\",P,\"W\"\n",
      "print \"Power supplied to the motor is\",round(Pm),\"W\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Lamp load alone: neutral curent is 45.64 A\n",
        "\n",
        "When Both lamp load and motor load is present:\n",
        "The current components are:\n",
        "Neutral current is 45.64 A\n",
        "IR = 224.7 A;\tIY = 232.0 A;\tIB = 209.11 A\n",
        "Power supplied to the lamp is 43010 W\n",
        "Power supplied to the motor is 27713.0 W\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 14.9, Page Number: 370"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import math\n",
      "\n",
      "#Variable declaration:\n",
      "Prn = 20                          #kW\n",
      "pf1 = 1                          #power factor of loaf RN\n",
      "kVAyn = 28.75                   #kVA of load YN\n",
      "kVAbn = 28.75                   #kVA of load BN\n",
      "pf2 = 0.866                     #power factor of laod YN & BN each.(lagging)\n",
      "Vl = 400                        #line voltage(V)\n",
      "Vp = 230                         #phase voltage(V)\n",
      "\n",
      "\n",
      "#Calculation:\n",
      "phy1 = math.acos(pf1)\n",
      "phy2 = math.acos(pf2)\n",
      "phy3 = phy2\n",
      "Ir = Prn*1000/Vp                   #A\n",
      "Iy = kVAyn*1000/Vp                 #A\n",
      "Ib = kVAbn*1000/Vp                 #A\n",
      "Ih = Ir-Iy*math.cos(phy2)-Ib*math.cos(phy2)          #A\n",
      "Iv = 0+Iy*math.sin(phy2)-Iy*math.sin(phy3)           #A\n",
      "In = math.sqrt(Ih**2+Iv**2)                               #A\n",
      "#When load from B to N removed.:\n",
      "#When the load from B to N is removed, the various line currents are:\n",
      "#Ir in phase with Vrn; Iy lagging by 30 deg.; Ib = 0.\n",
      "Ir1 = Ir\n",
      "Iy1 = Iy;     Ib1 = 0                    #A\n",
      "Ih1 = Ir1-Iy1*math.cos(math.pi/6)             #A\n",
      "Iv1 = 0-Iy1*math.sin(math.pi/6)               #A\n",
      "In1 = math.sqrt(Ih1**2+Iv1**2)               #A\n",
      "\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"When no changes were made, the various currents are:\"\n",
      "print \"Ir =\",round(Ir,2),\"A;\\tIy =\",Iy,\"A;\\tIb =\",Ib,\"A;\\tIn =\",round(In,2),\"A\"\n",
      "print \"\\nWhen load from B to N removed, the various currents are:\"\n",
      "print \"Ir =\",round(Ir1,2),\"A;\\tIy =\",Iy1,\"A;\\tIb =\",Ib1,\"A;\\tIn =\",round(In1,2),\"A\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "When no changes were made, the various currents are:\n",
        "Ir = 86.96 A;\tIy = 125.0 A;\tIb = 125.0 A;\tIn = 129.54 A\n",
        "\n",
        "When load from B to N removed, the various currents are:\n",
        "Ir = 86.96 A;\tIy = 125.0 A;\tIb = 0 A;\tIn = 66.03 A\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 14.10, Page Number: 371"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "import cmath\n",
      "import math\n",
      "\n",
      "#Variable declaration:\n",
      "Vl = 400                       #line voltage(V)\n",
      "Vp = 230                         #phase voltage(V)\n",
      "Ir = 30                        #load current at R-phase(A)\n",
      "pf1 = 0.866                    #power factor for R-phase(lagging)\n",
      "Iy = 30                        ##load current at Y-phase(A)\n",
      "pf2 = 0.866                    #power factor for R-phase(lagging)\n",
      "Ib = 30                         ##load current at R-phase(A)\n",
      "pf3 = 1.0                    #power factor for R-phase(lagging)\n",
      "R = 0.2                       #resistance of each line conductor(ohm)\n",
      "\n",
      "\n",
      "#Calculation:\n",
      "phy1 = math.acos(pf1)\n",
      "phy2 = math.acos(pf2)\n",
      "phy3 = math.acos(pf3)\n",
      "\n",
      "VR = Vp*(1+0j)                #V\n",
      "VY = Vp*(math.cos(-2*math.pi/3)+math.sin(-2*math.pi/3))        #V\n",
      "VB = Vp*(math.cos(2*math.pi/3)+math.sin(-2*math.pi/3))          #V\n",
      "\n",
      "#the line currents can be expressed as :\n",
      "IR = cmath.rect(30,-math.pi/6)                    #A\n",
      "IY = cmath.rect(30,-math.pi/2)                     #A\n",
      "IB = cmath.rect(30,2*math.pi/3)                   #A\n",
      "IN = IR+IY+IB                                #A\n",
      "\n",
      "#Since, the area of X-section of neutral is half of any line conductor.\n",
      "Rn = 2*R                                 #resistance of neutral(ohm)\n",
      "#ER = VR + Drop in R phase + Drop in neutral\n",
      "ER = VR+R*IR+IN*2*R                    #V\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The supply end voltage for R phase is\",round(ER.real,3)+1j*round(ER.imag,3),\"V\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The supply end voltage for R phase is (239.588-10.608j) V\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 3,
     "metadata": {},
     "source": [
      "Example 14.11, Page Number: 371"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "\n",
      "#Variable declaration:\n",
      "Vl = 400                    #line voltage(V)\n",
      "Vp = 230                      #phase voltage(A)\n",
      "Pln = 100                   #load connected b/n LN(W)\n",
      "Pyn = 150                   #load connected b/n YN(W)\n",
      "\n",
      "\n",
      "\n",
      "#Calculation:\n",
      "#before disconnecting the neutral wire,\n",
      "R1 = Vp**2/Pln                        #Resistance of lamp L1(ohm)\n",
      "R2 = Vp**2/Pyn                        #Resistance of lamp L2(ohm)\n",
      "\n",
      "#When the neutral wire is disconnected,\n",
      "EL = 400                              #V\n",
      "I = EL/(R1+R2)                       #A\n",
      "V1 = I*R1                            #Voltage across lamp L1(V)\n",
      "V2 = I*R2                            #Voltage across lamp L2(V)\n",
      "\n",
      "\n",
      "\n",
      "#Result:\n",
      "print \"The voltage across the lamps are:\"\n",
      "print \"Lamp 1, Voltage =\",V1,\"V ;\\tLamp 2, voltage =\",V2,\"V\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The voltage across the lamps are:\n",
        "Lamp 1, Voltage = 240.0 V ;\tLamp 2, voltage = 160.0 V\n"
       ]
      }
     ],
     "prompt_number": 5
    }
   ],
   "metadata": {}
  }
 ]
}