Example 2.1: Page number 31

In [1]:
#variable declaration

from math import exp
from math import pi

l=5.0;                        #length of tungsten filament in cm
d=0.01;                       #diameter of the filament in cm
T=2500.0;                     #operating temperature in K
A=60.2*pow(10,4);             #constant, depending upon the type of thermionic emitter, in amp/m²/K²
phi=4.517;                    #work function of emitter in eV

b=round(11600*phi,-1);                       #constant for a metal, in K
Js=round(A*T*T*exp(-b/T),-2);                #Emission current density in amp/m²
a=pi*(d/100)*(l/100);                        #Surface area of the cathode in m²
E_I=Js*a;                                     #Emission current in A

print("emission current =%.3f A"%E_I);
emission current =0.047 A

Example 2.2:Page number 31

In [3]:
from math import log

#Variable declaration
Js=0.1;                   #Emission current density in amp/cm²
A=60.2;                   #Constant depending upon the type of thermionic emitter, in amp/cm²/K²
T=1900.0;                 #Absolute temperature in K

#Calculating b according to the formula Js=A*T²*exp(-b/T) for emission current density
b=-T*(log(Js/(A*T*T)));          #constant for emitter, in K
phi= round(b/11600,2);           # work function in eV

print ("Work function of the tungsten wire = %.2f eV"%phi);

	print("Given sample is pure Tungsten");
elif(phi!=4.52 and phi>=2.63 and phi<=4.52):
	print ("The sample is not pure Tungsten");
#Note : In the text book, the work function has been approximated to 3.56eV, but in the code it calculates as  3.52eV
Work function of the tungsten wire = 3.52 eV
The sample is not pure Tungsten
In [ ]: