Chapter 4 Operational Amplifier

Example 4.1 Pg 79

In [1]:
from __future__ import division
# For an op-amp circuit find a) closed loop gain Acl b) input impedance Zin c) output impedance Zo
ro = 85 # # ohm
A = 150*10**3 # # ohm
R2 = 350*10**3 # # ohm  # Feedback resistance
R1 = 10*10**3 # # ohm  # Input resistance

# a) closed loop gain
# ACL = abs(Vo/Vin) = abs(R2/R1)
ACL = abs(R2/R1) #
print '  closed loop gain of an op-amp is = %0.2f'%ACL# # 1/beta = ACL
beta = (1/ACL) #

# b) the input impedance Zin
Zin = R1 #
print '  the input impedance Zin = %0.2f'%(Zin/1e3),'kohm '#

# c0 the output impedance Z0
Z0 = (ro)/(1+(beta*A))#
print '  the output impedance Z0 = %0.3f'%Z0,' ohm '#
  closed loop gain of an op-amp is = 35.00
  the input impedance Zin = 10.00 kohm 
  the output impedance Z0 = 0.020  ohm 

Example 4.2 Pg 80

In [2]:
# Determine the differece voltage and open loop gain of an op-amp
V1 = -5 # # volt  # input voltage
V2 = 5 # # volt
Vo = 20 # #volt  # output voltage

# the difference voltage is given by 
Vd = V2-V1 #
print '  The difference voltage is = %0.2f'%Vd,' V '

# open loop gain 
A = (Vo/Vd)#
print '  The open loop gain is = %0.2f'%A,'  '
  The difference voltage is = 10.00  V 
  The open loop gain is = 2.00   

Example 4.3 Pg 80

In [3]:
# Determine the differece voltage and open loop gain of an op-amp
V1 = -5 # # volt # input voltage
V2 = 0 # # volt  # GND
Vo = 20 # #volt  # output voltage

# the difference voltage is given by 
Vd = V2-V1 #
print '  The difference voltage is = %0.2f'%Vd,' V '

# open loop gain 
A = (Vo/Vd)#
print '  The open loop gain is = %0.2f'%A,'  '
  The difference voltage is = 5.00  V 
  The open loop gain is = 4.00   

Example 4.4 Pg 81

In [4]:
# Determine the differece voltage and open loop gain of an op-amp
V1 = 0 # # volt # input voltage  # GND
V2 = 5 # # volt  
Vo = 20 # #volt  # output voltage

# the difference voltage is given by 
Vd = V2-V1 #
print '  The difference voltage is = %0.2f'%Vd,' V '

# open loop gain 
A = (Vo/Vd)#
print '  The open loop gain is = %0.2f'%A,'  '
  The difference voltage is = 5.00  V 
  The open loop gain is = 4.00   

Example 4.5 Pg 81

In [5]:
# Determine the differece voltage and open loop gain of an op-amp
V1 = 5 # # volt # input voltage  # GND
V2 = -5 # # volt  
Vo = -20 # #volt  # output voltage

# the difference voltage is given by 
Vd = V2-V1 #
print '  The difference voltage is = %0.2f'%Vd,' V '

# open loop gain 
A = (Vo/Vd)#
print '  The open loop gain is = %0.2f'%A,'  '
  The difference voltage is = -10.00  V 
  The open loop gain is = 2.00   

Example 4.6 Pg 82

In [6]:
from __future__ import division
# To find closed loop gain and output voltage Vo of an inverting op-amp
R1 = 10 # #kilo ohm  # input resistance
R2 = 25 # # kilo ohm  # feedback resistance
Vin = 10 # #volt  # input voltage

# Closed loop gain of an inverting op-amp
Ac = -(R2/R1) #
print 'The Closed loop gain of an inverting op-amp is = %0.2f'%Ac,'  '
Ac = abs(Ac)#
print 'The |Ac| Closed loop gain of an inverting op-amp is = %0.2f'%Ac,'  '

# the output voltage of an inverting op-amp
Vo = -(R2/R1)*Vin #
print 'The output voltage of an inverting op-amp is = %0.2f'%Vo,' V '
The Closed loop gain of an inverting op-amp is = -2.50   
The |Ac| Closed loop gain of an inverting op-amp is = 2.50   
The output voltage of an inverting op-amp is = -25.00  V 

Example 4.7 Pg 82

In [7]:
from __future__ import division
# To find closed loop gain and output voltage Vo of an non-inverting op-amp
R1 = 10 # #kilo ohm  # input resistance
R2 = 25 # # kilo ohm  # feedback resistance
Vin = 10 # #volt  # input voltage

# Closed loop gain of an non-inverting op-amp
Ac = 1+(R2/R1) #
Ac = abs(Ac)#
print ' The Closed loop gain of an non-inverting op-amp is = %0.2f'%Ac,'  '

# the output voltage of an inverting op-amp
Vo = (1+R2/R1)*Vin #
print ' The output voltage of an non-inverting op-amp is = %0.2f'%Vo,' V '
 The Closed loop gain of an non-inverting op-amp is = 3.50   
 The output voltage of an non-inverting op-amp is = 35.00  V 

Example 4.8 Pg 83

In [8]:
from __future__ import division
# to find out closed loop gain and output voltage Vo
R1 = 10 # #kilo ohm  # input resistance
R3 = 10 # #kilo ohm  # input resistance
R2 = 25 # # kilo ohm  # feedback resistance
R4 = 25 # # kilo ohm  # feedback resistance
Vin2 = 10 # #volt  # input voltage
Vin1 = -10 # #volt  # input voltage

# closed loop gain of differntial op-amp is given by
Ac = (R2/R1) #
Ac = abs(Ac)# 
print 'The closed loop gain of differntial op-amp is = %0.2f'%Ac,'  '

# the output voltage of an non-inverting op-amp is given by
Vo = (R2/R1)*(Vin2-Vin1) #
print 'The output voltage of an non-inverting op-amp is= %0.2f'%Vo,' V '
The closed loop gain of differntial op-amp is = 2.50   
The output voltage of an non-inverting op-amp is= 50.00  V 

Example 4.9 Pg 84

In [9]:
from __future__ import division
# Determine the non-inverting input voltage
R1 = 10 # #kilo ohm  # input resistance
R2 = 25 # #kilo ohm # feedback resistance
Voh = 10 # # volt #output voltage
Vol = -10 # # volt # output voltage

# upper voltage
V = (R1/(R1+R2)*Voh) #
print '  The upper voltage is = %0.2f'%V,' V '

# Lower voltage
V = (R1/(R1+R2)*Vol) #
print '  The lower voltage is = %0.2f'%V,' V '
  The upper voltage is = 2.86  V 
  The lower voltage is = -2.86  V