Statistical Physics

Example 10.2 Page 307

In [2]:
#initiation of variable
from math import sqrt
#The solution is purely theoretical and involves a lot of approximations.
print"The value of shift in frequency was found out to be delf=7.14*fo*10^-7*sqrt(T) for a star composing of hydrogen atoms at a temperature T.";
T=6000.0;                       #temperature for sun
delf=7.14*10**-7*sqrt(T);#change in frequency

#result
print"The value of frequency shift for sun(at 6000 deg. temperature) comprsing of hydrogen atoms is",delf," times the frequency of the light."
The value of shift in frequency was found out to be delf=7.14*fo*10^-7*sqrt(T) for a star composing of hydrogen atoms at a temperature T.
The value of frequency shift for sun(at 6000 deg. temperature) comprsing of hydrogen atoms is 5.53062021838e-05  times the frequency of the light.

Example 10.3 Page 309

In [1]:
#initiation of variable
from math import sqrt,pi, exp, log
kT=0.0252;E=10.2                              # at room temperature, kT=0.0252 standard value and given value of E

#calculation
n2=2;n1=1; g2=2*(n2**2);g1=2*(n1**2);           #values for ground and excited states
t=(g2/g1)*exp(-E/kT);                         #fraction of atoms

#result
print"The number of hydrogen atoms required is %.1e" %(1.0/t)," which weighs %.1e" %((1/t)*(1.67*10**-27)),"Kg"

#partb
t=0.1/0.9;k=8.65*10**-5                          #fracion of atoms in case-2 is given
T=-E/(log(t/(g2/g1))*k);                        #temperature

#result
print"The value of temperature at which 1/10 atoms are in excited state in K is %.1e" %round(T,3);
The number of hydrogen atoms required is 1.5e+175  which weighs 2.5e+148 Kg
The value of temperature at which 1/10 atoms are in excited state in K is 3.3e+04

Example 10.4 Page 311

In [8]:
#initiation of variable
from math import log
#theoritical part a
print'The energy of interaction with magnetic field is given by uB and the degeneracy of the states are +-1/2 which are identical.\nThe ratio is therefore pE2/pE1 which gives e^(-2*u*B/k*T)';
#partb
uB=5.79*10**-4;        #for a typical atom
t=1.1;k=8.65*10**-5;   #ratio and constant k

#calculation
T=2*uB/(log(t)*k);    #temperature

#result
print"The value of temperature ar which the given ratio exists in K is",round(T,3);
The energy of interaction with magnetic field is given by uB and the degeneracy of the states are +-1/2 which are identical.
The ratio is therefore pE2/pE1 which gives e^(-2*u*B/k*T)
The value of temperature ar which the given ratio exists in K is 140.46

Example 10.5 Page 313

In [12]:
#initiation of variable
from math import pi
p=0.971; A=6.023*10**23; m=23.0;    # various given values and constants

#calculation
c= (p*A/m)*10**6;                   # atoms per unit volume
hc=1240.0; mc2=0.511*10**6;           # hc=1240 eV.nm
E= ((hc**2)/(2*mc2))*(((3/(8*pi))*c)**(2.0/3)); #value of fermi energy

#result
print"The fermi energy for sodium is",round(E*10**-18,4),"eV";#multiply by 10^-18 to convert metres^2 term to nm^2
The fermi energy for sodium is 3.1539 eV