summaryrefslogtreecommitdiff
path: root/Generation_Of_Electrical_Energy_by_B._R._Gupta/Chapter13.ipynb
blob: 2ff5f29b7bc60b90b01bab0b0c3d1882d9af3ee5 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:e3f5e499dcd1ee49e675b7d331eadcbb56a69331fd31c0617d103de1bd691963"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Ch-13, Major Electrical Equipment in Power Plant"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 13.1 Page 277"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "pg=3000  #kva rating of generators single phase\n",
      "xg=0.1  #10%reactanse of generator\n",
      "vg=11   #voltage at the terminals of generator\n",
      "xbf=5    #reactanse of feeder fron bus to fault\n",
      "pb=pg ;vb=vg ;ib=pg/vg  #let power and voltage of as respective base then current base\n",
      "zb=(vb*10**3)/ib   #base impedence\n",
      "xpu=xbf/zb  #per unit reactance of feeder\n",
      "tx=(xg/2)+(xpu) #total reactance \n",
      "sckva=pg/tx  #short circuit kva is ratio ofpower to total reactance\n",
      "sci=sckva/vg   #short circuit current\n",
      "print 'a'\n",
      "print \" p.u.feeder reactor %.3fp.u \\n total reactance is %.3fp.u \\n short circuit kVA %dkVA \\n short circuit current %.1fA\"%(xpu,tx,sckva,sci)\n",
      "gz=zb*xg  #generator impedence\n",
      "tz=(gz/2)+xbf  #total impedence\n",
      "scc=(vg*10**3)/tz  #short circuit current in ampears\n",
      "print 'b' \n",
      "print \" generator impedence %.3fohm \\n total impedence %.3f ohm \\n short circuit current %.1fA\"%(gz,tz,scc)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a\n",
        " p.u.feeder reactor 0.000p.u \n",
        " total reactance is 0.050p.u \n",
        " short circuit kVA 60000kVA \n",
        " short circuit current 5454.5A\n",
        "b\n",
        " generator impedence 4.000ohm \n",
        " total impedence 7.000 ohm \n",
        " short circuit current 1571.4A\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 13.2 page 277"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import sqrt\n",
      "pa1=20000 ; pa2=30000  #kva in in 3 ph power\n",
      "va1=11    ; va2=11  #voltage in kilo volts\n",
      "pt1=20000 ; pt2=30000#kva of 3 ph transformer\n",
      "vpt1=11   ; vpt2=11#voltage of primery of transformer\n",
      "vst1=132  ; vst2=132#voltage of secondary of transformer\n",
      "xg1=0.5  ; xg2=0.65   #reactance of generator\n",
      "xt1=0.05  ;xt2=0.05 #reactance of transformer with their own kva\n",
      "pb=pa2; vbg=va2 ;vbt=vpt2 #assumeing base quantoties\n",
      "xtn1=xt1*pb/pa1  ;xtn2=xt2*pb/pa2 #transformer reactance with new base\n",
      "xgn1=xg1*pb/pa1; xgn2=xg2*pb/pa2\n",
      "xn1=xtn1+xgn1 ;xn2=xtn2+xgn2  #reactancee up to fault from each generator\n",
      "xn=(xn1*xn2)/(xn1+xn2)  #equalent reactance between generator and fault\n",
      "sckva=pb/xn   #short circuit KVA\n",
      "print '(a)'\n",
      "print \" equivalent reactance is %.4f p.u \\n short circuit KVA %dKVA\"%(xn,sckva)\n",
      "print '(b)'\n",
      "sccb=sckva/(vst1*sqrt(3))\n",
      "sccg1=sccb*(xn2/(xn1+xn2))*vst1/vpt1\n",
      "sccg2=sccb*(xn1/(xn1+xn2))*vst2/vpt2\n",
      "print \" short circuit current on bus bar side %.1fA \\n short circuit current of generator 1 is %.1fA \\n short circuit current of generator 2 is %.1fA \\n\"%(sccb,sccg1,sccg2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "(a)\n",
        " equivalent reactance is 0.3787 p.u \n",
        " short circuit KVA 79220KVA\n",
        "(b)\n",
        " short circuit current on bus bar side 346.5A \n",
        " short circuit current of generator 1 is 1908.6A \n",
        " short circuit current of generator 2 is 2249.4A \n",
        "\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 13.3 Page 278"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "pa1=20000 ; pa2=30000  #kva in in 3 ph power\n",
      "va1=11    ; va2=11  #voltage in kilo volts\n",
      "pt1=20000 ; pt2=30000#kva of 3 ph transformer\n",
      "vpt1=11   ; vpt2=11#voltage of primery of transformer\n",
      "vst1=132  ; vst2=132#voltage of secondary of transformer\n",
      "xg1=0.5   ;xg2=0.65   #reactance of generator\n",
      "xt1=0.05  ;xt2=0.05 #reactance of transformer with their own kva\n",
      "pb=pa2 ;vbg=va2 ;vbt=vpt2 #assumeing base quantoties\n",
      "xtn1=xt1*pb/pa1  ;xtn2=xt2*pb/pa2 #transformer reactance with new base\n",
      "xgn1=xg1*pb/pa1 ;xgn2=xg2*pb/pa2\n",
      "xn1=xtn1+xgn1 ;xn2=xtn2+xgn2  #reactancee up to fault from each generator\n",
      "xn=(xn1*xn2)/(xn1+xn2)  #equalent reactance between generator and fault\n",
      "sckva=pb/xn   #short circuit KVA\n",
      "pf=50000  #fault kva rating\n",
      "xf=pb/pf  #reactance from fault\n",
      "xx=xf*xn1/(xn1-xf)\n",
      "x=xx-xn2 #reactance to be added \n",
      "bi=(vst1**2)*1000/(pb)\n",
      "xo=x*bi\n",
      "print \" reactance to be added in circuit of generator 2 have %.1f p.u. \\n reactance in ohms %.1f\"%(x,xo)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " reactance to be added in circuit of generator 2 have -0.7 p.u. \n",
        " reactance in ohms -406.0\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 13.4 Page 278"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "pa=50; xgb=0.5; xb=0.1 #given power,reactance of generator\n",
      "x1=xgb+xb \n",
      "x=x1*x1*xgb/(x1*x1+x1*xgb+x1*xgb)\n",
      "f=pa/x\n",
      "print \" total reactance %.4f.p.u \\n fault MVA %.1fMVA\"%(x,f)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " total reactance 0.1875.p.u \n",
        " fault MVA 266.7MVA\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example13_5 Page 279"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "vb=33\n",
      "pb=20 ;zb=vb**2/pb   #base voltage and base power\n",
      "pa1=10 ;pa2=10; xa1=0.08; xa2=0.08   #given power and reactance for different branches\n",
      "pbb=20 ;xb=0.06 ;pc=15 ;xc=0.12; pd=20; xd=0.08 \n",
      "xab=2.17; xbc=3.26; xcd=1.63; xda=4.35 \n",
      "xap1=xa1*pb/pa1 \n",
      "xap2=xa2*pb/pa2 ;xap=xap1*xap2/(xap1+xap2)\n",
      "xbp=xb*pb/pbb \n",
      "xcp=xc*pb/pc \n",
      "xdp=xd*pb/pd     #generators reactance in per unit\n",
      "xabp=round(xab*100/zb)/100 \n",
      "xbcp=round(xbc*100/zb)/100 \n",
      "xcdp=round(xcd*100/zb)/100 \n",
      "xdap=round(xda*100/zb)/100  #reactance in per unit between bus\n",
      "def del2star(d12,d23,d31):\n",
      "    dsum=d12+d23+d31\n",
      "    s1=d12*d31/(dsum)\n",
      "    s2=d12*d23/(dsum)\n",
      "    s3=d31*d23/dsum\n",
      "    return [s1,s2,s3]\n",
      "def star2del(s1,s2,s3):\n",
      "    d12=s1+s2+(s1*s2)/s3\n",
      "    d23=s2+s3+(s2*s3)/s1\n",
      "    d31=s3+s1+(s3*s1)/s2\n",
      "    return [d12,d31,d23]\n",
      "[xac,xrc,xra]=star2del(xcdp,xdap,xdp)\n",
      "rc=xrc*xcp/(xrc+xcp)\n",
      "ra=xra*xap/(xra+xap)\n",
      "[xpr,xpc,xpa]=del2star(xac,rc,ra)\n",
      "xf1=xbcp+xpc\n",
      "xf2=xpr+xabp\n",
      "xf=xf1*xf2/(xf1+xf2)\n",
      "xfr=xf+xpa\n",
      "xx=xfr*xbp/(xfr+xbp)\n",
      "netr=xx #net reactance\n",
      "fkva=pb*1000/xx\n",
      "print \"the rating of circuit breaker should be %d KVA, or %d MVA\"%(fkva,fkva/1000)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "the rating of circuit breaker should be 671200 KVA, or 671 MVA\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 13_6 Page 285"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "p=150 #given ,power\n",
      "v=11 #given voltage\n",
      "xg=0.12 #reactance of generator\n",
      "xb=0.08 #reactance of line\n",
      "scca=1/xg\n",
      "ms=scca**2\n",
      "sccb=1/(xg+xb)\n",
      "ms1=sccb**2\n",
      "print 'a'\n",
      "print \"short circuit current is %.3fp.u \\n ratio of mechanical stress on short circuit to aech. stresses on full load %.2f\"%(scca,ms)\n",
      "print 'b'\n",
      "print \"short circuit current is with reactor %.3fp.u \\n ratio of mechanical stress on short circuit to aech. stresses on full load with reactor %.f\"%(sccb,ms1)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a\n",
        "short circuit current is 8.333p.u \n",
        " ratio of mechanical stress on short circuit to aech. stresses on full load 69.44\n",
        "b\n",
        "short circuit current is with reactor 5.000p.u \n",
        " ratio of mechanical stress on short circuit to aech. stresses on full load with reactor 25\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example13_7 Page 286"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import acos, pi, sin, cos, atan\n",
      "xf=complex(0,0.04)\n",
      "pf=0.8 ;ph=acos(pf)*180/pi\n",
      "v=1 ;i=1 #let v and i\n",
      "vb=v+i*xf*(complex(cos(ph*pi/180),-sin(ph*pi/180)))\n",
      "iv=vb-abs(v) \n",
      "print \"bus bar voltage %.4f.p.u at angle %.1f\\nincrease in voltage %.4f =%.4f percent\"%(abs(vb),atan(vb.imag/vb.real)*180/pi,abs(iv),abs(iv*100))"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "bus bar voltage 1.0245.p.u at angle 1.8\n",
        "increase in voltage 0.0400 =4.0000 percent\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 13.8 page 286"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "p1=30 ;x1=0.3 #power and reactance of different sets\n",
      "p2=30 ;x2=0.3\n",
      "p3=20 ;x3=0.3\n",
      "l=10  ;xl=0.04\n",
      "pb=p1 ;xp3=x3*pb/p3\n",
      "tr=(xp3*x1*x2)/(xp3*x1+xp3*x2+x1*x2)\n",
      "sc=pb/tr\n",
      "print 'a'\n",
      "print \"total reactance %.4f p.u \\n short circuit MVA on l.v.bus %.2fMVA\"%(tr,sc)\n",
      "print 'b'\n",
      "xlp=xl*pb/l\n",
      "trr=tr+xlp\n",
      "scc=pb/trr\n",
      "print \"total reactance seen from h.v.side of transformer %.2fp.u \\n short circuit MVA %.2fMVA\"%(trr,scc)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a\n",
        "total reactance 0.1125 p.u \n",
        " short circuit MVA on l.v.bus 266.67MVA\n",
        "b\n",
        "total reactance seen from h.v.side of transformer 0.23p.u \n",
        " short circuit MVA 129.03MVA\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 13.9 Page 287"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "p1=30 ;x1=0.15; p2=10; x2=0.125 \n",
      "pt=10 ;vs=3.3 ;pm=100\n",
      "pb=p1 #let base as power of unit 1\n",
      "x22=x2*pb/p2; x11=x1*pb/p1\n",
      "xx=1/((1/x22)+(1/x11)+(1/x11))\n",
      "xl=(pb/pm)-xx\n",
      "xt2=xl*pt/pb\n",
      "bi=vs**2/pt\n",
      "xtt=xt2*bi\n",
      "print \" reactance of transformer is %.4f.p.u \\n reactance of transformer on %dMVA base is %.5fp.u. \\n reactance of transformer %.4fohm\"%(xl,pt,xl,xtt)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " reactance of transformer is -0.0625.p.u \n",
        " reactance of transformer on 10MVA base is -0.06250p.u. \n",
        " reactance of transformer -0.0227ohm\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 13.10 Page 287"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given #p=power/v=voltage/f=frequency/x=reactance/iff=feeder reactance take off\n",
      "pa=20 ;va=11 ;f=50 ;xa=0.2 ;pb=30 ;xb=0.2 ;pf=10 ;xf=0.06; iff=0.5\n",
      "pba=20 ;vba=11\n",
      "xap=xa*pba/pb\n",
      "xfp=xf*pba/pf\n",
      "nx=xfp+(xa/2)*(xa/2+xap)/(xa+xap)\n",
      "fcp=nx**(-1)\n",
      "bc=pba*1000/(va*sqrt(3))\n",
      "fc=fcp*bc\n",
      "print 'a'\n",
      "print \"fault current %.2fohm\"%(fc)\n",
      "ic=iff*fcp\n",
      "xtx=ic**(-1)\n",
      "xn=xtx-nx\n",
      "zb=va**2/pba\n",
      "xnn=xn*zb\n",
      "print 'b'\n",
      "print \"reactance required %.4fohm\"%(xnn)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a\n",
        "fault current 5524.88ohm\n",
        "b\n",
        "reactance required 1.1400ohm\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 13 11 Page 288"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "n1=5 ;x=0.4 ;d=0.1; g=20  #given\n",
      "mva=(g/x)+(g*(n1-1)/(x+n1*d))\n",
      "n2=10  #given\n",
      "mva2=(g/x)+(g*(n2-1)/(x+n2*d))\n",
      "print 'a'\n",
      "print \"fault MVA =(g/x)+(g*(n-1)/(x+nd)) \\n fault level is to equal to fault MVA if n=infinity\"\n",
      "print 'b'\n",
      "print \" MVA=%.2fMVA if n=%d \\n MVA=%.2fMVA if n=%d\"%(mva,n1,mva2,n2)\n",
      "fl=g*((1/x)+(1/d))\n",
      "print 'c'\n",
      "print \"\\nfault level %dMVA\"%(fl)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a\n",
        "fault MVA =(g/x)+(g*(n-1)/(x+nd)) \n",
        " fault level is to equal to fault MVA if n=infinity\n",
        "b\n",
        " MVA=138.89MVA if n=5 \n",
        " MVA=178.57MVA if n=10\n",
        "c\n",
        "\n",
        "fault level 250MVA\n"
       ]
      }
     ],
     "prompt_number": 11
    }
   ],
   "metadata": {}
  }
 ]
}