Chapter 1: Advanced Operational Amplifier Principles

Example 1.1,Page 6

In [1]:
#finding voltage current resistance

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
R1=1000.0;
R2=1000.0;
Rl=500.0#load resistance
V=1.0#input voltage

#calculation
Vo=(R2/(R1+R2))*V;
Rll=1/((1/R2)+(1/Rl))#lower loaded resistance
Vol=(Rll/(R2+Rll))*V;

#result
print "open output voltage is",round(Vo,3),"V"
print "resistance lower loaded is",round(Rll,3),"ohm"
print "loaded output voltage is",round(Vol,3),"V"
open output voltage is 0.5 V
resistance lower loaded is 333.333 ohm
loaded output voltage is 0.25 V

Example 1.2,Page 11

In [1]:
#finding voltage current resistance

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
Rf=100000.0#resistance
Acl=100.0#amplifier gain

#calculation
Ri=Rf/(Acl-1);

#result
print "input resistance is",round(Ri/1000,2), "Kohm"
input resistance is 1.01 Kohm

Example 1.3,Page 17

In [3]:
#finding voltage current resistance

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
Vni=0.0#non inverting voltage
Vinv=0.0;#inverting voltage
Vri1=1.0;
Vri2=15.0;
Ri1=5600.0#resistance
Ri2=470000.0;
Rf=10000.0#load resistance

#calculation
Ir1=Vri1/Ri1;
Ir2=Vri2/Ri2;
Irf=(Vri1/Ri1)+(Vri2/Ri2);
Vr=Irf*Rf;
Vo1=-Vr;
Vo=Irf*Rf;

#result
print "current through Ri1 is",round(Ir1*1e6,3), "microAmp"
print "current through Ri2 is",round(Ir2*1e6,3), "microAmp"
print "current through Ri2 is",round(Ir2*1e6,3),"microAmp"
print "current through Rf is",round(Irf*1e6,3), "microAmp"
print "voltage dropped is",round(Vr,3), "V"
print "output voltage 1 is",round(Vo1,3), "V"
print "output voltage is",round(Vo,3), "V"
current through Ri1 is 178.571 microAmp
current through Ri2 is 31.915 microAmp
current through Ri2 is 31.915 microAmp
current through Rf is 210.486 microAmp
voltage dropped is 2.105 V
output voltage 1 is -2.105 V
output voltage is 2.105 V

Example 1.4,Page 25

In [1]:
#finding voltage current resistance

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
Ri1=950.00;#ohm
Ri2=1050.00;
Rf1=105000.00;#resistance
Rf2=95000.00;
Vin=5.00;#voltage

#calculation
Vinv=(Rf1/(Rf1+Ri1))*Vin;
Vni=Vinv;
Irf2=(Vin-Vinv)/Ri2;
Iri2=Irf2;
Vrf2=Irf2*Rf2;
Vo=Vinv-Vrf2-.014;

#result
print "inverting voltage is",round(Vinv,3), "V"
print "non inverting voltage is",round (Vni,3), "V"
print "current through Rf2 is",round(Irf2*1e6,3), "microA"
print "current through Ri2 is",round(Iri2*1e6,3), "microA"
print "voltage dropped is",round(Vrf2,3), "V"
print "output voltage is",round(Vo*1000,3), "mV"
inverting voltage is 4.955 V
non inverting voltage is 4.955 V
current through Rf2 is 42.698 microA
current through Ri2 is 42.698 microA
voltage dropped is 4.056 V
output voltage is 884.897 mV

Example 1.5,Page 27

In [5]:
#finding voltage current resistance 

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
Vniu1=2.45;#V
Vniu2=2.55;#V
Vinvu1=2.45;
Vinvu2=2.55;
Ri1=9000.0;#ohm
Ri2=1000.0;#ohm
Rf1=1000.0;
Rf2=9000.0;
Rg=200.0;#load resistance

#calculation
Iri1=Vniu1/Ri1;
Irg=(Vniu2-Vniu1)/Rg;
Irf1=Irg-Iri1;
Vrf1=Irf1*Rf1;
Vou1=Vniu1-Vrf1;
Iri2=(Vniu2-Vou1)/Ri2;
Irf2=Iri2+Irg;
Vrf2=Irf2*Rf2#feedback resistor voltage
Vo=Vrf2+Vniu2;

#result
print "input resistor current is",round(Iri1*1e6,3), "microA"
print "input resistor current is",round(Irg*1e6,3), "microA"
print "feedback resistor current is",round(Irf1*1e6,3), "microAmp"
print "resistor voltage is",round(Vrf1*1000,3), "mV"
print "1st output voltage is",round(Vou1,3), "V"
print "input resistor current is",round(Iri2*1e6,3), "microA"
print "input resistor current is",round(Irf2*1e6,3),"microA"
print "feedback resistor voltage is",round(Vrf2,3), "V"
print "2nd output voltage is",round(Vo,3), "V"
input resistor current is 272.222 microA
input resistor current is 500.0 microA
feedback resistor current is 227.778 microAmp
resistor voltage is 227.778 mV
1st output voltage is 2.222 V
input resistor current is 327.778 microA
input resistor current is 827.778 microA
feedback resistor voltage is 7.45 V
2nd output voltage is 10.0 V

Example 1.6.a,Page 29

In [2]:
#finding voltage current resistance

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
Vniu1=0;#V
Vinvu2=0;#V
Vref=2.56;
Rl=10000.0;#ohm
Rf=39200.0;#ohm
Ro=10.0;#resistance
Vdc1=5.0;
Vdc2=15.0;
Idc=0.5;#current

#calculation
Iu1=(Vref/Rl)*.5;
Irf=Iu1;
Vrf=Irf*Rf;
Vout=Vrf+Vinvu2;
Eo=Vout-1.2;
Iload=Vdc1/Ro;
Pload=Vdc1**2/Ro;
Plm317=(Vdc2-Vdc1)*Idc;

#result
print "input resistor current is",round(Iu1*1e6,3), "microA"
print "feedback resistor current is",round(Irf*1e6,3), "microA"
print "feedback resistor voltage is",round(Vrf,3), "V"
print "output resistor voltage is",round(Vout,3), "V"
print "output voltage is",round(Eo,3), "V"
print "load current is",round(Iload,3), "A"
print "load power is",round(Pload,3), "W"
print "power dissipated in LM317 is",round(Plm317,3), "W"
input resistor current is 128.0 microA
feedback resistor current is 128.0 microA
feedback resistor voltage is 5.018 V
output resistor voltage is 5.018 V
output voltage is 3.818 V
load current is 0.5 A
load power is 2.5 W
power dissipated in LM317 is 5.0 W

Example 1.6.b,Page 31

In [7]:
#finding voltage current resistance

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
Vin=4;#V
Vs=1.8;#V
Rf=10000.0;#ohm
Ri=1100.0;#ohm
Rl=2.0;#ohm
Rs=0.1;#ohm

#calculation
Irf=Vin/(Rf+Ri);
Vni=Irf*Ri;
Ir=Vni/Rs;
Ve=Ir*(Rl+Rs);
Vo=Ve+Vs;

#result
print "input resistor current is",round(Irf*1e6,3),"microamp"
print "inverting voltage 1 & 2 is",round(Vni*1000,3), "mV"
print "current across Rs is",round(Ir,3), "A"
print "emitter voltage is",round(Ve,3), "V"
print "output voltage is",round(Vo,3), "V"
input resistor current is 360.36 microamp
inverting voltage 1 & 2 is 396.396 mV
current across Rs is 3.964 A
emitter voltage is 8.324 V
output voltage is 10.124 V

Example 1.7,Page 36

In [8]:
#finding voltage and power

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
Vs=18.0;#V
Rl=8.0;#load resistance
Pll=100.0;#power

#calculation
Vlp=Vs-4;
Vlr=Vlp/(2**(.5));
Pl=(Vlr**2)/Rl;
Vl=(Pll*Rl)**(.5);

#result
print "rms voltage is",round(Vlr,3), "V"
print "power delivered is",round(Pl,3), "W"
print "load voltage is",round(Vl,3), "V"
rms voltage is 9.899 V
power delivered is 12.25 W
load voltage is 28.284 V

Example 1.9,Page 44

In [2]:
#finding output volatage and range 

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
import numpy as np
Vp=6.0;#V
Ra=10.0;#Kohm
Rb=1800.0;#ohm
V=8.0;
#solving for Ir & Vo
a=np.array([[1.0,-124.6e-6],[7800.0,-1.0]])
b=np.array([134.6e-6,0.0])

#calculation
x=np.linalg.solve(a,b);
Vo=x[1];
Va=Vo+V;
Vb=Vo-V;

#result
print "output voltage is",round(Vo,2), "V"
print "V+ is",round(Va,2), "V ;V- is",round(Vb,2), "V"
output voltage is 37.34 V
V+ is 45.34 V ;V- is 29.34 V

Example 1.11,Page 50

In [1]:
#finding output voltage and gain output voltage 

#initialisation of variable
from math import pi,tan,sqrt,sin,cos,acos,atan
Vin=4.5;
R1=1100.0;
R2=10000.0;

G1=3.4#gain 1
G2=120.0#gain 2

#calculation
Ir=Vin/R1;
Vo=Ir*(R1+R2);
Vuo1=Vo/G1;
Vuo2=Vo/G2;

#result
print "output current is",round(Ir*1000,3),"mA"
print "output voltage is",round(Vo,3), "V"
print "gain output voltage 1 is",round(Vuo1,3), "V"
print "gain output voltage 2 is",round(Vuo2,2),"V"
output current is 4.091 mA
output voltage is 45.409 V
gain output voltage 1 is 13.356 V
gain output voltage 2 is 0.38 V