#Variable declaration
a=0.99;#a=fraction of the emitter current contributed by the carriers injected into the base and reaching the collector
Rl=4500; #Load resistance in ohms
rd=50; #dynamic resistance in ohms
#Calculations
Av=a*Rl/rd; #Voltage gain
Ap=a*Av;#Power gain
#Results
print 'Av=%.1f'%Av
print 'Ap=%.1f'%Ap
#Variable declaration
a=0.98;#a=fraction of the emitter current contributed by the carriers injected into the base and reaching the collector
Ie=0.003; #emitter current in A
Ico=10*10**-6; #reverse saturation current in A
#Calculations&Results
Ic=a*Ie+Ico; #collector current in A
print 'Ic=%.2f mA'%(Ic/10**-3);#Ic is converted in terms of mA
Ib=Ie-Ic; #base current in A
print 'Ib=%.f µA'%(Ib/10**-6);#Ib is converted in terms of µA
#Variable declaration
a=0.975;#a=fraction of the emitter current contributed by the carriers injected into the base and reaching the collector
Ico=10*10**-6; #reverse saturation current in A
Ib=250*10**-6; #base current in A
#Calculations&Results
b=a/(1-a); #transistor gain
print 'gain B=%.f'%b;
Ic=b*Ib+(b+1)*Ico; #collector current in A
print 'Ic=%.1f mA'%(Ic/10**-3);#Ic is converted in terms of mA
Ie=(Ic-Ico)/a; #emitter current in A
print 'Ie=%.1f mA'%(Ie/10**-3);#Ie is converted in terms of mA
#Variable declaration
b=125;#b=forward current transfer ratio or dc current gain
Vbe=0.6; #base to emitter voltage in V
#Calculations&Results
Ib=(10-Vbe)/(310*10**3); #base current in A
print 'Ib=%.4f ma'%(Ib*10**3);
Ic=b*Ib; #collector current in A
print 'Ic=%.2f mA'%(Ic*10**3)
Vce=20-(Ic*5000); #collector to emitter voltage
print 'Vce=%.2f V'%Vce
#Variable declaration
print "As the base is forward biased,transistor is not cut off."
print "Assuming the transistor in active region "
VBB=5#VBB=base bias voltage
VBE=0.7#VBE=voltage between base and emitter terminal
RB=220#RB=base circuit resistor in kilo ohms
#Calculations&Results
IB=(VBB-VBE)/RB#IB=base current in mA(By applying Kirchhoff's voltage law)
print "IB=%.4f mA"%IB
print "Ico<<IB"#Ico=reverse saturation current and is given as 22nA
B=100#B=dc current gain
IC=B*IB
print "IC=%.2f mA"%IC
Vcc=12#Vcc=collector supply voltage
Rc=3.3#Rc=collector circuit resistor in kilo ohms
VCB=Vcc-(IC*Rc)-VBE#VCB=voltage between collector and base terminal (by applying Kirchhoff's voltage law to the collector circuit)
print "\nVCB=%.2f V"%VCB
print "A positive value of VCB implies that for n-p-n transistor,the collector junction is reverse",\
"\nbiased and hence the transistor is actually in active region"
IE=-(IB+IC)#IE=emitter current
print "\nIE=%.2f mA"%IE
print "The negative sign indicates that IE actually flows in the opposite direction."
print "IB and IC do not depend on the collector circuit resistance Rc.So if it is increased, at",\
"\none stage VCB becomes negative and transistor goes into saturation region "
import numpy as np
from numpy.linalg import inv
#Variable declaration
print "Applying Kirchhoff voltage law to the base & collector circuit respectively"
#(R1*IB)+VBE+(RE*(Ic+IB))=VBB..........(1)
#(R2*Ic)+VCE+(RE*(Ic+IB))=Vcc..........(2)
R1=47#R1=value of base circuit resistance in kilo ohms
RE=2.2#RE=emitter circuit resistance in kilo ohms
R2=3.3#R2=collector circuit resistance in kilo ohms
VBE=0.85#VBE=voltage between base and emitter terminals
VBB=5#VBB=base supply voltage
Vcc=9#Vcc=collector supply voltage
VCE=0.22#VCE=voltage between collector and emitter terminals
#Calculations&Results
R=np.matrix([[R1+RE, RE],[RE, R2+RE]]);
V=np.matrix([[VBB-VBE],[Vcc-VCE]]);
I=inv(R)*V
print "IB=%.4f mA"%I[0]
print "IC=%.3f mA"%I[1]
hFE=110#hFE=dc current gain
IBmin=I[1]/hFE
print "The minimum base current required for saturation is %.4f mA"%IBmin
if (I[0]<IBmin):
print "\nAs IB<IBmin transitor is not in the saturation region.It must be in the active region."
#Variable declaration
IB=(30*10**-3)#IB=base current (in mA) of transistor in CE mode
IC1=3.5
IC2=3.7
VCE1=7.5
#Calculations&Results
VCE2=12.5#IC1 and IC2 are the change found in collector current IC in mA when collector emitter voltage VCE changes from VCE1 to VCE2(in volts)
VCE=VCE2-VCE1
IC=IC2-IC1
Ro=VCE/IC
print "The output resistance is = %.f K ohm"%Ro
b=IC2/IB#b=forward current transfer ratio or dc current gain
print "b=%.1f"%b
a=b/(b+1)#a=fraction of the emitter current contributed by the carriers injected into the base and reaching the collector
#b=a/(1-a) Hence a=b/(b+1)
print "a=%.3f"%a
#Variable declaration
b=100#b=forward current transfer ratio or dc current gain
Vz=4#Vz=Zener diode voltage
IL=2#IL=load current in mA
Iz=5#Iz=Zener current in mA
VCC=12#VCC=collector supply voltage
VEB1=0.7
#Calculations&Results
VEB2=VEB1#VEB1,VEB2=emitter-to-base voltage for both transistors Q1 and Q2 respectively
#Since IL is the collector current of transistor Q1
IB=IL/b#IB=base current of transistor Q1
IE=IB+IL#IE=emitter current of transistor Q1
VR1=VCC-VEB2-Vz#VR1=voltage drop across resistor R1
R1=VR1/(IB+Iz)
print "The resistance R1 is = %.2f Kohm"%R1
VR2=VEB2+Vz-VEB1#VR2=voltage drop across resistor R2
R2=VR2/IE
print "The resistance R2 is = %.f K ohm"%R2
#VBC=VCC-VR2-VEB1-(IL*RL) where VBC=base-collector voltage drop for transistor Q1
#VBC=7.3-(2*RL) where RL=load resistance for transistor Q1 in terms of kilo ohm
print "\nFor Q1 to remain in the active region,VBC≥0,i.e."
print "RL≤(7.3/2) kilo ohm"
print "RL≤3.65 kilo ohm"
print "So the range of RL for Q1 to remain in the active region is 0≤RL≤3.65 kilo ohm"