from numpy import arange
%matplotlib inline
from matplotlib.pyplot import plot,xlabel,ylabel,show,title,subplot
# given data
V_CC= 10## V
V_BE= 0.7## V
R1= 2.2## kΩ
R2= 10## kΩ
R_E= 1## kΩ
R_C= 3.6## kΩ
R= 1.5## kΩ
# The base voltage
V_B= R1*V_CC/(R1+R2)## V
# The emitter current,
I_E= (V_B-V_BE)/R_E## mA
# The collector current,
I_CQ= I_E## mA
# The collector emitter voltage,
V_CE= V_CC-I_E*(R_C+R_E)## V
V_CEQ= V_CE## V
# The saturation current,
I_Csat= V_CC/(R_C+R_E)## mA
V_CEcutoff= V_CC## V
V_CE= arange(0,0.1+V_CEcutoff,0.1) # V
I_C= (V_CC-V_CE)/(R_C+R_E)## mA
# The dc and ac load line
subplot(121)
plot(V_CE,I_C)
xlabel("V_CE in volts")
ylabel("I_C in mA")
title("DC load line")
r_L= R_C*R/(R_C+R)## kΩ
I_Csat= I_CQ+V_CEQ/r_L## mA
Vce_cutoff= V_CEQ+I_CQ*r_L## V
x=[0,Vce_cutoff]#
y=[I_Csat, 0]
subplot(122)
plot(x,y)
xlabel("V_CE in volts")
ylabel("I_C in mA")
title("AC load line")
show()
print "DC and AC load line shown in figure."
# given data
V_BE= 0.7## V
V_CC= 30## V
R_E= 8.2## Ω
R1= 22## Ω
R2= 47## Ω
R_C= 10## Ω
R_L= 30##in Ω
# The base to ground voltage,
V_B= R1*V_CC/(R1+R2)## V
# The emitter current,
I_E= (V_B-V_BE)/R_E## A
# The collector current,
I_CQ= I_E## A
# The collector emitter voltage,
V_CEQ= V_CC-I_E*(R_E+R_C)## V
# The load resistance,
r_L= R_C*R_L/(R_C+R_L)## Ω
I_Csat= I_E+V_CEQ/r_L## A
Vce_cutoff= V_CEQ+I_CQ*r_L## V
print "The cut off value of V_CE = %.2f volts"%Vce_cutoff
# given data
V_BE= 0.7## V
V_CC= 20## V
V_B= 10## V
R_E= 50## Ω
# The collector current,
I_CQ= (V_B-V_BE)/R_E## A
# The collector emitter voltage,
V_CEQ= V_CC-I_CQ*R_E## V
R1= 50## Ω
R2= 50## Ω
# The load resistance,
r_L= R1*R2/(R1+R2)## Ω
I_Csat= I_CQ+V_CEQ/r_L## A
Vce_cutoff= V_CEQ+I_CQ*r_L## V
print "The cut off value of V_CE = %.2f volts"%Vce_cutoff
# given data
V_E= 1.0## V
R_E=1*10**3## Ω
V_CC= 10.0## V
R_C= 4.0*10**3## Ω
R_L= 10.0*10**3## Ω
# The collector current,
I_CQ= V_E/R_E## A
I_C= I_CQ## A
# The collector emitter voltage,
V_CEQ= V_CC-I_C*(R_C+R_E)## V
# The load resistance,
r_L= R_L*R_C/(R_L+R_C)## Ω
#The ac compliance,
PP= 2*I_CQ*r_L## V
print "The ac compliance = %.2f volts"%PP
# given data
V_E= 1.0## V
R_E=1*10**3## Ω
R_C= 4.0*10**3## Ω
V_CC= 10.0## V
I_CQ= V_E/R_E## A
I_C= I_CQ## A
V_CEQ= V_CC-I_C*(R_C+R_E)## V
# (i) when R_L = 1 MΩ, the value of 2I_CQrL
R_L= 1*10**6## Ω
r_L= R_L*R_C/(R_L+R_C)## Ω
I_CQrL= I_CQ*r_L##in A
print "When R_L = 1 MΩ, the value of 2I_CQrL = %.2f volts"%(2*I_CQrL)
# (ii) when R_L = 100 kΩ, the value of 2I_CQrL
R_L= 100*10**3## Ω
r_L= R_L*R_C/(R_L+R_C)## Ω
I_CQrL= I_CQ*r_L##in A
print "When R_L = 100 kΩ, the value of 2I_CQrL = %.2f volts"%(2*I_CQrL)
# (iii) when R_L = 10 kΩ, the value of 2I_CQrL
R_L= 10*10**3## Ω
r_L= R_L*R_C/(R_L+R_C)## Ω
I_CQrL= I_CQ*r_L##in A
print "When R_L = 10 kΩ, the value of 2I_CQrL = %.2f volts"%(2*I_CQrL)
# (iv) when R_L = 1 kΩ, the value of 2I_CQrL
R_L= 1*10**3## Ω
r_L= R_L*R_C/(R_L+R_C)## Ω
I_CQrL= I_CQ*r_L##in A
print "When R_L = 1 kΩ, the value of 2I_CQrL = %.2f volts"%(2*I_CQrL)
# (v) when R_L = 100 Ω, the value of 2I_CQrL
R_L= 100## Ω
r_L= R_L*R_C/(R_L+R_C)## Ω
I_CQrL= I_CQ*r_L##in A
print "When R_L = 100 Ω, the value of 2I_CQrL = %.2f volts"%(2*I_CQrL)
# given data
V_CC= 12## V
V_BE= 0.7## V
I_CQ= 5*10**-3## A
bita= 200## unit less
# The emitter voltage,
V_E= 0.1*V_CC## V
# The emitter current,
I_E= I_CQ## A
# The emitter resistance,
R_E= V_E/I_E## Ω
# The collector resistance,
R_C= 4*R_E## Ω
# The base voltage,
V_B= V_E+V_BE## V
I_C= I_CQ## A
I_B= I_C/bita## A
R= V_CC/(10*I_B)## Ω
R2= V_B/(10*I_B)## Ω
R1= R-R2## Ω
R1= R1*10**-3## k ohm
R2= R2*10**-3## k ohm
R_C= R_C*10**-3## k ohm
print "The value of R1 is : %.2f"%(R1)," kΩ (standard value : 39 kΩ)"
print "The value of R2 is : %.2f"%(R2)," kΩ (standard value : 7.5 kΩ)"
print "The value of R_E is : %.2f"%(R_E)," Ω (standard value : 240 Ω)"
print "The value of R_C is : %.2f"%(R_C)," kΩ (standard value : 1 kΩ)"
# given data
I_CQ= 5*10**-3## A
R_C= 1*10**3## Ω
R_L= 1*10**3## Ω
# The load resistance
r_L= R_C*R_L/(R_C+R_L)## Ω
# The ac compliance,
PP= 2*I_CQ*r_L## V
I_CQ= 5.15*10**-3## A
PP= 2*I_CQ*r_L## V
print "The ac compliance = %.2f volts"%PP
# given data
V_CC= 12.0## V
V_BE= 0.7## V
R_C= 1*10**3## Ω
R_E= 240.0## Ω
r_L= 500.0## Ω
bita= 200.0## unit less
# The required collector current,
I_CQ= V_CC/(R_C+R_E+r_L)## A
# The emitter voltage,
V_E= I_CQ*R_E## V
# The base voltage,
V_B= V_E+V_BE## V
I_C= I_CQ## A
I_B= I_C/bita## A
# The total resistance of the voltage divider,
R= V_CC/(10*I_B)## Ω
R2= V_B/(10*I_B)## Ω
R1= R-R2## Ω
R1= R1*10**-3## k ohm
R2= R2*10**-3## k ohm
R_C= R_C*10**-3## k ohm
print "The value of R1 is : %.2f"%(R1)," kΩ (standard value : 39 kΩ)"
print "The value of R2 is : %.2f"%(R2)," kΩ (standard value : 7.5 kΩ)"
print "The value of R_E is : %.2f"%(R_E)," Ω (standard value : 240 Ω)"
print "The value of R_C is : %.2f"%(R_C)," kΩ (standard value : 1 kΩ)"
# given data
R_C= 3.6## kΩ
R_L= 1.5## kΩ
V_CEQ= 4.94## V
I_CQ= 1.1## mA
# The quiescent power dissipation of the transistor,
P_DQ= V_CEQ*I_CQ## mW
r_L= R_C*R_L/(R_C+R_L)## kΩ
PP= 2*I_CQ*r_L## V
# The maximum ac load power,
P_Lmax= PP**2/(8*R_L)## mW
print "The maximum ac load power = %.2f mW"%P_Lmax
# given data
V_E= 1.71## V
R_E= 240## Ω
V_CC= 12## V
R_C= 1*10**3## Ω
R_L= 1*10**3## Ω
I= 0.355*10**-3## A
I_CQ= V_E/R_E## A
I_C= I_CQ## A
# The collector emitter voltage,
V_CEQ= V_CC-I_C*(R_C+R_E)## V
r_L= R_C*R_L/(R_C+R_L)## Ω
PP= 2*V_CEQ## V
# The maximum ac load power,
P_Lmax= PP**2/(8*R_L)## W
I_CC= I_C+I## A
P_CC= V_CC*I_CC## W
# The efficiency
Eta= P_Lmax/P_CC*100## %
print "The efficiency = %.2f %%"%Eta
# given data
Ta= 70## ambient temperature = %.2f °C
P= 30## power dissipation = %.2f W
theta_CS= 0.5## °C/W
theta_SA= 1.5## °C/W
# The case temperature
Tc= Ta+P*(theta_CS+theta_SA)## °C
# The power rating
P_Dmax= 60## W
print "The case temperature = %.2f °C"%Tc
print "The power rating = %.2f watt"%P_Dmax