summaryrefslogtreecommitdiff
path: root/Electronic_Principles_/Chapter_17_New.ipynb
blob: 3de7e1293c24c9538aa72ff3822428af44ac31e1 (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
{
 "metadata": {
  "name": ""
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "CHAPTER 17 DIFFERENTIAL AMPLIFIERS"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17-1, Page 625"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 17.1.py\n",
      "#What are the ideal currents & voltages in figure 17-6a?\n",
      "\n",
      "#Variable declaration\n",
      "VCC=15                           #supply voltage(V)\n",
      "RE=7.5                           #Emitter resistance(KOhm)\n",
      "\n",
      "#Calculation\n",
      "IT=VCC/RE                         #tail current (mA)\n",
      "IE=IT/2                           #emitter current (mA)\n",
      "\n",
      "#Result\n",
      "print 'tail current = ',IT,'mA'\n",
      "print 'emitter current = ',IE,'mA'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "tail current =  2.0 mA\n",
        "emitter current =  1.0 mA\n"
       ]
      }
     ],
     "prompt_number": 94
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17-2, Page 626"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 17.2.py\n",
      "#Recalculate the currents and voltages for figure 17-6a using second approximation.\n",
      "\n",
      "#Variable declaration\n",
      "VCC=15                           #supply voltage(V)\n",
      "RE=7.5                           #Emitter resistance(KOhm)\n",
      "VBE=0.7                          #base-emitter voltage(V)\n",
      "RC=5                             #collector resistance(KOhm)\n",
      "\n",
      "#Calculation\n",
      "IT=(VCC-VBE)/RE                         #tail current (mA)\n",
      "IE=IT/2                                 #emitter current (mA)\n",
      "VC=VCC-(IE*RC)                          #collector quiescent voltage(V) \n",
      "\n",
      "#Result\n",
      "print 'tail current = ',round(IT,2),'mA'\n",
      "print 'emitter current = ',round(IE,2),'mA'\n",
      "print 'collector quiescent voltage VC = ',round(VC,2),'V'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "tail current =  1.91 mA\n",
        "emitter current =  0.95 mA\n",
        "collector quiescent voltage VC =  10.23 V\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17-3, Page 626"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 17.3.py\n",
      "#What are the ideal currents & voltages in figure 17-7a?\n",
      "\n",
      "#Variable declaration\n",
      "VCC=12.0                           #supply voltage(V)\n",
      "RE=5.0                             #Emitter resistance(KOhm)\n",
      "RC=3.0                             #collector resistance(KOhm)\n",
      "\n",
      "#Calculation\n",
      "IT=VCC/RE                         #tail current (mA)\n",
      "IE=IT/2                           #emitter current (mA)\n",
      "VC=VCC-(IE*RC)                    #collector quiescent voltage(V) \n",
      "#with second approximation,\n",
      "IT1=(VCC-VBE)/RE                          #tail current (mA)\n",
      "IE1=IT1/2                                 #emitter current (mA)\n",
      "VC1=VCC-(IE1*RC)                          #collector quiescent voltage(V) \n",
      "\n",
      "#Result\n",
      "print 'tail current = ',IT,'mA'\n",
      "print 'emitter current = ',IE,'mA'\n",
      "print 'collector quiescent voltage VC = ',VC,'V'\n",
      "print 'with second approximation,'\n",
      "print 'tail current = ',IT1,'mA'\n",
      "print 'emitter current = ',IE1,'mA'\n",
      "print 'collector quiescent voltage VC = ',VC1,'V'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "tail current =  2.4 mA\n",
        "emitter current =  1.2 mA\n",
        "collector quiescent voltage VC =  8.4 V\n",
        "with second approximation,\n",
        "tail current =  2.26 mA\n",
        "emitter current =  1.13 mA\n",
        "collector quiescent voltage VC =  8.61 V\n"
       ]
      }
     ],
     "prompt_number": 92
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17-4, Page 631"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 17.4.py\n",
      "#In figure 17-11, what is the ac output voltage? If B = 300, what is input impedance?\n",
      "\n",
      "#Variable declaration\n",
      "VCC=12.0                           #supply voltage(V)\n",
      "RE=7.5                             #Emitter resistance(KOhm)\n",
      "RC=5.0                             #collector resistance(KOhm)\n",
      "IE=1                               #emitter current as per preceding example(mA)\n",
      "Vin=1                              #input ac voltage(mV)\n",
      "B=300                              #current gain\n",
      "\n",
      "#Calculation\n",
      "re=25/IE                          #ac emitter resistance(Ohm)\n",
      "Av=1000*RC/re                     #voltage gain\n",
      "Vout=Av*Vin                       #Output voltage(mV)\n",
      "Zinb=2*B*re                       #input impedance of diff amp(Ohm)\n",
      "\n",
      "#Result\n",
      "print 'voltage gain Av = ',Av\n",
      "print 'Output voltage Vout = ',Vout,'mV'\n",
      "print 'input impedance of diff amplifier, Zin(base) = ',Zinb/1000,'KOhm'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "voltage gain Av =  200.0\n",
        "Output voltage Vout =  200.0 mV\n",
        "input impedance of diff amplifier, Zin(base) =  15 KOhm\n"
       ]
      }
     ],
     "prompt_number": 91
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17-5, Page 632"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 17.5.py\n",
      "#Repeat preceding example using second approximation to calculate ICQ.\n",
      "\n",
      "#Variable declaration\n",
      "VCC=12.0                           #supply voltage(V)\n",
      "RE=7.5                             #Emitter resistance(KOhm)\n",
      "RC=5.0                             #collector resistance(KOhm)\n",
      "IE=0.955                           #emitter current as per previous example(mA)\n",
      "Vin=1                              #input ac voltage(mV)\n",
      "B=300                              #current gain\n",
      "\n",
      "#Calculation\n",
      "re=25/IE                          #ac emitter resistance(Ohm)\n",
      "Av=1000*RC/re                     #voltage gain\n",
      "Vout=Av*Vin                       #Output voltage(mV)\n",
      "Zinb=2*B*re                       #input impedance of diff amp(Ohm)\n",
      "\n",
      "#Result\n",
      "print 'voltage gain Av = ',Av\n",
      "print 'Output voltage Vout = ',Vout,'mV'\n",
      "print 'input impedance of diff amplifier, Zin(base) = ',round((Zinb/1000),2),'KOhm'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "voltage gain Av =  191.0\n",
        "Output voltage Vout =  191.0 mV\n",
        "input impedance of diff amplifier, Zin(base) =  15.71 KOhm\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17-6, Page 633"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 17.6.py\n",
      "#Repeat example 17-4 for v2=1mV & v1=0.\n",
      "\n",
      "#Variable declaration\n",
      "VCC=12.0                           #supply voltage(V)\n",
      "RE=7.5                             #Emitter resistance(KOhm)\n",
      "RC=5.0                             #collector resistance(KOhm)\n",
      "IE=1                               #emitter current as per preceding example(mA)\n",
      "V2=1                               #input ac voltage(mV)\n",
      "B=300                              #current gain\n",
      "\n",
      "#Calculation\n",
      "re=25/IE                          #ac emitter resistance(Ohm)\n",
      "Av=1000*RC/re                     #voltage gain\n",
      "Vout=Av*V2                        #Output voltage(mV)\n",
      "Zinb=2*B*re                       #input impedance of diff amp(Ohm)\n",
      "\n",
      "#Result\n",
      "print 'V2 input is at inverting input, So, ideally same as previous case.'\n",
      "print 'Voltage gain Av = ',Av\n",
      "print 'Output voltage Vout = ',Vout,'mV'\n",
      "print 'input impedance of diff amplifier, Zin(base) = ',Zinb/1000,'KOhm'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "V2 input is at inverting input, So, ideally same as previous case.\n",
        "Voltage gain Av =  200.0\n",
        "Output voltage Vout =  200.0 mV\n",
        "input impedance of diff amplifier, Zin(base) =  15 KOhm\n"
       ]
      }
     ],
     "prompt_number": 96
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17-7, Page 633"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 17.7.py\n",
      "#What is ac output voltage in figure 17-12? if B=300, what is input impedance?\n",
      "\n",
      "#Variable declaration\n",
      "VCC=15.0                           #supply voltage(V)\n",
      "RC=1.0**10**6                      #collector resistance(Ohm)\n",
      "RE=1.0**10**6                      #emitter resistance(Ohm)\n",
      "IE=1                               #emitter current as per preceding example(mA)\n",
      "Vin=7                              #input ac voltage(mV)\n",
      "B=300                              #current gain\n",
      "\n",
      "#Calculation\n",
      "IT=VCC/RE                         #tail current (uA)\n",
      "IE=IT/2                           #emitter current (uA)\n",
      "re=25/IE/1000                     #ac emitter resistance(Ohm)\n",
      "Av=RC/(2*re)                      #voltage gain\n",
      "Vout=Av*Vin                       #Output voltage(V)\n",
      "Zinb=2*B*re                       #input impedance of diff amp(MOhm)\n",
      "\n",
      "#Result\n",
      "print 'Voltage gain Av = ',Av\n",
      "print 'Output voltage Vout = ',Vout/1000,'V'\n",
      "print 'input impedance of diff amplifier, Zin(base) = ',Zinb,'MOhm'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Voltage gain Av =  150.0\n",
        "Output voltage Vout =  1.05 V\n",
        "input impedance of diff amplifier, Zin(base) =  2.0 MOhm\n"
       ]
      }
     ],
     "prompt_number": 97
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17-8, Page 639"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 17.8.py\n",
      "#The diff amp of figure 17-17 has Av=200, Iin(bias)=3uA, Iin(off) =0.5 uA. and Vin(off)= 1mV. What is output error voltage?\n",
      "#what is output error voltage?\n",
      "\n",
      "#Variable declaration\n",
      "VCC=15.0                           #supply voltage(V)\n",
      "RC=5.0*10**3                       #collector resistance(Ohm)\n",
      "RE=7.5*10**3                       #emitter resistance(Ohm)\n",
      "RB=1*10**3                         #base resistance(Ohm)\n",
      "Vin=10                             #input ac voltage(mV)\n",
      "Av=200                             #voltage gain\n",
      "Iinb=3*10**-6                      #bias current(A)\n",
      "Iino =0.5*10**-6                   #Iin(off)  (A) \n",
      "Vino=1.0                           #Vin(off) (mV)\n",
      "\n",
      "#Calculation\n",
      "V1err=RB*Iinb*1000                      #dc error input1 (mV)\n",
      "V2err=RB*(Iino/2)*1000                  #dc error input2 (mV)\n",
      "V3err=Vino                              #dc error input3 (mV)\n",
      "Verror=Av*(V1err+V2err+V3err)           #output error voltage(mV)\n",
      "#if matching base resistor is used,\n",
      "V1err1=0                                #dc error input1 (mV)\n",
      "V2err1=RB*Iino*1000                     #dc error input2 (mV)\n",
      "V3err1=Vino                             #dc error input3 (mV)\n",
      "Verror1=Av*(V1err1+V2err1+V3err1)       #output error voltage(mV)\n",
      "\n",
      "#Result\n",
      "print 'output error voltage Verror = ',Verror,'mV'\n",
      "print 'output error voltage Verror = ',Verror1,'mV'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "output error voltage Verror =  850.0 mV\n",
        "output error voltage Verror =  300.0 mV\n"
       ]
      }
     ],
     "prompt_number": 37
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17-9, Page 640"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 17.9.py\n",
      "#The diff amp of figure 17-18 has Av=300, Iin(bias)=80nA, Iin(off) =20 nA. and Vin(off)= 5mV. What is output error voltage?\n",
      "\n",
      "#Variable declaration\n",
      "VCC=15.0                           #supply voltage(V)\n",
      "RC=1.0*10**6                       #collector resistance(Ohm)\n",
      "RE=1.0*10**6                       #emitter resistance(Ohm)\n",
      "RB=10*10**3                        #base resistance(Ohm)\n",
      "Vin=10                             #input ac voltage(mV)\n",
      "Av=300                             #voltage gain\n",
      "Iinb=80*10**-9                     #bias current(A)\n",
      "Iino=20*10**-9                     #Iin(off)  (A) \n",
      "Vino=5.0                           #Vin(off) (mV)\n",
      "\n",
      "#Calculation\n",
      "V1err=0                                 #dc error input1 (mV)\n",
      "V2err=RB*(Iino/2)*1000                  #dc error input2 (mV)\n",
      "V3err=Vino                              #dc error input3 (mV)\n",
      "Verror=Av*(V1err+V2err+V3err)           #output error voltage(mV)\n",
      "\n",
      "#Result\n",
      "print 'output error voltage Verror = ',Verror/1000,'V'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "output error voltage Verror =  1.53 V\n"
       ]
      }
     ],
     "prompt_number": 98
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17-10, Page 643"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 17.10.py\n",
      "#In figure 17-2, what is common-node voltage gain & output voltage?\n",
      "\n",
      "#Variable declaration\n",
      "VCC=15.0                           #supply voltage(V)\n",
      "RC=1.0*10**6                       #collector resistance(Ohm)\n",
      "RE=1.0*10**6                       #emitter resistance(Ohm)\n",
      "Vin=1                              #input ac voltage(mV)\n",
      "\n",
      "#Calculation\n",
      "Av_CM=RC/(2*RE)                    #common mode voltage gain\n",
      "Vout=Av_CM*Vin                     #output voltage(mV) \n",
      "\n",
      "#Result \n",
      "print 'common mode voltage gain : Av(CM) = ',Av_CM\n",
      "print 'Output voltage Vout = ',Vout,'mV'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "common mode voltage gain : Av(CM) =  0.5\n",
        "Output voltage Vout =  0.5 mV\n"
       ]
      }
     ],
     "prompt_number": 45
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17-11, Page 643"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 17.11.py\n",
      "#In figure 17-22 has Av=150, Av(CM)=0.5, Vin =1 mV. \n",
      "#If base leads are picking up a common-mode signal of 1mV, what is the output voltage?\n",
      "\n",
      "#Variable declaration\n",
      "Vin=1                              #input ac voltage(mV)\n",
      "Av=150                             #voltage gain\n",
      "Av_CM=0.5                          #common mode voltage gain\n",
      "\n",
      "#Calculation\n",
      "Vout1=Av*Vin                       #output voltage1(mV)\n",
      "Vout2=Av_CM*Vin                       #output voltage2(mV)\n",
      "Vout=Vout1+Vout2                    #output volatge(mV)\n",
      "\n",
      "#Result\n",
      "print 'output voltage Vout1 = ',Vout1,'mV'\n",
      "print 'output voltage Vout2 = ',Vout2,'mV'\n",
      "print 'output voltage Vout = ',Vout,'mV'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "output voltage Vout1 =  150 mV\n",
        "output voltage Vout2 =  0.5 mV\n",
        "output voltage Vout =  150.5 mV\n"
       ]
      }
     ],
     "prompt_number": 46
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17-12, Page 644"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 17.12.py\n",
      "#OP-AMP with Av=2,00,000 & CMRR(dB)=90dB. what is the common mode voltage gain? \n",
      "#If desired & common-mode signal is of 1uV, what is the output voltage?\n",
      "\n",
      "#Variable declaration\n",
      "CMRR_dB=90                               #CMRR(dB)\n",
      "Av=200000                                #voltage gain\n",
      "Vin=1*10**-6                             #input voltage(V)\n",
      "\n",
      "#Calculation\n",
      "CMRR=10**(CMRR_dB/20.0)                 #CMRR \n",
      "Av_CM=Av/CMRR                         #common mode voltage gain   \n",
      "Vout1=Av*Vin                          #desired output: voltage1(V)\n",
      "Vout2=Av_CM*Vin                       #common mode output: voltage2(V)\n",
      "\n",
      "#Result\n",
      "print 'output voltage Vout1 = ',Vout1,'V'\n",
      "print 'output voltage Vout2 = ',round((Vout2*10**6),2),'uV'\n",
      "print 'see, desired output is much larger than common mode output.'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "output voltage Vout1 =  0.2 V\n",
        "output voltage Vout2 =  6.32 uV\n",
        "see, desired output is much larger than common mode output.\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17-13, Page 651"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 17.13.py\n",
      "#What is load voltage in figure 17-32a when RL=15KOhm?\n",
      "\n",
      "#Variable declaration\n",
      "VCC=15.0                           #supply voltage(V)\n",
      "RC=7.5*10**3                       #collector resistance(Ohm)\n",
      "RE=7.5*10**3                       #emitter resistance(Ohm)\n",
      "V1=10                              #input ac voltage(mV)\n",
      "re=25                              #as per example 17-4 (Ohm)   \n",
      "RL=15*10**3                        #load resistance(KOhm)\n",
      "\n",
      "#Calculation\n",
      "Av=RC/re                           #voltage gain\n",
      "Vout=Av*V1/1000                    #output voltage(V) \n",
      "RTH=2*RC                           #Thevenin resistance(Ohm)\n",
      "VL=(RL/(RL+RTH))*Vout              #load voltage(V)\n",
      "\n",
      "#Result \n",
      "print 'Load voltage VL = ',VL,'V'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Load voltage VL =  1.5 V\n"
       ]
      }
     ],
     "prompt_number": 67
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 17-14, Page 652"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#Example 17.14.py\n",
      "#An ammeter is used for load resistance. find current through the ammeter?\n",
      "\n",
      "#Variable declaration\n",
      "RL=15.0                            #load resistance as per previous example(Ohm)\n",
      "VL=3                               #load voltage as per previous example(V)\n",
      "\n",
      "#Calculation\n",
      "iL=VL/RL                           #load current(mA)\n",
      "\n",
      "#Result\n",
      "print 'Load current iL = ',iL,'mA'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Load current iL =  0.2 mA\n"
       ]
      }
     ],
     "prompt_number": 69
    }
   ],
   "metadata": {}
  }
 ]
}