summaryrefslogtreecommitdiff
path: root/Basic_Electronics_(Electronics_Engineering)_by_J_B_Gupta/chapter5.ipynb
blob: 8ce58f25e62fd71c47ffdc47b21ca820bb8ab7fd (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
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
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#Chapter 5 , Diode Applications - DC Power Supplies and Waveshaping Circuits "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5.1 , Page Number 140"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Idc =  1.957  A.\n",
      "Irms =  3.074  A.\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#Variables \n",
    "\n",
    "VSrms = 10                #Supply voltage\n",
    "VSmax = 10* 2**0.5        #Peak value of supply voltage (in volts)\n",
    "RF = 0.3                  #Forward resistance (in ohm)\n",
    "RL = 2                    #Load resistance (in ohm)\n",
    "\n",
    "#Calculation\n",
    "\n",
    "Imax = VSmax/(RL + RF)    #Peak value of current in load (in Ampere)\n",
    "Idc = Imax/math.pi        #DC ouput current (in Ampere)\n",
    "Irms = Imax/2             #RMS value of output current (in Ampere)             \n",
    "\n",
    "#Result\n",
    "\n",
    "print \"Idc = \",round(Idc,3),\" A.\"\n",
    "print \"Irms = \",round(Irms,3),\" A.\"\n",
    "\n",
    "#Slight variation due to higher precision."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5.2 , Page Number 141"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Imax =  148.156  mA.\n",
      "Idc =  47.16  mA.\n",
      "Irms =  74.078  mA.\n",
      "PIV =  311.127  V.\n",
      "Load output voltage =  94.32  V.\n",
      "DC output power =  4.448  W.\n",
      "AC input power =  11.524  W.\n",
      "Ripple factor =  1.21 .\n",
      "Transformer utilisation factor =  0.2724 .\n",
      "Rectification efficiency =  38.6 %.\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#Variables \n",
    "\n",
    "VSrms = 220.0                   #Supply voltage\n",
    "VSmax = 220.0 * 2**0.5          #Peak value of supply voltage (in volts)\n",
    "RF = 100.0                      #Forward resistance (in ohm)\n",
    "RL = 2.0 * 10**3                #Load resistance (in ohm)\n",
    "\n",
    "#Calculation\n",
    "\n",
    "Imax = VSmax/(RL + RF)          #Maximum value of current (in Ampere)\n",
    "Idc = Imax/math.pi              #DC ouput current (in Ampere)\n",
    "Irms = Imax/2                   #RMS value of output current (in Ampere)  \n",
    "PIV = VSmax                     #Peak inverse voltage (in volts)\n",
    "Vdc = Idc*RL                    #Load output voltage (in volts)\n",
    "Pdc = Idc**2 * RL               #DC output power (in watt)\n",
    "Pac = Imax**2/4*(RF + RL)       #AC input power (in watt)\n",
    "gamma = ((Irms/Idc)**2 - 1)**.5 #Ripple factor \n",
    "TUF = 0.286/(1 + RF/RL)         #Transformer utilisation factor\n",
    "eeta = Pdc/Pac * 100            #Rectification efficiency\n",
    "\n",
    "#Result\n",
    "\n",
    "print \"Imax = \",round(Imax * 10**3,3),\" mA.\\nIdc = \",round(Idc * 10**3,2),\" mA.\\nIrms = \",round(Irms * 10**3,3),\" mA.\"\n",
    "print \"PIV = \",round(PIV,3),\" V.\"\n",
    "print \"Load output voltage = \",round(Vdc,2),\" V.\"\n",
    "print \"DC output power = \",round(Pdc,3),\" W.\\nAC input power = \",round(Pac,3),\" W.\"\n",
    "print \"Ripple factor = \",round(gamma,2),\".\"\n",
    "print \"Transformer utilisation factor = \",round(TUF,4),\".\"\n",
    "print \"Rectification efficiency = \",round(eeta,1),\"%.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5.3 , Page Number 141"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Percentage voltage regulation :  4.76  %.\n"
     ]
    }
   ],
   "source": [
    "#Variables \n",
    "\n",
    "VNL = 44.0             #No load voltage (in volts)\n",
    "VFL = 42.0             #Full load voltage (in volts)              \n",
    "\n",
    "#Calculation\n",
    "\n",
    "Reg = (VNL - VFL)/VFL * 100        #Percentage voltage regulation \n",
    "\n",
    "#Result\n",
    "\n",
    "print \"Percentage voltage regulation : \",round(Reg,2),\" %.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5.4 , Page Number 141"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "DC output voltage :  4.4  V.\n",
      "PIV :  17.0  V.\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#Variables \n",
    "\n",
    "RF = 10                  #Forward resistance (in ohm)\n",
    "IL = 100 * 10**-3        #Load current (in Ampere)\n",
    "VSrms = 12               #RMS value of supply voltage (in volts)\n",
    "VSmax = 12 * 2**0.5      #Maximum value of supply voltage (in volts)\n",
    "Idc = 0.1                #DC current (in Ampere)\n",
    "\n",
    "#Calculation\n",
    "\n",
    "Vdc = VSmax/math.pi - Idc*RF    #DC output voltage (in volts)\n",
    "PIV = VSmax                     #Peak inverse voltage (in volts)\n",
    "\n",
    "#Result\n",
    "\n",
    "print \"DC output voltage : \",round(Vdc,1),\" V.\"\n",
    "print \"PIV : \",round(PIV),\" V.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5.5 , Page Number 146 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Peak value of current :  0.109  A.\n",
      "Average value of current :  0.0694  A.\n",
      "RMS value of current :  0.077  A.\n",
      "Ripple factor :  0.483 .\n",
      "Efficiency of rectifier :  73.82 %.\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#Variables \n",
    "\n",
    "VSmax = 60.0                           #Maximum value of supply voltage (in volts)\n",
    "RF = 50.0                              #Forward resistance (in ohm)\n",
    "RL = 500.0                             #Load resistance (in ohm)  \n",
    "\n",
    "#Calculation\n",
    "\n",
    "Imax = VSmax/(RL + RF)                #Peak current (in Ampere)\n",
    "Idc = 2*Imax/math.pi                  #Average current (in Ampere)\n",
    "Irms = Imax/2**0.5                    #RMS value of current (in Ampere)\n",
    "r = ((Irms/Idc)**2 - 1)**0.5          #Ripple factor \n",
    "n = 0.812/(1 + RF/RL)*100             #Efficiency of rectifier                   \n",
    "\n",
    "#Result\n",
    "\n",
    "print \"Peak value of current : \",round(Imax,3),\" A.\\nAverage value of current : \",round(Idc,4),\" A.\\nRMS value of current : \",round(Irms,3),\" A.\"\n",
    "print \"Ripple factor : \",round(r,3),\".\"\n",
    "print \"Efficiency of rectifier : \",round(n,2),\"%.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5.6 , Page Number 147"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "DC output voltage :  10.8  V.\n",
      "DC load current :  108.0  mA.\n",
      "PIV rating required :  33.94  V.\n"
     ]
    }
   ],
   "source": [
    "import math \n",
    "\n",
    "#Variables \n",
    "\n",
    "VSmax = 12 * 2**0.5            #Peak value of supply voltage (in volts)\n",
    "RL = 100.0                     #Load resistance (in ohm)\n",
    "\n",
    "#Calculation\n",
    "\n",
    "Idc = 2*VSmax/(RL*math.pi)     #Average current (in Ampere)\n",
    "Vdc = Idc * RL                 #Average voltage (in volts)\n",
    "PIV = 2*VSmax                  #Peak inverse voltage (in volts)\n",
    "\n",
    "#Result\n",
    "\n",
    "print \"DC output voltage : \",round(Vdc,1),\" V.\"\n",
    "print \"DC load current : \",round(Idc * 10**3),\" mA.\"\n",
    "print \"PIV rating required : \",round(PIV,2),\" V.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5.7 , Page Number 153 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Output DC voltage :  25.46 V.\n",
      "Ripple fator :  0.0149 .\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#Variables \n",
    "\n",
    "VLmax = VSmax = 40.0         #Peak value of supply voltage (in volts)\n",
    "f = 50                       #Frequency (in Hertz) \n",
    "w = 2*math.pi*50             #Angular frequency (in rad/sec)\n",
    "L = 2.0                      #Inductance (in Henry)\n",
    "C = 40 * 10**-6              #Capacitance (in Farad) \n",
    "\n",
    "#Calculation\n",
    "\n",
    "Vdc = 2*VSmax/math.pi        #Average voltage (in bolts)\n",
    "r = 1/(6*2**0.5*w**2*L*C)    #Ripple factor\n",
    "\n",
    "#Result\n",
    "\n",
    "print \"Output DC voltage : \",round(Vdc,2),\"V.\"\n",
    "print \"Ripple fator : \",round(r,4),\".\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5.8 , Page Number 161"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Peak output voltage :  14.3  V.\n"
     ]
    }
   ],
   "source": [
    "#Variables \n",
    "\n",
    "Vo = 0.7                    #Barrier potential (in volts)\n",
    "Vinpeak = 15                #Peak input voltage (in volts)\n",
    "\n",
    "#Calculation\n",
    "\n",
    "Voutpeak = Vinpeak - Vo     #Peak output voltage (in volts)   \n",
    "\n",
    "#Result\n",
    "\n",
    "print \"Peak output voltage : \",Voutpeak,\" V.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5.9 , Page Number 161"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Output voltage (rms value) :  1.27  V.\n"
     ]
    }
   ],
   "source": [
    "import math\n",
    "\n",
    "#Variables \n",
    "\n",
    "R1 = 2.0 * 10**3                #Resistance1 (in ohm)\n",
    "R2 = 1.0 * 10**3                #Resistance2 (in ohm)\n",
    "Vinpeak = 10                    #peak input voltage (in volts)\n",
    "\n",
    "#Calculation\n",
    "\n",
    "RL = R1*R2/(R1+R2)              #Load resistance (in ohm)\n",
    "Voutpeak = Vinpeak*RL/(R2+RL)   #Peak voltage across load resistance (in ohm)\n",
    "Vrms = Voutpeak/math.pi         #RMS value of output voltage (in volts)\n",
    "\n",
    "#Result\n",
    "\n",
    "print \"Output voltage (rms value) : \",round(Vrms,2),\" V.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5.10 , Page Number 162 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Voutpeak :  8.0 V.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.text.Text at 0x6186270>"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXUAAAEZCAYAAABoy7XpAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XeYFGW2x/HvASOiYFpMKCbMIgaMaKsouIKuuurqLmYx\noawZWAOIAXTNrq4RXROoKFdABfHakiRIDiqYERX1oigCLsK5f7wNtuMw08N0dXVX/z7PMw/dVdVV\np6aY02+99QZzd0REJBnqxB2AiIjkj5K6iEiCKKmLiC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DfvkGq0AcxjUAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x702b130>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import math\n",
    "import numpy\n",
    "%matplotlib inline\n",
    "from matplotlib.pyplot import plot,title,xlabel,ylabel,ylim,xlim\n",
    "\n",
    "#Variables \n",
    "\n",
    "R1 = 20.0 * 10**3                #Resistance1 (in ohm)\n",
    "R2 = 10.0 * 10**3                #Resistance2 (in ohm)\n",
    "Vinpeak = 20                     #peak input voltage (in volts)\n",
    "\n",
    "#Calculation\n",
    "\n",
    "RL = R1*R2/(R1+R2)              #Load resistance (in ohm)\n",
    "Voutpeak = Vinpeak*RL/(R2+RL)   #Peak voltage across load resistance (in ohm)\n",
    "\n",
    "#Result\n",
    "\n",
    "print \"Voutpeak : \",Voutpeak,\"V.\"\n",
    "\n",
    "#Graph\n",
    "\n",
    "x = numpy.linspace(0,math.pi,100)\n",
    "y = numpy.sin(x)\n",
    "plot(x,8*y,'b')\n",
    "ylim(0,9)\n",
    "xlim(0,math.pi)\n",
    "title(\"Output Waveform\")\n",
    "xlabel(\"t ->\")\n",
    "ylabel(\"-Vout->\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5.11 , Page Number 162"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Peak output voltage :  10.0  V.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.text.Text at 0x6dc1210>"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYMAAAEZCAYAAAB1mUk3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XeYlOW5x/HvDYiIEDBAKKJ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jAZOihZSZDXUMhBpgKTbZ6K798jh2m2BPxFOLbsD+Hu14zhFUkXFQKSB\nzOxeoBfwpLv/po7rNgfc3d8oWjiRRlIxEBERjRmIiIiKgYiIoGIgIiKoGIiICCoGIiKCioGIiKBi\nICIiqBiIiAjw/wCL3MAebnEQAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7504050>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import math\n",
    "import numpy\n",
    "%matplotlib inline\n",
    "from matplotlib.pyplot import plot,title,xlabel,ylabel,ylim,xlim\n",
    "\n",
    "#Variables \n",
    "\n",
    "Vinpeak = 12.0               #Peak input voltage (in volts)\n",
    "Vo = 0.7                     #Barrier potential (in volts)\n",
    "RS = 500                     #Series resistance (in ohm)\n",
    "RL = 2.5 * 10**3             #Load resistance (in ohm)\n",
    "\n",
    "#Calculation\n",
    "\n",
    "Voutpeak = Vinpeak*RL/(RS+RL) #Peak output voltage (in volts) \n",
    "\n",
    "#Result\n",
    "\n",
    "print \"Peak output voltage : \",Voutpeak,\" V.\"\n",
    "\n",
    "#Graph\n",
    "\n",
    "x = numpy.linspace(0,math.pi,100)\n",
    "x1 = numpy.linspace(math.pi,2*math.pi,100)\n",
    "x2 = numpy.linspace(math.pi,2*math.pi,100)\n",
    "x3=numpy.linspace(0,8,100)\n",
    "y2 = numpy.sin(x2)\n",
    "y = numpy.sin(x)\n",
    "plot(x,8*y,'b')\n",
    "plot(x1,-0.7+x1-x1,'b')\n",
    "plot(x2,12*y2,'--')\n",
    "plot(x3,0+x3-x3,'k')\n",
    "ylim(-13,9)\n",
    "xlim(0,2*math.pi+1)\n",
    "title(\"Output Waveform\")\n",
    "xlabel(\"t ->\")\n",
    "ylabel(\"-Vout->\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5.12 , Page Number 163 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "PIV of diode :  5 V.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.text.Text at 0x7d41190>"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXUAAAEZCAYAAABoy7XpAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd4VGX2wPHvAQQBFV1UbLjYcNddC65trUEREUUs6IKi\ngFhWRd1dXbsSfz4iCq4dBQQUKWIBCzZUCDYsdBDEgiJ2UIo0ieT8/jgTiRDIJLl33pk75/M8PCQz\nN/eegcyZ977lvKKqOOecS4YaoQNwzjkXHU/qzjmXIJ7UnXMuQTypO+dcgnhSd865BPGk7pxzCeJJ\n3bksICKniMh8EflZRPYNHY/LXZ7UXaREpLOIzBCR5SLyrYj0EZEGlfj5L0Tk6Ajj2ej5RGSOiJxR\n5vvDRKSknMeWikic75fewMWqurmqTovxOi7hPKm7yIjIFUBP4ApgC+AQ4I/AqyKySZqnUUAiDKui\n840Hjizz/ZHAR+U89o6qlkQY129ERICdgVlV/Hl/H7vf+C+Di4SIbAEUAt1UdYyqrlHVecAZQBOg\nY+q4R0TkljI/VyAi81NfP4Ylt+dT3RBXikiTVMv5fBH5WkS+SX14UJXzlRP6G/w+gR8O3L7OY0ek\njkNEnkzdgSwWkfEislfq8YNTj//2AZLqUpmW+rqGiFwjIp+KyEIRGSEiW4lIHeBnoCYwTUQ+SR3/\nZxEpEpFFIjJTRNqs85ofFJEXRWQZ0Dx1R3KliExPvdYBItJIRF4SkSUi8qqIbFnR/6PLfZ7UXVQO\nBTYFRpZ9UFWXAy8Cx5Y+lPqzHlU9G/gSODHVDdG7zNMFwO5AS+BqETmmmucr9SbwFxHZMtXiPQAY\nAWxZ5rFDSSV14IVUHNsAk4GhqWu9BywHj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84lSPDt7JxzzkXHk7pzziWIJ3XnnEsQT+rOOZcgntSdcy5BPKk751yCeFJ3\neUlEGojIRaHjcC5qntRdvtoKuDidA0Vki9RCJeeynv+iunzVE9gttfHC7RUcewTwkYh0F5HGFRzr\nXFC+otTlJRH5IzA63c1MRKQhcDbQCfgOq4fzbGo/AOeyhid1l5dSteGfr8oOVSLyd2AgsFpV9404\nNOeqxbtfnFuHiFyc6paZLCLbl3l8LxHpBTwKvAmcFyxI5zbAW+ouL6W6UyapapM0jt0feADbUehh\nYESZ7fCcyyqe1F3eEpGhwD7Ai6p69UaO+xOgqjonY8E5V0We1J1zLkG8T9055xLEk7pzziWIJ3Xn\nnEsQT+rOOZcgntSdcy5BPKk751yCeFJ3zrkE8aTunHMJ8v87OAaDXCzckwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7cb4d50>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import math\n",
    "import numpy\n",
    "%matplotlib inline\n",
    "from matplotlib.pyplot import plot,title,xlabel,ylabel,ylim,xlim\n",
    "\n",
    "#Variables \n",
    "\n",
    "Vi = 10                    #Input voltage (in volts)\n",
    "\n",
    "#Calculation\n",
    "\n",
    "Vo = Vi * 1.0/2            #Output voltage (in volts)\n",
    "Vdc = 0.636 * Vo           #DC output voltage (in volts)\n",
    "PIV = 5                    #Peak inverse voltage (in volts) \n",
    "\n",
    "#Result\n",
    "\n",
    "print \"PIV of diode : \",PIV,\"V.\"\n",
    "\n",
    "#Graph\n",
    "\n",
    "x = numpy.linspace(0,math.pi,100)\n",
    "y = numpy.sin(x)\n",
    "x1 = numpy.linspace(math.pi,2*math.pi,100)\n",
    "y1 = numpy.sin(x1)\n",
    "ylim(0,8)\n",
    "xlim(0,2*math.pi)\n",
    "plot(x,5*(y),'b')\n",
    "plot(x1,-5*(y1),'b')\n",
    "plot(x,0+x-x,'k')\n",
    "plot(x1,0+x1-x1,'k')\n",
    "plot(x,5+x-x,'--',color='g')\n",
    "plot(x1,5+x1-x1,'--',color='g')\n",
    "title(\"Output Waveform\")\n",
    "xlabel(\"t ->\")\n",
    "ylabel(\"-Vout->\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5.13 , Page Number 164"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "PIV rating of diode : 200 V.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.text.Text at 0x802a9d0>"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYEAAAEZCAYAAABxbJkKAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xm8XPP9x/HXJxJq32KLhlQqtSu/8hOKq0hrjWoRGvtO\nKa0l8UOitQRtSaUSuyArWoJSgkjTEA1BKgjaiIiENCGRhOQmn98fnzM1ubk3mXvvzJyZe97PxyOP\nzJw5c87nzr1zPue7m7sjIiLZ1CrtAEREJD1KAiIiGaYkICKSYUoCIiIZpiQgIpJhSgIiIhmmJCCS\nMLN7zew3acdRKcxsLzN718zmmdnhaccjpaEkICtkZieZ2UQzm29mH5vZrWa2biPeP8XMflDEeBo8\nnpltbmaLzWyrel77s5nduJLDe/IPM6sxsw+bH3HjmdlfzeySvOebm9nSBrZtXMJQfg38wd3XdvcR\nJTyPpEhJQBpkZr8C+gC/AtYB9gC2BJ4xszYFHsYBK2JYDR7P3T8CngWOz99uZhsABwH3FnD8Ysba\nVC8A++Q93wd4u55tk939kxLGsQUwqSlvNLNVihyLlIiSgNTLzNYBegM/d/en3X2Ju38AHA10ALon\n+y1ThZJ/B21m9xMXkseSKoWLzKxDcgd7upl9ZGbTk2RDU45XT+gDqZMEgG7Am+7+pplta2ajzGyO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gbuBha5+85FDk2kWVQdJNJMZnZOUk30qpltlrd9OzO7ERgI\n/A04LbUgRRqgkoBIAZLqnVfcvUMB++4K/JGYffJOYJi7LyhthCJNoyQgUiAzG0QsyP4Xd790Bftt\nA7i7v1O24ESaSElARCTD1CYgIpJhSgIiIhmmJCAikmFKAiIiGaYkICKSYUoCIiIZpiQgIpJhSgIi\nIhn2/7EYzCDf36DyAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x86934f0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import math\n",
    "import numpy\n",
    "%matplotlib inline\n",
    "from matplotlib.pyplot import plot,title,xlabel,ylabel,ylim,xlim,annotate\n",
    "\n",
    "#Variables \n",
    "\n",
    "Vimax = 200            #Peak input voltage (in volts)\n",
    "R = 10 * 10**3         #Resistance (in ohm)\n",
    "RL = 4 * 10**3         #Load resistance (in ohm)\n",
    "\n",
    "#Calculation\n",
    "\n",
    "Iimax = Vimax/R        #Peak input current (in Ampere) \n",
    "VLmax = Iimax * RL     #Peak voltage across load (in volts) \n",
    "PIV = 200              #Peak inverse voltage (in volts)\n",
    "\n",
    "#Result\n",
    "\n",
    "print \"PIV rating of diode :\",PIV,\"V.\"\n",
    "\n",
    "#Graph\n",
    "\n",
    "x1 = numpy.linspace(0,math.pi,100)\n",
    "x2 = numpy.linspace(math.pi,2*math.pi,100)\n",
    "x3 = numpy.linspace(2*math.pi,3*math.pi,100)\n",
    "y1 = numpy.sin(x1)\n",
    "y2 = numpy.sin(x2)\n",
    "y3 = numpy.sin(x3)\n",
    "plot(x1,80*(y1),'b')\n",
    "plot(x2,(-1)*80*(y2),'b')\n",
    "plot(x3,80*(y3),'b')\n",
    "plot(x1/2,80+x1-x1,'--',color='g')\n",
    "xlim(0,3*math.pi)\n",
    "ylim(0,200)\n",
    "annotate('80 V',xy=(0.5 ,80))\n",
    "title(\"Output Voltage Waveform\")\n",
    "xlabel(\"t ->\")\n",
    "ylabel(\"-Vout->\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5.14 , Page Number 165 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "During positive half , Output voltage Vo = 2 V when Vi < 2 V.\n",
      "Output voltage Vo = Vi when Vi > 2 V.\n",
      "During negative half , Output voltage Vo = 2 V.\n"
     ]
    }
   ],
   "source": [
    "#Variables \n",
    "\n",
    "Vo = 2                     #Output voltage when Vi < 2 V (in volts)\n",
    "#Vo1 = Vi                  #Output voltage when Vi > 2 V (in volts) \n",
    "\n",
    "#Calculation\n",
    "\n",
    "Vo = 2                     #Output voltage during negative half (in volts)\n",
    "\n",
    "#Result\n",
    "\n",
    "print \"During positive half , Output voltage Vo = 2 V when Vi < 2 V.\\nOutput voltage Vo = Vi when Vi > 2 V.\"\n",
    "print \"During negative half , Output voltage Vo = 2 V.\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5.15 , Page Number 166 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "During positive half , Output voltage :  5.0 V.\n",
      "During negative half , Output voltage :  -10 V.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "(-12, 10)"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEZCAYAAAB4hzlwAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAFpxJREFUeJzt3XmYbHV95/H3R66iiGxiwuKVqygqM0bgMT6gAndciCtE\nZ3CLqNGYGY1LJjFBzTyCk5lBx8TJ6swkCkHDFtcBFxTUi6igQcCwXRGVsCMIgmvC8p0/zuk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ZO8fug6pOViKEiLsyPwhnEWTLJd/0E9\naWr4BystzruBPfsLurxnA8seCKxPclSS1RtYVpoIfqJZWoQkewCfqqonjLn8Q4EjgFcBN9B9H9X/\n668HIk0cQ0FahP7aFKeNGwqznnsAcCzwr1X1xCUuTVoSdh9JSyTJG/pupfOT7Doyf+8k76W7nOXZ\nwG8NVqS0AbYUpEXou4O+WVVrxlh2P+Cv6b4p8wPAKSOXI5UmkqEgLVKSE4BfAT5TVUcusNzjgKqq\nOS9mIk0iQ0GS1DimIElqDAVJUmMoSJIaQ0GS1BgKkqTGUJAkNYaCJKkxFCRJzf8HrlMfb6z5gHsA\nAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x8939390>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import math\n",
    "import numpy\n",
    "%matplotlib inline\n",
    "from matplotlib.pyplot import plot,title,xlabel,ylabel,ylim,xlim\n",
    "\n",
    "#Variables \n",
    "\n",
    "Vi = 10                    #Input voltage (in volts)\n",
    "V1 = 2.5                   #Voltage (in volts)\n",
    "Rnet = 3 * 10**3           #Net resistance (in ohm)\n",
    "R1 = 2.0 * 10**3           #Resistance1 (in ohm)\n",
    "R2 = 1.0 * 10**3           #Resistance2 (in ohm)\n",
    "\n",
    "#Calculation\n",
    "\n",
    "I = (Vi - V1)/Rnet         #Current (in Ampere)\n",
    "Vo = I * (R2) + 2.5        #Output voltage positive half (in volts)\n",
    "Voneg = -Vi                #Output voltage negative half (in volts)\n",
    "\n",
    "#Result\n",
    "\n",
    "print \"During positive half , Output voltage : \",Vo,\"V.\"\n",
    "print \"During negative half , Output voltage : \",Voneg,\"V.\" \n",
    "\n",
    "#Graph\n",
    "\n",
    "x = numpy.linspace(0,9,100) \n",
    "x1 = numpy.linspace(0,3,100)\n",
    "x2 = numpy.linspace(3,6,100)\n",
    "x3 = numpy.linspace(6,9,100)\n",
    "y1 = numpy.linspace(-10,5,100)\n",
    "plot(x,0+x-x,'k')\n",
    "plot(x1,-10+x1-x1,'--',color='g')\n",
    "plot(x1,5-x1+x1,'b')\n",
    "plot(x2,-10+x2-x2,'b')\n",
    "plot(x3,5+x3-x3,'b')\n",
    "plot(3+y1-y1,y1,'b')\n",
    "plot(6+y1-y1,y1,'b')\n",
    "title(\"Output Voltage Waveform\")\n",
    "xlabel(\"t ->\")\n",
    "ylabel(\"-Vout->\")\n",
    "xlim(0,9)\n",
    "ylim(-12,10)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5.16 , Page Number 166"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "During positive half , peak voltage :  12 V.\n",
      "During negative half , peak voltage :  -8 V.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.text.Text at 0x9864710>"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYMAAAEZCAYAAAB1mUk3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmcFPW57/HPIyAqAu6iiKBGoiRGUePBlYka3MUNNbgh\n6Mk92c81iYnnnjAmN9FcT3xlO1lumAFEAUGRACoRl0GJu4JiEEFFWRTccDcq8Jw/ftXSDLP0zHT3\nr6r7+3695sV0dXXVM2XZT9VvecrcHRERqW5bxA5ARETiUzIQERElAxERUTIQERGUDEREBCUDERFB\nyUBkE2Y2zsx+FjuOtDCzI81sqZm9Z2anx45HSkfJQFplZiPMbKGZfWBmr5rZH8ysZxs+/5KZHVvE\neJrdnpn1NrNPzWzvJt67zcyua2XznvxgZjVmtqLjEbedmf3NzH6Y97q3mW1oZtkuJQzlp8Bv3b27\nu88o4X4kMiUDaZGZXQFcC1wB9AAGAX2BOWbWpcDNOGBFDKv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9/HA2eUNagUauY4gc6pz7j7andfkPz+PvAsYeBLJs+nrCWD3sCKvNealNY8B+42s8fN7PLY\nwaTcru6+Jvl9DbBrzGBS7ttJTbG6rDR/lIOZ9QMGEioqZPJ8yloyUG934Y5094HASYTb16NjB5QF\nyeg1nWdN+yOwF3AQ8CpheHjVM7NtgVuB77r7e/nvZel8yloyWAX0yXvdh03LV0jC3V9N/n0duA3V\neGrJGjPrBWBmuwGvRY4nldz9NU8AY9A5hZl1ISSCCe4+PVmcyfMpa8ngcWBfM+tnZlsSKpzOiBxT\n6pjZNmbWPfm9GzAEWNjyp6raDOCS5PdLgOktrFu1ki+2nDOp8nPKwiSpOmCRu/86761Mnk+Zm2dg\nZicBvwY6AXXufk3kkFLHzPYi3A1AmFh4k45TYGaTgMHAToT23J8AfwWmAHsCLwHnuvvbsWJMgyaO\n02ightBE5MAy4Ot5beNVx8yOAu4HnmZjU9CPgUfJ4PmUuWQgIiLFl7VmIhERKQElAxERUTIQEREl\nAxERQclARERQMhAREZQMRNrEzHqa2b/FjkOk2JQMRNpme+AbhaxoZj3MTP+PSSboRBVpm2uBfZKH\nu/yylXWPBhab2Wgz69PKuiJRaQaySBuYWV9glrsfUOD6OwIXEWrUrCbUsvlr8jwOkdRQMhBpg6Ru\n/cxCk0Gjzx4O1AOfuPuBRQ5NpEPUTCRSJGb2jaT56Mn8Cp9mNsDMriM89eoB4LJoQYo0Q3cGIm2Q\nNPs84e79Clj3YOC/gQ2E+v83u/uHpY1QpH2UDETayMxuAr4E3OHuV7aw3n6Eh109V7bgRNpJyUBE\nRNRnICIiSgYiIoKSgYiIoGQgIiIoGYiICEoGIiKCkoGIiKBkICIiwP8Ar9uYYw/8STMAAAAASUVO\nRK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x8f02ef0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import math\n",
    "import numpy\n",
    "%matplotlib inline\n",
    "from matplotlib.pyplot import plot,title,xlabel,ylabel,ylim,xlim\n",
    "\n",
    "#Variables \n",
    "\n",
    "V1 = 12              #Voltage1 (in volts)\n",
    "V2 = 8               #Voltage2 (in volts) \n",
    "\n",
    "#Calculation\n",
    "\n",
    "Vopos = V1           #Peak Output voltage during positive half (in volts)\n",
    "Voneg = -V2          #Peak Output voltage during negative half (in volts) \n",
    "\n",
    "#Result\n",
    "\n",
    "print \"During positive half , peak voltage : \",Vopos,\"V.\\nDuring negative half , peak voltage : \",Voneg,\"V.\"\n",
    "\n",
    "#Graph \n",
    "\n",
    "x = numpy.linspace(0,24,100)\n",
    "x1 = numpy.linspace(0,2,100)\n",
    "x2 = numpy.linspace(2,6,100)\n",
    "x3 = numpy.linspace(6,8,100)\n",
    "x4 = numpy.linspace(8,8+8.0/6,100)\n",
    "x5 = numpy.linspace(8+8.0/6,12+8.0/6,100)\n",
    "x6 = numpy.linspace(12+8.0/6,12+2*8.0/6,100)\n",
    "x7 = numpy.linspace(12+2*8.0/6,14+2*8.0/6,100)\n",
    "x8 = numpy.linspace(14+2*8.0/6,18+2*8.0/6,100)\n",
    "x9 = numpy.linspace(18+2*8.0/6,20+2*8.0/6,100)\n",
    "x10 = numpy.linspace(0,8+8.0/6,100)\n",
    "plot(x,0+x-x,'k')\n",
    "plot(x1,6*x1,'b')\n",
    "plot(x2,12-x2+x2,'b')\n",
    "plot(x3,12-6*(x3-6),'b')\n",
    "plot(x4,-6*(x4-8),'b')\n",
    "plot(x5,-8+x5-x5,'b')\n",
    "plot(x6,-8+6*(x6-(12+8.0/6)))\n",
    "plot(x7,6*(x7-(12+2*8.0/6)),'b')\n",
    "plot(x8,12-x8+x8,'b')\n",
    "plot(x9,12-6*(x9-(18+2*8.0/6)),'b')\n",
    "plot(x10,-8+x10-x10,'--',color='g')\n",
    "plot(x1,12+x1-x1,'--',color='g')\n",
    "ylim(-20,15)\n",
    "xlim(0,20+2*8.0/6)\n",
    "title(\"Output Voltage Waveform\")\n",
    "xlabel(\"t ->\")\n",
    "ylabel(\"-Vout->\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5.17 , Page Number 167 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Following is the output wave generated when Vinmax is changed to 60 V.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.text.Text at 0x9d5c490>"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEZCAYAAACNebLAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmcVNWd9/HPT1AUFRA3RBAURMEVRQXXFpfgirtxIbhH\nesw4mcxEk5lXJJln1BnzzDM6Iy2uAVlUxCi449KiEbeIoihBUQQUEfe4s/yeP87tWLTVTVd1VZ97\nq77v16tfVN2uuvdLQ9fvnnPuPcfcHRERkcbWiR1ARETSSQVCRETyUoEQEZG8VCBERCQvFQgREclL\nBUJERPJSgRDJYWZ/MLN/i50jLcxsPzN7w8z+ambHxs4jbUsFQtbKzM4ys1fM7EszW2pmY8yscwHv\nX2hmQ0uYp8n9mdnWZrbCzLbL870/mtlVa9m9J1+YWY2ZLW594sKZ2UNm9suc51ub2eomtm1Rxii/\nA65x943dfVoZjyMppAIhzTKzXwBXAr8AOgGDgV7ADDNbt4W7ccBKGKvJ/bn7u8CjwIjc7WbWFTgC\n+EML9l/KrMV6Ajgw5/mBwLw82+a7+wdlzLEN8FoxbzSzdiXOIm1MBUKaZGadgNHARe7+sLuvcvd3\ngFOA3sCZyevW6JbJPfM2s1sJHzLTk26KfzKz3smZ7/lm9q6ZvZcUIorZX57o42hUIIAfA3Pdfa6Z\n9TezejP7xMxeNbNjGr3Wzawj8ADQPTnO52bWzcz2NrNZyXvfM7P/yS2UZna4mf3Fz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iFSADPrbGajYucQaQsqECKF2QSobckLzayTmel3TDJL/3lFCnMl\n0Ce5q7fZxVaAA4B5ZnZZslaASKboTmqRAphZL+DeZFGglrx+U2AEYb6j9wlzdN3TMB+/SJqpQIgU\nIFnfY3pLC0Sj9w4hzIXzXbJCmkiqqYtJpETMrDbpenoxmUK7YfsAM7uKsHLbk8B50UKKFEAtCJEC\nJF1Gf3b33i147R7AtYTV+m4kzD78VXkTipSOCoRIgcxsImHK8fvd/ZJmXrcjYcG2v7RZOJESUoEQ\nEZG8NAYhIiJ5qUCIiEheKhAiIpKXCoSIiOSlAiEiInmpQIiISF4qECIikpcKhIiI5PX/Ad/k1W1o\nBU7NAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x9582910>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import math\n",
    "import numpy\n",
    "%matplotlib inline\n",
    "from matplotlib.pyplot import plot,title,xlabel,ylabel,ylim,xlim\n",
    "\n",
    "#Variables \n",
    "\n",
    "Vinmax1 = 25                   #Peak input voltage1 (in volts)\n",
    "Vinmax2 = 60                   #Peak input voltage2 (in volts)\n",
    "\n",
    "#Calculation\n",
    "\n",
    "Voutmax1 = 20                  #Peak output voltage1 (in volts)\n",
    "Voutmax2 = 10                  #Peak output voltage2 (in volts)\n",
    "\n",
    "#Result\n",
    "\n",
    "print \"Following is the output wave generated when Vinmax is changed to 60 V.\"\n",
    "\n",
    "#Graph\n",
    "\n",
    "x = numpy.linspace(0,24,100)\n",
    "x1 = numpy.linspace(0,2,100)\n",
    "x2 = numpy.linspace(2,6,100)\n",
    "x3 = numpy.linspace(6,8,100)\n",
    "x4 = numpy.linspace(8,10,100)\n",
    "x5 = numpy.linspace(10,14,100)\n",
    "x6 = numpy.linspace(14,16,100)\n",
    "x7 = numpy.linspace(0,10,100)\n",
    "plot(x,0+x-x,'k')\n",
    "plot(x1,10*x1,'b')\n",
    "plot(x2,20-x2+x2,'b')\n",
    "plot(x3,20-10*(x3-6),'b')\n",
    "plot(x4,-10*(x4-8),'b')\n",
    "plot(x5,-20+x5-x5,'b')\n",
    "plot(x6,-20+10*(x6-14))\n",
    "plot(x7,-20+x7-x7,'--',color='g')\n",
    "xlim(0,16)\n",
    "ylim(-22,22)\n",
    "title(\"Output Voltage Waveform\")\n",
    "xlabel(\"t ->\")\n",
    "ylabel(\"-Vout->\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5.18 , Page Number 168 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Output voltage Vout = Vin/2.\n",
      "Voutmax =  5.0 V.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.text.Annotation at 0xa9b53f0>"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX8AAAEZCAYAAAB/6SUgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGGlJREFUeJzt3XuYJXV95/H3B4YBERgumh256EQiUeMN1yioQIeLAVSI\nJqISQVdjntWIZL0huo/M7K4LLiYxF9k8iYJoQIgoLhBALtKDF8AgoFwGAW/cBLmjokHku39UNZxp\nume6Z7qnzqHer+fpp8+p8ztV33Oq+3N+9as6VakqJEn9sl7XBUiS1j3DX5J6yPCXpB4y/CWphwx/\nSeohw1+SesjwVy8l+UyS/9l1HcMiycuSXJ/kZ0n267oezT/DX49I8pYkVyb5RZKfJDkmyaJZPP9H\nSXafw3qmnV+SbZL8OsnTp3js1CRHr2b21f6QZCzJTWtf8ewl+UqSDwzc3ybJw9NM+615LOV/AH9X\nVZtW1WnzuBwNCcNfACR5L3AU8F5gM2An4GnAuUk2mOFsCsgcljXt/KrqFuB84KDB6Um2BPYBPjOD\n+c9lrWt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V/n4q8BqmGSbr6kteq1RVDyV5F/AVmh2Gn66qFV3WlOTzwG7AVkluAj5S\nVcd1WRPwMuBNwHeTTATs4VV1doc1PQU4Psl6NJ2Lz1XV+R3WM5VhGVb8T8CpTXawADihqs7ptiQA\nDgFOaDte3wf+S8f1THw47gkMw34Rquo77dbjpTTDKpcB/9RtVY84JclWNDuk31lV90/VyC95SVIP\nDeuwjyRpHhn+ktRDhr8k9ZDhL0k9ZPhLUg8Z/pLUQ4a/NIUki5K8o+s6pPli+EtT2wJ450waJtms\n/VKbNDL8g5WmdhSwfXvxkI+tpu0uwLVJjkiy3WraSkPBb/hKU0jyNOCMqnruDNtvBRwEvBm4jeac\nS/+vvR6FNHQMf2kK7fURTp9p+E967s7AscCDVfX8OS5NmhMO+0izlOSd7XDQZUmeMjD92UmOprkM\n4teAP+usSGk17PlLU2iHcb5dVUtm0PaFwCdpzu74KeDkgUtZSkPJ8JemkeQE4HnAmVV12CraPROo\nqpryohnSMDL8JamHHPOXpB4y/CWphwx/Seohw1+Sesjwl6QeMvwlqYcMf0nqIcNfknro/wPCn7wQ\nQ7x1SgAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xafafd90>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import math\n",
    "import numpy\n",
    "%matplotlib inline\n",
    "from matplotlib.pyplot import plot,title,xlabel,ylabel,ylim,xlim,annotate\n",
    "\n",
    "#Variables \n",
    "\n",
    "Vinmax = 10.0                   #Peak input voltage (in volts)\n",
    "R1 = 5 * 10**3                  #Resistance1 (in ohm)\n",
    "R2 = 5 * 10**3                  #Resistance2 (in ohm) \n",
    "\n",
    "#Calculation\n",
    "\n",
    "Vout = Vinmax/(R1 + R2)*R2      #Output voltage (in volts)          \n",
    "\n",
    "#Result\n",
    "\n",
    "print \"Output voltage Vout = Vin/2.\"\n",
    "print \"Voutmax = \",Vout,'V.'\n",
    "\n",
    "#Graph\n",
    "\n",
    "x = numpy.linspace(0,12,100) \n",
    "x1 = numpy.linspace(0,3,100)\n",
    "x2 = numpy.linspace(3,6,100)\n",
    "x3 = numpy.linspace(6,9,100)\n",
    "y1 = numpy.linspace(-5,0,100)\n",
    "plot(x,0+x-x,'k')\n",
    "plot(x1,0-x1+x1,'b')\n",
    "plot(x2,-5+x2-x2,'b')\n",
    "plot(x3,0+x3-x3,'b')\n",
    "plot(3+y1-y1,y1,'b')\n",
    "plot(6+y1-y1,y1,'b')\n",
    "plot(9+y1-y1,y1,'b')\n",
    "plot(x2,-2+x2-x2,'--',color='g')\n",
    "title(\"Output Voltage Waveform\")\n",
    "xlabel(\"t ->\")\n",
    "ylabel(\"-Vout->\")\n",
    "xlim(0,9)\n",
    "ylim(-6,5)\n",
    "annotate('T/2',xy=(4.25,-2))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5.19 , Page Number 168 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "OUtput voltage lies in range : -8 V to +6 V.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.text.Text at 0xccf9450>"
      ]
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYkAAAEZCAYAAABiu9n+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3X+YVHXd//HnG1SKSPzBb8MQi8z70oKrmzsVdP1iipYa\n+TVZ0jTTQtPUSkG9L1m+GmL19dLqvv3eJRh2C2SkAquSrrmABpkJ3pSuWkoo4PpzKVPCdt/fPz5n\nYlh2dmdmZ+acM/N6XNdeO3PmzJn3HoZ5z+fH+3zM3REREelKn7gDEBGR5FKSEBGRnJQkREQkJyUJ\nERHJSUlCRERyUpIQEZGclCREspjZT8zs2r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DLr/khCa0KK5O5bo9+vAncTuvSkeK1mNgzAzIYDr8QcT6q5+yseAW5F78+C\nmNmehATxU3e/J9pc0Hs0bUniceDDZjbKzPYCzgCWxRxTaplZfzN7f3T7fcDxwIbunyU9WAacHd0+\nG7inm327xGE2AAABrklEQVSlB9GHWMYU9P7Mm5kZMA94yt1vynqooPdo6iquzexE4CagLzDP3a+P\nOaTUMrODCK0HgD2AO3Q+82dmi4BjgEGEvt1rgKXAncCBwEbg8+7eFleMadLF+ZwF1BG6mhx4Afhq\nVn+6dMPMJgCrgP9hZ5fSlcBjFPAeTV2SEBGRyklbd5OIiFSQkoSIiOSkJCEiIjkpSYiISE5KEiIi\nkpOShIiI5KQkIVIAMxtoZhfEHYdIpShJiBRmX+DCfHY0s73NTP/HJNX0BhYpzFzg4GgBnBt62Hci\n0GJms8xsZA/7iiSSKq5FCmBmHwQa3f2wPPffHziLcI2clwnX0lkarYciknhKEiIFiK7LvzzfJNHp\nuUcA84Ed7v6xEocmUhbqbhIpETO7MOqGeiL76qVmdqiZfZewCthq4LzYghQpkFoSIgWIuo9+5+6j\n8th3HPAfQAdhLYSfufvb5Y1QpLSUJEQKZGZ3AIcD97n7jG72O4Sw+NczFQtOpMSUJEREJCeNSYiI\nSE5KEiIikpOShIiI5KQkISIiOSlJiIhITkoSIiKSk5KEiIjkpCQhIiI5/X8U4pCMWcduDwAAAABJ\nRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xcbb18d0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import math\n",
    "import numpy\n",
    "%matplotlib inline\n",
    "from matplotlib.pyplot import plot,title,xlabel,ylabel,ylim,xlim,annotate\n",
    "\n",
    "#Variables \n",
    "\n",
    "Vinmax = 10                             #Peak input voltage (in volts)\n",
    "V1 = 5.3                                #Voltage source1 (in volts)\n",
    "V2 = 7.3                                #Voltage source2 (in volts) \n",
    "R = 10.0 * 10**3                        #Resistance (in ohm)\n",
    "\n",
    "#Calculation\n",
    "\n",
    "Vomax = 6                               #Peak output voltage in positive half (in volts)\n",
    "Vomin = -8                              #Peak output voltage in negative half (in volts)\n",
    "\n",
    "#Result\n",
    "\n",
    "print \"OUtput voltage lies in range : -8 V to +6 V.\"\n",
    "\n",
    "#Graph \n",
    "\n",
    "x = numpy.linspace(0,24,100)\n",
    "x1 = numpy.linspace(0,3,100)\n",
    "x2 = numpy.linspace(3,5,100)\n",
    "x3 = numpy.linspace(5,7,100)\n",
    "x4 = numpy.linspace(7,10,100)\n",
    "x5 = numpy.linspace(10,14,100)\n",
    "x6 = numpy.linspace(14,15,100)\n",
    "x7 = numpy.linspace(15,16,100)\n",
    "x8 = numpy.linspace(16,20,100)\n",
    "x9 = numpy.linspace(0,5,100)\n",
    "x10 = numpy.linspace(0,14,100)\n",
    "x11 = numpy.linspace(0,15,100)\n",
    "\n",
    "plot(x,0+x-x,'k')\n",
    "plot(x1,2*x1,'b')\n",
    "plot(x2,2*x2,'--',color='b')\n",
    "plot(x3,10-2*(x3-5),'--',color='b')\n",
    "plot(x4,6-2*(x4-7),'b')\n",
    "plot(x5,-2*(x5-10),'b')\n",
    "plot(x6,-8-2*(x6-14),'--',color='b')\n",
    "plot(x7,-10+2*(x7-15),'--',color='b')\n",
    "plot(x8,-8+2*(x8-16),'b')\n",
    "\n",
    "plot(x1,6-x1+x1,'--',color='g')\n",
    "plot(x2,6-x2+x2,'k')\n",
    "plot(x3,6-x3+x3,'k')\n",
    "plot(x6,-8-x6+x6,'k')\n",
    "plot(x7,-8-x7+x7,'k')\n",
    "plot(x9,10+x9-x9,'--',color='g')\n",
    "plot(x10,-8+x10-x10,'--',color='g')\n",
    "plot(x11,-10+x11-x11,'--',color='g')\n",
    "\n",
    "xlim(0,20)\n",
    "ylim(-12,12)\n",
    "title(\"Output Voltage Waveform\")\n",
    "xlabel(\"t ->\")\n",
    "ylabel(\"-Vout->\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 5.20 , Page Number 173 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Output voltage in positive half :  35 V.\n",
      "Output voltage in negative half  : -5 V.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "(-10, 40)"
      ]
     },
     "execution_count": 98,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEZCAYAAAB4hzlwAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGGZJREFUeJzt3XmYLXV95/H3By6giGyScAEvXCUSdcYIPI4PqECraFxB\nnQGXSDQueUZjJBNNuDAzQmYJqJlMVjNPohAkbOJCwAVBpcEFQQSUVdwIm1xENhVNWL7zR1UX5zbd\nfbvv7b51ivt+PU8/fU6dOnW+51R3fer3+1WdSlUhSRLAJn0XIEkaH4aCJKljKEiSOoaCJKljKEiS\nOoaCJKljKEgjkvxjkv/Zdx3jIslzk3w3yU+THNR3PVp6hoLWKsmbk1yZ5OdJfpTkQ0m2WcDzb0jy\ngkWsZ9blJdklyf1JnjzDY59K8sG1LL7aH5JMJLlp/SteuCSfT/LHI/d3SfLQLNN+dQlL+R/AX1XV\n46vqrCV8HY0JQ0FzSvIe4DjgPcDWwD7AbsB5STab52IKyCKWNevyquoW4IvAYaPTk2wPvBT4x3ks\nfzFrXVcXAPuP3N8fuG6GaddX1e1LWMeuwDXr8sQkmy5yLdoADAXNKsnWwDHAu6rq3Kp6sKr+BTgU\nWAm8sZ1vjS6X0T3sJCfRbFjObrsg3ptkZbuH+/YktyS5tQ0f1mV5M5R+ItNCAXgdcHVVXZ3kaUkm\nk9yV5Kokr5w2byXZEvgcsHP7OvcmWZ7k2Ukuap97a5K/Hg3HJC9O8p0kdyf52yQXJHnryONvSXJN\nkjuTnJNk11k+/i8Dzx25/zzgL4BnjUz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EmkHwd1bVvTPN5MlrkqTO\n0LqPJElLyFCQJHUMBUlSx1CQJHUMBUlSx1CQJHUMBWkBkmyT5B191yEtFUNBWpjtgHfOZ8YkW7cn\n6kmD4R+stDDHAbu3F3R5/1rm3Q+4LsnRSVasZV5pLHhGs7QASXYDPl1Vz5jn/E8ADgPeBNxG831U\n/9xeD0QaO4aCtADttSnOnm8oTHvuvsDxwL9V1TMXuTRpUdh9JC2SJO9su5UuS7LTyPSnJ/kgzeUs\nvwy8rbcipbWwpSAtQNsd9M2qWjmPefcG/pbmmzI/DJw+cjlSaSwZCtICJTkZ+A3gs1V1xBzzPRWo\nqprxYibSODIUJEkdxxQkSR1DQZLUMRQkSR1DQZLUMRQkSR1DQZLUMRQkSR1DQZLU+f8JNf15Q00k\nGQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xcbb1ad0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import math\n",
    "import numpy\n",
    "%matplotlib inline\n",
    "from matplotlib.pyplot import plot,title,xlabel,ylabel,ylim,xlim\n",
    "\n",
    "#Variables \n",
    "\n",
    "Vin = 20                      #Input voltage (in volts)\n",
    "V1 = 5                        #Battery voltage (in volts) \n",
    "\n",
    "#Calculation\n",
    "\n",
    "Voutp = (2*Vin - V1)          #Output voltage in positive half (in volts)\n",
    "Voutn = 0 - V1                #Output voltage in negative half (in volts) \n",
    "\n",
    "#Result\n",
    "\n",
    "print \"Output voltage in positive half : \",Voutp,\"V.\"\n",
    "print \"Output voltage in negative half  :\",Voutn,\"V.\"\n",
    "\n",
    "#Graph\n",
    "\n",
    "x = numpy.linspace(0,9,100) \n",
    "x1 = numpy.linspace(0,3,100)\n",
    "x2 = numpy.linspace(3,6,100)\n",
    "x3 = numpy.linspace(6,9,100)\n",
    "y1 = numpy.linspace(-5,35,100)\n",
    "plot(x,0+x-x,'k')\n",
    "plot(x1,-10+x1-x1,'--',color='g')\n",
    "plot(x1,35-x1+x1,'b')\n",
    "plot(x2,-5+x2-x2,'b')\n",
    "plot(x3,35+x3-x3,'b')\n",
    "plot(3+y1-y1,y1,'b')\n",
    "plot(6+y1-y1,y1,'b')\n",
    "title(\"Output Voltage Waveform\")\n",
    "xlabel(\"t ->\")\n",
    "ylabel(\"-Vout->\")\n",
    "xlim(0,9)\n",
    "ylim(-10,40)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}