# varitation in alpha and value of beta
import math
#Variable declaration
Beta=50.0 #amlification factor
dbb=1.0 #percentage variation in degree celsius
daa=dbb/50.0 #variation in degree celsius
temp=325.0 #in K
t=25 #degree celsius
#Calculations
Beta1=dbb*t
nBeta=Beta+(Beta1/100)*t
#Result
print("(b) variation in alpha for a silicon BJT is ,(%%/degree-Celsius) = %.2f"%daa)
print("(c) new value of Beta is , = %.2f"%nBeta)
# current amplification factor
import math
#Variable declaration
del_Ic=1*10**-3 # in A
del_Ib=50*10**-6 # in A
#Calcualtions
Beta=del_Ic/del_Ib;
print("The current amplification factor,Beta = %.f"%Beta)
# base current
import math
#Variable declaration
alfa=0.88 # Alfa
Ie=1 # in mA
#Calcualtions
Ic=alfa*Ie
I_B=Ie-Ic
#Result
print("Base current,(mA) = %.2f"%I_B)
# short circuit current gain
import math
#Variable declaration
del_Ic=0.95*10**-3 # in A
del_Ie=1*10**-3 # in A
#Calculations
alfa=del_Ic/del_Ie;
print("the short circuit current gain, = %.2f"%alfa)
# collector and base current
import math
#Variable declaration
Ie=5*10**-3 # in A
alfa=0.95 # Alfa
I_co=10*10**-6 # in A
Ic=((alfa*Ie)+I_co)*10**3
Ib=(Ie-(Ic*10**-3))*10**6
print("Collector current,(mA) = %.2f"%Ic)
print("Base current,(micro-A) = %.f"%Ib)
# Ic Ib and Iceo
import math
#Variable declaration
Ie=5.0 # in mA
alfa=0.99 # Alfa
I_co=0.005 # in mA
#CAlculations
Ic=((alfa*Ie)+I_co)
Ib=(Ie-Ic)
Beta=alfa/(1-alfa)
I_CEO=I_co/(1-alfa)
#Result
print("Ic,(mA) = %.3f"%Ic)
print("Ib,(micro-A) = %.f"%(Ib*10**3))
print("Beta = %.f"%Beta)
print("I_CEO(micro-A) = %.f"%(I_CEO*10**3))
# change in collector current
import math
#Variable declaration
alfa=0.9 # constant
Del_Ib=4 # in mA
#Caculations
Beta=alfa/(1-alfa)
Del_Ic=Beta*Del_Ib;
#Result
print("The change in the collector current,(mA) = %.f"%Del_Ic)
# emitter current
import math
#Variable declaration
Beta=40.0 #beta
Ib=25.0 # base current in micro-A
#Calculation
Ic=Beta*Ib;
Ie=(Ib+Ic)*10**-3
print("Ie,(mA) = %.3f"%Ie)
# beta
import math
#Variable declaration
alfa=0.98 # constant
#Calculation
Beta=alfa/(1-alfa)
#Result
print("Beta = %.f"%Beta)
# error
import math
#Variable declaration
Beta=100.0 # constant
Ib=20*10**-6 # in A
I_co=500*10**-9 # in A
#Calculation
Ic1=((Beta*Ib)+(1+Beta)*I_co)*10**3
Ic2=(Beta*Ib)*10**3
Error=(Ic1-Ic2)*100.0/Ic1
#Result
print("The error,(%%) = %.2f"%Error)
#answer is wrong in the txtbook
# change in base current
import math
#Variable declaration
alfa=0.98
del_Ie=5.0 # in mA
#Calculations
del_Ic=alfa*del_Ie # in mA
del_Ib=del_Ie-del_Ic;
#Result
print("change in base current,(mA) = %.1f"%del_Ib)
# collector current base current and alfa
import math
#Variable declaration
Ie=8.4 # in mA
cr=0.8/100 # carriers recombine in base in %
#Calculations
Ib=cr*Ie
Ic=Ie-Ib
alfa=Ic/Ie
#Result
print("(a). The base current,Ib(mA) = %.3f"%Ib)
print("(b). The collector current,Ic(mA) = %.2f"%Ic)
print("(c). the value of alfa = %.3f"%alfa)
# ac current gain
import math
#Variable declaration
Ie1=20.0 # in mA
Ie2=15.0 # in mA
Ib1=0.48 # in mA
Ib2=0.32 # in mA
#Calculation
del_Ie=(Ie1-Ie2)*10**-3
del_Ib=(Ib1-Ib2)*10**-3
del_Ic=del_Ie-del_Ib
alfa=del_Ic/del_Ie
Beta=del_Ic/del_Ib
#Result
print("ac current gain in common base arrangement, = %.2f"%alfa)
print("ac current gain in common emitter arrangement, = %.f"%Beta)
# Beta Iceo and collector current
import math
#Variable declaration
alfa=0.992 # constant
Ib=30*10**-6 # in A
I_CBO=48*10**-9 # in A
#Result
Beta=alfa/(1-alfa)
I_CEO=(1+Beta)*I_CBO*10**6
Ic=((Beta*Ib)+(1+Beta)*I_CBO)*10**3
#Result
print("(a) Beta = %.f"%Beta)
print("(a) I_CEO (micro-A) = %.f"%I_CEO)
print("(b) Collector current,Ic(mA) = %.2f"%(math.floor(Ic*100)/100))
# collector current alfa and beta
import math
#Variable declaration
Ie=9.6 # emitter current in mA
Ib=0.08 # base current in mA
alfa=0.99
Ic=Ie-Ib
alfa=math.floor(Ic*100/Ie)/100
Beta=alfa/(1-alfa)
#Result
print("(a). collector current,Ic(mA) = %.2f"%Ic)
print("(b). alfa = %.2f"%alfa)
print("(c). Beta = %.f"%Beta)
# collector current
import math
#Variable declaration
Ib=68*10**-6 # in A
Ie=30*10**-3 # in A
Beta=440.0 # constant
#Calculations
alfa=Beta/(1+Beta)
Ic=alfa*Ie*10**3
#Result
print("Collector current,Ic(mA) = %.2f"%Ic)