summaryrefslogtreecommitdiff
path: root/Electrical_Circuit_Theory_And_Technology/chapter_26-checkpoint_1.ipynb
blob: 4edde9321c87c62a7fbfb11ad786ed8152dae3b5 (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
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h1>Chapter 26: Power in a.c. circuits</h1>"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 1, page no. 466</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Determine the active power in the circuit\n",
      "from __future__ import division\n",
      "import math\n",
      "import cmath\n",
      "#initializing  the  variables:\n",
      "RL  =  12j;#  in  ohm\n",
      "R  =  5;#  in  ohm\n",
      "rv  =  52;#  in  volts\n",
      "thetav  =  30;#  in  degree\n",
      "\n",
      "#calculation:\n",
      " #voltage\n",
      "V  =  rv*math.cos(thetav*math.pi/180)  +  1j*rv*math.sin(thetav*math.pi/180)\n",
      " #impedance,  Z\n",
      "Z  =  R  +  RL\n",
      " #current\n",
      "I  =  V/Z\n",
      " #Active  power,  P\n",
      "Pa  =  V.real*I.real  +  V.imag*I.imag\n",
      "\n",
      "\n",
      "#Results\n",
      "print  \"\\n\\n  Result  \\n\\n\"\n",
      "print  \"\\nthe  active  power  in  the  circuit  \",Pa,\"  W\\n\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "\n",
        "  Result  \n",
        "\n",
        "\n",
        "\n",
        "the  active  power  in  the  circuit   80.0   W"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 2, page no. 467</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Determine (a) the active power, and (b) the reactive power.\n",
      "from __future__ import division\n",
      "import math\n",
      "import cmath\n",
      "#initializing  the  variables:\n",
      "V  =  120  +  200j;#  in  volts\n",
      "I  =  15  +  8j;#  in  amperes\n",
      "\n",
      "#calculation:\n",
      " #Active  power,  P\n",
      "Pa  =  V.real*I.real  +  V.imag*I.imag\n",
      " #Reactive  power,  Q\n",
      "Q  =  V.imag*I.real  -  V.real*I.imag\n",
      "\n",
      "#Results\n",
      "print  \"\\n\\n  Result  \\n\\n\"\n",
      "print  \"\\n  (a)  the  active  power  in  the  circuit  \",Pa,\"  W\\n\"\n",
      "print  \"\\n  (b)  the  reactive  power  in  the  circuit  \",Q,\"  var\\n\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "\n",
        "  Result  \n",
        "\n",
        "\n",
        "\n",
        "  (a)  the  active  power  in  the  circuit   3400.0   W\n",
        "\n",
        "\n",
        "  (b)  the  reactive  power  in  the  circuit   2040.0   var"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 3, page no. 468</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#determine (a) the current flowing and its phase, (b) the value of resistance R, and (c) the value of capacitance C.\n",
      "from __future__ import division\n",
      "import math\n",
      "import cmath\n",
      "#initializing  the  variables:\n",
      "Vm  =  141.4;#  in  volts\n",
      "w  =  10000;#  in  rad/sec\n",
      "phiv  =  math.pi/9;#  in  radian\n",
      "Pd  =  1732;#  in  Watts\n",
      "pf  =  0.866;#  power  fctr\n",
      "\n",
      "#calculation:\n",
      " #the  rms  voltage,\n",
      "Vrms  =  0.707*Vm\n",
      " #Power  P  =  V*I*cos(phi)\n",
      " #current  magnitude,  Irms\n",
      "Irms  =  Pd/(Vrms*pf)\n",
      "phid  =  math.acos(pf)\n",
      " #current  phase  angle\n",
      "phii  =  phiv  +  phid\n",
      "phiid  =  phii*180/math.pi#  in  degrees\n",
      " #Voltage,  V\n",
      "V  =  Vrms*math.cos(phiv)  +  1j*Vrms*math.sin(phiv)\n",
      " #current,  I\n",
      "I  =  Irms*math.cos(phii)  +  1j*Irms*math.sin(phii)\n",
      " #Impedance,  Z\n",
      "Z  =  V/I\n",
      " #resistance,  R\n",
      "R  =  Z.real\n",
      " #capacitive  reactance,  Xc\n",
      "Xc  =  abs(Z.imag)\n",
      " #capacitance,  C\n",
      "C  =  1/  (w*Xc)\n",
      "\n",
      "\n",
      "#Results\n",
      "print  \"\\n\\n  Result  \\n\\n\"\n",
      "print  \"\\n  (a)the  current  flowing  and  Circuit  phase  angle  is  \",round(Irms,2),\"/_\",round(phiid,2),\"deg  A\\n\"\n",
      "print  \"\\n  (b)  the  resistance  is  \",round(R,2),\"  ohm\\n\"\n",
      "print  \"\\n  (c)  the  capacitance  is  \",round(C*1E6,2),\"uF\\n\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "\n",
        "  Result  \n",
        "\n",
        "\n",
        "\n",
        "  (a)the  current  flowing  and  Circuit  phase  angle  is   20.01 /_ 50.0 deg  A\n",
        "\n",
        "\n",
        "  (b)  the  resistance  is   4.33   ohm\n",
        "\n",
        "\n",
        "  (c)  the  capacitance  is   40.02 uF"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 4, page no. 468</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#determine the active power developed between points (a) A and B, (b) C and D, (c) E and F.\n",
      "from __future__ import division\n",
      "import math\n",
      "#initializing  the  variables:\n",
      "rv  =  100;#  in  volts\n",
      "thetav  =  0;#  in  degrees\n",
      "R  =  5;#  in  ohm\n",
      "R1  =  3;#  in  ohms\n",
      "RL  =  4j;#  in  ohm\n",
      "Rc  =  -10j;#  in  ohms\n",
      "\n",
      "#calculation:\n",
      " #impedance,  Z1\n",
      "Z1  =  R1  +  RL\n",
      " #impedance,  Zc\n",
      "Zc  =  Rc\n",
      " #Circuit  impedance,  Z\n",
      "Z  =  R  +  (Z1*Zc/(Z1  +  Zc))\n",
      " #voltage\n",
      "V  =  rv*math.cos(thetav*math.pi/180)  + 1j*rv*math.sin(thetav*math.pi/180)\n",
      "I  =  V/Z\n",
      "Imag  =  ((I.real)**2  +  (I.imag)**2)**0.5\n",
      " #Active  power  developed  between  points  A  and  B\n",
      "Pab  =  (Imag**2)*R\n",
      " #Active  power  developed  between  points  C  and  D\n",
      "Pcd  =  (Imag**2)*Zc.real\n",
      " #Current,  I1\n",
      "I1  =  I*Zc/(Zc  +  Z1)\n",
      "I1mag  =  ((I1.real)**2  +  (I1.imag)**2)**0.5\n",
      " #active  power  developed  between  points  E  and  F\n",
      "Pef  =  (I1mag**2)*Z1.real\n",
      "\n",
      "\n",
      "#Results\n",
      "print  \"\\n\\n  Result  \\n\\n\"\n",
      "print  \"\\n  (a)Active  power  developed  between  points  A  and  B  is  \",round(Pab,2),\"  W\\n\"\n",
      "print  \"\\n  (b)Active  power  developed  between  points  C  and  D  is  \",round(Pcd,2),\"  W\\n\"\n",
      "print  \"\\n  (c)Active  power  developed  between  points  E  and  F  is  \",round(Pef,2),\"  W\\n\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "\n",
        "  Result  \n",
        "\n",
        "\n",
        "\n",
        "  (a)Active  power  developed  between  points  A  and  B  is   339.62   W\n",
        "\n",
        "\n",
        "  (b)Active  power  developed  between  points  C  and  D  is   0.0   W\n",
        "\n",
        "\n",
        "  (c)Active  power  developed  between  points  E  and  F  is   452.83   W"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 5, page no. 469</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Determine (a) the apparent power, (b) the reactive power, \n",
      "#(c) the value and phase of current I, and (d) the value of impedance Z.\n",
      "from __future__ import division\n",
      "import math\n",
      "import cmath\n",
      "#initializing  the  variables:\n",
      "Pa  =  400;#  in  Watts\n",
      "rv  =  100;#  in  volts\n",
      "thetav  =  30;#  in  degrees\n",
      "R  =  4;#  in  ohm\n",
      "pf  =  0.766;#  power  factor\n",
      "\n",
      " #calculation:\n",
      "V  =  rv*math.cos(thetav*math.pi/180)  +  1j*rv*math.sin(thetav*math.pi/180)\n",
      " #magnitude  of  apparent  power,S  =  V*I\n",
      "S  =  Pa/pf\n",
      "phi  =  math.acos(pf)\n",
      "theta  =  phi*180/math.pi#  in  degrees\n",
      " #Reactive  power  Q\n",
      "Q  =  S*math.sin(phi)\n",
      " #magnitude  of  current\n",
      "Imag  =  S/rv\n",
      "thetai  =  thetav  -  theta\n",
      "I  =  Imag*math.cos(thetai*math.pi/180)  +  1j*Imag*math.sin(thetai*math.pi/180)\n",
      " #Total  circuit  impedance  ZT\n",
      "ZT  =  V/I\n",
      " #impedance  Z\n",
      "Z  =  ZT  -  R\n",
      "\n",
      "\n",
      "#Results\n",
      "print  \"\\n\\n  Result  \\n\\n\"\n",
      "print  \"\\n  (a)apparent  power  is  \",round(S,2),\"  VA\\n\"\n",
      "print  \"\\n  (b)reactive  power  is  \",round(Q,1),\"  var lagging\\n\"\n",
      "print  \"\\n  (c)the  current  flowing  and  Circuit  phase  angle  is  \",round(Imag,2),\"/_\",round(thetai,2),\"deg  A\\n\"\n",
      "print  \"\\n  (d)impedance,  Z  is  \",round(Z.real,2),\"  +  (\",round(  Z.imag,2),\")i  ohm\\n\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "\n",
        "  Result  \n",
        "\n",
        "\n",
        "\n",
        "  (a)apparent  power  is   522.19   VA\n",
        "\n",
        "\n",
        "  (b)reactive  power  is   335.7   var lagging\n",
        "\n",
        "\n",
        "  (c)the  current  flowing  and  Circuit  phase  angle  is   5.22 /_ -10.0 deg  A\n",
        "\n",
        "\n",
        "  (d)impedance,  Z  is   10.67   +  ( 12.31 )i  ohm\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 6, page no. 471</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Determine the rating (in kilovars) of the capacitors required.\n",
      "from __future__ import division\n",
      "import math\n",
      "import cmath\n",
      "#initializing  the  variables:\n",
      "S  =  300000;#  in  VA\n",
      "pf1  =  0.70;#  in  power  factor\n",
      "pf2  =  0.90;#  in  power  factor\n",
      "\n",
      "#calculation:\n",
      " #active  power,  P\n",
      "Pa  =  S*pf1\n",
      "phi1  =  math.acos(pf1)\n",
      "phi1d  =  phi1*180/math.pi\n",
      " #Reactive  power,  Q\n",
      "Q  =  S*math.sin(phi1)\n",
      "phi2  =  math.acos(pf2)\n",
      "phi2d  =  phi2*180/math.pi\n",
      " #The  capacitor  rating  needed  to  improve  the  power  factor  to  0.90\n",
      " #the  capacitor  rating,\n",
      "Pr  =  Q  -  (Pa*math.tan(phi2))\n",
      "\n",
      "\n",
      "#Results\n",
      "print  \"\\n\\n  Result  \\n\\n\"\n",
      "print  \"\\n  the  rating  (in  kilovars)  of  the  capacitors  is  \",round((Pr/1E3),2),\"  kvar leading\\n\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "\n",
        "  Result  \n",
        "\n",
        "\n",
        "\n",
        "  the  rating  (in  kilovars)  of  the  capacitors  is   112.54   kvar leading"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 7, page no. 471</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Determine (a) the supply current, (b) the active, apparent and reactive power,\n",
      "#(c) the rating of a capacitor (d) the value of capacitance\n",
      "from __future__ import division\n",
      "import math\n",
      "import cmath\n",
      "#initializing  the  variables:\n",
      "Z  =  3  +  4j;#  in  ohms\n",
      "rv  =  50;#  in  volts\n",
      "thetav  =  30;#  in  Degrees\n",
      "f  =  1500;#  in  Hz\n",
      "pf1  =  0.966;#  in  power  factor\n",
      "\n",
      "#calculation:\n",
      "V  =  rv*math.cos(thetav*math.pi/180)  + 1j*rv*math.sin(thetav*math.pi/180)\n",
      " #Supply  current,  I\n",
      "I  =  V/Z\n",
      "Istr  =  I.real  -  1j*I.imag\n",
      " #Apparent  power,  S\n",
      "S  =  V*Istr\n",
      " #active  power,  Pa\n",
      "Pa  =  S.real\n",
      "#reactive  power,  Q\n",
      "Q  =  abs(S.imag)\n",
      " #apparent  power,  S\n",
      "S  =  (S.real**2  +  S.imag**2)**0.5\n",
      "phi1  =  math.acos(pf1)\n",
      "phi1d  =  phi1*180/math.pi\n",
      " #rating  of  the  capacitor  \n",
      "Pr  =  Q  -  Pa*math.tan(phi1)\n",
      " #Current  in  capacitor,  Ic\n",
      "Ic  =  Pr/rv\n",
      " #Capacitive  reactance,  Xc\n",
      "Xc  =  rv/Ic\n",
      "C  =  1/(2*math.pi*f*Xc)\n",
      "\n",
      "\n",
      "#Results\n",
      "print  \"\\n\\n  Result  \\n\\n\"\n",
      "print  \"\\n  (a)supply  current,  I  is  \",round(I.real,2),\"  +  (\",round(  I.imag,2),\")i  A\\n\"\n",
      "print  \"\\n  (b)active  power  is  \",round(Pa,2),\"  W,  apparent  power  is  \",round(  S,2),\"  W  \"\n",
      "print   \"and  reactive  power  is  \",round(  Q,2),\"  W lagging\\n\"\n",
      "print  \"\\n  (c)the  rating  of  the  capacitors  is  \",round(Pr,2),\"  var leading\\n\"\n",
      "print  \"\\n  (d)value  of  capacitance  needed  to  improve  the  power  factor  to  0.966  lagging  is  \",round(  C*1E6,2),\"uF\\n\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "\n",
        "  Result  \n",
        "\n",
        "\n",
        "\n",
        "  (a)supply  current,  I  is   9.2   +  ( -3.93 )i  A\n",
        "\n",
        "\n",
        "  (b)active  power  is   300.0   W,  apparent  power  is   500.0   W  and  reactive  power  is   400.0   W lagging\n",
        "\n",
        "\n",
        "  (c)the  rating  of  the  capacitors  is   319.71   var leading\n",
        "\n",
        "\n",
        "  (d)value  of  capacitance  needed  to  improve  the  power  factor  to  0.966  lagging  is   13.57 uF"
       ]
      }
     ],
     "prompt_number": 3
    }
   ],
   "metadata": {}
  }
 ]
}