5: Elements of statistical mechanics

Example number 5.1, Page number 5.10

In [4]:
#importing modules
import math
from __future__ import division

#Variable declaration
k=1.38*10**-23;    #boltzmann constant(J)
T=300;       #temperature(K)
e=1.6*10**-19;     #charge(c)

#Calculation
E=3*k*T/(2*e);     #average thermal energy(eV)

#Result
print "average thermal energy is",round(E,3),"eV"
average thermal energy is 0.039 eV

Example number 5.3, Page number 5.18

In [11]:
#importing modules
import math
from __future__ import division

#Variable declaration
kT=1;    #assume
E_Ef=kT;

#Calculation
FE=1/(1+math.exp(1));     #fermi function

#Result
print "fermi function is",round(FE,3)
fermi function is 0.269

Example number 5.4, Page number 5.18

In [15]:
#importing modules
import math
from __future__ import division

#Variable declaration
FE=10/100;     #fermi function
EF=5.5;     #energy function(eV)
e=1.6*10**-19;     #charge(c)
k=1.38*10**-23;    #boltzmann constant(J)

#Calculation
E=EF+(EF/100);    #energy(eV)
x=math.log((1/FE)-1);
T=(E-EF)*e/(k*x);     #temperature(K)

#Result
print "temperature is",round(T,1),"K"
 temperature is 290.2 K

Example number 5.5, Page number 5.19

In [20]:
#importing modules
import math
from __future__ import division

#Variable declaration
k=1.38*10**-23;    #boltzmann constant(J)
T=24600;     #temperature(K)
m=9.108*10**-31;    #mass(kg)

#Calculation
vF=math.sqrt(2*k*T/m);     #fermi velocity(m s-1)

#Result
print "fermi velocity is",round(vF/10**6,2),"*10**6 m s-1"
fermi velocity is 0.86 *10**6 m s-1

Example number 5.6, Page number 5.21

In [29]:
#importing modules
import math
from __future__ import division
from scipy.integrate import quad

#Variable declaration
EF=3.0;     #fermi energy(eV)
e=1.6*10**-19;     #charge(c)
m=9.14*10**-31;    #mass(kg)
h=6.62*10**-34;    #planck's constant

#Calculation
E1=EF*e;     #energy(J)
E2=(EF+0.01)*e;   #energy(J)
def zintg(E):
	return (4*math.pi*(2*m)**(3/2)*math.sqrt(E))/h**3;

n=quad(zintg,E1,E2)[0];      #number of states

#Result
print "number of states is",round(n/10**26,4),"*10**26"
print "answer given in the book is wrong"
number of states is 1.1877 *10**26
answer given in the book is wrong