from __future__ import division
Amin=8000
print "Amin=%0.2f"%(Amin) # Minimum gain of OP-AMP
Amax=64000
print "Amax=%0.2f"%(Amax) # Maximum gain
print "part (i)"
delta_Af=0.01
print "delta_Af=%0.2f"%(delta_Af) # Change in overall feedBack gain
delta_A=(Amax-Amin)/Amin
print "delta_A= (Amax-Amin)/Amin = %0.2f"%(delta_A) # Change in open loop gain
Sg = delta_Af/delta_A
B = (1/Sg - 1)/Amax
print "Sg = delta_Af/delta_A = %0.2f"%(Sg)#desensitivity factor
print " B = (1/Sg - 1)/Amax = %0.2f"%(B)#feedBack factor
print " part (ii)"
Af_min = Amin/(1+B*Amin)#minimum change in overall feedBack gain
Af_max = Amax/(1+B*Amax)#/maximum change in overall feedBack gain
print "Af_min = Amin/(1+B*Amin) = %0.2f"%(Af_min)
print "Af_max = Amax/(1+B*Amax) = %0.2f"%(Af_max)
print "variation in Af = %0.2f"%(Af_max/Af_min)#variation in Af with feedBack factor 'B'
# for above problem author has divided question in two parts but during solution has written 3 parts.
# part (i) and part (ii) combinedly equivlent to part (i)
# part (iii) is equivalent to part (ii)
from __future__ import division
Avf=-100
print "Avf=%0.2f"%(Avf) # Voltage gain
Rif=1
print "Rif= %0.2f"%(Rif)," ohm" #Input resistance of OP-AMP
R1=Rif
RF=-R1*Avf # using formulae Vo=(-RF/R1)*Vi
print "RF= -R1*Avf=%0.2f"%(RF)," ohm" #Feedback resistance of OP-AMP
# NOTE:Error in value of RF since they have given value of Rif=1ohm but calculated RF by using Rif=1 Kilo ohm
# So i have calculated using Ri=1ohm and hence RF=100 ohm
from __future__ import division
R11=1*10**(3)
print "R11= %0.2f"%(R11)," ohm" # resistance at input terminal of OP-AMP Adder
RF=100*10**(3)
print "RF= %0.2f"%(RF)," ohm" #Feedback resistance
R12=10*10**(3)
print "R12= %0.2f"%(R12)," ohm" # resistance at input terminal of OP-AMP Adder
R13=100*10**(3)
print "R13= %0.2f"%(R13)," ohm" # resistance at input terminal of OP-AMP Adder
print "vo = -(%0.2f"%(RF/R11),"vs1 +%0.2f"%(RF/R12),"vs2 +%0.2f"%(RF/R13),"vs3)" # output voltage of opamp adder in terms of input vs1,vs2 vs3
# for average value of input signal
n = 3# given inputs are '3'
R11 = n*RF
R12 = n*RF
R13 = n*RF
print "vo = -(%0.2f"%(RF/R11)," vs1 +%0.2f"%(RF/R12)," vs2 +%0.2f"%(RF/R13)," vs3)" # output voltage of opamp adder
# note : the output voltage of inverting adder is negative
# but while calculating weighted output voltage in above question ..author has neglected or miss the negative sign
from __future__ import division
Ir=10*10**(-3)
print "Ir = %0.2f"%(Ir)," ampere/lumen of radiant energy " #photodiode Reverse saturation current for constant reverse bias VR
RF=10*10**(3)
print "RF= %0.2f"%(RF)," ohm" #Feedback resistance
E=1*10**(-2)
print "E = %0.2f"%(E)," lumens"# radiant energy
IR=Ir*E
print "IR =Ir*E= %0.2e"%(IR)," ampere" # Reverse saturation current
Vo=IR*RF
print "Vo=IR*RF= %0.2f"%(Vo)," volts" # output voltage
s=E/Vo
print "scale factor=E/Vo= %0.2f"%(E)," lumens/V" # Scale factor of photometer
from __future__ import division
Av=1*10**(5)
print "Av= %0.2f"%(Av) #Voltage gain
RF=100*10**(3)
print "RF= %0.2f"%(RF)," ohm" #Feedback resistance
RM=10*10**(3)
print "RM= %0.2f"%(RM)," ohm" # D.C Ammeter internal resistance
Is=10*10**(-6)
print "is = %0.2e"%(Is)," ampere" # Source current
vo=Is*RF
print "vo=is*RF= %0.2f"%(vo)," volts" # output voltage
S=vo/Is
print "S=vo/is= %0.2f"%(S)," V/A" # Sensitivity of Ammeter
Rif=RF/(1+Av)
print "Rif=RF/(1+Av)= %0.2f"%(Rif)," ohm" #Input resistance of OP-AMP
im=100*10**(-6)
print "im = %0.2f"%(im)," ampere" # Meter Full-Scale deflection current
RF=(im*RM)/Is
print "RF=(im*RM)/is= %0.2f"%(RF)," ohm" # New required Feedback resistance for im=100 micro ampere
from __future__ import division
Av=36
print "Av= %0.2f"%(Av)," dB" #Voltage gain
R1=1*10**(3)# Choosing value of R1
print "R1= %0.2f"%(R1)," ohm" # Resistor at input side of OP-AMP
RF=R1*(10**(Av/20)-1) # Using formulae Av=20*log(1+RF/R1)
print "RF=R1*[10**(Av/20)-1]= %0.2f"%(RF)," ohm" # Calculated Feedback resistance
#NOTE: Correct value of RF=62095.734 ohm or 62.095 kilo ohm but in book given as 62.24 kilo ohm
from __future__ import division
If=100*10**(-6)
print "if = %0.2e"%(If)," ampere" #Full-Scale deflection current
Av=1*10**(5)
print "Av= %0.2f"%(Av) #Voltage gain
vs=10*10**(-3)
print "vs= %0.2f"%(vs)," volts" # Input voltage
RM=100
print "RM= %0.2f"%(RM)," ohm" # Moving coil Ammeter internal resistance
Ri=10*10**(3)
print "Ri= %0.2f"%(Ri)," ohm" #Input resistance of OP-AMP
R1=vs/If
print "R1=vs/if= %0.2f"%(R1)," ohm" # Resistor at input side of OP-AMP in Voltage-to-Current converter
Avf=1+(RM/R1) # formulae using Avf=1+(RF/R1)=1+(RM/R1)# since RF=RM
print "Avf=1+(RM/R1)=%0.2f"%(Avf) # Overall Voltage gain
Rif=Ri*(Av/Avf)
print "Rif=Ri*(Av/Avf)=%0.2e"%(Rif)," ohm" # Equivalent input side resistance of OP-AMP with feedback
from __future__ import division
Ro=0.001
print "Ro= %0.2e"%(Ro)," ohm" #Output resistance
Sv=0.01
print "Sv= %0.2f"%(Sv),"%" # Input Regulation for IC regulator
delta_VI=12-9
print "change in regulator voltage= %0.2f"%(delta_VI)," volts" # Regulator input voltage variation
delta_IL=1.25-1
print "change in regulator Current= %0.2f"%(delta_IL)," A" # Regulator Current variation
delta_Vo=(delta_VI*(Sv/100)+delta_IL*Ro)
print "change in regulator output voltage= %0.2f"%(delta_Vo)," volts" # Regulator output voltage variation
from math import pi
from __future__ import division
alpha=1.414# Damping coefficient for Butterworth LP filter
print "alpha=%0.2f"%(alpha)
AM=3-alpha
print "AM=%0.2f"%(AM) # Midband gain of filter
fOH=1*10**(3)
print "fOH= %0.2f"%(fOH)," Hz"#Cut off frequency
R1=10*10**(3)# Choosing value of R1 same as in book
print "R1= %0.2f"%(R1)," ohm" # Resistor at input side of (OP-AMP)filter
RF=R1*(AM-1)
print "RF=R1*(AM-1)=%0.2f"%(RF)," ohm" #Feedback resistance
C=0.1*10**(-6) # Choosing value of capacitor same a in book
print "C=%0.2e"%(C),"farad"
R=1/(2*pi*fOH*C)# Using formulae wOH=1/C*R and wOH=(2*pi*fOH)
print "R=1/(omega_OH*C)=1/(2*pi*fOH*C)=%0.2f"%(R)," ohm" # resistance value for filter design
from math import sqrt,pi
from __future__ import division
fo=150
print "fo= %0.2f"%(fo)," Hz"#Central frequency of band pass filter
BW=15
print "BW= %0.2f"%(BW)," Hz"# Upper cut-off frequency or 3-dB bandwidth
Q=fo/BW # Quality factor
print "Q= %0.2f"%(Q)
C=0.05*10**(-6) # Choosing value of capacitor same as in book
print "C=%0.2e"%(C),"farad"
R=sqrt(2)/(2*pi*fo*C)
print "R=sqrt(2)/(2*pi*fo*C)=%0.2f"%(R)," ohm" # resistance value for filter design
Am=5-(sqrt(2)/Q) # formulae
print "Am=5-(sqrt(2)/Q)=%0.2f"%(Am) # Midband gain
Abp=Am/(5-Am)
print "Abp=Am/(5-Am)=%0.2f"%(Abp) # Central frequency gain
from __future__ import division
R=10*10**(3)
print "R= %0.2f"%(R)," ohm" # resistance
R1=10*10**(3)
print "R1= %0.2f"%(R1)," ohm" # resistance
C=0.01*10**(-6) # value of capacitor
print "C=%0.2e"%(C)," farad"
R1_ratio_K=2.5*10**(3)
print "R1_ratio_K= %0.2f"%(R1_ratio_K)," ohm" # resistance
R2=5*10**(3)
print "R= %0.2f"%(R)," ohm" # resistance
alpha_R2=250
print "alpha_R2= %0.2f"%(alpha_R2)," ohm" # resistance
alpha=alpha_R2/R2
print "alpha=alpha_R2/R2= %0.2f"%(alpha) # Damping factor
Q=1/alpha
print "Q= 1/alpha=%0.2f"%(Q) # Quality factor
omega_o=1/(R*C)
print "omega_o=1/(R*C)= %0.2f"%(omega_o)," radian"# centre angular frequency
BW=omega_o/Q
print "Bandwidth=omega_o/Q= %0.2f"%(BW)," radian"# Upper cut-off frequency or 3-dB bandwidth
K=R1/(R1_ratio_K)# Pass band gain for lPF and HPF of state variable filter
print "K=R1/(R1_ratio_K)= %0.2f"%(K)
Gm=K/alpha# Pass band gain of state variable filter
print "center frequency gain for BPF, K/alpha=K*Q= %0.2f"%(Gm) # Centre frequency gain for BP filter
from __future__ import division
IB=0.5*10**(-6)
print "IB = %0.2e"%(IB)," ampere" #Input bias current
Iio=0.05*10**(-6)
print "Iio = %0.2e"%(Iio)," ampere" #Input offset current
Vio=1*10**(-3)
print "Vio= %0.2e"%(Vio)," volts" #Input offset voltage
R1=10*10**(3)
print "R1= %0.2f"%(R1)," ohm" # resistance
RF=500*10**(3)
print "RF= %0.2f"%(RF)," ohm" #Feedback resistance
Vos1=Vio*(1+RF/R1)
print "Vos1=Vio*(1+RF/R1)=%0.2f"%(Vos1)," volts" #output offset voltage due to input offset voltage
Vos2=IB*RF
print "Vos2=IB*RF=%0.2f"%(Vos2)," volts" #output offset voltage due to Input bias current
Vos=Vos1+Vos2
print "Vos=Vos1+Vos2=%0.2f"%(Vos)," volts" #total output offset voltage
R2=(R1*RF)/(R1+RF)
print "R2=(R1*RF)/(R1+RF)= %0.2f"%(R2)," ohm" # resistance to balance IB effect
Vos2=Iio*RF
print "Vos2=Iio*RF=%0.2f"%(Vos2)," volts" # Reduced output offset voltage due to Input offset current
Vos=Vos1+Vos2
print "Vos=Vos1+Vos2=%0.2f"%(Vos)," volts" # output offset voltage with compensation
from __future__ import division
Iio=0.1*10**(-9)
print "Iio = %0.2e"%(Iio)," ampere/degree _celsius" #Input offset current
Vio=10*10**(-6)
print "Vio= %0.2e"%(Vio)," volt/degree _celsius" #Input offset voltage
Vs=10*10**(-3)
print "Vs= %0.2f"%(Vs)," volts" #Input voltage
R1=10*10**(3)
print "R1= %0.2f"%(R1)," ohm" # resistance
RF=100*10**(3)
print "RF= %0.2f"%(RF)," ohm" #Feedback resistance
print "part(i)"
R2=(R1*RF)/(R1+RF)# R1 in parallel with RF
print "R2=(R1*RF)/(R1+RF)= %0.2f"%(R2)," ohm" # resistance to balance IB i.e offset effect
print "part(ii)"
delta_T=75-25
print "delta_T=75-25 = %0.2f"%(delta_T)," degree_celsius" #Temperature change
delta_Vo=((Vio*delta_T)*(1+RF/R1))+(Iio*delta_T*RF)
print "delta_Vo=[(Vio*delta_T)*(1+RF/R1)]+(Iio*delta_T*RF)= %0.2f"%(delta_Vo)," volts" #Output voltage drift
print "part(iii)"
Vo=(-RF/R1)*Vs
print "Vo=(-RF/R1)*Vs= %0.2f"%(Vo)," volts" #Inverting OP-AMP output voltage
e=(delta_Vo/Vo)*100
print "Percentage error=(delta_Vo/Vo)*100 =(-)%0.2f"%(abs(e)),", (+)%0.2f"%(abs(e))," percent"#percentage error
from __future__ import division
Iio=0.1*10**(-9)
print "Iio = %0.2e"%(Iio)," ampere" #Input offset current
VCC=15
print "VCC= %0.2f"%(VCC)," volts" # voltage supply
PSRR=150*10**(-6)
print "PSRR= %0.2e"%(PSRR)," volts/V"# Power supply rejection ratio
Vio=10*10**(-6)
print "Vio= %0.2e"%(Vio)," volts" #Input offset voltage
R1=10*10**(3)
print "R1= %0.2f"%(R1)," ohm" # resistance
RF=100*10**(3)
print "RF= %0.2f"%(RF)," ohm" #Feedback resistance
delta_T=75-25
print "delta_T=75-25 = %0.2f"%(delta_T)," celsius" #Temperature change
delta_Vo=((Vio*delta_T)*(1+RF/R1))+(Iio*delta_T*RF)
print "delta_Vo=[(Vio*delta_T)*(1+RF/R1)]+(Iio*delta_T*RF)= %0.2f"%(delta_Vo)," volts" #Output voltage drift
delta_Vio1=(delta_Vo)*(R1/RF)
print "delta_Vio1=(delta_Vo)*(R1/RF)= %0.2f"%(delta_Vio1)," volts" # voltage change at Input for voltage drift found
delta_Vio2=(delta_Vio1)*(1/10)
print "delta_Vio2=(delta_Vio1)*(1/10)= %0.2f"%(delta_Vio2)," volts" # change in Vio due to PSRR
p=((delta_Vio2)/(VCC*PSRR))*100
print "power supply regulation=[(delta_Vio2)/(VCC*PSRR)]*100 =%0.2f"%(p)," percent"# power supply regulation requirement
#delta_Vio1 corresponds to voltage change at Input for voltage drift found
#delta_Vio2 corresponds voltage change at input due to PSRR
from math import pi
from __future__ import division
SR=0.65
print "SR= %0.2f"%(SR)," volts/microsecond"# Slew rate of OP-AMP
print "part(i)"
Vm=5
print "Vm= %0.2f"%(Vm)," volts" # Output peak voltage1
fsm=SR/(10**(-6)*(2*pi*Vm)) # using formulae SR=2*pi*fsm*Vm
print "fsm=SR/[10**(-6)*(2*pi*Vm)] = %0.2f"%(fsm)," Hz"# # Full power bandwidth for Output peak voltage Vm=5V
print "part(ii)"
Vm=1
print "Vm= %0.2f"%(Vm)," volts" # Output peak voltage2
fsm=SR/(10**(-6)*(2*pi*Vm)) # using formulae SR=2*pi*fsm*Vm
print "fsm=SR/[10**(-6)*(2*pi*Vm)] = %0.2f"%(fsm)," Hz"# # Full power bandwidth for Output peak voltage Vm=1V