summaryrefslogtreecommitdiff
path: root/Electric_Power_Distribution_System_Engineering_by_T._Gonen/ch9_1.ipynb
blob: ecdc82d79c87812601acbd1eccbf317cc9878896 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:34811960951969c03d923c2b2288130419dca2ae4cd032dc1740e25d2d5fd68b"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 9 : Distribution System Voltage Regulation"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.1  Page No : 468"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "from numpy import exp\n",
      "\n",
      "# Variables\n",
      "#Base Value\n",
      "S3phib = 15;         #in MVA\n",
      "Vllst = 69;         #in kV\n",
      "Vllp = 13.2;         #in kV\n",
      "Vrrb = 120.;\n",
      "\n",
      "Ztpu = 1j*0.08;         #Transformer impedance per unit length\n",
      "VSTpuop = 1.05*exp(1j*0);         #Per Unit Maximum Subtransmission Voltage Off Peak\n",
      "VSTpup = 1.00*exp(1j*0);         #Per Unit Maximum Subtransmission Voltage Peak\n",
      "pftop = 0.95;         #Off Peak kilovoltageamperage power factor\n",
      "Sop = 0.25;         #Off Peak kilovoltageamperage\n",
      "pftp = 0.85;         #Off Peak kilovoltageamperage power factor\n",
      "Sp = 1.0;         #Off Peak kilovoltageamperage\n",
      "Regpu = 5./(8*100);         #Regulated percent volts for 32 steps\n",
      "K = 3.88*(10**-6);         #Drop Consmath.tant\n",
      "S = 4000.;         # Peak Load in kVA\n",
      "l = 10.;         #Length of the feeder\n",
      "#Case A\n",
      "Rset = 0.;\n",
      "Xset = 0.;\n",
      "Vpmax = 1.0417;\n",
      "BW = 0.0083;\n",
      "VRRpu = (Vpmax-BW);         #Setting of VRR\n",
      "VRR = (Vpmax-BW)*Vrrb;\n",
      "\n",
      "# Calculations\n",
      "#Case B\n",
      "IPpuop = (Sop/VSTpuop)*exp(1j*math.acos(pftop)*math.pi/180);         #No Load Primary Current at substation Off Peak\n",
      "VPpuop  = VSTpuop-(IPpuop*Ztpu);         #Highest Allowable Primary Voltage Off Peak\n",
      "IPpup = (Sp/VSTpup)*exp(-1*1j*math.acos(pftp)*math.pi/180);         #No Load Primary Current at substation Peak\n",
      "VPpup  = VSTpup-(IPpup*Ztpu);         #Highest Allowable Primary Voltage  Peak\n",
      "\n",
      "Step1 = (abs(VPpuop)-VRRpu)/Regpu;         #Off Peak Number Steps\n",
      "#To find the positive step value\n",
      "Step2 = -1*(abs(VPpup)-VRRpu)/Regpu;         # Peak Number Steps\n",
      "\n",
      "\n",
      "#Case C\n",
      "#At Peak Load Primary Voltages\n",
      "MaxVpp = 1.075;         #Max\n",
      "MinVpp = 1.000;         #Min\n",
      "\n",
      "TVDpu = K*S*l/2;         #Total Voltage Drop\n",
      "MinVPpu = VRRpu-TVDpu;\n",
      "\n",
      "#At Annual Peak Load Primary Voltages\n",
      "APMaxVPpu = MaxVpp-BW;         #Max\n",
      "APMinVPpu = MinVpp+BW;         #Min\n",
      "\n",
      "#At no load Load Primary Voltages\n",
      "NLMaxVPpu = Vpmax-BW;         #Max\n",
      "NLMinVPpu = APMinVPpu;         #Min\n",
      "\n",
      "# Results\n",
      "print 'a)The Setting of the VRR for the highest allowable primary voltage is %g V'%(VRR)\n",
      "print 'b The Maximum Number of Steps of buck and boost for:'\n",
      "print 'Off Peak : %g steps'%(math.ceil(Step1))\n",
      "print 'Peak : %g steps'%(math.ceil(Step2))\n",
      "print 'c) At Annual Load%( Significant Values on Voltage Curve'\n",
      "print 'The Total Voltage Drop is %g pu V'%(TVDpu)\n",
      "print 'The Minimum Feeder Voltage at the end of the feeder is %g'%(MinVPpu)\n",
      "print 'The Minimum and Maximum Primary Voltages at Peak Load is %g pu V and %g pu V'%(APMaxVPpu,APMinVPpu)\n",
      "print 'The Minimum and Maximum Primary Voltages at Peak Load is %g pu V and %g pu V'%(NLMaxVPpu,NLMinVPpu)\n",
      "\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a)The Setting of the VRR for the highest allowable primary voltage is 124.008 V\n",
        "b The Maximum Number of Steps of buck and boost for:\n",
        "Off Peak : 3 steps\n",
        "Peak : 5 steps\n",
        "c) At Annual Load%( Significant Values on Voltage Curve\n",
        "The Total Voltage Drop is 0.0776 pu V\n",
        "The Minimum Feeder Voltage at the end of the feeder is 0.9558\n",
        "The Minimum and Maximum Primary Voltages at Peak Load is 1.0667 pu V and 1.0083 pu V\n",
        "The Minimum and Maximum Primary Voltages at Peak Load is 1.0334 pu V and 1.0083 pu V\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.2  Page No : 472"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "from sympy import Symbol,solve\n",
      "\n",
      "# Variables\n",
      "#Terms from previous example\n",
      "TVDpu = 0.0776;         #Total Voltage Drop\n",
      "VRRpu = 1.035;         #Setting Voltage of Regulator\n",
      "l = 10.;        #Length of the Feeder\n",
      "\n",
      "#Primary voltages for various cases\n",
      "VPpua = 1.01;\n",
      "VPpub = 1.00;\n",
      "\n",
      "s1 = Symbol('s1');         #Variable Value of Regulator length\n",
      "#Function to find the equation for the regulator dismath.tance\n",
      "def dist(y): \n",
      "    return (s1*(2-(s1/l))/l)-((VRRpu-y)/TVDpu)\n",
      "\n",
      "# Calculations\n",
      "#Different Cases\n",
      "Xa = dist(VPpua);\n",
      "Xb = dist(VPpub);\n",
      "\n",
      "s1a = solve(Xa);\n",
      "if((abs(l-s1a[0])+(l-s1a[0])) == 0):\n",
      "    s1a = s1a[1];\n",
      "else:\n",
      "    s1a = s1a[0];\n",
      "\n",
      "s1b = solve(Xb);\n",
      "if((abs(l-s1b[0])+(l-s1b[0])) == 0):\n",
      "    s1b = s1b[1];\n",
      "else:\n",
      "    s1b = s1b[0];\n",
      "\n",
      "# Results\n",
      "print 'a) The Regulator must be placed at %g miles from the start of the feeder'%(s1a)\n",
      "print 'b) The Regulator must be placed at %g miles from the start of the feeder'%(s1b)\n",
      "print 'c The Advantage of a over b is that it can compensate for future growth'\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a) The Regulator must be placed at 1.76693 miles from the start of the feeder\n",
        "b) The Regulator must be placed at 2.59076 miles from the start of the feeder\n",
        "c The Advantage of a over b is that it can compensate for future growth\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.3  Page No : 473"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "l = 10.;         #Length of the feeder\n",
      "S3phi = 4000.;         #Annual Peak Load in kVA\n",
      "VPpu = 1.01;         #Primary Feeder Voltage\n",
      "s1 = 1.75;         # Dismath.tance of the Regulator\n",
      "Rmax = 10./100;         #Regulation Percent\n",
      "\n",
      "# Calculations\n",
      "S = S3phi*(1-(s1/l));         #Uniformly Distributed three phase load\n",
      "Sph = S/3;         #Single Phase Load\n",
      "\n",
      "Sreg = Rmax*Sph;         #Regulated Size\n",
      "\n",
      "# Results\n",
      "print 'The Calculated Circuit Kilovoltampere Size is %g kVA, And The corresponding Minimum kilovoltampere size \\\n",
      "of the regulator size can be found as 114.3 kVA'%(Sreg)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Calculated Circuit Kilovoltampere Size is 110 kVA, And The corresponding Minimum kilovoltampere size of the regulator size can be found as 114.3 kVA\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.4  Page No : 474"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "#To specify the best settings for regulation\n",
      "#Page 474\n",
      "\n",
      "# Variables\n",
      "s1 = 1.75;         #As Found in Example 2\n",
      "VRRpu = 1.035;         #As R and X are zero, the Settings turn out to produce this\n",
      "\n",
      "#Parameters of Distribution\n",
      "K = 3.88*(10**-6);\n",
      "S = 3300.;\n",
      "l = 10.;         #length of the line\n",
      "\n",
      "# Calculations\n",
      "VDpu = K*S*(l-s1)/2;         #Per unit voltage drop\n",
      "\n",
      "VP = VRRpu-VDpu;         #Primary Feeder Voltage\n",
      "\n",
      "#We Obtain VDs  =  K*(S3-((S3*s)/l))s+K(S*s/l)s/2;\n",
      "#We take various values of s and carry out the computation and hence form the table 9-4 given given in the result file\n",
      "\n",
      "#We Obtain from the voltage drop value for any give point s between the substation and the regulator  station as\n",
      "#VDs = I(r.math.cos(theta)+ del math.sin(theta))s*(1-(s/(2*l)))\n",
      "\n",
      "#We finally Get VDs  =  3.88 * (10**-6) * (3300-(3300s/8.25))s+3.88*(10**-6)*(3300s/8.25)*s/2\n",
      "\n",
      "# Results\n",
      "#Again for different values of s we get the table 9-5\n",
      "print 'a)The Best Settings for LDCs R and X, and for the VRR'\n",
      "print 'The best settings for LDC of the regulator are when settings for both R and X are zero and VRRpu  =  %g pu V'%(VRRpu)\n",
      "print 'b)The Voltage Drop occuring in the feeder portion between the regulating point and the end of the feeder is %g pu V'%(VDpu)\n",
      "print 'The Result Files give the Profiles and relevant information about the solution'\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a)The Best Settings for LDCs R and X, and for the VRR\n",
        "The best settings for LDC of the regulator are when settings for both R and X are zero and VRRpu  =  1.035 pu V\n",
        "b)The Voltage Drop occuring in the feeder portion between the regulating point and the end of the feeder is 0.0528165 pu V\n",
        "The Result Files give the Profiles and relevant information about the solution\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.5  Page No : 478"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "#To determine the setting of the regulator so that the voltage criteria is met\n",
      "#Page 478\n",
      "\n",
      "# Variables\n",
      "l = 10.;         #Length of the feeder\n",
      "s1 = 1.75;\n",
      "ra = 0.386;\n",
      "xa = 0.4809;\n",
      "xd = 0.1802;\n",
      "xL = xa+xd;\n",
      "Vb = 120;\n",
      "pf = 0.85;         #Power Factor\n",
      "S = 1100.;         #Load in kVA\n",
      "Vln = 7.62;         #line to neutral voltage in kV\n",
      "Reff = ra*(l-s1)/2;\n",
      "Xeff = xL*(l-s1)/2;\n",
      "\n",
      "#Primary Ratings\n",
      "CTp = 150;         #Current Tranformer\n",
      "PTn = 63.5;         #POtential Transformer\n",
      "\n",
      "# Calculations\n",
      "#R Value of the dial\n",
      "Rset = (CTp/PTn)*Reff;\n",
      "Rsetpu = Rset/Vb;\n",
      "\n",
      "#X value of the dial\n",
      "Xset = (CTp/PTn)*Xeff;\n",
      "Xsetpu = Xset/Vb;\n",
      "\n",
      "VRP = 1.0138;         #Assumption Made on the Regulating Point\n",
      "#Output Voltage of the Regulator\n",
      "Vreg = VRP+((S/Vln)*((Rset*pf)+(Xset*math.sin(math.radians(math.acos(pf)))))/(CTp*Vb)); \n",
      "\n",
      "# Results\n",
      "print 'a) The Regulating Voltage is %g pu V'%(Vreg)\n",
      "print 'As per Table 9-6; the primary voltage criteria are met by using the R and X settings'\n",
      "print 'b The Voltage Profiles are given in the result file attached'\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a) The Regulating Voltage is 1.03994 pu V\n",
        "As per Table 9-6; the primary voltage criteria are met by using the R and X settings\n",
        "b The Voltage Profiles are given in the result file attached\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.6  Page No : 480"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "#From Problems 4 and 5 the co-effcients are obtained\n",
      "VRRpu = 1.035;\n",
      "Vreg4 = 1.0337;\n",
      "Vreg5 = 1.0666;\n",
      "VRP4 = 1.0337;\n",
      "VRP5 = 1.0138;\n",
      "Vmin = 1.010;         #For s =  1.75\n",
      "\n",
      "# Calculations\n",
      "#Steps\n",
      "Buck4 = (VRRpu-VRP4)/(0.00625);\n",
      "Buck5 = (VRRpu-VRP5)/(0.00625);\n",
      "Boost4 = (Vreg4-Vmin)/(0.00625);\n",
      "Boost5 = (Vreg5-Vmin)/(0.00625);\n",
      "\n",
      "# Results\n",
      "print 'a) The Number of steps of buck and number is steps of boost in example 9-4 is %g and %g respectively'%(Buck4,Boost4)\n",
      "print 'b) The Number of steps of buck and number is steps of boost in example 9-5 is %g and %g respectively'%(Buck5,Boost5)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a) The Number of steps of buck and number is steps of boost in example 9-4 is 0.208 and 3.792 respectively\n",
        "b) The Number of steps of buck and number is steps of boost in example 9-5 is 3.392 and 9.056 respectively\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.8  Page No : 482"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "l = 3.;        #Length of the line\n",
      "Vlc = 2450.;         #Regulated Voltage\n",
      "Vcp = 12800.;         #Primary of customer transformer\n",
      "        #Base Values\n",
      "Vlbp = 2400.;         #Primary Bus Voltage of Customer's Bus(Low Voltage)\n",
      "Vlbs = 4160.;        #Secondary Bus Voltage of Customer's Bus\n",
      "Sb = 5000.;         #Power in kVA\n",
      "r = 0.3;         #Line Resismath.tance per mile\n",
      "x = 0.8;         #Line Reacmath.tance per mile\n",
      "Vhbp = 7390.;        #Primary Bus Voltage of High Voltage Bus\n",
      "Vhbs = 12800.;        #Secondary Bus Voltage of High Voltage Bus\n",
      "PTn = 63.5;         #Potential Transformer Turns Ratio\n",
      "CTp = 250.;        #Current Transformer Turns Ratio\n",
      "VRP = Vlc/Vlbp;        #Voltage at RP \n",
      "Vll = Vhbs/1000;         #Line Voltage\n",
      "VBsec = Vcp/(math.sqrt(3)*PTn);         #Secondary Reading of the Customer Transformer\n",
      "\n",
      "# Calculations\n",
      "VRRset = VRP*VBsec;         #Setting of the voltage-setting dial of VRR\n",
      "\n",
      "Zb = (Vll**2)*1000/Sb;         #Applicable Impedance Base\n",
      "Ztpu = 0.05*1j;        #Transformer Impedance per unit\n",
      "Zt = Ztpu*Zb;        #Transformer Impedance\n",
      "\n",
      "        #Effective Resismath.tances and Reacmath.tances\n",
      "Reff = (r*l)+Zt.real;\n",
      "Xeff = (x*l)+Zt.imag;\n",
      "\n",
      "Rset = CTp*Reff/PTn;         #X Dial Setting of LDCs\n",
      "Xset = CTp*Xeff/PTn;         #X Dial Setting of LDCs\n",
      "\n",
      "# Results\n",
      "print 'a) The Necessary Setting of the voltage-setting dial of the VRR of each single phase regulator in use is %g V'%(VRRset)\n",
      "print 'b) R and X dial settings of LDS is %g ohm and %g ohm respectively'%(Rset,Xset)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a) The Necessary Setting of the voltage-setting dial of the VRR of each single phase regulator in use is 118.804 V\n",
        "b) R and X dial settings of LDS is 3.54331 ohm and 15.8992 ohm respectively\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.9  Page No : 484"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "#To Determine the Design Parameters of a Distributed System\n",
      "#Page 484\n",
      "\n",
      "# Variables\n",
      "VPpu = 1.035;         #Primary Feeder Voltage per unit\n",
      "TVDpu = 0.0776;         #Total Voltage Drop of Feeder\n",
      "Vll = 13.2;         #Line Voltage in kV\n",
      "Vlpuqsw = 1;        #New Voltage at the End of the Feeder due to Qsw at annual peak load\n",
      "XL = 0.661;         #Inductive Reacmath.tance per mile\n",
      "Pl = 3400;         #Real Power\n",
      "Ql = 2100;         #Reactive Power\n",
      "l = 10.;         #Length of the Feeder in Miles\n",
      "Lf = 0.4;         #Load Factor\n",
      "CR = 0.27;         #Total Capacitor Compensation Ratio For the Above Load Factor\n",
      "QNSW = CR*Ql;         #Required Size of the Nonswitched capacitor bank\n",
      "s = 2*l/3;         #Loacation of Nonswitched capacitor bank for Optimum Result\n",
      "VRpu = QNSW*(2*XL*l/3)/(1000*(Vll**2));         #Per Unit Voltage Rise\n",
      "VDspu = TVDpu*s*(2-(s/l))/l;         #Voltage drop for the uniformaly distributed load\n",
      "\n",
      "VSpu = VPpu-VDspu;        #Feeder Voltage at 2l/3 dismath.tance\n",
      "\n",
      "nVSpu = VSpu+VRpu;         #New Voltage Rise when there is a fixed capacitor bank\n",
      "\n",
      "Vlpu = VPpu-TVDpu;         #When No Capcacitor bank is there, the voltage at the end of the feeder\n",
      "\n",
      "nVlpu = Vlpu+VRpu;         #When Capcacitor bank is there, the voltage at the end of the feeder\n",
      "VRpuqsw = Vlpuqsw-nVlpu;         #Required Voltage Rise\n",
      "\n",
      "Q3phisw = 1000*(Vll**2)*VRpuqsw/(XL*l);         #Required Size of the Capacitor Bank\n",
      "\n",
      "# Calculations\n",
      "#Let us assume the 15 single phase standard 50 kVAr Capacitor Units  =  750 kVAr\n",
      "\n",
      "SQ3phisw = 750;         #Selected Capacitor Bank\n",
      "\n",
      "RVRlpu = VRpuqsw*SQ3phisw/Q3phisw;         #Resulmath.tant Voltage Rises at dismath.tance l\n",
      "RVRspu = RVRlpu*s/l;         #Resulmath.tant Voltage Rises at dismath.tance s\n",
      "\n",
      "#At Peak Load when both the Non-Switched and Switched Capacitor Banks are on\n",
      "\n",
      "PVspu = nVSpu+RVRspu;         #Voltage at s\n",
      "PVlpu = nVlpu+RVRlpu;         #Voltage at l\n",
      "\n",
      "# Results\n",
      "print 'a) The NSW Capacitor Rating is %g kVAr, Which means 2 100kVAr Capacitor Banks per phase'%(QNSW)\n",
      "print 'b) Voltage Rise per unit is %g pu V'%(VRpu)\n",
      "print 'i When the No Capacitor Bank is Installed '\n",
      "print 'Voltage at %g miles is %g pu V'%(s,VSpu)\n",
      "print 'Voltage at %g miles is %g pu V'%(l,Vlpu)\n",
      "print 'ii When the Fixed Capacitor Bank is Installed '\n",
      "print 'Voltage at %g miles is %g pu V'%(s,nVSpu)\n",
      "print 'Voltage at %g miles is %g pu V'%(l,nVlpu)\n",
      "print 'c) At Annual Peak Load, The Size of Capacitor Bank Required is %g'%(Q3phisw)\n",
      "print 'The Voltage Rise at the Annual Load for the Required Capacitor Bank is %g pu V'%(VRpuqsw)\n",
      "\n",
      "#Note That The Calculations are highly accurate, Rounding of Terms hasn't be emplyed\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a) The NSW Capacitor Rating is 567 kVAr, Which means 2 100kVAr Capacitor Banks per phase\n",
        "b) Voltage Rise per unit is 0.0143399 pu V\n",
        "i When the No Capacitor Bank is Installed \n",
        "Voltage at 6.66667 miles is 0.966022 pu V\n",
        "Voltage at 10 miles is 0.9574 pu V\n",
        "ii When the Fixed Capacitor Bank is Installed \n",
        "Voltage at 6.66667 miles is 0.980362 pu V\n",
        "Voltage at 10 miles is 0.97174 pu V\n",
        "c) At Annual Peak Load, The Size of Capacitor Bank Required is 744.939\n",
        "The Voltage Rise at the Annual Load for the Required Capacitor Bank is 0.0282601 pu V\n"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.10  Page No : 488"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "from numpy import exp\n",
      "#To Determine the proper 3 phase capacitor bank\n",
      "#Page 488\n",
      "\n",
      "# Variables\n",
      "V = 12.8;         #Voltage in kV\n",
      "xl = 0.8;         #Reacmath.tance per unit length\n",
      "l = 3;         #Dismath.tance of the line\n",
      "Xl = xl*l;         #Effective Reacmath.tance of the the Line\n",
      "pf = 0.8;         #Initial Power Factor\n",
      "pfn = 0.88;         #New Improved Power Factor\n",
      "Qcu = 150;         #Capacity of each unit available\n",
      "XT = 1.6384;         #Reacmath.tance of the transformer\n",
      "\n",
      "# Calculations\n",
      "S3phi = 5000*exp(1j*math.pi*math.acos(pf)/180);         #Presently existing Load\n",
      "\n",
      "#For New Load Real part of the Load doesn't Change\n",
      "\n",
      "QLnew = (S3phi.real)*math.degrees(math.atan(math.acos(pfn)));         #The Required VAr\n",
      "\n",
      "S3phinew  = math.sqrt(((S3phi.real)**2)+(QLnew**2));         #New Apparent Power\n",
      "\n",
      "Qc = (S3phi.imag)-QLnew;         #Minimum Size of capacitor bank;\n",
      "\n",
      "N = math.ceil(Qc/Qcu);         #Number of Units Required\n",
      "Qcn = N*Qcu;         #Required VAr\n",
      "\n",
      "XL = Xl+XT;         #Total Reacmath.tance\n",
      "\n",
      "VRpu = Qcn*XL/(1000*(V**2));         #Voltage Rise Per unit\n",
      "\n",
      "# Results\n",
      "print 'The The Voltage Rise found out is %g pu V, which is greater than the voltage rise criterion.Hence %g Capacitor units\\\n",
      " of %g kVAr must be installed'%(VRpu,N,Qcu)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The The Voltage Rise found out is -3.2425 pu V, which is greater than the voltage rise criterion.Hence -877 Capacitor units of 150 kVAr must be installed\n"
       ]
      }
     ],
     "prompt_number": 19
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.11  Page No : 493"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "Skva = 6.3*(10**3);         #Starting kVA per HP of the Motor\n",
      "HPmotor = 10.;         #Power Rating\n",
      "Vll = 7.2*(10**3);         #Line Voltage\n",
      "I3phi = 1438.;         #Fault Current\n",
      "\n",
      "# Calculations\n",
      "Sstart = Skva*HPmotor;         #Starting kVA\n",
      "VDIP = 120*Sstart/(I3phi*Vll);         #Voltage Dip\n",
      "\n",
      "# Results\n",
      "print 'a) The Voltage dip due to the motor start is %g V'%(VDIP)\n",
      "print 'b) From the Permissible voltage flicker limit curve%( The Voltage dip of 0.73 Vwith a frequency of\\\n",
      " 15 times per hour is in the satisfactory flicker zone and therefore is not objectionable to the immediate customers'\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a) The Voltage dip due to the motor start is 0.730181 V\n",
        "b) From the Permissible voltage flicker limit curve%( The Voltage dip of 0.73 Vwith a frequency of 15 times per hour is in the satisfactory flicker zone and therefore is not objectionable to the immediate customers\n"
       ]
      }
     ],
     "prompt_number": 20
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 9.12  Page No : 495"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "# Variables\n",
      "Skva = 5.6*(10**3);         #Starting kVA per HP of the Motor\n",
      "HPmotor = 100.;         #Power Rating\n",
      "Vll = 12.47*(10**3);         #Line Voltage\n",
      "I3phi = 1765.;         #Fault Current\n",
      "\n",
      "# Calculations\n",
      "Sstart = Skva*HPmotor;         #Starting kVA\n",
      "VDIP = 69.36*Sstart/(I3phi*Vll);         #Voltage Dip\n",
      "\n",
      "# Results\n",
      "print 'a) The Voltage dip due to the motor start is %g V'%(VDIP)\n",
      "print 'b) From the Permissible voltage flicker limit curve, The Voltage dip of 1.72 Vwith a frequency of three\\\n",
      " times per hour is in the satisfactory flicker zone and therefore is not objectionable to the immediate customers'\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a) The Voltage dip due to the motor start is 1.76476 V\n",
        "b) From the Permissible voltage flicker limit curve, The Voltage dip of 1.72 Vwith a frequency of three times per hour is in the satisfactory flicker zone and therefore is not objectionable to the immediate customers\n"
       ]
      }
     ],
     "prompt_number": 21
    }
   ],
   "metadata": {}
  }
 ]
}