Chapter 3 : Transistor Amplifiers

Example 3.1, Page No.187

In [21]:
# calculate the input impedence, output impedence, voltage gain and current gain 

import math
#Variable declaration
Hie=500.0              # the h-parameters of the transistor in ohm
Hfe=60.0               # the h-parameters of the transistor in ohm
Ic=3*10**-3            # collector current in ampere
Rb=220*10**3           # resistance in ohm
Rc=5.1*10**3           # resistance in ohm
Vcc=12.0               # voltage in volts
Vbe=0.6                # voltage in volts
Beta=60.0              # for transistor


#Calculations
zi=Hie
zo=Rc
Av=-Hfe*Rc/Hie
Ai=-Hfe
Ib=(Vcc-Vbe)/Rb
Ie=Beta*Ib
re=26*10**-3/Ie
Zin=Beta*math.ceil(re*100)/100
Zout=Rc
Av1=-Rc/re
Ai1=-Beta


#Result
print("part 1 - from h-parameter model:")
print("input impedence (ohm)   = %.f"%zi)
print("ouput impedence (k-ohm)   = %.1f "%(zo/1000))
print("current gain (unitless) = %.f"%Ai)
print("voltage gain (unitless) = %.f"%Av)
print("\npart 2 - from re model:")
print("base curret (micro-A)   = %.1f"%(Ib*10**6))
print("emitter curret (mA)     = %.3f"%(Ie*1000))
print("resistance              = %.2f"%(math.ceil(re*100)/100))
print("input impedence (ohm)   = %.1f"%Zin)
print("ouput impedence (k-ohm) = %.1f"%(Zout/1000))
print("current gain (unitless) = %.f"%Ai1)
print("voltage gain (unitless) = %.f"%(math.ceil(Av1)))
part 1 - from h-parameter model:
input impedence (ohm)   = 500
ouput impedence (k-ohm)   = 5.1 
current gain (unitless) = -60
voltage gain (unitless) = -612

part 2 - from re model:
base curret (micro-A)   = 51.8
emitter curret (mA)     = 3.109
resistance              = 8.37
input impedence (ohm)   = 502.2
ouput impedence (k-ohm) = 5.1
current gain (unitless) = -60
voltage gain (unitless) = -609

Example 3.2, Page No. 192

In [42]:
# calculate the input impedence, output impedence, voltage gain and current gain 

import math
#Variable declaration
Hie=3.2                 # the h-parameters of the transistor in kilo-ohm
Hfe=100.0               # the h-parameters of the transistor 
R1=40.0                 # resistance in kilo-ohm
R2=4.7                  # resistance in kilo-ohm;
Rc=4.0                  # resistance in kilo-ohm;
Re=1.2                  # resistance in kilo-ohm;
Vcc=16.0                # voltage in volts
Vbe=0.6                 # voltage in volts
Beta=100.0              # for transistor

#Calcualtions
Rb=(R1*R2)/(R1+R2)
zi=(Rb*Hie)/(Rb+Hie)
zo=Rc
Av=-(Hfe*Rc)/Hie
Ai=-(Rb*Hfe)/(Rb+Hie)
Vb=(R2*Vcc)/(R1+R2)
Ib=(Vb-Vbe)/(Rb+(1+Beta)*Re)
Ic=math.floor(Beta*Ib*100)/100
Ie=Ic
re=26.0/Ie
Zin=(Rb*(Beta*re*10**-3))/(Rb+(Beta*re*10**-3))
Zout=Rc
Av1=-(Rc*10**3)/re
Ai1=-(Beta*(Rb*10**3))/((Rb*10**3)+(Beta*re))

#Result
print("part 1 -from h-parameter model:")
print("base resistance (kilo-ohm) = %.1f"%Rb)
print("input impedence (kilo-ohm) = %.2f"%zi)
print("ouput impedence (kilo-ohm) = %.f"%zo)
print("current gain (unitless)    = %.2f"%Ai)
print("voltage gain (unitless)    = %.f"%Av)
print("\npart 2 -from re model:")
print("base voltage (V)           = %.3f"%Vb)
print("base curret (micro-A)      = %.2f"%(Ib*1000))
print("collector curret (mA)      = %.2f"%Ic)
print("emitter curret (mA)        = %.2f"%Ie)
print("resistance                 = %.2f"%re)
print("input impedence (kilo-ohm) = %.2f"%Zin)
print("ouput impedence (kilo-ohm) = %.f"%Zout)
print("current gain (unitless)    = %.2f"%Ai1)
print("voltage gain (unitless)    = %.1f"%Av1)

#Current gain values are slightly different
part 1 -from h-parameter model:
base resistance (kilo-ohm) = 4.2
input impedence (kilo-ohm) = 1.82
ouput impedence (kilo-ohm) = 4
current gain (unitless)    = -56.79
voltage gain (unitless)    = -125

part 2 -from re model:
base voltage (V)           = 1.682
base curret (micro-A)      = 8.63
collector curret (mA)      = 0.86
emitter curret (mA)        = 0.86
resistance                 = 30.23
input impedence (kilo-ohm) = 1.76
ouput impedence (kilo-ohm) = 4
current gain (unitless)    = -58.18
voltage gain (unitless)    = -132.3

Example 3.3, Page No. 194

In [50]:
# calculate the input impedence, output impedence, voltage gain and current gain 

import math
#Variable declaration
Re=4.0           # resistance in kilo-ohm
Rc=3.0           # resistance in kilo-ohm
Vcc=10.0         # collector voltage in volts
Vee=8.0          # emitter voltage in volts
Vbe=0.6          # base voltage in volts

#Calculation
Ie=(Vee-Vbe)/(Re*10**3)
re=math.floor(26*10**-3*100/Ie)/100
zi=((Re*10**3)*re)/((Re*10**3)+re);
zo=Rc;
Av=Rc/(re*10**-3);
Ai=Ie/Ie

#Result
print("emitter current (mA)       = %.2f"%(Ie*1000))
print("input impedence (ohm)      = %.f"%zi)
print("ouput impedence (kilo-ohm) = %.f"%zo)
print("current gain (unitless)    = %.f"%Ai)
print("voltage gain (unitless)    = %.2f"%Av)
emitter current (mA)       = 1.85
input impedence (ohm)      = 14
ouput impedence (kilo-ohm) = 3
current gain (unitless)    = 1
voltage gain (unitless)    = 213.52

Example 3.3, Page No. 223

In [52]:
# Collector efficiency

import math
#Vaariable declaration
P = 8.0               # zero-signal power dissipation
Pac = 2               # AC power output


#Calculations
eff = (Pac/P)*100

#Result
print("Collector Efficiency = %.f %%"%eff)
#example 3.3 is twice in the book
Collector Efficiency = 25 %

Example 3.4, Page No. 227

In [53]:
# determine collector efficiency

import math
#Variable declaration
Vmax=25.0               # collector emitter voltag in volts
Vmin=2.5                # collector emitter voltag in volts

#Calculations
eta= 50*((Vmax-Vmin)/(Vmax+Vmin))

#Result
print("collector efficiency (%%) = %.1f"%eta)
collector efficiency (%) = 40.9

Example 3.5, Page No. 228

In [54]:
# determine maximum output power

import math
#Variable declaration
Rl=80.0             # load resistance in ohm
alfa=5.0            # turn ratio
Ic=120.0            # collector current in milli-ampere

#Calculations
Rl1=alfa**2*Rl
Imax=2*Ic
Imin=0
Irms=(1/math.sqrt(2))*((Imax-Imin)/2.0)
Pout=((Ic*10**-3)**2*Rl1)/2;

#Result
print("load as seen by transformer primary (ohm) = %.f"%Rl1)
print("maximum current (mA)                      = %.f"%Imax)
print("minimum current (mA)                      = %.f"%Imin)
print("rms value of current (mA)                 = %.2f"%Irms)
print("maximum power output (W)                  = %.1f"%Pout) 
load as seen by transformer primary (ohm) = 2000
maximum current (mA)                      = 240
minimum current (mA)                      = 0
rms value of current (mA)                 = 84.85
maximum power output (W)                  = 14.4

Example 3.6, Page No. 228

In [17]:
# (i) maximum output power (ii) maximum collector efficiency (iii) power rating of the transistor

import math
#Variable declaration
Vcc=10.0              # collector supply voltage in volts
Icq=200.0             # zero-signal collector current in milli-ampere
Rl=2.0                # load resistance in ohm
alfa=5.0              # turn ratio

#Calculations
Pout=(Vcc*(Icq*10**-3))/2
Pin=(Vcc*(Icq*10**-3))
eta=(Pout/Pin)*100
P=(Vcc*(Icq*10**-3)) 
Rl1=(alfa**2)*Rl

#REsult
print("output power for dc (w)              = %.f"%Pout)
print("input power for ac (w)               = %.f"%Pin)
print("collector efficiency (%%)             = %.f"%eta)
print("power rating of the transistor (w)   = %.f"%P)
print("load by the tranformer primary (ohm) = %.f"%Rl1)
output power for dc (w)              = 1
input power for ac (w)               = 2
collector efficiency (%)             = 50
power rating of the transistor (w)   = 2
load by the tranformer primary (ohm) = 50

Example 3.7, Page No. 228

In [1]:
# Various parameter calculations

import math
#Variable declaration
alpha=3.0
Podc=0.434         # output ac power in watts
Icq=140.0          # current in milli ampere
Rl=8.0             # load resistance in killo ohms
Vcq=10.0 
Vcemax=18.3        # maximum collector to emitter voltage in volts
Vcemin=2.5         # minimum collector to emitter voltage in volta
Icmax=245.0        # maximum collector current in mili ampere
Icmin=25.0         # minimum collector current in mili ampere

#Calculations
Vcc=Vcq
Vlrms=(Vcemax-Vcemin)/(2*math.sqrt(2))
VLrms=(1/alpha)*Vlrms                  #rms value of load voltage
ILrms=(VLrms/Rl)*10**3                 #rms value of load current
Pindc=Vcc*Icq*10**-3                   #ac power developed across the load in watts
Pd=Pindc-Podc                          #power dissipated in watts
n=(Podc/Pindc)*100                     #efficieny

#Result
print("maximum collector to emitter voltage in volts  = %.1f"%Vcemax)
print("minimum collector to emitter voltage in volts  = %.1f"%Vcemin)
print("maximum collector current in mA                = %.f"%Icmax)
print("minimum collector current in mA                = %.f"%Icmin)
print("rms value of load voltage                      = %.2f"%VLrms)
print("rms value of load current in mA                = %.1f"%ILrms)
print("ac power developed across the load in watts    = %.1f"%Pindc)
print("power dissipated in watts                      = %.3f"%Pd)
print("efficiency                                     = %.f%%"%n)
#Value for rms voltage and current is slightly different than book
maximum collector to emitter voltage in volts  = 18.3
minimum collector to emitter voltage in volts  = 2.5
maximum collector current in mA                = 245
minimum collector current in mA                = 25
rms value of load voltage                      = 1.86
rms value of load current in mA                = 232.8
ac power developed across the load in watts    = 1.4
power dissipated in watts                      = 0.966
efficiency                                     = 31%

Example 3.8, Page No. 232

In [2]:
# overall efficiency

import math
#Variable declaration
Vcc=20.0             # in volts
Vce=2.5              # in volts

#Calculatins
eta=78.5*(1-(Vce/Vcc))
print(" overall efficiency = %.2f %%"%eta)
 overall efficiency = 68.69 %

Example 3.9.a, Page No. 234

In [3]:
# the percent second harmonic distortion

import math
#Variable declaration
V1ce=22.0           # maximum voltage in volts
V2ce=1.2            # minimum voltage in volts
Vceq=10.0           # in volts

#Calculations
D2=(((1.0/2)*(V1ce+V2ce)-Vceq)/(V1ce-V2ce))*100;

#Result
print("the percent harmonic distortion  = %.1f %%"%D2)
the percent harmonic distortion (%) = 7.7

Example 3.9.b, Page No.234

In [4]:
# the percent second harmonic distortion

import math
#Variable declaration
V1ce=18.0              # maximum voltage in volts
V2ce=2.0               # minimum voltage in volts
Vceq=10.0              # in volts

#Calculations
D2=(((1.0/2)*(V1ce+V2ce)-Vceq)/(V1ce-V2ce))*100

#Result
print("the percent harmonic distortion = %.f %% i.e. no distortion"%D2)
the percent harmonic distortion = 0 % i.e. no distortion

Example 3.10, Page No. 235

In [8]:
# Percentage Increase in powe

import math
#Variable declaration
#Vs=1.95*sin(400*t);in volt
#io=12*sin400*t+1.2*sin800*t+0.9*sin*1200*t+0.4*sin1600*t
#from current we have
V1=12.0              #in volt
V2=1.2               #in volt
V3=0.9               #in volt
V4=0.4               #in volt
#Harmonic distortion of each component is expressed as :
D2=V2/V1             #unitless
D3=V3/V1             #unitless
D4=V4/V1             #unitless
#Total distortion 
D=math.sqrt(D2**2+D3**2+D4**2)
PowerIncrease=D**2*100

print("Total disortion = %.4f or %.2f%%"%(D,D*100))
print("\nTotal Power, P=(1+D2^2)*P1")
print("\nPercentage Increase in power because of distortion=(P-P1)*100/P1")
print("\nPercentage Increase in power = %.3f"%PowerIncrease)
Total disortion = 0.1294 or 12.94%

Total Power, P=(1+D2^2)*P1

Percentage Increase in power because of distortion=(P-P1)*100/P1

Percentage Increase in power = 1.674

Example 3.11.i, Page No. 242

In [9]:
# minimum power drain on the power supply 

import math
#Variable declaration
Pl=10.0           # power delivered to load in watt
eta1=80.0/100     # output transformer efficiency
eta=78.5/100      # efficiency of a class B push pull amplfier under optimum condition
Pout=Pl/eta1
Pin=Pout/eta
print("ac power output of amplifier (W)            = %.1f"%Pout)
print("minimum power drain on the power supply (W) = %.1f"%Pin)
ac power output of amplifier (W)            = 12.5
minimum power drain on the power supply (W) = 15.9

Example 3.11.ii, Page No.242

In [11]:
# minimum average power dissipation
    
import math
#Variable declaration
Pl=10              # power delivered to load in watt
eta1=80.0/100      # output transformer efficiency
eta=78.5/100       # efficiency of a class B push pull amplfier under optimum condition

#Calcualtions
Pout=Pl/eta1
Pin=Pout/eta
Pd=Pin-Pout
Pd1=Pd/2.0

#Calculations
print("ac power output of amplifier (W)                                          = %.1f"%Pout)
print("minimum power drain on the power supply for dc (W)                        = %.1f"%Pin)
print("minimum average power dissipation (W)                                     = %.1f"%Pd)
print("minimum average power dissipation rating required for each transistor (W) = %.1f"%Pd1)
ac power output of amplifier (W)                                          = 12.5
minimum power drain on the power supply for dc (W)                        = 15.9
minimum average power dissipation (W)                                     = 3.4
minimum average power dissipation rating required for each transistor (W) = 1.7

Example 3.12, Page No.243

In [18]:
# the percent second harmonic distortion

import math
#Variable declaration
Vcc=50.0             # voltage in volts
Vmin=5.0             # minimum voltage in volts
Pd=40.0              # total power dissipation in watt

#Calculations
Icmax=Pd/(((2*Vcc)/math.pi)-((Vcc-Vmin)/2));
Pin=(2/math.pi)*(Vcc*Icmax);
Pout=((Icmax/2)*(Vcc-Vmin));
eta=(Pout/Pin)*100;

#Result
print("maximum collector current (A) = %.3f"%Icmax)
print("total power input (W)         = %.2f"%Pin)
print("ac power output (W)           = %.2f"%Pout)
print("conversion efficiency (%%)     = %.2f"%eta)
#Answer for AC power output and efficiency is wrong in the book
maximum collector current (A) = 4.287
total power input (W)         = 136.45
ac power output (W)           = 96.45
conversion efficiency (%)     = 70.69