summaryrefslogtreecommitdiff
path: root/Electrical_Circuit_Theory_And_Technology/chapter_45-checkpoint_2.ipynb
blob: f30323f6b5239af6feeeeec609db76e7b7e27ddc (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
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h1>Chapter 45: Transients and Laplace\n",
      "transforms</h1>"
     ]
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 1, page no. 903</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate (a) the initial value of current flowing, \n",
      "#(b) the value of current 150 ms after connection, \n",
      "#(c) the value of capacitor voltage 80 ms after connection, and \n",
      "#(d) the time after connection when the resistor voltage is 35 V.\n",
      "from __future__ import division\n",
      "import math\n",
      "import cmath\n",
      "#initializing  the  variables:\n",
      "C  =  500E-9;#  in  Farad\n",
      "R  =  100000;#  in  Ohm\n",
      "V  =  50;#  in  VOlts\n",
      "ti  =  0.15;#  in  sec\n",
      "tc  =  0.08;#  in  sec\n",
      "Vrt  =  35;#  in  Volts\n",
      "\n",
      " #calculation:\n",
      " #Initial  current,  \n",
      "i0  =  (V/R)\n",
      " #when  time  t  =  150ms  current  is\n",
      "i150  =  (V/R)*math.e**(-1*ti/(R*C))\n",
      " #capacitor  voltage,  Vc\n",
      "Vc  =  V*(1  -  math.e**(-1*tc/(R*C)))\n",
      " #time,  t\n",
      "tvr  =  -1*R*C*math.log(Vrt/V)\n",
      "\n",
      "\n",
      "#Results\n",
      "print  \"\\n\\n  Result  \\n\\n\"\n",
      "print  \"\\n  initial  value  of  current  flowing  is  \",round(i0*1E3,2),\"mA\"\n",
      "print  \"\\n  current  flowing  at  t  =  150ms  is  \",round(i150*1E6,2),\"uA\"\n",
      "print  \"\\n    value  of  capacitor  voltage  at  t  =  80ms  is  \",round(Vc,2),\"  V\"\n",
      "print  \"\\n    the  time  after  connection  when  the  resistor  voltage  is  35  V  is  \",round(tvr*1E3,2),\"msec\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "\n",
        "  Result  \n",
        "\n",
        "\n",
        "\n",
        "  initial  value  of  current  flowing  is   0.5 mA\n",
        "\n",
        "  current  flowing  at  t  =  150ms  is   24.89 uA\n",
        "\n",
        "    value  of  capacitor  voltage  at  t  =  80ms  is   39.91   V\n",
        "\n",
        "    the  time  after  connection  when  the  resistor  voltage  is  35  V  is   17.83 msec\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 2, page no. 905</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Calculate the p.d. across the capacitor after 20 s\n",
      "from __future__ import division\n",
      "import math\n",
      "import cmath\n",
      "#initializing  the  variables:\n",
      "C  =  5E-6;#  in  Farad\n",
      "R  =  2000000;#  in  Ohm\n",
      "V  =  200;#  in  VOlts\n",
      "tc  =  20;#  in  sec\n",
      "\n",
      " #calculation:\n",
      " #capacitor  voltage,  Vc\n",
      "Vc  =  V*(math.e**(-1*tc/(R*C)))\n",
      "\n",
      "\n",
      "#Results\n",
      "print  \"\\n\\n  Result  \\n\\n\"\n",
      "print  \"\\n    value  of  capacitor  voltage  at  t  =  20s  is  \",round(Vc,2),\"  V\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "\n",
        "  Result  \n",
        "\n",
        "\n",
        "\n",
        "    value  of  capacitor  voltage  at  t  =  20s  is   27.07   V"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 3, page no. 907</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Determine (a) the final value of current, (b) the value of current after 4 ms, \n",
      "#(c) the value of the voltage across the resistor after 6 ms,\n",
      "#(d) the value of the voltage across the inductance after 6 ms, and \n",
      "#(e) the time when the current reaches 15 A.\n",
      "from __future__ import division\n",
      "import math\n",
      "import cmath\n",
      "#initializing  the  variables:\n",
      "L  =  0.05;#  in  Henry\n",
      "R  =  5;#  in  Ohm\n",
      "V  =  110;#  in  VOlts\n",
      "ti  =  0.004;#  in  sec\n",
      "tvr  =  0.006;#  in  sec\n",
      "tvl  =  0.006;#  in  sec\n",
      "it  =  15;#  in  amperes\n",
      "\n",
      " #calculation:\n",
      " #steady  state  current  i\n",
      "i  =  V/R\n",
      " #when  time  t  =  4ms  current  is\n",
      "i4  =  (V/R)*(1  -  math.e**(-1*ti*R/L))\n",
      " #resistor  voltage,  VR\n",
      "VR6  =  V*(1  -  math.e**(-1*tvr*R/L))\n",
      " #inductor  voltage,  VL\n",
      "VL6  =  V*(math.e**(-1*tvl*R/L))\n",
      " #time,  t\n",
      "ti  =  (-1*L/R)*math.log(1  -  it*R/V)\n",
      "\n",
      "\n",
      "#Results\n",
      "print  \"\\n\\n  Result  \\n\\n\"\n",
      "print  \"\\n  steady  state  current  i  is  \",round(i,2),\"  A\"\n",
      "print  \"\\n  when  time  t  =  4ms  current  is  is  \",round(i4,2),\"  A\"\n",
      "print  \"\\n    value  of  resistor  voltage  at  t  =  6ms  is  \",round(VR6,2),\"  V\"\n",
      "print  \"\\n    value  of  inductor  voltage  at  t  =  6ms  is  \",round(VL6,2),\"  V\"\n",
      "print  \"\\n    the  time  after  connection  when  the  current  is  15  V  is  \",round(ti,5),\"  sec\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "\n",
        "  Result  \n",
        "\n",
        "\n",
        "\n",
        "  steady  state  current  i  is   22.0   A\n",
        "\n",
        "  when  time  t  =  4ms  current  is  is   7.25   A\n",
        "\n",
        "    value  of  resistor  voltage  at  t  =  6ms  is   49.63   V\n",
        "\n",
        "    value  of  inductor  voltage  at  t  =  6ms  is   60.37   V\n",
        "\n",
        "    the  time  after  connection  when  the  current  is  15  V  is   0.01145   sec"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 4, page no. 909</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Determine\n",
      "#(a) the time for the current in the 2 H inductor to fall to 200 mA,\n",
      "#and (b) the maximum voltage appearing across the resistor.\n",
      "from __future__ import division\n",
      "import math\n",
      "import cmath\n",
      "#initializing  the  variables:\n",
      "i  =  5;#  in  Amperes\n",
      "L  =  2#  in  Henry\n",
      "i1  =  0.2;#  in  Amperes\n",
      "R  =  10;#  in  Ohm\n",
      "\n",
      " #calculation:\n",
      " #time  t\n",
      "ti  =  (-1*L/R)*math.log(i1/i)\n",
      " #voltage  across  the  resistor  is  a  maximum  \n",
      "VRm  =  i*R\n",
      "\n",
      "\n",
      "#Results\n",
      "print  \"\\n\\n  Result  \\n\\n\"\n",
      "print  \"\\n    time  t  for  the  current  in  the  2  H  inductor  to  fall  to  200  mA  is  \",round(ti,3),\"  sec\"\n",
      "print  \"\\n    max  voltage  across  the  resistor  is  \",VRm,\"  V\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "\n",
        "  Result  \n",
        "\n",
        "\n",
        "\n",
        "    time  t  for  the  current  in  the  2  H  inductor  to  fall  to  200  mA  is   0.644   sec\n",
        "\n",
        "    max  voltage  across  the  resistor  is   50   V"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 5, page no. 911</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#(a) Determine whether the circuit is over, critical or underdamped. (b) If C D 5 nF, determine the state of damping.\n",
      "from __future__ import division\n",
      "import math\n",
      "import cmath\n",
      "#initializing  the  variables:\n",
      "L  =  0.002#  in  Henry\n",
      "R  =  1000;#  in  Ohm\n",
      "C1  =  5E-6;#  in  farad\n",
      "C2  =  5E-9;#  in  farad\n",
      "\n",
      " #calculation:\n",
      "a  =  (R/(2*L))**2\n",
      "b  =  1/(L*C1)\n",
      "if  (a>b):\n",
      "\ts1  =  \"overdamped\";\n",
      "elif  (a<b):\n",
      "\ts1  =  \"underdamped\";\n",
      "else:\n",
      "\ts1  =  \"critically  damped\";\n",
      "c  =  1/(L*C2)\n",
      "if  (a>c):\n",
      "\ts2  =  \"overdamped\";\n",
      "elif  (a<c):\n",
      "\ts2  =  \"underdamped\";\n",
      "else:\n",
      "\ts2  =  \"critically  damped\";\n",
      "\t\n",
      "\n",
      "#Results\n",
      "print  \"\\n\\n  Result  \\n\\n\"\n",
      "print  \"\\n    circuit  is  \",s1\n",
      "print  \"\\n    if  C  =  5  nF,  circuit  is  \",s2"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "\n",
        "  Result  \n",
        "\n",
        "\n",
        "\n",
        "    circuit  is   overdamped\n",
        "\n",
        "    if  C  =  5  nF,  circuit  is   underdamped"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 6, page no. 912</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#what value of capacitance will give critical damping ?\n",
      "from __future__ import division\n",
      "import math\n",
      "import cmath\n",
      "#initializing  the  variables:\n",
      "L  =  0.002#  in  Henry\n",
      "R  =  1000;#  in  Ohm\n",
      "\n",
      " #calculation:\n",
      "a  =  (R/(2*L))**2\n",
      " #for  critically  damped\n",
      "C  =  4*L/R**2\n",
      "\t\n",
      "\n",
      "#Results\n",
      "print  \"\\n\\n  Result  \\n\\n\"\n",
      "print  \"\\n    capacitance  C  is  \",C*1E9,\"nF\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "\n",
        "  Result  \n",
        "\n",
        "\n",
        "\n",
        "    capacitance  C  is   8.0 nF"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "markdown",
     "metadata": {},
     "source": [
      "<h3>Example 7, page no. 913</h3>"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Determine the nature of the response and obtain an expression for the current in the coil.\n",
      "from __future__ import division\n",
      "import math\n",
      "import cmath\n",
      "#initializing  the  variables:\n",
      "L  =  1.5#  in  Henry\n",
      "R  =  90;#  in  Ohm\n",
      "C = 5*1E-6; # in Farad\n",
      "V = 10; # in Volts\n",
      "\n",
      "#calculation:\n",
      "a = -1*R/(2*L)\n",
      "b = (1/(L*C) - (R/(2*L))**2)**0.5\n",
      "V0 = V\n",
      "I0 = 0\n",
      "A = V0\n",
      "B = (I0 - C*a*V0)/(C*b)\n",
      "\n",
      "#Results\n",
      "print \"\\n\\n  Result  \\n\\n\"\n",
      "print \"Current, i = e^(\",a,\"t) (\",round((a*C*B - A*C*b),4),\"sin(\",round(b,1),\"t)  + (\",round((-1*a*C*A + B*C*C*b),0),\"cos(\",round(b,1),\"t) Amps.\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "\n",
        "  Result  \n",
        "\n",
        "\n",
        "Current, i = e^( -30.0 t) ( -0.0183 sin( 363.9 t)  + ( 0.0 cos( 363.9 t) Amps.\n"
       ]
      }
     ],
     "prompt_number": 2
    }
   ],
   "metadata": {}
  }
 ]
}