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
|
{
"metadata": {
"name": "",
"signature": "sha256:aec700ae8e541452237ee9c0f10eb2b8642d7039520473250339382162750967"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"9: Varying and alternating currents"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example number 9.1, Page number 242"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#importing modules\n",
"import math\n",
"from __future__ import division\n",
"\n",
"#Variable declaration\n",
"L=0.1; #inductance(H)\n",
"R=10; #resistance(ohm)\n",
"t1=0; #time(sec)\n",
"t2=0.002; #time(sec)\n",
"t3=0.04; #time(sec)\n",
"E=5; #voltage(V)\n",
"\n",
"#Calculation\n",
"tow=L/R; #time(sec)\n",
"a=E/R;\n",
"i1=a*(1-math.exp(-t1/tow)); #current for t=0 sec(A)\n",
"i2=a*(1-math.exp(-t2/tow)); #current for t=0.002 sec(A)\n",
"i3=a*(1-math.exp(-t3/tow)); #current for t=0.04 sec(A)\n",
"i4=a*(1-math.exp(-tow/tow)); #current for t=tow sec(A)\n",
"\n",
"#Result\n",
"print \"current for t=0 sec is\",i1,\"A\"\n",
"print \"current for t=0.002 sec is\",round(i2,2),\"A\"\n",
"print \"current for t=0.04 sec is\",round(i3,2),\"A\"\n",
"print \"current for t=tow sec is\",round(i4,3),\"A\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"current for t=0 sec is 0.0 A\n",
"current for t=0.002 sec is 0.09 A\n",
"current for t=0.04 sec is 0.49 A\n",
"current for t=tow sec is 0.316 A\n"
]
}
],
"prompt_number": 6
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example number 9.2, Page number 243"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#importing modules\n",
"import math\n",
"from __future__ import division\n",
"\n",
"#Variable declaration\n",
"L=0.5; #inductance(H)\n",
"R=5; #resistance(ohm)\n",
"E=2; #voltage(V)\n",
"t=0.2; #time(sec)\n",
"\n",
"#Calculation\n",
"tow=L/R; #time(sec)\n",
"a=E/R;\n",
"i=a*(1-math.exp(-t/tow)); #current(A)\n",
"dibydt=(E-(R*i))/L; #rate of growth of current(A/s)\n",
"E=(1/2)*L*(i**2); #energy stored by inductor(J)\n",
"\n",
"#Result\n",
"print \"rate of growth of current is\",round(dibydt,2),\"A/s\"\n",
"print \"energy stored by inductor is\",round(E,2),\"J\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"rate of growth of current is 0.54 A/s\n",
"energy stored by inductor is 0.03 J\n"
]
}
],
"prompt_number": 8
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example number 9.3, Page number 244"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#importing modules\n",
"import math\n",
"from __future__ import division\n",
"\n",
"#Variable declaration\n",
"L=10; #inductance(H)\n",
"R=10; #resistance(ohm)\n",
"E=10; #voltage(V)\n",
"t1=0.3; #time(sec)\n",
"t2=0.5; #time(sec)\n",
"t3=1; #time(sec)\n",
"\n",
"#Calculation\n",
"tow=L/R; #time(sec)\n",
"i0=E/R;\n",
"i1=i0*math.exp(-t1/tow); #current for t=0.3 sec(A)\n",
"i2=i0*math.exp(-t2/tow); #current for t=0.5 sec(A)\n",
"i3=i0*math.exp(-t3/tow); #current for t=1 sec(A)\n",
"\n",
"#Result\n",
"print \"current for t=0.3 sec is\",round(i1,2),\"A\"\n",
"print \"current for t=0.5 sec is\",round(i2,2),\"A\"\n",
"print \"current for t=1 sec is\",round(i3,2),\"A\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"current for t=0.3 sec is 0.74 A\n",
"current for t=0.5 sec is 0.61 A\n",
"current for t=1 sec is 0.37 A\n"
]
}
],
"prompt_number": 12
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example number 9.4, Page number 250"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#importing modules\n",
"import math\n",
"from __future__ import division\n",
"\n",
"#Variable declaration\n",
"E=5; #voltage(V)\n",
"C=2*10**-6; #capacitor(F)\n",
"R=1*10**6; #resistance(ohm)\n",
"t=1; #time(sec)\n",
"v=40/100; #decay value(%)\n",
"\n",
"#Calculation\n",
"q=E*C*(1-math.exp(-t/(R*C))); #charge on plates(C)\n",
"Vc=q/C; #voltage drop across capacitor(V)\n",
"i0=E/R;\n",
"i=i0*math.exp(-t/(R*C)); #current in circuit(A)\n",
"V=i*R; #voltage drop across resistor(V)\n",
"E=(1/2)*C*(Vc**2); #energy stored by capacitor(J)\n",
"tow=R*C; #time constant(sec)\n",
"t=2*math.log(1/v); #time taken(sec)\n",
"\n",
"#Result\n",
"print \"voltage drop across capacitor is\",round(Vc,2),\"V\"\n",
"print \"current in circuit is\",int(i*10**6),\"micro A\"\n",
"print \"voltage drop across resistor is\",int(V),\"V\"\n",
"print \"energy stored by capacitor is\",round(E*10**6,1),\"*10**-6 J\"\n",
"print \"time constant is\",tow,\"sec\"\n",
"print \"time taken is\",round(t,4),\"sec\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"voltage drop across capacitor is 1.97 V\n",
"current in circuit is 3 micro A\n",
"voltage drop across resistor is 3 V\n",
"energy stored by capacitor is 3.9 *10**-6 J\n",
"time constant is 2.0 sec\n",
"time taken is 1.8326 sec\n"
]
}
],
"prompt_number": 22
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example number 9.5, Page number 265"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#importing modules\n",
"import math\n",
"from __future__ import division\n",
"\n",
"#Variable declaration\n",
"L=1*10**-3; #inductance(H)\n",
"C=0.1*10**-6; #capacitor(F)\n",
"R=1; #resistance(ohm)\n",
"\n",
"#Calculation\n",
"a=1/(L*C);\n",
"b=(R**2)/(4*(L**2)); \n",
"omega=math.sqrt(a-b); #angular frequency(per sec)\n",
"Q=omega*L/R; #Q-factor\n",
"\n",
"#Result\n",
"print \"angular frequency is\",round(omega),\"per sec\"\n",
"print \"answer varies due to rounding off errors\"\n",
"print \"Q-factor is\",round(Q)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"angular frequency is 99999.0 per sec\n",
"answer varies due to rounding off errors\n",
"Q-factor is 100.0\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example number 9.6, Page number 280"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#importing modules\n",
"import math\n",
"from __future__ import division\n",
"\n",
"#Variable declaration\n",
"#v=7sin(314+pi/6)\n",
"v=7;\n",
"R=100; #resistance(ohm)\n",
"\n",
"#Calculation\n",
"Im=v/R; #maximum current(A)\n",
"Irms=Im/math.sqrt(2); #rms value of current(A)\n",
"Vrms=v/math.sqrt(2);\n",
"P=Vrms*Irms; #average power(W)\n",
"\n",
"#Result\n",
"print \"maximum current is\",Im,\"A\"\n",
"print \"rms value of current is\",round(Irms,2),\"A\"\n",
"print \"average power is\",round(P,3),\"W\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"maximum current is 0.07 A\n",
"rms value of current is 0.05 A\n",
"average power is 0.245 W\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example number 9.7, Page number 283"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#importing modules\n",
"import math\n",
"from __future__ import division\n",
"\n",
"#Variable declaration\n",
"#V=7sin(314t+pi/6)\n",
"v=7;\n",
"omega=314; \n",
"L=0.05; #inductance(H)\n",
"\n",
"#Calculation\n",
"XL=omega*L;\n",
"betaL=1/XL; #susceptance(per ohm)\n",
"i=v*betaL; #current through inductor\n",
"Im=i;\n",
"Irms=Im/math.sqrt(2); #rms current(A)\n",
"P=0; #power loss\n",
"\n",
"#Result\n",
"print \"susceptance is\",round(betaL,4),\"per ohm\"\n",
"print \"current through inductor is\",round(i,2),\"sin(314t-math.pi/3)\"\n",
"print \"rms current is\",round(Irms,2),\"A\"\n",
"print \"power loss is\",P"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"susceptance is 0.0637 per ohm\n",
"current through inductor is 0.45 sin(314t-math.pi/3)\n",
"rms current is 0.32 A\n",
"power loss is 0\n"
]
}
],
"prompt_number": 6
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example number 9.8, Page number 286"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#importing modules\n",
"import math\n",
"from __future__ import division\n",
"\n",
"#Variable declaration\n",
"#V=7sin(314t+pi/6)\n",
"v=7;\n",
"omega=314; \n",
"C=0.05*10**-6; #capacitance(F)\n",
"\n",
"#Calculation\n",
"XC=1/(omega*C); #value of XC \n",
"i=v/XC; #current through capacitor\n",
"Im=i;\n",
"Irms=Im/math.sqrt(2); #rms current(A)\n",
"P=0; #power loss\n",
"\n",
"#Result\n",
"print \"value of XC is\",round(XC/10**3,1),\"K ohm\"\n",
"print \"current through capacitor is\",i*10**3,\"*10**-3 sin(314t+2*math.pi/3)\"\n",
"print \"rms current is\",int(Irms*10**6),\"micro A\"\n",
"print \"power loss is\",P"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"value of XC is 63.7 K ohm\n",
"current through capacitor is 0.1099 *10**-3 sin(314t+2*math.pi/3)\n",
"rms current is 77 micro A\n",
"power loss is 0\n"
]
}
],
"prompt_number": 14
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example number 9.9, Page number 294"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#importing modules\n",
"import math\n",
"from __future__ import division\n",
"\n",
"#Variable declaration\n",
"V1=110; #voltage(V)\n",
"P=40; #power(W)\n",
"V2=230; #voltage(V)\n",
"\n",
"#Calculation\n",
"RB=V1**2/P; #resistance of bulb(ohm)\n",
"i=V1/RB; #electric current through bulb(A)\n",
"Z=V2/i; #series resistance(ohm)\n",
"R=Z-RB; #pure resistance(ohm)\n",
"XL=math.sqrt((Z**2)-(RB**2)); \n",
"L=XL/314; #inductance(H)\n",
"\n",
"#Result\n",
"print \"pure resistance is\",R,\"ohm\"\n",
"print \"inductance is\",round(L,3),\"H\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"pure resistance is 330.0 ohm\n",
"inductance is 1.769 H\n"
]
}
],
"prompt_number": 19
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example number 9.10, Page number 311"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#importing modules\n",
"import math\n",
"from __future__ import division\n",
"\n",
"#Variable declaration\n",
"C=10**-6; #capacitance(F)\n",
"L=10*10**-3; #inductance(H)\n",
"R=1*10**3; #resistance(ohm)\n",
"\n",
"#Calculation\n",
"fr=1/(2*math.pi*math.sqrt(L*C)); #resonant frequency(Hz)\n",
"Z=L/(C*R); #impedence(ohm)\n",
"\n",
"#Result\n",
"print \"resonant frequency is\",round(fr/10**3,3),\"KHz\"\n",
"print \"impedence is\",Z,\"ohm\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"resonant frequency is 1.592 KHz\n",
"impedence is 10.0 ohm\n"
]
}
],
"prompt_number": 23
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example number 9.11, Page number 312"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#importing modules\n",
"import math\n",
"from __future__ import division\n",
"\n",
"#Variable declaration\n",
"C=5*10**-6; #capacitance(F)\n",
"R=10; #resistance(ohm)\n",
"new=50; #frequency(Hz)\n",
"\n",
"#Calculation\n",
"omega=2*math.pi*new;\n",
"L=1/(C*(omega**2)); #self inductance(H)\n",
"\n",
"#Result\n",
"print \"self inductance is\",round(L,3),\"H\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"self inductance is 2.026 H\n"
]
}
],
"prompt_number": 25
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example number 9.12, Page number 312"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#importing modules\n",
"import math\n",
"from __future__ import division\n",
"\n",
"#Variable declaration\n",
"C=0.1*10**-6; #capacitance(F)\n",
"L=1*10**-3; #inductance(H)\n",
"R=10; #resistance(ohm)\n",
"\n",
"#Calculation\n",
"omega0=1/math.sqrt(L*C); #resonant frequency(rad/sec)\n",
"d=R/L; #difference between two half power points\n",
"cosphi=R/R; #power factor at resonance\n",
"\n",
"#Result\n",
"print \"resonant frequency is\",omega0/10**5,\"*10**5 rad/sec\"\n",
"print \"power factor at resonance is\",cosphi"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"resonant frequency is 1.0 *10**5 rad/sec\n",
"power factor at resonance is 1.0\n"
]
}
],
"prompt_number": 28
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example number 9.13, Page number 313"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#importing modules\n",
"import math\n",
"from __future__ import division\n",
"\n",
"#Variable declaration\n",
"C=0.1*10**-6; #capacitance(F)\n",
"L=10*10**-3; #inductance(H)\n",
"R=10; #resistance(ohm)\n",
"\n",
"#Calculation\n",
"Z=L/(C*R); #impedence at resonance(ohm)\n",
"\n",
"#Result\n",
"print \"impedence at resonance is\",Z/10**4,\"*10**4 ohm\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"impedence at resonance is 1.0 *10**4 ohm\n"
]
}
],
"prompt_number": 30
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example number 9.14, Page number 313"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#importing modules\n",
"import math\n",
"from __future__ import division\n",
"\n",
"#Variable declaration\n",
"C=5*10**-6; #capacitance(F)\n",
"L=10*10**-3; #inductance(H)\n",
"R=10*10**3; #resistance(ohm)\n",
"\n",
"#Calculation\n",
"omegar=1/math.sqrt(L*C); #resonant frequency(Hz)\n",
"omegar=round(omegar/10**3,1);\n",
"delta_omega=1/(R*C); #bandwidth(Hz)\n",
"Q=omegar*10**3/delta_omega; #Q-factor\n",
"\n",
"#Result\n",
"print \"resonant frequency is\",omegar,\"*10**3 Hz\"\n",
"print \"bandwidth is\",delta_omega,\"Hz\"\n",
"print \"Q-factor is\",Q"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"resonant frequency is 4.5 *10**3 Hz\n",
"bandwidth is 20.0 Hz\n",
"Q-factor is 225.0\n"
]
}
],
"prompt_number": 36
}
],
"metadata": {}
}
]
}
|