summaryrefslogtreecommitdiff
path: root/OpAmps_And_Linear_Integrated_Circuits_by_Gayakwad/Chapter4.ipynb
blob: d79d53851428c8635134d353025c2cf3c3008acb (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
{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "# Chapter 4: The Practical Op-Amp"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Example 4.1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Resistance Rb is 10.0 kilo ohms\n",
      "Resistance Ra is  4.0 kilo ohms\n"
     ]
    }
   ],
   "source": [
    "\n",
    "#Example 4.1\n",
    "#Design a Compensating Network for the opamp LM307.\n",
    "#The opamp uses +10 V and -10 V supply voltages.\n",
    "\n",
    "#Variable declaration\n",
    "V=10             #Supply voltage\n",
    "Vio=10*10**-3    #Input offset voltage\n",
    "Rc=10            #Assumption\n",
    "\n",
    "#calculation\n",
    "Rb=(V/Vio)*Rc\n",
    "Ra=Rb/2.5        #Since Rb>Rmax,let us choose Rb=10*Rmax where Rmax=Ra/4\n",
    "\n",
    "#Result\n",
    "print \"Resistance Rb is\",Rb/10**3,\"kilo ohms\"\n",
    "print \"Resistance Ra is \",Ra/10**3,\"kilo ohms\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Example 4.2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Max output offset voltage is 110.0 milli Volts\n"
     ]
    }
   ],
   "source": [
    "\n",
    "#Example 4.2\n",
    "#The opamp in the circuit of figure 4-13 is the LM307 with Vio=10 mV dc maximum.\n",
    "#What is the maximum possible output offset voltage, Voo, caused by\n",
    "#the input offset voltage Vio?\n",
    "\n",
    "#Variable declaration\n",
    "R1=1*10**3\n",
    "Rf=10*10**3\n",
    "Vio=10*10**-3      #Input offset voltage\n",
    "\n",
    "#calculation\n",
    "Aoo=1+Rf/R1        #To find max value of Voo,we reduce input voltage vin to zero.\n",
    "Voo=Aoo*Vio        #Max output offset voltage\n",
    "\n",
    "#Result\n",
    "print \"Max output offset voltage is\",Voo*10**3,\"milli Volts\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Example 4.3"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Closed loop gain of non-inverting amplifier is 11.0\n"
     ]
    }
   ],
   "source": [
    "#Example 4.3\n",
    "#Design an input offset voltage-compensating network for the circuit in\n",
    "#figure 4-13\n",
    "\n",
    "from __future__ import division #to perform decimal division\n",
    "\n",
    "#Variable declaration\n",
    "R1=1*10**3\n",
    "Rf=10*10**3\n",
    "Rc=10\n",
    "\n",
    "\n",
    "#calculation\n",
    "Af=1+Rf/(R1+Rc)    #Closed loop gain of non-inverting amplifier\n",
    "\n",
    "#Result\n",
    "print \"Closed loop gain of non-inverting amplifier is\",round(Af)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Example 4.4"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Max output offset voltage due to Vio is 606.0 milli Volts\n",
      "Max output offset voltage due to Ib is  23.5 milli Volts\n",
      "Parallel combination of R1 and Rf,i.e ROM is  465.35 Ohms\n"
     ]
    }
   ],
   "source": [
    "#Example 4.4\n",
    "#a) For the inverting amplifier of Figure 4-19, determine the maximum possible\n",
    "#output offset voltage due to input offset voltage Vio and input bias current Ib\n",
    "#The opamp is a type 741.\n",
    "#b) What value of ROM is needed to reduce the effect of input bias current Ib.\n",
    "\n",
    "from __future__ import division #to perform decimal division\n",
    "\n",
    "#Variable declaration\n",
    "R1=470\n",
    "Rf=47*10**3\n",
    "Vio=6*10**-3          #Input offset voltage\n",
    "Ib=500*10**-9         #Input bias current\n",
    "Vs=15                 #Supply voltage\n",
    "\n",
    "#calculation\n",
    "Voo=(1+Rf/R1)*Vio     #Max output offset voltage due to input offset voltage Vio\n",
    "VoIb=Rf*Ib            #Max output offset voltage due to input offset voltage Ib\n",
    "ROM=R1*Rf/(R1+Rf)     #Parallel combination of R1 and Rf\n",
    "\n",
    "#Result\n",
    "print \"Max output offset voltage due to Vio is\",round(Voo*10**3),\"milli Volts\"\n",
    "print \"Max output offset voltage due to Ib is \",round(VoIb*10**3,1),\"milli Volts\"\n",
    "print \"Parallel combination of R1 and Rf,i.e ROM is \",round(ROM,2),\"Ohms\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Example 4.5"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Max output offset voltage due to Vio is 606.0 milli Volts\n",
      "Max output offset voltage due to Ib is  50.0 milli Volts\n",
      "Parallel combination of R1 and Rf,i.e ROM is  990.1 Ohms\n"
     ]
    }
   ],
   "source": [
    "#Example 4.5\n",
    "#Repeat example 4.4 if R1 replaced by 1 kilo Ohm and Rf replaced by 100 kilo Ohm\n",
    "\n",
    "from __future__ import division #to perform decimal division\n",
    "\n",
    "#Variable declaration\n",
    "R1=1*10**3\n",
    "Rf=100*10**3\n",
    "Vio=6*10**-3          #Input offset voltage\n",
    "Ib=500*10**-9         #Input bias current\n",
    "Vs=15                 #Supply voltage\n",
    "\n",
    "#calculation\n",
    "Voo=(1+Rf/R1)*Vio     #Max output offset voltage due to input offset voltage Vio\n",
    "VoIb=Rf*Ib            #Max output offset voltage due to input offset voltage Ib\n",
    "ROM=R1*Rf/(R1+Rf)     #Parallel combination of R1 and Rf\n",
    "\n",
    "#Result\n",
    "print \"Max output offset voltage due to Vio is\",round(Voo*10**3),\"milli Volts\"\n",
    "print \"Max output offset voltage due to Ib is \",round(VoIb*10**3,1),\"milli Volts\"\n",
    "print \"Parallel combination of R1 and Rf,i.e ROM is \",round(ROM,2),\"Ohms\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Example 4.6"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Max output offset voltage due to Ib is  20.0 milli Volts\n"
     ]
    }
   ],
   "source": [
    "\n",
    "#Example 4.6\n",
    "#For the inverting amplifier in figure 4-21, determine the maximum output offset\n",
    "#voltage VoIio caused by the input offset current Iio.\n",
    "#The opamp is a type 741\n",
    "\n",
    "from __future__ import division #to perform decimal division\n",
    "\n",
    "#Variable declaration\n",
    "Iio=200*10**-9      #Input offset current\n",
    "Rf=100*10**3\n",
    "\n",
    "#calculation\n",
    "VoIio=Rf*Iio        #Max output offset voltage due to input offset voltage Ib\n",
    "\n",
    "#Result\n",
    "print \"Max output offset voltage due to Ib is \",round(VoIio*10**3),\"milli Volts\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Example 4.7"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Max output offset voltage due to Ib is  85.0 milli Volts\n",
      "Max output offset voltage due to Iio is  83.0 milli Volts\n"
     ]
    }
   ],
   "source": [
    "#Example 4.7\n",
    "#Compute the maximum possible output offset voltages in the amplifier circuits\n",
    "#shown in the figure 4-22. The opamp is MC1536 with the following specifications.\n",
    "#Vio=7.5 mV maximum, Iio=50 nA maximum,Ib=250 nA maximum at TA=25 degree celcius\n",
    "\n",
    "from __future__ import division #to perform decimal division\n",
    "\n",
    "#Variable declaration\n",
    "R1=1*10**3\n",
    "Rf=10*10**3\n",
    "Vio=7.5*10**-3 #Max input offset voltage\n",
    "Iio=50*10**-9  #Max input offset current\n",
    "Ib=250*10**-9  #Max input bias current\n",
    "\n",
    "#calculation\n",
    "# For figure 4.22(a)\n",
    "VooT1=(1+Rf/R1)*Vio+(Rf*Ib)  #Since the current generated output offset voltage is due to input bias current Ib\n",
    "# For figure 4.22(b)\n",
    "VooT2=(1+Rf/R1)*Vio+(Rf*Iio) #Since the current generated output offset voltage is due to input offset current Ib\n",
    "\n",
    "#Result\n",
    "print \"Max output offset voltage due to Ib is \",VooT1*10**3,\"milli Volts\"\n",
    "print \"Max output offset voltage due to Iio is \",VooT2*10**3,\"milli Volts\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Example 4.8_a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Error voltage is  30.6 mV\n",
      "Output voltage 1 is  -69.4 mV\n",
      "Output voltage 2 is  -130.6 mV\n"
     ]
    }
   ],
   "source": [
    "\n",
    "#Example 4.8_a\n",
    "#Refer to the inverting amplifier in figure 4-24. The opamp is the LM307 with\n",
    "#the following specifications.\n",
    "#delta_Vio/delta_T =30 microVolt/degree celcius maximum\n",
    "#delta_Iio/delta_T= 300 pA/degree celcius\n",
    "#Vs=15 V, R1=1 Kilo Ohm, Rf=100 Kilo Ohm,Rl=10 Kilo Ohm\n",
    "#Assume that the amplifier is nulled at 25 degree celcius. Calculate the value\n",
    "#of the error voltage Ev and output voltage at 35 degree celcius if\n",
    "#a) Vin= 1 mV dc\n",
    "\n",
    "from __future__ import division #to perform decimal division\n",
    "\n",
    "#Variable declaration\n",
    "delta_Vio=30*10**-6        #Change in input offset voltage\n",
    "delta_T=1                  #Unit change in temperature\n",
    "delta_Iio=(300*10**-12)    #Change in input offset current\n",
    "Vs=15\n",
    "R1=1*10**3\n",
    "Rf=100*10**3\n",
    "Rl=10*10**3\n",
    "Vin=1*10**-3               #Input voltage\n",
    "k=25                       #Amplifier is nulled at 25 deg\n",
    "T=35-k                     #Change in temperature\n",
    "\n",
    "#calculation\n",
    "Ev=(1+Rf/R1)*(delta_Vio/delta_T)*T + Rf*(delta_Iio/delta_T)*T   #Error voltage\n",
    "Vo1=-(Rf/R1)*Vin+Ev                                             #Output voltage\n",
    "Vo2=-(Rf/R1)*Vin-Ev                                             #Output voltage\n",
    "\n",
    "#Result\n",
    "print \"Error voltage is \",round(Ev*10**3,1),\"mV\"\n",
    "print \"Output voltage 1 is \",round(Vo1*10**3,1),\"mV\"\n",
    "print \"Output voltage 2 is \",round(Vo2*10**3,1),\"mV\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Example 4.8_b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Error voltage is  30.6 mV\n",
      "Output voltage 1 is  -969.4 mV\n",
      "Output voltage 2 is  -1030.6 mV\n"
     ]
    }
   ],
   "source": [
    "\n",
    "#Example 4.8_b\n",
    "#Refer to the inverting amplifier in figure 4-24. The opamp is the LM307 with\n",
    "#the following specifications.\n",
    "#delta_Vio/delta_T =30 microVolt/degree celcius maximum\n",
    "#delta_Iio/delta_T= 300 pA/degree celcius\n",
    "#Vs=15 V, R1=1 Kilo Ohm, Rf=100 Kilo Ohm,Rl=10 Kilo Ohm\n",
    "#Assume that the amplifier is nulled at 25 degree celcius. Calculate the value\n",
    "#of the error voltage Ev and output voltage at 35 degree celcius if\n",
    "#a) Vin= 10 mV dc\n",
    "\n",
    "from __future__ import division #to perform decimal division\n",
    "\n",
    "#Variable declaration\n",
    "delta_Vio=30*10**-6        #Change in input offset voltage\n",
    "delta_T=1                  #Unit change in temperature\n",
    "delta_Iio=(300*10**-12)    #Change in input offset current\n",
    "Vs=15\n",
    "R1=1*10**3\n",
    "Rf=100*10**3\n",
    "Rl=10*10**3\n",
    "Vin=10*10**-3              #Input voltage\n",
    "k=25                       #Amplifier is nulled at 25 deg\n",
    "T=35-k                     #Change in temperature\n",
    "\n",
    "#calculation\n",
    "Ev=(1+Rf/R1)*(delta_Vio/delta_T)*T + Rf*(delta_Iio/delta_T)*T   #Error voltage\n",
    "Vo1=-(Rf/R1)*Vin+Ev                                             #Output voltage\n",
    "Vo2=-(Rf/R1)*Vin-Ev                                             #Output voltage\n",
    "\n",
    "#Result\n",
    "print \"Error voltage is \",round(Ev*10**3,1),\"mV\"\n",
    "print \"Output voltage 1 is \",round(Vo1*10**3,1),\"mV\"\n",
    "print \"Output voltage 2 is \",round(Vo2*10**3,1),\"mV\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Example 4.8_a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Error voltage is  0.0306 Volts\n",
      "Output voltage 1 is  -0.0694 Volts\n",
      "Output voltage 2 is  -0.1306 Volts\n"
     ]
    }
   ],
   "source": [
    "\n",
    "#Example 4.8_a\n",
    "#Design of Compensating Network\n",
    "\n",
    "from __future__ import division #to perform decimal division\n",
    "\n",
    "#Variable declaration\n",
    "delta_Vio=30*10**-6        #Change in input offset voltage\n",
    "delta_T=1                  #Unit change in temperature\n",
    "delta_Iio=(300*10**-12)    #Change in input offset current\n",
    "Vs=15\n",
    "R1=1*10**3\n",
    "Rf=100*10**3\n",
    "Rl=10*10**3\n",
    "Vin=1*10**-3                #Input voltage\n",
    "k=25                        #Amplifier is nulled at 25 deg\n",
    "T=35-k                      #Change in temperature\n",
    "\n",
    "#calculation\n",
    "Ev=(1+Rf/R1)*(delta_Vio/delta_T)*T + Rf*(delta_Iio/delta_T)*T   #Error voltage\n",
    "Vo1=-(Rf/R1)*Vin+Ev                                             #Output voltage\n",
    "Vo2=-(Rf/R1)*Vin-Ev                                             #Output voltage\n",
    "\n",
    "#Result\n",
    "print \"Error voltage is \",Ev,\"Volts\"\n",
    "print \"Output voltage 1 is \",Vo1,\"Volts\"\n",
    "print \"Output voltage 2 is \",Vo2,\"Volts\"\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Example 4.9_a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Error voltage is  91.8 mV\n",
      "Output voltage 1 is  -908.2 mV\n",
      "Output voltage 2 is  -1091.8 mV\n"
     ]
    }
   ],
   "source": [
    "#Example 4.9_a\n",
    "#Refer again to the amplifier circuit in figure 4-24.Use the same circuit\n",
    "#specifications that are given in example 4-8. Assume that the amplifier is\n",
    "#nulled at 25 degree celcius. If Vin is a 10 mV peak sine wave at 1 kilo Hz\n",
    "#Calculate Ev and Vo at 55 degree celcius.\n",
    "\n",
    "from __future__ import division #to perform decimal division\n",
    "\n",
    "#Variable declaration\n",
    "delta_Vio=30*10**-6        #Change in input offset voltage\n",
    "delta_T=1                  #Unit change in temperature\n",
    "delta_Iio=(300*10**-12)    #Change in input offset current\n",
    "Vs=15\n",
    "R1=1*10**3\n",
    "Rf=100*10**3\n",
    "Rl=10*10**3\n",
    "Vin=10*10**-3               #Input voltage\n",
    "k=25                        #Amplifier is nulled at 25 deg\n",
    "T=55-k                      #Change in temperature\n",
    "\n",
    "#calculation\n",
    "Ev=(1+Rf/R1)*(delta_Vio/delta_T)*T + Rf*(delta_Iio/delta_T)*T   #Error voltage\n",
    "Vo1=-(Rf/R1)*Vin+Ev                                             #Output voltage\n",
    "Vo2=-(Rf/R1)*Vin-Ev                                             #Output voltage\n",
    "\n",
    "#Result\n",
    "print \"Error voltage is \",round(Ev*10**3,1),\"mV\"\n",
    "print \"Output voltage 1 is \",round(Vo1*10**3,1),\"mV\"\n",
    "print \"Output voltage 2 is \",round(Vo2*10**3,1),\"mV\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Example 4.9_b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZIAAAEZCAYAAAC99aPhAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmclXP/x/FXaqIS6S4pIiokS6RVNLeSdCNbkkSKEN0K\nIUuNLbKFm3L/opT2TdYSaW7qltEqKi2EqbtFsrY35/fH5xpzzpia5Szf6zrn/Xw8zuNc5zpnzvk0\nzPlc3+3zBREREREREREREREREREREREREREREREREREREZFClHIdgIjERR+gCvA98G/HsYiIpJRZ\nQBkfvEc0DgU+BRoD9R3GISnC5f/sIn5zJNZK3+P4PaLVBFgMZDmMQVJIadcBiMTRkUBvoCLQGdgL\nnAn0B6YAacBMYBRwHnAf8AtQAUsG/wCu8h6fA5wMLAFqAq0LeJ//ee/xK1Ae+AKoBZwL3AG8DZzu\nvWY61nL5DPibF2c5YACwC1gJHOX97MPAJKy7qoUX413AgUAn4D9h/+YmwD3AH9iF4ooCfg8/AMd6\n/6aXsBbMUGA50Aro4v2bTwLu9/49J3ixLQV+KtJvX0Qk4CpgV+R/8x63A9ZgX84fe+daAK+G/cxY\noKF33AY4C5gQ9n4rvePzCnifVwp4j9zX1gHe9R73A67zjm/GvqwXA5W8cx8Bh3vH5wLHhH1OdSxJ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2NXZjXchVNs27z7sthFyU8OYymJo4B2wCsEt0hrUOM+FLsQHO49zl3nFkStsclP\nPxT0ZCokkvAFi5C3yFESrxbWuvrMcRzFcQCWCDdiXXTL3IZTbIOBvkCO60BKKAR8CMwHbnQcS3Ed\niy1HGAEsBIaR18INmquAsft6MhUSSch1AAJYt9Zk4HasZRIUOVjX3FHAOUC602iK50JgE9a/HdSr\n+rOwi48LgFuxK/ygKIOtkxvi3f9B5Dq5oCgLXARM2tcLUiGRrCOyX68mkeVWJP7SsDpoo4FpjmMp\nqV+Ad4EzXQdSDM2xWnTfYjXszsXq1AXJ/7z7zcAbWFd1UGR7t8+9x5P5a7XzILgAWMC+F3unhDJY\n314tLLMGbbAdLPagDraXwr68BrsOpASqYLNuAMph1aqDWhS0JcGbtVUeK9YKUAGYS+TWEkHwMXC8\nd5xBMKuTjweucx2EH1yAzRZaje13EiTjgPXATmys53q34RRbC6x7aDF50wjb7vcn/OMUrG97MTYF\nta/bcKLSkuDN2joW+90vxqaOB+1vF+A0rEWyBJhK8GZtVQB+JC+hi4iIiIiIiIiIiIiIiIiIiIiI\niIiIiIhIwQ4FbvGOq7OfEhMiIiIFqUVwKxKIiIgPjMfK0C/CtoPOTSpdsZpjM7E6WLcBd2Gr6D8F\nDvNeVxvbhno+VmrjhATFLSIiPnEMeckj/LgrtltnBaye1y9AD++5Z7EKyQCzgDrecRPvsYjvlHEd\ngEgSK7WPY7C9Tf7wbj+TV1BxKXAqlmSaEzmuUjY+YYpER4lExI2dYcc5YY9zsL/LA7CdMU9PcFwi\nxZYK+5GIuPIbxa+amtty+Q0bP7ki7PypMYpLJKaUSETiZwu2h8ZS4EnydusMEblzZ/7j3Medge7k\nlVG/OJ7BioiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIiIjEzf8DtLWn4UD80MsAAAAASUVORK5C\nYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f6982087550>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "\n",
    "#Example 4.9_b\n",
    "#Refer again to the amplifier circuit in figure 4-24.Use the same circuit\n",
    "#specifications that are given in example 4-8. Assume that the amplifier is\n",
    "#nulled at 25 degree celcius. If Vin is a 10 mV peak sine wave at 1 kilo Hz\n",
    "#Draw the output voltage waveform at 55 degree celcius.\n",
    "\n",
    "\n",
    "from __future__ import division #to perform decimal division\n",
    "%matplotlib inline\n",
    "\n",
    "from matplotlib.pyplot import ylabel, xlabel, title, plot, show\n",
    "import matplotlib.pyplot as plt\n",
    "import math\n",
    "import numpy as np\n",
    "\n",
    "\n",
    "\n",
    "#calculation\n",
    "x=np.arange(0,2*math.pi,0.1)   #x coordinate\n",
    "y=-1000*np.sin(x)+91.8         #y coordinate\n",
    "\n",
    "#result\n",
    "plt.plot(x,y)\n",
    "plt.ylabel('voltage')\n",
    "plt.xlabel('time')\n",
    "plt.title(r'$output waveform$')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Example 4.10_a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Error voltage is  30.6 mV\n",
      "Output voltage 1 is  131.6 mV\n",
      "Output voltage 2 is  70.4 mV\n"
     ]
    }
   ],
   "source": [
    "#Example 4.10_a\n",
    "#Repeat example 4-8 for the noniverting amplifier shown in figure 4-26.\n",
    "#Assume that Rc<<R1.\n",
    "\n",
    "\n",
    "from __future__ import division #to perform decimal division\n",
    "\n",
    "#Variable declaration\n",
    "delta_Vio=30*10**-6        #Change in input offset voltage\n",
    "delta_T=1                  #Unit change in temperature\n",
    "delta_Iio=(300*10**-12)    #Change in input offset current\n",
    "Vs=15\n",
    "R1=1*10**3\n",
    "Rf=100*10**3\n",
    "Rl=10*10**3\n",
    "Vin=1*10**-3               #Input voltage\n",
    "k=25                       #Amplifier is nulled at 25 deg\n",
    "T=35-k                     #Change in temperature\n",
    "\n",
    "#calculation\n",
    "Ev=(1+Rf/R1)*(delta_Vio/delta_T)*T + Rf*(delta_Iio/delta_T)*T   #Error voltage\n",
    "Vo1=(1+Rf/R1)*Vin+Ev                                            #Output voltage\n",
    "Vo2=(1+Rf/R1)*Vin-Ev                                            #Output voltage\n",
    "\n",
    "#Result\n",
    "print \"Error voltage is \",round(Ev*10**3,1),\"mV\"\n",
    "print \"Output voltage 1 is \",round(Vo1*10**3,1),\"mV\"\n",
    "print \"Output voltage 2 is \",round(Vo2*10**3,1),\"mV\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Example 4.10_b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Error voltage is  30.6 mV\n",
      "Output voltage 1 is  1040.6 mV\n",
      "Output voltage 2 is  979.4 mV\n"
     ]
    }
   ],
   "source": [
    "\n",
    "#Example 4.10_b\n",
    "#Repeat example 4-8 for the noniverting amplifier shown in figure 4-26.\n",
    "#Assume that Rc<<R1.\n",
    "\n",
    "from __future__ import division #to perform decimal division\n",
    "\n",
    "#Variable declaration\n",
    "delta_Vio=30*10**-6        #Change in input offset voltage\n",
    "delta_T=1                  #Unit change in temperature\n",
    "delta_Iio=(300*10**-12)    #Change in input offset current\n",
    "Vs=15\n",
    "R1=1*10**3\n",
    "Rf=100*10**3\n",
    "Rl=10*10**3\n",
    "Vin=10*10**-3              #Input voltage\n",
    "k=25                       #Amplifier is nulled at 25 deg\n",
    "T=35-k                     #Change in temperature\n",
    "\n",
    "#calculation\n",
    "Ev=(1+Rf/R1)*(delta_Vio/delta_T)*T + Rf*(delta_Iio/delta_T)*T   #Error voltage\n",
    "Vo1=(1+Rf/R1)*Vin+Ev                                            #Output voltage\n",
    "Vo2=(1+Rf/R1)*Vin-Ev                                            #Output voltage\n",
    "\n",
    "#Result\n",
    "print \"Error voltage is \",round(Ev*10**3,1),\"mV\"\n",
    "print \"Output voltage 1 is \",round(Vo1*10**3,1),\"mV\"\n",
    "print \"Output voltage 2 is \",round(Vo2*10**3,1),\"mV\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Example 4.11_a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Change in Output offset voltage is  3.2 mV\n"
     ]
    }
   ],
   "source": [
    "\n",
    "#Example 4.11_a\n",
    "#The amplifier in figure 4-28(b) is nulled when the low dc supply voltage is\n",
    "#20 mV.\n",
    "#Because of poor regulation,low dc voltage varies with time from 18 V to 22 V.\n",
    "#a) Determine the change in the output offset voltage caused by the change in\n",
    "#supply voltages\n",
    "\n",
    "from __future__ import division #to perform decimal division\n",
    "\n",
    "#Variable declaration\n",
    "delta_Vio=15.85*10**-6  #Change in input offset voltage\n",
    "delta_V=1               #Unit change in supply voltage\n",
    "V=2                     #Change in supply voltage\n",
    "R1=1*10**3\n",
    "Rf=100*10**3\n",
    "\n",
    "#calculation\n",
    "delta_Voo=(1+Rf/R1)*(delta_Vio/delta_V)*V  #Change in output offset voltage\n",
    "        \n",
    "\n",
    "#Result\n",
    "print \"Change in Output offset voltage is \",round(delta_Voo*10**3,2),\"mV\"\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Example 4.11_b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total Output offset voltage 1 is  -996.8 mV\n",
      "Total Output offset voltage 2 is  -1003.2 mV\n"
     ]
    }
   ],
   "source": [
    "\n",
    "#Example 4.11_b\n",
    "#The amplifier in figure 4-28(b) is nulled when the low dc supply voltage is\n",
    "#20 mV.\n",
    "#Because of poor regulation,low dc voltage varies with time from 18 V to 22 V.\n",
    "#b) Determine the output voltage Vo if Vin=10 mV dc. The opamp is the LM307\n",
    "#with SVRR=96 dB.\n",
    "\n",
    "\n",
    "from __future__ import division #to perform decimal division\n",
    "\n",
    "#Variable declaration\n",
    "delta_Vio=15.85*10**-6  #Change in input offset voltage\n",
    "delta_V=1               #Unit change in supply voltage\n",
    "V=2                     #Change in supply voltage\n",
    "R1=1*10**3\n",
    "Rf=100*10**3\n",
    "Vin=10*10**-3\n",
    "\n",
    "#calculation\n",
    "delta_Voo=(1+Rf/R1)*(delta_Vio/delta_V)*V   #Output offset voltage\n",
    "Vo1=(-Rf/R1)*Vin+delta_Voo                  #Total output offset voltage 1\n",
    "Vo2=(-Rf/R1)*Vin-delta_Voo                  #Total output offset voltage 2\n",
    "        \n",
    "\n",
    "#Result\n",
    "print \"Total Output offset voltage 1 is \",round(Vo1*10**3,1),\"mV\"\n",
    "print \"Total Output offset voltage 2 is \",round(Vo2*10**3,1),\"mV\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Example 4.11_b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Total Output offset voltage 1 is  -0.9968 Volts\n",
      "Total Output offset voltage 2 is  -1.0032 Volts\n"
     ]
    }
   ],
   "source": [
    "#Example 4.11_b\n",
    "#Design of Compensating Network\n",
    "\n",
    "from __future__ import division #to perform decimal division\n",
    "\n",
    "#Variable declaration\n",
    "delta_Vio=15.85*10**-6  #Change in input offset voltage\n",
    "delta_V=1               #Unit change in supply voltage\n",
    "V=2                     #Change in supply voltage\n",
    "R1=1*10**3\n",
    "Rf=100*10**3\n",
    "Vin=10*10**-3\n",
    "\n",
    "#calculation\n",
    "delta_Voo=(1+Rf/R1)*(delta_Vio/delta_V)*V   #Output offset voltage\n",
    "Vo1=(-Rf/R1)*Vin+delta_Voo                  #Total output offset voltage 1\n",
    "Vo2=(-Rf/R1)*Vin-delta_Voo                  #Total output offset voltage 2\n",
    "        \n",
    "\n",
    "#Result\n",
    "print \"Total Output offset voltage 1 is \",round(Vo1,4),\"Volts\"\n",
    "print \"Total Output offset voltage 2 is \",round(Vo2,4),\"Volts\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Example 4.12"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Change in Output offset voltage 1 is  16.0 uV rms\n"
     ]
    }
   ],
   "source": [
    "#Example 4.12\n",
    "#Referring to figure 4-28(b), suppose that the circuit is nulled when the voltage\n",
    "#across terminals +Vcc and -Vee measures 20 V dc. Also suppose that because of\n",
    "#poor filtering, 10 mV rms ac ripple is measured across terminals +Vcc and -Vee.\n",
    "#While the input signal Vin=0V, how much ripple voltage can we expect at the\n",
    "#output if the opamp is the LM307.\n",
    "\n",
    "from __future__ import division #to perform decimal division\n",
    "\n",
    "#Variable declaration\n",
    "delta_Vio=15.85*10**-6  #Change in input offset voltage\n",
    "delta_V=1               #Unit change in supply voltage\n",
    "V=10*10**-3             #Change in supply voltage\n",
    "R1=1*10**3\n",
    "Rf=100*10**3\n",
    "\n",
    "\n",
    "#calculation\n",
    "delta_Voo=(1+Rf/R1)*(delta_Vio/delta_V)*V   #Output offset voltage\n",
    "\n",
    "#Result\n",
    "print \"Change in Output offset voltage 1 is \",round(delta_Voo*10**6),\"uV rms\"\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Example 4.13"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Change in Output offset voltage 1 is  2.82 mV\n"
     ]
    }
   ],
   "source": [
    "\n",
    "#Example 4.13\n",
    "#Suppose that the circuit in figure 4-24 is initially nulled. Assume also that\n",
    "#room temperature and the voltage terminals +Vcc and -Vee remain constant.\n",
    "#Determine the maximum possible chnage in output offset voltage after one month\n",
    "#if the opamp is the LH0041C.\n",
    "#Assume that R1=1kilo Ohm, Rf=100 kilo Ohm and Rl=10 kilo Ohm.\n",
    "\n",
    "from __future__ import division #to perform decimal division\n",
    "\n",
    "#Variable declaration\n",
    "delta_Vio=5*10**-6  #Change in input offset voltage\n",
    "delta_t=1           #Unit change in time\n",
    "delta_Iio=2*10**-9  #Change in input offset current \n",
    "t=4                 #Time elapsed(weeks)\n",
    "R1=1*10**3\n",
    "Rf=100*10**3\n",
    "Rl=10*10**3\n",
    "\n",
    "\n",
    "#calculation\n",
    "delta_Voot=(1+Rf/R1)*(delta_Vio/delta_t)*t+Rf*(delta_Iio/delta_t)*t  #Output offset voltage\n",
    "\n",
    "#Result\n",
    "print \"Change in Output offset voltage 1 is \",round(delta_Voot*10**3,2),\"mV\"\n"
   ]
  }
 ],
 "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.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}