#determine the collector and base current
#given
a=0.98;#dc alpha
Ie=5.*10.**-3.;#A#emitter current
Ico=2.*10.**-6.;#A#collector reverse leakage current
Ic=a*Ie+Ico;
Ib=Ie-Ic;
print '%s %.3f %s' %("The collector current is =",Ic*1000,"mA\n");
print '%s %.f %s' %("The base current is =",Ib*10**6,"uA");
#determine the base and collector current and exact and approax dc alpha
#given
Ie=8.4*10.**-3.#A#emitter current
Icbo=0.1*10.**-6.##A#reverse leakage current
Ib=0.008*Ie##A#base current
Ic=Ie-Ib#
Icinj=Ic-Icbo#
a0=Icinj/Ie#
a=Ic/Ie#
print '%s %.1f %s' %("Base current is =",Ib*10**6,"uA\n")#
print '%s %.4f %s' %("Collector current =",Ic*1000,"mA\n",)#
print '%s %.7f %s' %("Exact value of alphha =",a0,"\n")#
print '%s %.3f' %("Approax value of alpha =",a)#
#Determine the base current
#given
a=0.96; #dc alpha
Rc=2.*10.**3.;#ohm #resistor across collector
Vc=4.;#V #Voltage drop across the collector resistor
Ic=Vc/Rc; #Colletor current
Ie=Ic/a; #Emmiter current
Ib=Ie-Ic; #Base current
print '%s %.f %s' %("The base current is =",Ib*10**6,"uA",)
#determine dynamic input resistance
#given
Ie=2.;#mA
Vcb=10.;#V
#Taking points around Ie & Vcb from graph
del_Ie=(2.5-1.5)*10.**-3.;#A
#corresponding change in Veb
del_Veb=(0.9-0.8);#V
rib=del_Veb/del_Ie;
print '%s %.f %s' %("The dynamic input resistance of transistor is =",rib,"ohm");
#find dc current gain in common emitter configuration
#given
a=0.98;#dc current gain in common base configuration
B=a/(1.-a);
print '%s %.f' %("The dc current gain in common emitter configuration is=",B);
#calculate ac alpha and beta
#given
ic=0.995#mA#Emitter current change
ie=1.#mA#collector current change
a=ic/ie;
B=a/(1.-a);
print '%s %.3f %s' %("The ac alpha is =",a,"\n")
print '%s %.f' %("The common emitter ac current gain is =",B);
#Calculate beta and Iceo and exact and approax collector current
#given
a0=0.992;#dc current gain in common base configuration
Icbo=48.*10.**-9.;#A
Ib=30.*10.**-6.;#A#base current
B=a0/(1.-a0);
Iceo=Icbo/(1.-a0);
print '%s %.f %s' %("Beta=",B,"\n");
print '%s %.f %s' %("Iceo=",Iceo*10**6,"uA\n");
Ic=B*Ib+Iceo;
Ica=B*Ib;#approax
print '%s %.3f %s' %("Exact collector current =",Ic*1000,"mA\n");
print '%s %.2f %s' %("Approax collector current =",Ica*1000,"mA");
#determine dynamic input resistance
#given
Vbe=0.75;#V
Vce=2.;#V
#Taking points around Vbe=0.75V from graph
del_Vbe=(0.98-0.9);#V
#corresponding change in ib
del_ib=(68.-48.)*10.**-6.;#A
rie=del_Vbe/del_ib;
print '%s %.f %s' %("The dynamic input resistance of transistor is =",rie/1000,"k ohm");
#determine dynamic input resistance and dc and ac current gain
#given
Ib=30.*10.**-6.;#A
Vce=10.;#V
Ic=3.6*10.**-3.;#A #from graph
#Taking points around Vce = 10V from graph
del_Vce=(12.5-7.5);#V
#corresponding change in ic
del_ic=(3.7-3.5)*10.**-3.;#A
roe=del_Vce/del_ic;
print '%s %.f %s' %("The dynamic output resistance of transistor is =",roe/1000,"k ohm\n");
#dc current gain
Bo=Ic/Ib;
print '%s %.f %s' %("The dc current gain is =",Bo,"\n");
#ac current gain
del_ic=(4.7-2.5)*10.**-3.; #the collector current change is from 3.5mA to 4.7mA as we can see from graph when we change ib from 40mA to 20mA
del_ib=(40.-20.)*10.**-6.;
B=del_ic/del_ib;
print '%s %.f %s' %("The ac current gain is =",B,"\n");
#calculate ac current gain in CE and CC configuration
#given
a=0.99;
B=a/(1.-a);
print '%s %.f' %("The ac current gain in CE configuration is =",B);
y=1.+B;
print '%s %.f' %("\nThe ac current gain in CC configuration is =",y);