## Example 19-1, Page 709¶

In [1]:
Vin=50                            #input voltage(mV)
Rf=3.9                            #feedback path resistance Rf (KOhm)
R1=0.1                            #inverting input resistance R1(KOhm)
AVOL=100000                       #open loop voltage gain

B=R1/(Rf+R1)                     #feedback fraction
Av=B**-1                         #closed loop voltage gain
Err=100/(1+AVOL*B)               #percent error (%)
Av1=Av-((Av/100)*Err)            #closed loop voltage gain1
Av2=AVOL/(1+AVOL*B)              #closed loop voltage gain2

print 'closed loop voltage gain by approach 1 = ',round(Av1,2)
print 'closed loop voltage gain by approach 2 = ',round(Av2,2)

closed loop voltage gain by approach 1 =  39.98
closed loop voltage gain by approach 2 =  39.98


## Example 19-2, Page 713¶

In [2]:
Vin=50                            #input voltage(mV)
Rf=3.9*10**3                      #feedback path resistance Rf (Ohm)
R1=100                            #inverting input resistance R1(Ohm)
AVOL=100000                       #open loop voltage gain
B=0.025                           #feedback fraction
Rin=2*10**6                       #open loop input resistance(Ohm)
RCM=200*10**6                     #common mode input resistance(Ohm)

Zin_CL=(1+(AVOL*B))*Rin           #closed loop input impedance(Ohm)
Zin_CL1=RCM*Zin_CL/(RCM+Zin_CL)   #closed loop input impedance(Ohm)

print 'closed loop input impedance Zin(CL) = ',round((Zin_CL1/10**6),2),'MOhm'

closed loop input impedance Zin(CL) =  192.31 MOhm


## Example 19-3, Page 714¶

In [8]:
Rout=75                           #open loop output resistance(Ohm)
AVOL=100000                       #open loop voltage gain
B=0.025                           #feedback fraction

Zout_CL=Rout/(1+AVOL*B)           #closed loop input impedance(Ohm)

print 'closed loop output impedance Zout(CL) = ',round(Zout_CL,2),'Ohm'

closed loop output impedance Zout(CL) =  0.03 Ohm


## Example 19-4, Page 714¶

In [7]:
THD=7.5                           #open loop total harmonic distortion (%)
AVOL=100000                       #open loop voltage gain
B=0.025                           #feedback fraction

THD_CL=THD/(1+AVOL*B)             #closed loop total harmonic distortion (%)

print 'Closed loop total harmonic distortion THD(CL) = ',round(THD_CL,3),'%'

Closed loop total harmonic distortion THD(CL) =  0.003 %


## Example 19-5, Page 716¶

In [14]:
Iin=1                             #input current(mA)
Rf=5                              #feedback path resistance Rf (KOhm)

Vout=-(Iin*Rf)                    #Output voltage at 1KHz (Vpp)

print 'Output ac voltage at 1KHz Vout = ',Vout,'Vpp'

Output ac voltage at 1KHz Vout =  -5 Vpp


## Example 19-6, Page 717¶

In [1]:
Rout=75.0                           #open loop output resistance(Ohm)
AVOL=100000                         #open loop voltage gain
Rf=5.0*10**3                        #feedback path resistance(Ohm)

Zin_CL=Rf/(1+AVOL)              #closed loop input impedance(Ohm)
Zout_CL=Rout/(1+AVOL)           #closed loop input impedance(Ohm)

print 'closed loop input impedance Zin(CL) = ',round(Zin_CL,2),'Ohm'
print 'closed loop output impedance Zout(CL) = ',round(Zout_CL,5),'Ohm'

closed loop input impedance Zin(CL) =  0.05 Ohm
closed loop output impedance Zout(CL) =  0.00075 Ohm


## Example 19-7, Page 718¶

In [26]:
Vin=2                              #input voltage(Vrms)
R1=1                               #inverting input resistance R1(KOhm)

iout=Vin/R1                         #output current (mA)
PL1=(iout**2)*RL1                   #load power for 2 Ohm (W)
PL2=(iout**2)*RL2                   #load power for 4 Ohm (W)

print 'load power for 2 Ohm = ',PL1,'W'
print 'load power for 4 Ohm = ',PL2,'W'

load power for 2 Ohm =  8 W
load power for 4 Ohm =  16 W


## Example 19-8, Page 720¶

In [10]:
import math

Iin=1.5*10**-3                     #input current(mA)
R1=1                               #inverting input resistance R1(KOhm)
Rf=1*10**3                         #feedback path resistance(Ohm)

Ai=math.ceil(1+(Rf/R1))             #current gain
iout=Iin*Ai                         #output current (mA)
PL1=(iout**2)*RL1                   #load power for 1 Ohm (W)
PL2=(iout**2)*RL2                   #load power for 2 Ohm (W)

print 'load power for 2 Ohm = ',round(PL1,2),'W'
print 'load power for 4 Ohm = ',round(PL2,2),'W'

load power for 2 Ohm =  2.25 W
load power for 4 Ohm =  4.51 W


## Example 19-9, Page 723¶

In [29]:
AB=1000                            #(1+AvolB) term
f2_OL=160                          #open loop bandwidth(Hz)

f2_CL=f2_OL*AB/1000               #closed loop bandwidth(KHz)

print 'closed loop bandwidth f2(CL)= ',f2_CL,'KHZ'

closed loop bandwidth f2(CL)=  160 KHZ


## Example 19-10, Page 723¶

In [32]:
AVOL=250000                             #open loop voltage gain
f2_OL=1.2                               #open loop bandwidth(Hz)
Av_CL=50                                #closed loop voltage gain

f2_CL=f2_OL*AVOL/Av_CL/1000             #closed loop bandwidth(KHz)

print 'closed loop bandwidth for Av(CL) = 50, f2(CL)= ',f2_CL,'KHZ'

closed loop bandwidth for Av(CL) = 50, f2(CL)=  6.0 KHZ


## Example 19-11, Page 724¶

In [35]:
AVOL=50000                              #open loop voltage gain
f2_OL=14                                #open loop bandwidth(Hz)

f2_CL=f2_OL*(1+AVOL)/1000               #closed loop bandwidth(KHz)

print 'closed loop bandwidth f2(CL)= ',f2_CL,'KHZ'

closed loop bandwidth f2(CL)=  700 KHZ


## Example 19-12, Page 724¶

In [38]:
AB=2500                            #(1+AvolB) term
f2_OL=20                           #open loop bandwidth(Hz)

f2_CL=f2_OL*AB/1000                #closed loop bandwidth(KHz)

print 'closed loop bandwidth f2(CL)= ',f2_CL,'KHZ'

closed loop bandwidth f2(CL)=  50 KHZ


## Example 19-13, Page 724¶

In [13]:
import math

Av_CL=10.0                                #voltage gain
Funity=1*10**6                            #unity frequency (Hz)
Sr=0.5                                    #slew rate (V/us)

f2_CL=Funity/Av_CL/1000                    #closed loop bandwidth(KHz)
Vp_max=1000*Sr/(2*math.pi*f2_CL)            #largest peak output voltage(V)

print 'closed loop bandwidth f2(CL)= ',f2_CL,'KHZ'
print 'largest peak output voltage Vp(max)= ',round(Vp_max,3),'V'

closed loop bandwidth f2(CL)=  100.0 KHZ
largest peak output voltage Vp(max)=  0.796 V

In [ ]: