summaryrefslogtreecommitdiff
path: root/Electronic_Principles_/Chapter_24_New.ipynb
blob: 7b020fb611665b225e49b2a671365a22bd34c71b (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
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "CHAPTER 24 REGULATED POWER SUPPLIES"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 24-1, Page 954  "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 24.1.py\n",
      "#Vin=15V, Rs=10 Ohm, Vz=9.1V, VBE=0.8V, RL=40 Ohm.\n",
      "#what are the value of Vout, Iin, IL, IC.\n",
      "\n",
      "#Variable declaration\n",
      "Rs=10                          #given source resistance Rs(Ohm)\n",
      "RL=40                          #given load resistance RL(Ohm)\n",
      "Vin=15                         #input voltage(V)\n",
      "VBE=0.8                        #base-emitter voltage drop(V) \n",
      "Vz=9.1                         #voltage across diode(V)\n",
      "\n",
      "#Calculation\n",
      "Vout=Vz+VBE                         #output voltage(V) \n",
      "Is=1000*(Vin-Vout)/Rs               #input current(mA)  \n",
      "IL=1000*Vout/RL                     #load current(mA)\n",
      "IC=Is-IL                            #collector current(mA)\n",
      "\n",
      "#Result\n",
      "print 'Output voltage Vout = ',Vout,'V'\n",
      "print 'input current Is = ',Is,'mA'\n",
      "print 'load current IL = ',IL,'mA'\n",
      "print 'collector current IC = ',IC,'mA'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Output voltage Vout =  9.9 V\n",
        "input current Is =  510.0 mA\n",
        "load current IL =  247.5 mA\n",
        "collector current IC =  262.5 mA\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 24-2, Page 954"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 24.2.py\n",
      "#Vin=15V, Rs=10 Ohm, Vz=6.2V, VBE=0.81V, RL=40 Ohm , R1=750 Ohm, R2=250 Ohm.\n",
      "#what are the value of Vout, Iin, IL, IC.\n",
      "\n",
      "#Variable declaration\n",
      "Rs=10                          #given source resistance Rs(Ohm)\n",
      "RL=40                          #given load resistance RL(Ohm)\n",
      "Vin=15                         #input voltage(V)\n",
      "VBE=0.81                       #base-emitter voltage drop(V) \n",
      "Vz=6.2                         #voltage across diode(V)\n",
      "R1=750                         #base input resistance(Ohm)\n",
      "R2=250                         #base input resistance(Ohm)\n",
      "\n",
      "#Calculation\n",
      "Vout=(Vz+VBE)*(R1+R2)/R1            #output voltage(V) \n",
      "Is=1000*(Vin-Vout)/Rs               #input current(mA)  \n",
      "IL=1000*Vout/RL                     #load current(mA)\n",
      "IC=Is-IL                            #collector current(mA)\n",
      "\n",
      "#Result\n",
      "print 'Output voltage Vout = ',round(Vout,2),'V'\n",
      "print 'input current Is = ',round(Is,2),'mA'\n",
      "print 'load current IL = ',round(IL,2),'mA'\n",
      "print 'collector current IC = ',round(IC,2),'mA'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Output voltage Vout =  9.35 V\n",
        "input current Is =  565.33 mA\n",
        "load current IL =  233.67 mA\n",
        "collector current IC =  331.67 mA\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 24-3, Page 954"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 24.3.py\n",
      "#What is the approximate efficiency in the preceding example?\n",
      "#How much power does the regulator dissipate?\n",
      "\n",
      "#Variable declaration\n",
      "#data from preceding example\n",
      "Vout=9.35                         #output voltage(V)\n",
      "IL=234                            #load current(mA)\n",
      "Is=565                            #input current(mA)\n",
      "Vin=15.0                          #input voltage(V)\n",
      "\n",
      "#Calculation\n",
      "Pout=Vout*IL/1000                 #output power(W)\n",
      "Pin=Vin*Is/1000                   #input power(W)\n",
      "eff=Pout/Pin                      #efficiency\n",
      "preg=Pin-Pout                     #power dissipated by regulator(W)\n",
      "\n",
      "#Result\n",
      "print 'input power Pin = ',Pin,'W'\n",
      "print 'Output power Pout = ',round(Pout,2),'W'\n",
      "print 'Effifciency = ',round((eff*100),2),'%'\n",
      "print'power dissipated by regulator = ',round(preg,2),'W'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "input power Pin =  8.475 W\n",
        "Output power Pout =  2.19 W\n",
        "Effifciency =  25.82 %\n",
        "power dissipated by regulator =  6.29 W\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 24-4, Page 955"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 24.4.py\n",
      "#Vin=15V, Rs=10 Ohm, Vz=6.8V, RL=40 Ohm , R1=7.5 KOhm, R2=2.5 KOhm.\n",
      "#what are the value of Vout, Iin, IL, IC.\n",
      "\n",
      "#Variable declaration\n",
      "Rs=10                          #given source resistance Rs(Ohm)\n",
      "RL=40                          #given load resistance RL(Ohm)\n",
      "Vin=15                         #input voltage(V)\n",
      "Vz=6.8                         #voltage across diode(V)\n",
      "R1=7.5*10**3                   #base input resistance(Ohm)\n",
      "R2=2.5*10**3                   #base input resistance(Ohm)\n",
      "\n",
      "#Calculation\n",
      "Vout=Vz*(R1+R2)/R1                  #output voltage(V) \n",
      "Is=1000*(Vin-Vout)/Rs               #input current(mA)  \n",
      "IL=1000*Vout/RL                     #load current(mA)\n",
      "IC=Is-IL                            #collector current(mA)\n",
      "\n",
      "#Result\n",
      "print 'Output voltage Vout = ',round(Vout,2),'V'\n",
      "print 'input current Is = ',round(Is,2),'mA'\n",
      "print 'load current IL = ',round(IL,2),'mA'\n",
      "print 'collector current IC = ',round(IC,2),'mA'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Output voltage Vout =  9.07 V\n",
        "input current Is =  593.33 mA\n",
        "load current IL =  226.67 mA\n",
        "collector current IC =  366.67 mA\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 24-5, Page 956"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 24.5.py\n",
      "#Calculate maximum load currents for examples 24-1,2,4.\n",
      "\n",
      "#Variable declaration\n",
      "Is1=510                            #input current in ex. 24-1 (mA)\n",
      "Is2=565                            #input current in ex. 24-2 (mA)\n",
      "Is4=593                            #input current in ex. 24-4 (mA)\n",
      "\n",
      "#Calculation\n",
      "Imax1=Is1                           #maximum load current (mA) \n",
      "Imax2=Is2                           #maximum load current (mA) \n",
      "Imax4=Is4                           #maximum load current (mA) \n",
      "\n",
      "#Result\n",
      "print 'maximum load current Imax1 = ',Imax1,'mA'\n",
      "print 'maximum load current Imax2 = ',Imax2,'mA'\n",
      "print 'maximum load current Imax4 = ',Imax4,'mA'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "maximum load current Imax1 =  510 mA\n",
        "maximum load current Imax2 =  565 mA\n",
        "maximum load current Imax4 =  593 mA\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 24-6, Page 956"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 24.6.py\n",
      "#VNL=9.91V, VFL=9.81V, VHL=9.94V, and VLL=9.79V. What is load regulation & line regulation?\n",
      "\n",
      "#Variable declaration\n",
      "VNL=9.91                              #given VNL(V)\n",
      "VFL=9.81                              #given VFL(V)\n",
      "VHL=9.94                              #given VHL(V) \n",
      "VLL=9.79                              #given VLL(V)\n",
      "\n",
      "#Calculation\n",
      "LoR=(VNL-VFL)*100/VFL                  #Load regulation(%)\n",
      "LiR=(VHL-VLL)*100/VLL                  #Line regulation(%)\n",
      "\n",
      "#Result\n",
      "print 'Load regulation = ',round(LoR,2),'%'\n",
      "print 'Line regulation = ',round(LiR,2),'%'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Load regulation =  1.02 %\n",
        "Line regulation =  1.53 %\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 24-7, Page 962"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 24.7.py\n",
      "#Calculate approx. output voltage in figure 24-14, what is the power dissipation in pass transistor?\n",
      "\n",
      "#Variable declaration\n",
      "RL=40.0                         #given load resistance RL(Ohm)\n",
      "VBE=0.7                         #base-emitter voltage drop(V) \n",
      "Vz=6.2                          #voltage across diode(V)\n",
      "R1=3.0                          #base input resistance(KOhm)\n",
      "R2=1.0                          #base input resistance(KOhm)\n",
      "Vin=15                          #input voltage(V)\n",
      "\n",
      "#Calculation\n",
      "Vout=(Vz+VBE)*(R1+R2)/R1        #output voltage(V)\n",
      "IC=Vout/RL                      #transistor current(A)\n",
      "PD=(Vin-Vout)*IC                #power dissipation(W)\n",
      "\n",
      "#Result\n",
      "print 'Output voltage Vout = ',Vout,'V'\n",
      "print 'transistor current = load current = IC = ',IC*1000,'mA'\n",
      "print 'Power dissipation PD = ',PD,'W'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Output voltage Vout =  9.2 V\n",
        "transistor current = load current = IC =  "
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "230.0 mA\n",
        "Power dissipation PD =  1.334 W\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 24-8, Page 963"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 24.3.py\n",
      "#What is the approximate efficiency in the preceding example 24-7?\n",
      "\n",
      "#Variable declaration\n",
      "#data from preceding example\n",
      "Vout=9.2                          #output voltage(V)\n",
      "IL=230                            #load current(mA)\n",
      "Vin=15.0                          #input voltage(V)\n",
      "\n",
      "#Calculation\n",
      "Pout=Vout*IL/1000                 #output power(W)\n",
      "Pin=Vin*IL/1000                   #input power(W)\n",
      "eff1=Pout/Pin                     #efficiency\n",
      "eff2=Vout/Vin                     #efficiency\n",
      "\n",
      "#Result\n",
      "print 'input power Pin = ',Pin,'W'\n",
      "print 'Output power Pout = ',Pout,'W'\n",
      "print 'Effifciency 1= ',round((eff1*100),2),'%'\n",
      "print 'Effifciency 2= ',round((eff2*100),2),'%'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "input power Pin =  3.45 W\n",
        "Output power Pout =  2.116 W\n",
        "Effifciency 1=  61.33 %\n",
        "Effifciency 2=  61.33 %\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 24-9, Page 963"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 24.9.py\n",
      "#What is the approx. output voltage in figure 24-15,Why is a darlington transistor is used?\n",
      "\n",
      "#Variable declaration\n",
      "RL=4.0                          #given load resistance RL(Ohm)\n",
      "Vz=5.6                          #voltage across diode(V)\n",
      "R1=2.7                          #base input resistance(KOhm)\n",
      "R2=2.2                          #base input resistance(KOhm)\n",
      "Vin=15                          #input voltage(V)\n",
      "B=100                           #current gain\n",
      "\n",
      "#Calculation\n",
      "Vout=Vz*(R1+R2)/R1              #output voltage(V)\n",
      "IL=Vout/RL                      #load current(A)\n",
      "IB=IL/B                         #base current(A)\n",
      "\n",
      "#Result\n",
      "print 'Output voltage Vout = ',round(Vout,2),'V'\n",
      "print 'Load current IL = ',round(IL,2),'A'\n",
      "print 'base current IB = ',round((IB*1000),2),'mA'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Output voltage Vout =  10.16 V\n",
        "Load current IL =  2.54 A\n",
        "base current IB =  25.41 mA\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 24-10, Page 964"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 24.10.py\n",
      "#VNL=10.16V, VFL=10.15V, VHL=10.16V, and VLL=10.07V. What is load regulation & line regulation?\n",
      "\n",
      "#Variable declaration\n",
      "VNL=10.16                              #given VNL(V)\n",
      "VFL=10.15                              #given VFL(V)\n",
      "VHL=10.16                              #given VHL(V) \n",
      "VLL=10.07                              #given VLL(V)\n",
      "\n",
      "#Calculation\n",
      "LoR=(VNL-VFL)*100/VFL                  #Load regulation(%)\n",
      "LiR=(VHL-VLL)*100/VLL                  #Line regulation(%)\n",
      "\n",
      "#Result\n",
      "print 'Load regulation = ',round(LoR,3),'%'\n",
      "print 'Line regulation = ',round(LiR,2),'%'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Load regulation =  0.099 %\n",
        "Line regulation =  0.89 %\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 24-11, Page 965"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 24.11.py\n",
      "#vin can vary from 17.5 to 22.5V, what is the maximum zener current, min & max regulated output voltages?\n",
      "#If regulated voltage is 12.5V, what is the load resistance where current limiting starts & approx. shorted-load current?\n",
      "\n",
      "#Variable declaration\n",
      "RL=3.0                          #given load resistance RL(Ohm)\n",
      "Vz=4.7                          #voltage across diode(V)\n",
      "R11=1750                        #base input resistance with max. potentiometer(Ohm)\n",
      "R12=750                         #base input resistance with min. potentiometer(Ohm)\n",
      "R2=750                          #base input resistance(Ohm)\n",
      "Vin=22.5                        #max. input voltage(V)\n",
      "B=100                           #current gain\n",
      "Rs=820                          #input side resistance(Ohm)\n",
      "Vcl=0.6                          #voltage across current limiting resistor(V)\n",
      "Vcs=0.7                          #voltage across current sensing resistor(V)\n",
      "Vo=12.5                         #regulated voltage given(V)\n",
      "\n",
      "#Calculation\n",
      "Iz=(Vin-Vz)/Rs                  #max. zener current(A)\n",
      "Vout1=Vz*(R11+R2)/R11           #min. regulated output voltage(V)\n",
      "Vout2=Vz*(R12+R2)/R12           #max. regulated output voltage(V)\n",
      "IL=Vcl/RL                       #load current(A)\n",
      "RL1=Vo/IL                       #load resistance(Ohm)\n",
      "ISL=Vcs/RL                      #shorted-load current(A)\n",
      "\n",
      "#Result\n",
      "print 'maximum zener current Iz = ',round((Iz*1000),2),'mA'\n",
      "print 'Load current IL = ',IL*1000,'mA'\n",
      "print 'load resistance RL = ',RL1,'Ohm'\n",
      "print 'shorted-load current ISL = ',round((ISL*1000),2),'mA'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "maximum zener current Iz =  21.71 mA\n",
        "Load current IL =  200.0 mA\n",
        "load resistance RL =  62.5 Ohm\n",
        "shorted-load current ISL =  233.33 mA\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 24-12, Page 971"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 24.12.py\n",
      "#what is load current in figure 24-21? what is the output ripple?\n",
      "\n",
      "#Variable declaration\n",
      "Vout=12.0                                #regulated output voltage(V)\n",
      "RL=100.0                                 #given load resistance RL(Ohm)\n",
      "\n",
      "C=1000*10**-6                            #given capacitance(F)\n",
      "f=120                                    #frequency(Hz)\n",
      "RR_dB=72.0                               #ripple rejection(dB)\n",
      "\n",
      "#Calculation  \n",
      "IL=Vout/RL                               #load current(A)\n",
      "VRi=IL/(f*C)                             #peak to peak input ripple (V)\n",
      "RR=10**(RR_dB/20)                        #ripple rejection\n",
      "VRo=VRi/RR                               #peak to peak output ripple (V)\n",
      "\n",
      "#Result\n",
      "print 'Load current IL = ',IL*1000,'mA'\n",
      "print 'peak to peak input ripple = ',VRi,'V'\n",
      "print 'peak to peak output ripple = ',round((VRo*1000),2),'mV'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Load current IL =  120.0 mA\n",
        "peak to peak input ripple =  1.0 V\n",
        "peak to peak output ripple =  0.25 mV\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 24-13, Page 972"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 24.13.py\n",
      "#If R1=2KOhm, R2=22KOhm in figure 24-20, what is the output voltage? If R2 is increased to 46 KOhm. What is the output voltage?\n",
      "\n",
      "#Variable declaration\n",
      "R1=2.0                          #given resistance(KOhm)\n",
      "R2=22.0                         #given resistance(KOhm)\n",
      "R21=46.0                        #given resistance increased(KOhm)\n",
      "\n",
      "#Calculation\n",
      "Vout1=1.25*(R1+R2)/R1              #output voltage(V)\n",
      "Vout2=1.25*(R1+R21)/R1             #output voltage with increased R2(V)\n",
      "\n",
      "#Result\n",
      "print 'Output voltage Vout1 = ',Vout1,'V'\n",
      "print 'output voltage with increased R2, Vout2 = ',Vout2,'V' "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Output voltage Vout1 =  15.0 V\n",
        "output voltage with increased R2, Vout2 =  30.0 V\n"
       ]
      }
     ],
     "prompt_number": 26
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 24-14, Page 972"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 24.14.py\n",
      "#The LM7805 can regulate to specifications with input voltage between 7.5 & 20V.\n",
      "#what is the maximum & minimum efficiency? \n",
      "\n",
      "#Variable declaration\n",
      "#data from preceding example\n",
      "Vout=5.0                          #output voltage(V)\n",
      "Vin_min=7.5                       #min. input voltage(V)\n",
      "Vin_max=20.0                      #max. input voltage(V)\n",
      "\n",
      "#Calculation\n",
      "eff_max=Vout/Vin_min                     #maximum efficiency\n",
      "eff_min=Vout/Vin_max                     #minimum efficiency\n",
      "\n",
      "#Result\n",
      "print 'Minimum Effifciency = ',eff_min*100,'%'\n",
      "print 'Maximum Effifciency = ',round((eff_max*100),2),'%'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Minimum Effifciency =  25.0 %\n",
        "Maximum Effifciency =  66.67 %\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 24-15, Page 984"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 24.15.py\n",
      "#R1=2.21 KOhm, R2=2.8 KOhm, what is the output voltage, minimum input voltage that can be used with the output voltage?\n",
      "\n",
      "#Variable declaration\n",
      "R1=2.21                          #given resistance(KOhm)\n",
      "R2=2.8                           #given resistance(KOhm)\n",
      "R21=46.0                         #given resistance increased(KOhm)\n",
      "VREF=2.21                        #Reference voltage(V)\n",
      "\n",
      "#Calculation\n",
      "Vout=VREF*(R1+R2)/R1             #output voltage(V)\n",
      "\n",
      "#Result\n",
      "print 'Output voltage Vout = ',Vout,'V'\n",
      "print 'Input voltage should be 2V greater than output voltage So, Vin = 7 V'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Output voltage Vout =  5.01 V\n",
        "Input voltage should be 2V greater than output voltage So, Vin = 7 V\n"
       ]
      }
     ],
     "prompt_number": 31
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 24-16, Page 984"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 24.15.py\n",
      "#In buck-boost regulator of figure 24-32, If R1=1 KOhm, R2=5.79 KOhm, what is the output voltage? \n",
      "\n",
      "#Variable declaration\n",
      "R1=1                              #given resistance(KOhm)\n",
      "R2=5.79                           #given resistance(KOhm)\n",
      "VREF=2.21                         #Reference voltage(V)\n",
      "\n",
      "#Calculation\n",
      "Vout=VREF*(R1+R2)/R1             #output voltage(V)\n",
      "\n",
      "#Result\n",
      "print 'Output voltage Vout = ',round(Vout,2),'V'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Output voltage Vout =  15.01 V\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}