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
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
|
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 8: DC TRANSIENTS"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.1,Page number: 207 "
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Question:\n",
"\"\"\"Finding the current i(0+)=I0.\"\"\"\n",
"\n",
"#Variable Declaration:\n",
"V=24 #Supply voltage(in Volts)\n",
"\n",
"\n",
"#Calculations:\n",
"Req=20+(1.0/((1.0/20)+(1.0/10)))\n",
"I=V/Req\n",
"I_L=I*(20.0/(20+10))\n",
"Io=I_L\n",
"i_0_plus=Io\n",
"R=20\n",
"v_R=(-Io)*R\n",
"R1=(20+10)\n",
"v_L=Io*R1\n",
"\n",
"\n",
"#Result:\n",
"print \"(a)The current i(0+)=Io=%.2f A.\" %(i_0_plus)\n",
"print \"(b)The magnitude of v_R across the 20 Ohms resistor at the instant just after the switch is opened is %.2f V.\" %(v_R)\n",
"print \"(c)The magnitude of v_L across the inductor immediately after the switch is opened is %.2f V.\" %(v_L)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)The current i(0+)=Io=0.60 A.\n",
"(b)The magnitude of v_R across the 20 Ohms resistor at the instant just after the switch is opened is -12.00 V.\n",
"(c)The magnitude of v_L across the inductor immediately after the switch is opened is 18.00 V.\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.2,Page number: 208"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Question:\n",
"\"\"\"Finding i(0),the power being absorbed by the inductor at t=1 s.\"\"\"\n",
"\n",
"from math import e,pow,sqrt,log\n",
"\n",
"#Variable Declaration:\n",
"L=1.6 #Self-inductance of the inductor(in Henry)\n",
"R=0.8 #Resistance of the resistor(in Ohms)\n",
"t=-1.0 #Instant of time(in seconds) \n",
"i_minus_1=20.0 #Current at t=1 seconds(in Amperes)\n",
"\n",
"\n",
"#Calculations:\n",
"time_const=L/R\n",
"Io=i_minus_1/pow(e,(-t/time_const))\n",
"t=1\n",
"i_t=Io*pow(e,(-t/time_const))\n",
"p_t=i_t*i_t*R\n",
"W=100.0\n",
"i_t1=sqrt((2*W)/L)\n",
"t=-(log(i_t1/Io))*time_const\n",
"\n",
"\n",
"#Result:\n",
"print \"(a)i(0) = %.3f A.\" %(Io)\n",
"print \"(b)The power absorbed by the resistor is %.2f W. \" %(p_t) \n",
"print \" The inductor by virtue of the emf induced in it,supplies this power to the resistor.\"\n",
"print \" Therefore,the power absorbed by the inductor is %.2f W.\" %(-p_t)\n",
"print \"(c)The time at which the energy stored in the inductor is 100J is %.5f seconds.\" %(t)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)i(0) = 12.131 A.\n",
"(b)The power absorbed by the resistor is 43.31 W. \n",
" The inductor by virtue of the emf induced in it,supplies this power to the resistor.\n",
" Therefore,the power absorbed by the inductor is -43.31 W.\n",
"(c)The time at which the energy stored in the inductor is 100J is 0.16315 seconds.\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.3,Page number: 210"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Question:\n",
"\"\"\"Finding the value of current in the circuit at an instant 0.4 s after the switch has been closed.\"\"\"\n",
"\n",
"from math import e,pow,log\n",
"\n",
"#Variable Declaration:\n",
"L=14.0 #Self-inductance of the inductor(in Henry)\n",
"R=10.0 #Resistance of the resistor(in Ohms)\n",
"V=140.0 #Supply Voltage(in Volts)\n",
"\n",
"\n",
"#Calculations:\n",
"time_const=L/R\n",
"t=0.4\n",
"Io=V/R\n",
"i=Io*(1-pow(e,(-t/time_const)))\n",
"i_t=8\n",
"t=-time_const*log(i_t/Io)\n",
"\n",
"\n",
"#Result:\n",
"print \"(a)The value of current in the circuit at an instant 0.4 s after the switch has been closed is %.3f A.\" %(i)\n",
"print \"(b)The time taken for the current to drop to 8 A after the switch is opened is %.4f seconds.\" %(t)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)The value of current in the circuit at an instant 0.4 s after the switch has been closed is 3.479 A.\n",
"(b)The time taken for the current to drop to 8 A after the switch is opened is 0.7835 seconds.\n"
]
}
],
"prompt_number": 13
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.4,Page number: 210"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Question:\n",
"\"\"\"Finding the magnitude of the inductor current at t=0- and at t=0+.\"\"\"\n",
"\n",
"from math import pow,e\n",
"\n",
"#Variable Declaration:\n",
"L=40e-03 #Self-inductance of the inductor(in Henry)\n",
"R=80.0 #Resistance of the resistor(in Ohm) \n",
"V1=20.0 #Supply voltage-1(in Volts) \n",
"V2=40.0 #Supply voltage-2(in Volts)\n",
"\n",
"\n",
"#Calculations:\n",
"time_const=L/R\n",
"I_01=V1/R\n",
"i_0_minus=I_01\n",
"i_0_plus=I_01\n",
"I_02=(V1+V2)/R\n",
"t=1e-03\n",
"i_t=I_01+(I_02-I_01)*(1-pow(e,(-t/time_const)))\n",
"\n",
"\n",
"#Result:\n",
"print \"(a)The magnitude of inductor current at t=0- is %.2f A.\" %(i_0_minus)\n",
"print \"(b)The magnitude of inductor current at t=0+ is %.2f A.\" %(i_0_plus)\n",
"print \"(c)As t tends to infinity,the current approaches its final steady-state value given as %.2f A.\" %(I_02)\n",
"print \"(d)The magnitude of inductor current at t=1 ms is %.3f A.\" %(i_t)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)The magnitude of inductor current at t=0- is 0.25 A.\n",
"(b)The magnitude of inductor current at t=0+ is 0.25 A.\n",
"(c)As t tends to infinity,the current approaches its final steady-state value given as 0.75 A.\n",
"(d)The magnitude of inductor current at t=1 ms is 0.682 A.\n"
]
}
],
"prompt_number": 14
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.5,Page number: 211"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Question:\n",
"\"\"\"Finding i_L(0-),i2(0-),i_L(0+),i_L(20 ms) and i_2(20 ms).\"\"\"\n",
"\n",
"from math import e,pow\n",
"\n",
"#Variable Declaration:\n",
"V=20.0 #Source Voltage(in Volts)\n",
"R1=20.0 #Resistance of resistor-1(in Ohms)\n",
"R2=40.0 #Resistance of resistor-2(in Ohms)\n",
"R3=30.0 #Resistance of resistor-3(in Ohms)\n",
"R4=25.0 #Resistance of resistor-4(in Ohms)\n",
"R5=5.0 #Resistance of resistor-5(in Ohms)\n",
"L=2.0 #Self-inductance of inductor(in Henry)\n",
"\n",
"\n",
"#Calculations:\n",
"Io=V/(R4+R5)\n",
"i_L_0_minus=Io\n",
"i_2_0_minus=V/R3\n",
"i_L_0_plus=Io\n",
"R_45=R4+R5\n",
"R_12=R1+R2\n",
"Req=R_45+(1/((1/R_12)+(1/R3)))\n",
"time_const=L/Req\n",
"t=20e-03\n",
"i_L_t=Io*pow(e,(-t/time_const))\n",
"i_2_t=-i_L_t*(R_12/(R_12+R3))\n",
"\n",
"\n",
"#Result:\n",
"print \"(a)i_L(0-) = %.3f A.\" %(i_L_0_minus)\n",
"print \"(b)i_2(0-) = %.3f A.\" %(i_2_0_minus)\n",
"print \"(c)i_L(0+) = %.3f A.\" %(i_L_0_plus)\n",
"print \"(d)i_L(20 ms) = %.3f A.\" %(i_L_t)\n",
"print \"(e)i_2(20 ms) = %.3f A.\" %(i_2_t)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)i_L(0-) = 0.667 A.\n",
"(b)i_2(0-) = 0.667 A.\n",
"(c)i_L(0+) = 0.667 A.\n",
"(d)i_L(20 ms) = 0.404 A.\n",
"(e)i_2(20 ms) = -0.270 A.\n"
]
}
],
"prompt_number": 11
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.6,Page number: 215"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Question:\n",
"\"\"\"Finding v(0+),i(0+) and time constant.\"\"\"\n",
"\n",
"from math import e,pow\n",
"\n",
"#Variable Declaration:\n",
"R=1.5e03 #Resistance of the resistor(in Ohms) \n",
"C=5e-06 #Capacitance of the capacitor(in Farad)\n",
"Vo=3.0 #Source Voltage(in Volts)\n",
"v_0_plus=0 #Voltage across capacitor at t=0+(in Volts) \n",
"v_0_minus=0 #Voltage across capacitor at t=0-(in Volts)\n",
"\n",
"\n",
"#Calculations:\n",
"Io=Vo/R\n",
"i_0_plus=Io\n",
"time_const=R*C\n",
"t=15e-03\n",
"v=Vo*(1-pow(e,(-t/time_const))) \n",
"i=Io*pow(e,(-t/time_const))\n",
"\n",
"\n",
"#Result:\n",
"print \"(a)Since the voltage across a capacitor cannot change instantaneously, we have, v(0+)=%d V.\" %(v_0_plus)\n",
"print \"(b)i(0+)= %.3f mA.\" %(i_0_plus*1000)\n",
"print \"(c)The time constant is %.2f ms.\" %(time_const*1000)\n",
"print \"(d)At t=15 ms, \\n v=%.5f V. \\n i=%.4f mA.\" %(v,(i*1000))"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)Since the voltage across a capacitor cannot change instantaneously, we have, v(0+)=0 V.\n",
"(b)i(0+)= 2.000 mA.\n",
"(c)The time constant is 7.50 ms.\n",
"(d)At t=15 ms, \n",
" v=2.59399 V. \n",
" i=0.2707 mA.\n"
]
}
],
"prompt_number": 6
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.7,Page number: 216\n"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Question:\n",
"\"\"\"Finding v(0+),i(0+) and time constant.\"\"\"\n",
"\n",
"from math import e,pow\n",
"\n",
"#Variable Declaration:\n",
"R=100 #Resistance of the resistor(in Ohms)\n",
"C=5e-06 #Capacitance of the capacitor(in Farads) \n",
"Vo=3.0 #Source Voltage(in Volts)\n",
"\n",
"\n",
"#Calculations:\n",
"v_0_plus=Vo\n",
"v_0_minus=Vo\n",
"Io=Vo/R\n",
"i_0_plus=-Io\n",
"time_const=R*C\n",
"t=1.2e-03\n",
"v=Vo*pow(e,(-t/time_const)) \n",
"i=-Io*pow(e,(-t/time_const))\n",
"\n",
"\n",
"#Result:\n",
"print \"(a)Since the voltage across a capacitor cannot change instantaneously, we have, v(0+)=%d V.\" %(v_0_plus)\n",
"print \"(b)At t=0+, the capacitor behaves as a voltage source of emf Vo. Hence, i(0+)= -Io = %.3f mA.\" %(i_0_plus*1000)\n",
"print \"(c) The time constant is %.2f ms.\" %(time_const*1000)\n",
"print \"(d)At t=1.2 ms, \\n v=%.5f V. \\n i=%.4f mA.\" %(v,(i*1000))"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)Since the voltage across a capacitor cannot change instantaneously, we have, v(0+)=3 V.\n",
"(b)At t=0+, the capacitor behaves as a voltage source of emf Vo. Hence, i(0+)= -Io = -30.000 mA.\n",
"(c) The time constant is 0.50 ms.\n",
"(d)At t=1.2 ms, \n",
" v=0.27215 V. \n",
" i=-2.7215 mA.\n"
]
}
],
"prompt_number": 7
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.8,Page number: 218"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Question:\n",
"\"\"\"Finding the current i(t) for t>0 seconds.\"\"\"\n",
"\n",
"#Calculations:\n",
"\"\"\" R_Th=(1+10)kilo ohm || (1 kiloohm) \"\"\" #Thevenin's Equivalent Resistance(in Ohms) \n",
"\n",
"print(\"Note: All currents expressed in mA \\n\")\n",
"R_Th=1.0/((1.0/11000)+(1.0/1000))\n",
"C=10e-06\n",
"time_const=R_Th*C\n",
"v_C_0_minus=30.0*((1e03)/((1e03)+(1e03)))\n",
"\n",
"\"\"\" Applying KVL, 30-(i_0_plus*(1 kilo ohm))-15=0 \"\"\"\n",
"\n",
"i_0_plus=(30-15)/1.0\n",
"i_infinity=30.0/(1+1+10)\n",
"\n",
"\n",
"#Result:\n",
"print \"i(t)= (%.1f + (%.1f-%.1f)*(e to the power -t/%.2f ms)) mA.\" %(i_infinity,i_0_plus,i_infinity,(time_const*1000))"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Note: All currents expressed in mA \n",
"\n",
"i(t)= (2.5 + (15.0-2.5)*(e to the power -t/9.17 ms)) mA.\n"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.9,Page number: 220"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Question:\n",
"\"\"\"Finding the current at t=1 seconds.\"\"\"\n",
"\n",
"from math import exp,log\n",
"\n",
"#Variable Declaration:\n",
"R=3.0 #Resistance of the coil(in Ohms)\n",
"time_const=1.8 #Time constant of the coil(in seconds)\n",
"V=10.0 #Supply voltage(in Volts)\n",
"\n",
"\n",
"#Calculations:\n",
"L=time_const*R\n",
"i_0_plus=0\n",
"I0=V/R\n",
"i=I0*(1-exp((-1/time_const)))\n",
"t=(log(0.5,e))*(-1.8)\n",
"growth=V/L\n",
"\n",
"\n",
"#Result:\n",
"print \"(a)The current at t=1 seconds is given as %.2f A.\" %(i)\n",
"print \"(b)The time at which current attains half of its final value is %.2f seconds.\" %(t)\n",
"print \"(c)The initial rate of growth of current is %.2f A/s.\" %(growth)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)The current at t=1 seconds is given as 1.42 A.\n",
"(b)The time at which current attains half of its final value is 1.25 seconds.\n",
"(c)The initial rate of growth of current is 1.85 A/s.\n"
]
}
],
"prompt_number": 10
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.10,Page number: 220"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Question:\n",
"\"\"\"Finding the value of current during a sudden change.\"\"\"\n",
"\n",
"#Calculations:\n",
"\"\"\"If I0 is the final steady-state value of current,at t=1 s, we have\n",
" \n",
" i=Io*(1-exp(-1/time_const)) or (0.741*Io)=Io*(1-exp(-1/time_const));\n",
" \n",
" exp(-1/time_const)=0.259;\n",
" \n",
" During the decay of current,we have i(t)=Io*exp(-1/time_const); \n",
" \n",
" Therefore, at t=1s, we have\n",
" \n",
" i1=0.259*Io.\n",
" \n",
" Therefore the value of current in the circuit is 0.259 times the steady state value.\"\"\"\n",
"k=1-0.741\n",
"\n",
"\n",
"#Result:\n",
"print \"The value of current in the circuit is %.3f times the steady state value.\" %(k)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The value of current in the circuit is 0.259 times the steady state value.\n"
]
}
],
"prompt_number": 12
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.11,Page number: 220"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Question:\n",
"\"\"\"Finding the current in the circuit at t=0.6 s.\"\"\"\n",
"\n",
"#Variable Declaration:\n",
"V=120.0 #Supply dc voltage(in Volts)\n",
"R=20.0 #Resistance of the resistor(in Ohms)\n",
"L=8.0 #Inductance of the inductor(in Henry)\n",
"\n",
"\n",
"#Calculations:\n",
"time_const=L/R\n",
"Io=V/R\n",
"i=Io*(1-exp(-0.6/time_const))\n",
"\"\"\"The voltage drop across R,v_R=i*r=Io*(1-exp(-t/time_const))*R;\n",
" The voltage drop across L,v_L=L*(di/dt)=((L*Io)/time_const)*exp(-t/time_const); \n",
" \n",
" We are to find the time at which these two voltage-drops are same. \"\"\"\n",
"t=-time_const*log(0.5,e)\n",
"\n",
"\n",
"#Result:\n",
"print \"(a)The current in the circuit at t=0.6 s is %.2f A.\" %(i)\n",
"print \"(b)The time at which the voltage drops across R and L are same is %.3f s.\" %(t)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)The current in the circuit at t=0.6 s is 4.66 A.\n",
"(b)The time at which the voltage drops across R and L are same is 0.277 s.\n"
]
}
],
"prompt_number": 14
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.12,Page number: 221"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Question:\n",
"\"\"\"Finding the energy stored in the magnetic field.\"\"\"\n",
"\n",
"#Variable Declaration:\n",
"V=30.0 #Supply dc voltage(in Volts)\n",
"R=12.0 #Resistance of the resistor(in Ohms)\n",
"L=18.0 #Inductance of the inductor(in Henry)\n",
"\n",
"\n",
"#Calculations:\n",
"time_const=L/R\n",
"rate_curr=V/L\n",
"Io=V/R\n",
"i1=(V/R)*(1-exp(-3.0/time_const))\n",
"W1=0.5*i1*i1*L\n",
"Wlost=(0.5*L*Io*Io)-W1\n",
"\n",
"\n",
"#Result:\n",
"print \"(a)The time constant is %.2f seconds.\" %(time_const)\n",
"print \"(b)The initial rate of change of current is %.3f A/s.\" %(rate_curr)\n",
"print \"(c)The current at t=3 s is %.2f A.\" %(i1)\n",
"print \"(d)The energy stored in the magnetic field at t=3 s is %.3f J.\" %(W1)\n",
"print \"(e)The energy lost as heat till t=3 s is %.3f J.\" %(Wlost)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)The time constant is 1.50 seconds.\n",
"(b)The initial rate of change of current is 1.667 A/s.\n",
"(c)The current at t=3 s is 2.16 A.\n",
"(d)The energy stored in the magnetic field at t=3 s is 42.055 J.\n",
"(e)The energy lost as heat till t=3 s is 14.195 J.\n"
]
}
],
"prompt_number": 15
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.13,Page number: 221"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Question:\n",
"\"\"\"Finding the voltage and current at different time instants.\"\"\"\n",
"\n",
"#Variable Declaration:\n",
"R1=200.0 #Resistance of resistor 1(in Ohms)\n",
"L=5e-03 #Inductance of the coil(in Henry)\n",
"R2=17.0 #Resistance of resistor 2(in Ohms)\n",
"\n",
"\n",
"#Calculations:\n",
"i_0_plus=20e-03\n",
"v_0_plus=i_0_plus*R2\n",
"time_const=L/R1\n",
"v_L_0_plus=(L*i_0_plus)/time_const\n",
"t=20e-06 \n",
"i_20=i_0_plus*exp(-t/time_const)\n",
"v_20=v_0_plus\n",
"t=50e-06\n",
"i_50=i_0_plus*exp(-t/time_const)\n",
"v_50=v_0_plus\n",
"\n",
"\n",
"#Result:\n",
"print \"(a)The value of i(0+)=%e A.\" %(i_0_plus) \n",
"print \"(b)The value of v(0+)=%.3f V.\" %(v_0_plus)\n",
"print \"(c)The value of v_L(0+)=%.3f V.\" %(v_L_0_plus)\n",
"print \"(d)The value of i at t=20 micro seconds is %e A and v=%.3f V.\" %(i_20,v_20)\n",
"print \"(d)The value of i at t=50 micro seconds is %e A and v=%.3f V.\" %(i_50,v_50)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)The value of i(0+)=2.000000e-02 A.\n",
"(b)The value of v(0+)=0.340 V.\n",
"(c)The value of v_L(0+)=4.000 V.\n",
"(d)The value of i at t=20 micro seconds is 8.986579e-03 A and v=0.340 V.\n",
"(d)The value of i at t=50 micro seconds is 2.706706e-03 A and v=0.340 V.\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.14,Page number: 222"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Question:\n",
"\"\"\"Finding the currents at t=5 mill seconds.\"\"\"\n",
"\n",
"#Variable Declaration:\n",
"L=0.8 #Self Inductance of the coil(in Henry)\n",
"\n",
"\n",
"#Calculations:\n",
"i_L_0_minus=(120e-03)*(200.0/(200.0+40.0))\n",
"Req=40+(1.0/((1.0/800.0)+(1.0/200.0)))\n",
"time_const=L/Req\n",
"t=5e-03 \n",
"i_L=i_L_0_minus*exp(-t/time_const)\n",
"i_x=-i_L*(800.0/(800.0+200.0))\n",
"i_y=(120e-03)+(-i_L*(200.0/(200.0+800.0)))\n",
"\n",
"\n",
"#Result:\n",
"print \"At t=5 milli seconds,\" \n",
"print \"(a)The current i_L=%e A.\" %(i_L)\n",
"print \"(b)The current i_x=%e A.\" %(i_x)\n",
"print \"(c)The current i_y=%e A.\" %(i_y)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"At t=5 milli seconds,\n",
"(a)The current i_L=2.865048e-02 A.\n",
"(b)The current i_x=-2.292038e-02 A.\n",
"(c)The current i_y=1.142699e-01 A.\n"
]
}
],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.15,Page number: 223 "
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Question:\n",
"\"\"\"Finding the current through an inductor at the time of switching.\"\"\"\n",
"\n",
"#Variable Declaration:\n",
"L=4.0 #Self inductance of inductor(in Henry)\n",
"R=10.0 #Resistance of resistor parallel to the inductor(in Ohms)\n",
"\n",
"\n",
"#Calculations:\n",
"\"\"\"By superposition theorem, I_L_0=I_L_1+I_L_2; \"\"\"\n",
"I_L1=12.0/4.0\n",
"I_L2=2.0\n",
"I_L0=I_L1+I_L2\n",
"i_L_0_plus=I_L0\n",
"w_L_0_plus=0.5*L*I_L0*I_L0\n",
"time_const=L/R\n",
"t=1.0\n",
"i_L=I_L0*exp(-t/time_const)\n",
"v_10=-i_L*R\n",
"\n",
"\n",
"#Result:\n",
"print \"(a)The current i_L(0+)=%.2f A. The energy stored in the inductor is w_L(0+)=%.2f J.\" %(i_L_0_plus,w_L_0_plus)\n",
"print \"(b)At t=1 second, the current in the inductance is %.2f A and the voltage v_10=%.2f V.\" %(i_L,v_10) "
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)The current i_L(0+)=5.00 A. The energy stored in the inductor is w_L(0+)=50.00 J.\n",
"(b)At t=1 second, the current in the inductance is 0.41 A and the voltage v_10=-4.10 V.\n"
]
}
],
"prompt_number": 8
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.16,Page number: 223 "
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Question:\n",
"\"\"\"Finding the energy stored in the inductor.\"\"\"\n",
"\n",
"#Variable Declaration:\n",
"L=5e-03 #Self inductance of inductor(in Henry)\n",
"R=200.0 #Resistance of resistor(in Ohms)\n",
"\n",
"\n",
"#Calculations:\n",
"I_L0=5e-03\n",
"time_const=L/R\n",
"t=20e-06\n",
"i_L=I_L0*exp(-t/time_const)\n",
"w=0.5*L*i_L*i_L\n",
"\n",
"\n",
"#Result:\n",
"print \"The energy stored in the inductor after 20 micro seconds of throwing the switch is %e J.\" %(w)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The energy stored in the inductor after 20 micro seconds of throwing the switch is 1.261853e-08 J.\n"
]
}
],
"prompt_number": 10
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.17,Page number: 224 "
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Question:\n",
"\"\"\"Finding the current in the circuit.\"\"\"\n",
"\n",
"#Variable DEclaration:\n",
"L=8.0 #Self inductance of the coil(in Henry)\n",
"R=20.0 #Resistance of resistor(in Ohms)\n",
"V=120.0 #Voltage of the supply(in Volts) \n",
"\n",
"\n",
"#Calculations:\n",
"Io=V/R\n",
"time_const=L/R\n",
"t=0.6\n",
"i_t=Io*(1-exp(-t/time_const))\n",
"\"\"\" The voltage of R at any time is given as v_R(t)=6*(1-exp(-t/0.4))*20=120*(1-exp(-t/0.4));\n",
"\n",
" The voltage across L at any time is v_L(t)=L*(di/dt)=120*exp(-t/0.4);\n",
" \n",
" Applying v_L(t)=v_R(t), \"\"\"\n",
"t=-log(120.0/240.0)*0.4\n",
"\n",
"\n",
"#Result:\n",
"print \"(a)The current in the circuit at t=0.6 seconds is %.2f A.\" %(i_t)\n",
"print \"(b)The time at which the voltage drops across R and L are same is %.4f seconds.\"%(t)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"(a)The current in the circuit at t=0.6 seconds is 4.66 A.\n",
"(b)The time at which the voltage drops across R and L are same is 0.2773 seconds.\n"
]
}
],
"prompt_number": 13
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.18,Page number: 224 "
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Question:\n",
"\"\"\"Finding the current i_x in the circuit at different time instants.\"\"\"\n",
"\n",
"#Variable Declaration:\n",
"L=25e-03 #Self inductance of the coil(in Henry)\n",
"\n",
"\n",
"#Calculations:\n",
"I_L0=(10e-03)*(80.0/(80.0+20.0))\n",
"i_x_minus_2=I_L0\n",
"i_x_0_minus=I_L0\n",
"i_x_0_plus=I_L0*(30.0/(30.0+20.0))\n",
"Req=1.0/((1.0/20.0)+(1.0/30.0))\n",
"time_const=L/Req\n",
"t=2e-03\n",
"i_L_2=I_L0*exp(-t/time_const)\n",
"i_x_2=i_L_2*(30.0/(30.0+20.0))\n",
"t=4e-03\n",
"i_L_4=I_L0*exp(-t/time_const)\n",
"i_x_4=i_L_4*(30.0/(30.0+20.0))\n",
"\n",
"\n",
"#Result:\n",
"print \"The current i_x:\" \n",
"print \"At t=-2 ms, i_x=%e A.\" %(i_x_minus_2) \n",
"print \"At t=0- ms, i_x=%e A.\" %(i_x_0_minus)\n",
"print \"At t=0+ ms, i_x=%e A.\" %(i_x_0_plus)\n",
"print \"At t=2 ms, i_x=%e A.\" %(i_x_2)\n",
"print \"At t=4 ms, i_x=%e A.\" %(i_x_4)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The current i_x:\n",
"At t=-2 ms, i_x=8.000000e-03 A.\n",
"At t=0- ms, i_x=8.000000e-03 A.\n",
"At t=0+ ms, i_x=4.800000e-03 A.\n",
"At t=2 ms, i_x=1.837886e-03 A.\n",
"At t=4 ms, i_x=7.037134e-04 A.\n"
]
}
],
"prompt_number": 16
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.19,Page number: 225 "
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Question:\n",
"\"\"\"Finding the current and voltage at the time of switching.\"\"\"\n",
"\n",
"#Variable Declaration: \n",
"V=1.5 #Voltage of the supply(in Volts)\n",
"R1=5e-03 #Resistance of resistor 1(in Ohms) \n",
"R2=1.5e03 #Resistance of resistor 2(in Ohms)\n",
"\n",
"\n",
"#Calculations:\n",
"\"\"\"Before the switch is thrown from a to b,the capacitor is fully charged to supply voltage.\n",
"\n",
" When switching takes place,the capacitor starts discharging through the 5 milli Ohms resistance.\"\"\" \n",
"V0=V\n",
"v_0_plus=V0\n",
"i_0_plus=V0/R1\n",
"\n",
"\n",
"#Result:\n",
"print \"The voltage v(0+)=%.2f V and the current i(0+)=%.2f A.\" %(v_0_plus,i_0_plus)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The voltage v(0+)=1.50 V and the current i(0+)=300.00 A.\n"
]
}
],
"prompt_number": 15
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.20,Page number: 226"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Question:\n",
"\"\"\"Finding the voltage and current at different time intervals.\"\"\"\n",
"\n",
"#Variable Declaration:\n",
"C=5e-06 #Capacitance of the capacitor(in Farads)\n",
"V=6.0 #Voltage of the supply(in Volts) \n",
"\n",
"\n",
"#Calculations:\n",
"v_0_minus=6.0*((3.0+2.0)/(3.0+2.0+1.0))\n",
"R=(1e03+3e03+2e03)\n",
"i_0_minus=V/R\n",
"v_0_plus=v_0_minus\n",
"Vo=v_0_plus\n",
"Req=(5e03+3e03+2e03)\n",
"time_const=Req*C\n",
"i_0_plus=v_0_plus/Req\n",
"Io=i_0_plus\n",
"t=0.05\n",
"v_t1=Vo*exp(-t/time_const)\n",
"i_t1=Io*exp(-t/time_const)\n",
"t=0.10\n",
"v_t2=Vo*exp(-t/time_const)\n",
"i_t2=Io*exp(-t/time_const)\n",
"\n",
"\n",
"#Result:\n",
"print \"The values of v(t) and i(t) are: \"\n",
"print \"At t=0- s, v(t)=%.3f V and i(t)=%e A.\" %(v_0_minus,i_0_minus)\n",
"print \"At t=0+ s, v(t)=%.3f V and i(t)=%e A.\" %(v_0_plus,i_0_plus)\n",
"print \"At t=0.05 s, v(t)=%.3f V and i(t)=%e A.\" %(v_t1,i_t1)\n",
"print \"At t=0.10 s, v(t)=%.3f V and i(t)=%e A.\" %(v_t2,i_t2)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The values of v(t) and i(t) are: \n",
"At t=0- s, v(t)=5.000 V and i(t)=1.000000e-03 A.\n",
"At t=0+ s, v(t)=5.000 V and i(t)=5.000000e-04 A.\n",
"At t=0.05 s, v(t)=1.839 V and i(t)=1.839397e-04 A.\n",
"At t=0.10 s, v(t)=0.677 V and i(t)=6.766764e-05 A.\n"
]
}
],
"prompt_number": 25
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.21,Page number: 227"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Question:\n",
"\"\"\"Finding the voltage and current at the time of switching.\"\"\"\n",
"\n",
"#Calculations:\n",
"\"\"\"Using current divider rule, the current through branch AB is determined.\"\"\" \n",
"I_AB=10e-03*(1000.0/(1000.0+(800.0+200.0)))\n",
"v_0_minus=I_AB*800.0\n",
"V_AB=v_0_minus\n",
"v_0_plus=V_AB\n",
"i_C_0_plus=V_AB/(1.0/((1.0/200.0)+(1.0/800.0)))\n",
"i_0_plus=i_C_0_plus*(800.0/(800.0+200.0))\n",
"\n",
"\n",
"#Result:\n",
"print \"The value of v(0+)=%.2f V and the current i(0+)=%e A.\" %(v_0_plus,i_0_plus)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The value of v(0+)=4.00 V and the current i(0+)=2.000000e-02 A.\n"
]
}
],
"prompt_number": 30
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 8.22,Page number: 227"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#Question:\n",
"\"\"\"Finding the voltages across resistor,capacitor and switch.\"\"\"\n",
"\n",
"#Variable Declaration:\n",
"V=12.0 #Voltage of the supply(in Volts)\n",
"C=50e-03 #Capacitance of the capacitor(in Farads)\n",
"\n",
"\n",
"#Calculations:\n",
"v_C_0_minus=12.0*(20.0/(20.0+4.0))\n",
"v_C_0_plus=v_C_0_minus\n",
"Vo=v_C_0_plus\n",
"Req=5.0+20.0\n",
"time_const=Req*C\n",
"t=1.0\n",
"v_C1=Vo*exp(-t/time_const)\n",
"v_R1=v_C1*(20.0/(20.0+5.0))\n",
"v_SW1=V-V_R1\n",
"\n",
"\n",
"#Result:\n",
"print \"The value of v_C at t=1 second is %.3f V.\" %(v_C1) \n",
"print \"The value of v_R at t=1 second is %.3f V.\" %(v_R1)\n",
"print \"The value of v_SW at t=1 second is %.3f V.\" %(v_SW1)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The value of v_C at t=1 second is 4.493 V.\n",
"The value of v_R at t=1 second is 3.595 V.\n",
"The value of v_SW at t=1 second is 8.405 V.\n"
]
}
],
"prompt_number": 27
}
],
"metadata": {}
}
]
}
|