#Ex5_1 Pg-278
#calculate Collector current,Emitter current
alpha_dc=0.97 #transistor current gain
ICBO=10.*10.**(-6.) #collector to base leakage current in A
Ib=50.*10.**(-6.) #base current in A
Ic=((alpha_dc*Ib)/(1.-alpha_dc))+(ICBO/(1.-alpha_dc)) #collector current
print '%s %.2f' %("Collector current =mA",Ic*10**3)
Ie=Ic+Ib #emitter current
print '%s %.0f' %("Emitter curren=mA",Ie*10**3)
#Ex5_2 Pg-279
#calculate Common current gain factor alpha_dc,Dc emitter current gain factor beta,Emitter current
Ic=5.255*10.**(-3.) #collector current in A
Ib=100.*10.**(-6.) #base current in A
ICBO=5.*10.**(-6.) #collector to base leakage current in A
alpha_dc=(Ic-ICBO)/(Ib+Ic) #common current gain factor
print '%s %.2f' %("Common current gain factor alpha_dc=",alpha_dc)
Beta=alpha_dc/(1-alpha_dc) #Dc emitter current gain factor value in text book is wrong
print '%s %.2f' %("\nDc emitter current gain factor beta =",Beta)
Ie=Ic+Ib #emitter current value in text book wrong
print '%s %.3f' %("\nEmitter current=mA",Ie*10**3)
#Ex5_3 Pg-279
#calculate Dc emitter current gain factor beta,Emitter current,Common current gain factor alpha_dc,Collector current
Ic=12.427*10.**(-3.) #collector current in A
Ib=200.*10.**(-6.) #base current in A
ICBO=7.*10.**(-6.) #collector to base leakage current in A
Beta=(Ic-ICBO)/(Ib+ICBO) #Dc emitter current gain factor (value in texbook is wrong)
print '%s %.0f' %("\nDc emitter current gain factor beta=",Beta)
Ie=Ic+Ib #emitter current
print '%s %.1f' %("\nEmitter current=mA",Ie*10**3)
alpha_dc=(Ic-ICBO)/(Ib+Ic) #common current gain factor
print '%s %.2f' %("\nCommon current gain factor alpha_dc=",alpha_dc)
Ib=150.*10.**(-6.) #new base current
Ic=Beta*Ib+(Beta+1.)*ICBO #collector current (value in textbook is wrong)
print '%s %.3f' %("\nCollector current=mA",Ic*10**3)