import math
#Variable declaration
Rb=1*10**3 #base resistance(ohms)
Vcc=20 #supply voltage(V)
Rc=20 #collector resistance(ohms)
beeta=25 #current gain
Vbe=0.7 #base to emitter voltage(V)
ib=10*10**-3 #base current(ohms)
#Calculations
Ibq=(Vcc-Vbe)/Rb #current(A)
Icq=beeta*Ibq #current(A)
Vceq=Vcc-(Icq*Rc) #collector voltage(V)
ic=beeta*ib #collector current(A)
Po=((ic/(math.sqrt(2)))**2)*Rc #output voltage(V)
Pi=Vcc*Icq #input power(W)
eta=(Po/Pi)*100 #efficiency
Pd=Pi-((Icq**2)*Rc)-Po #power dissipated(W)
#Results
print"input power is Pi",Pi,"W"
print"output power is Po",Po,"W"
print"power dissipated is",round(Pd,1),"W"
import math
#Variable declaration
Rl=500 #load resistance(ohms)
Vceq=50 #queinscent collector voltage(V)
beetamin=30 #current gain minimum(at Q)
Icq=0.4 #queinscent collector current(A)
Ibq=8 #queinscent base current(mA)
#Calculations
Rac=Vceq/Icq #ac resistance(ohms)
beeta=(Icq*10**-3)/Ibq #current gain
Re=5/Icq #emitter resistance(ohms)
Rc=(512.5*Rac)/(512.5-Rac) #as Re+Rl=500+12.5=512.5
Vcc=5+Vceq+(Icq*Rc) #supply voltage(V)
Rb=(beetamin*Re)/10 #base resistance(ohms)
R1=39.5 #solving 125=Rc||(Rl+Re) and Vbb=Vcc*(R1/(R1+R2))
R2=750
Pi=120*Icq #Vcc chosen as 120
r=(Rc*Rl)/(Rc+Rl)
Poac=(100/(2*math.sqrt(2)))**2/r #output power(W)
etamax=Poac/Pi #efficiency
Poac1=(100/(2*math.sqrt(2)))**2/Rl #ac power absorbed by load(W)
eta=Poac1/Pi
Pc=(Icq**2)*Rc #power lost in Rc(W)
Pe=(Icq**2)*Re #power lost in Re(W)
Pd=Pi-Pc-Pe-Poac #power consumed(W)
#Results
print"input power is Pi",Pi,"W"
print"output power is Po",round(Poac,2),"W"
print"dissipated power is",round(Pd,2),"W"
print"values of R1,R2,Re and Rc are",R1,"ohms,",R2,"ohms,",Re,"ohms and",round(Rc),"ohms resp. (Calculated value of Rc is wrong in the book)"
import math
#Variable declaration
Pmax=10 #power maximum(W)
Ic=1 #collector current(A)
Vcemax=100 #max collector to emitter current(V)
Vcemin=2 #min collector to emitter current(V)
#Calculations
#Part a
Vceq=46 #Vce at Q point
Icq=0.21 #Ic at Q point
Vcc=92 #supply voltage(V)
ic=0.42 #collector current(A)
#Part b
Rl=Vceq/Icq #load resistance(ohms)
#Part c
Pi=Vcc*Icq #input power(W)
Po=((ic/(2*math.sqrt(2)))**2)*Rl #output power(W)
eta=(Po/Pi)*100 #efficiency
#Results
print"Rl for maximum power input is",round(Rl),"ohms"
print"input power is is",Pi,"W"
print"Po is",Po
print"eta is",eta,"%"
import math
#Variable declaration
Vcc=15 #supply voltage(V)
beeta=40. #current gain
Icq=5. #Ic at Q(mA)
Vceq=7.5 #Vce at Q(V)
icswing=10 #swing in ic(mA)
#Calculations
#Part a
Rl=Vceq/Icq*10**-3 #load resistance(ohms)
#Part b
Ibq=Icq/beeta #base current at Q(uA)
#Part c
ibswing=icswing/beeta #swing in ib(mA)
Pac=Rl*(icswing/(2*math.sqrt(2)))**2 #ac power(W)
Pdc=Vcc*(Icq*10**-3) #dc power(W)
eta=(Pac/Pdc)*100 #efficiency
#Results
print"a)value of Rl is",round(Rl/1E-6),"ohms"
print"b)Ibq is",round(Ibq/1E-3),"uA"
print"c)ac power output is",round((Pac/1E-3),2),"mW"
print"efficiency is",eta,"%"
print"corresponding swing in ib is",ibswing,"mA"
import math
#Variable declaration
Vcc=Vce=10 #supply voltage(V)
Icq=140*10**-3 #Ic at Q point(A)
Rl=8 #load resistance(ohms)
vce=16 #instantaneous collector to emitter voltage(V)
ic=235*10**-3 #instantaneous collector current(A)
#Calculations
RL=Vcc/Icq
r=math.sqrt(RL/Rl) #load resistance for max ac swing(ohms)
Po=(vce*ic)/(2*math.sqrt(2)*2*math.sqrt(2)) #output power(W)
Pi=Vcc*Icq #input power(W)
eta=Po/Pi #efficiency
Pd=Pi-Po #dissipated power(W)
#Results
print"a)transformation ratio is",round(r)
print"c)power output is",Po,"W"
print"efficiency is",round(eta*100,2),"%"
import math
#Variable declaration
Rl=4.5 #load resistance(ohms)
Vceq=50 #Vc at point Q(V)
Icq=400*10**-3 #Ic at Q(A)
Re=12.5 #emitter resistance(ohms)
Vcemax=90 #from figure
Vcemin=10 #from figure
Icmax=730 #max Ic(mA)
Icmin=30 #min Ic(mA)
#Calculations
#Part a
Rac=Vceq/Icq #ac resistance(ohms)
n=math.sqrt(Rac/Rl) #as n=N1/N2 and Rac=(N1/N2)^2*Rl
#Part b
Vcc=Vceq+(Icq*Re) #supply voltage(V)
#Part c
vce=Vcemax-Vcemin #instantaneous collector to emitter voltage(V)
ic=Icmax-Icmin #instantaneous collector current(mA)
Po=(vce*ic)/((2*math.sqrt(2))*(2*math.sqrt(2))) #output voltage(V)
Pi=Vcc*Icq #input voltage(V)
eta=(Po/Pi)*100 #efficiency
Pd=Pi-(Icq**2*Re)-Po*10**-3 #dissipated power(W)
#Results
print"a)transformation ratio is",round(n,2)
print"b)Vcc is",Vcc,"V"
print"c)power efficiency for the load is",round((eta/1E+3),1),"%"
print"power dissipated is",Pd,"W"
#Finding input power,output power,Pd,efficiency,
import math
#Variable declaration
Vcc=30 #supply voltage(V)
Rl=16 #load resistance(ohms)
n=2 #transformation ratio
Im=1 #peak value of current(A)
etamax=78.54 #max efficiency(%)
#Calculations
#Part a
Rl1=Rl*(n/2)**2 #load resistance(ohms)
Pi=(2*Vcc*Im)/math.pi #input power(W)
Pimax=(2*Vcc**2)/((math.pi)*Rl1) #input power max(W)
#Part b
Po=((Im**2)*Rl1)/2 #output power(W)
Pomax=(Vcc**2)/(2*Rl1) #output power max(W)
#Part c
eta=Po/Pi #efficiency
#Part d
P=((2*Vcc*Im)/math.pi)-((Im**2*Rl1)/2) #Power dissipated by transistors(W)
Pd=P/2 #power dissipated by each transistors
Pmax=(2*Vcc**2)/((math.pi)**2*Rl1) #max power dissipated by transistors
Pdmax=Pmax/2 #max power dissipated by each transistor
#Results
print"a)input power is",round(Pi,1),"W and max input power is",round(Pimax,2),"W"
print"b)output power ",Po,"W and max output power is",round(Pomax,2),"W"
print"c)power efficiency for the load is",round((eta/1E-2),2),"% and its max value is",etamax,"%"
print"power dissipated by each transiator is",round(Pd,1),"W and max value is",round(Pdmax,1),"W"
import math
#Variable declaration
Pd=10
#Calculations
#Part a
Poacmax=10. #as Pd=Po(ac)max by class A
#Part b
Pd=2*Poacmax #power dissipated(W)
Poacmax1=146/2 #max output power by class B
f=Poacmax1/Poacmax #factor by which power of class B is greater than class A
#Results
print"maximum signal output powerclass A produce is",Poacmax,"W"
print"maximum signal output powerclass produce is",Poacmax1,"W"
print"factor by which power in class b is larger than power in class A transformer is",f
import math
#Variable declaration
Vcc=30. #supply voltage(V)
Im=1 #peak value of current(A)
Rl=10. #load resistance(ohms)
#Calculations
#Part a
Pi=(Vcc*Im)/math.pi #input power(W)
Pimax=(Vcc**2)/(math.pi*2*Rl) #max input power(W)
#Part b
Po=((Im**2)*Rl)/2 #output power(W)
Pomax=(Vcc**2)/(8*Rl) #output power max(W)
#Part c
eta=Po/Pi #efficiency
etamax=Pomax/Pimax #efficiency max
#Part d
Pd=Pi-Po #Power dissipated by transistors(W)
Pmax=(Vcc**2)/(2*(math.pi)**2*Rl) #max power dissipated by transistors
#Results
print"a)input power is ",round(Pi,2),"W and max input power is",round(Pimax,2),"W"
print"b)output power is ",Po,"W and max output power is",round(Pomax,2),"W"
print"c)power efficiency for the load is",round((eta/1E-2),2),"% and its max value is",round((etamax/1E-2),2),"%"
print"power dissipated and its max value are",round(Pd,2),"W and",round(Pmax,2),"W"
import math
#Variable declaration
P1=2 #transistor power(W)
Rl=5*10**3. #load resistance()
Ic=35 #collector current(mA)
#Calculations
Bo=40-Ic
B1=math.sqrt((2*P1)/Rl)
B2=Bo
D2=(B2/B1)*100 #second harmonic distortion(%)
#Results
print"second harmonic distortion is",round((D2/1E+3),2),"%"
import math
#Variable declaration
Vcc=15. #supply voltage(V)
Rl=10. #load resistance(ohms)
#Calculations
#Part a
Immax=Vcc/Rl #max peak current(A)
Irmsmax=Immax/(math.sqrt(2)) #max rms current(A)
Pomax=Irmsmax**2*Rl #max output power(W)
Pi=(2*Vcc*Immax)/math.pi #max input power(W)
eta=Pomax/Pi #efficiency
#Part b
Im=(2*Vcc)/(math.pi*Rl) #peak current(A)
Pdmax=((2*Vcc*Im)/(math.pi))-((Im**2*Rl)/2) #max power dissipated(W)
eta1=((Im**2)*Rl*math.pi)/(2*2*Vcc*Im) #efficiency
#Results
print"a)max signal output power,collector dissipation are",Pomax,"W,",round(Pi,2),"W and efficiency is",round((eta/1E-2),2),"%"
print"b)max dissipation of each transistor and corresponding efficiency is",round(Pdmax,2),"W and",eta1,"resp."
#Calculations
eta=0.5 #As Po(ac)=Vcc^2/2*pi^2*Rl and Pi(dc)=Vcc^2/pi^2*Rl
#put these in eta=Po(ac)/Pi(dc) which is 1/2=0.5
#Results
print"push pull amplifier efficiency is",round(eta/1E-2),"%"