# Fermi Energy of metals
import math
# variable declaration
d_cu=8.96*10**3 # density of cu
a_cu=63.55 # Atomic weight of cu
d_z=7.14*10**3 # density of Zn
a_z=65.38 # Atomic weight of Zn
d_al=2700 # density of Al
a_al=27 # Atomic weight of Al
avg=6.022*10**26 # Avogadro's number
h=6.626*10**-34 # Planck's constant
m=9.1*10**-31 # mass of an electrons
e=1.6*10**-19 # charge of an electron
#(i)
# Calculations
n_cu=d_cu*avg/a_cu
e_cu=(h**2/(8*m))*(3*n_cu/math.pi)**(2.0/3.0)
e_cu=e_cu/e
#Result
print("\n(i)For Cu\nThe electron concentration in Cu is %.4f*10^28 per m^3\nFermi energy at 0 k =%.4f eV "%(n_cu*10**-28,e_cu))
#(ii)
# calculations
n_z=d_z*avg*2/a_z
e_z=(h**2/(8*m))*(3*n_z/math.pi)**(2.0/3.0)
e_z=e_z/e
# Result
print("\n(ii)For Zn\nThe electron concentration in Zn is %.5f*10^28 per m^3\nFermi energy at 0 k =%.2f eV "%(n_z*10**-28,e_z))
#(iii)
# Calculations
n_al=d_al*avg*3/a_al
e_al=(h**2/(8*m))*(3*n_al/math.pi)**(2.0/3.0)
e_al=e_al/e
#Result
print("\n(iii)For Al\nThe electron concentration in Al is %.3f*10^28 per m^3\nFermi energy at 0 k =%.2f eV "%(n_al*10**-28,e_al))
# Density of states for Cu
import math
# variable declaration
avg=6.023*10**26 # avogadro's number
h=6.626*10**-34 # Planck's constant
m=9.1*10**-31 # mass of an electron
e=1.6*10**-19 # charge of an electron
n=8.4905*10**28 # sphere of radius
gam=6.82*10**27 # gamma
# Calculations
ef=(h**2/(8*m))*(3*n/math.pi)**(2.0/3.0)
ef=ef/e
x=(gam*math.sqrt(ef))/2
#Result
print("The density of states for Cu at the Fermi level for T = 0 K is %.0f*10^27 m^-3"%(x*10**-27))
# Nordheims coeeficient
import math
#Variable declaration
rni=63 # Resistivity of Ni
rcr=129 # Resistivity of Cr
k=1120 # Resistivity of 80% Ni + 20% Cr
#Calculations
c=(k*10**-9)/(0.8*(1-0.8))
#Result
print("The Nordheims coeeficient is %.0f *10^-6 Ohm-m"%(c*10**6))
# Conductivity of Al
import math
#Variable declaaration
d=2700 # Density of Al
awt=27 # Atomic weight
t=10**-14 # Relaxation time
e=1.6*10**-19 # charge of an electron
m=9.1*10**-31 # mass of an electron
avg=6.022*10**26 # Avogadros number
# calculation
n=avg*d*3/awt
sig=(n*t*e**2)/m
#Result
print("The conductivity of Al is %.4f*10^7 ohm-m."%(sig*10**-7))
#Fermi distribution function
import math
#variable declaration
e1=0.01 # difference between energy level to fermi level in eV
e=1.6*10**-19 # charge of an electron
ed=e*e1 # difference between energy level to fermi level in J
T=200 # Temperature
k=1.38*10**-23 # Boltzmann's constant
# Calculations
E=1/(1+math.e**(ed/(T*k)))
print("The Fermi distribution function for energy E is %.4f"%E)
# Fermi energy and fermi temperature
import math
#variable declaration
v=0.86*10**6 # velocity of electron
m=9.11*10**-31 # mass of electron
e=1.6*10**-19 # electronic charge
k=1.38*10**-23 # Boltzmann's constant
#calculations
E=(m*v**2)/2
E= math.floor(E*10**22)/10**22
T=E/k
#Result
print("\nThe fermi energy is %.3f*10^-19 J\nThe Fermi Temperature Tf is %.2f*10^4 K"%(E*10**19,T*10**-4))
# answer in the book for Temperature id 2.43 x 10^4
# No of states lying between energy levels
import math
# variable declaration
m=9.1*10**-31 # mass of electron
dE=0.01 # energy interval
h=6.63*10**-34 # planck's constant
eF=3.0 # Fermi energy
e=1.6*10**-19 # electronic charge
#Calculations
E1=eF*e
E2=E1+e*dE
n=(4*math.pi*(2*m)**(1.5))/h**3
k=((2*0.3523/3)*((E2**(1.5)-(E1**(1.5)))))
n=n*k
#Result
print("The number of states lying between the energy level is %.2f*10^25"%(n*10**-25))
#Fermi Velocity
import math
#Variable declaration
Tf=24600 # Fermi temperature of the metal
m=9.11*10**-31 # mass of electron
k=1.38*10**-23 # Boltzmann's constant
#Calculations
vf=math.sqrt(2*k*Tf/m)
#Result
print("The Fermi Velocity is %.4f *10^6 m/s"%(vf*10**-6))
#Fermi energy
import math
#variable declaration
n=18.1*10**28 # elecron density of electron
h=6.62*10**-34 # Planck's constant
m=9.1*10**-31 # mass of an electron
e=1.6*10**-19 # electronic charge
#calculations
ef=((3*n/(8*math.pi))**(2.0/3.0))*((h**2)/(2*m))
ef=ef/e
ef=math.ceil(ef*100)/100
#Result
print("The Fermi energy at 0 K is %.2f eV "%(ef))
#Fermi energy
import math
#variable declaration
n=18.1*10**28 # elecron density of electron
h=6.62*10**-34 # Planck's constant
m=9.1*10**-31 # mass of an electron
e=1.6*10**-19 # electronic charge
#calculations
ef=((3*n/(8*math.pi))**(2.0/3.0))*((h**2)/(2*m))
ef=ef/e
ef=math.ceil(ef*100)/100
#result
print("The Fermi energy at 0 K is %.2f eV "%ef)
# Temperature calculation
import math
#variable declaration
e=1.6*10**-19 # electronic charge
Ed=0.5*e # difference between energy level to fermi level
k=1.38*10**-23 # Boltzmann's constant
x=0.01 # probability
#Calculaations
T=Ed/(k*math.log((1/x)-1))
#Result
print("Temperature at which there is 1%% probability that a state with 0.5 eV energy occupied above the Fermi energy level is %.1f K"%T)
#answer is not matching with the answer given in the book
#energies for the occupying of electrons
import math
#variable declaration
ef=2.1 # Fermi energy
k=1.38*10**-23 # Boltzmann's constant
T=300 # Temperature
e=1.6*10**-19 # Electronic charge
#calculations
#(i)
p1=0.99 # probability
E1=ef+(k*T*math.log(-1+1/p1))/e
#(ii)
p2=0.01 # probability
E2=ef+(k*T*math.log(-1+1/p2))/e
#(iii)
p3=0.5 # probability
E3=ef+(k*T*math.log(-1+1/p3))/e
#Result
print("\nThe energies for the occupying of electrons at %d K for the probability of %.2f are %.2f eV"%(T,p1,E1))
print("\nThe energies for the occupying of electrons at %d K for the probability of %.2f are %.2f eV"%(T,p2,E2))
print("\nThe energies for the occupying of electrons at %d K for the probability of %.2f are %.2f eV"%(T,p3,E3))
# Fermi distribution function
import math
# Variable declarations
e=1.6*10**-19 # Electronic charge
ed=0.02*e # difference between energy level to fermi level
T1=200 # Temperature 1
T2=400 # Temperature 2
k=1.38*10**-23 # Boltzmann's constant
#Calculations
fe1=1/(1+math.e**(ed/(k*T1)))
fe2=1/(1+math.e**(ed/(k*T2)))
#Result
print("\nThe Fermi distribution function for the given energy at %d K is %.5f"%(T1,fe1))
print("\nThe Fermi distribution function for the given energy at %d K is %.4f"%(T2,fe2))
# Fermi energy for given metal
import math
#Variaable declaration
d=10500 # Density of the metal
avg=6.022*10**26 # Avogadro's number
awt=107.9 # Atomic weight of metal
h=6.62*10**-34 # Planck's constant
m=9.1*10**-31 # mass of an electron
e=1.6*10**-19 # electronic charge
#Calculattions
n=d*avg/awt
ef=((3*n/(8*math.pi))**(2.0/3.0))*((h**2)/(2*m))
ef=ef/e
#Result
print("The Fermi energy for given metal is %.1f eV "%ef)
# Fermi distribution function
import math
#Variable declaration
e=1.6*10**-19 # electronic charge
ed=0.2*e # difference between energy level to Fermi level
T1=300 # Temperature 1
T2=1000 # Temperature 2
k=1.38*10**-23 # Boltzmann's constant
#Calculations
fe1=1/(1+math.e**(ed/(k*T1)))
fe2=1/(1+math.e**(ed/(k*T2)))
#Result
print("\nThe Fermi distribution function for the given energy at %d K is %.7f"%(T1,fe1))
print("\nThe Fermi distribution function for the given energy at %d K is %.4f"%(T2,fe2))
# Answer for 300 K is wrong in the book
# Free electrons concentration
import math
#Variable declarations
h=6.62*10**-34 # Planck's constant
m=9.1*10**-31 # Mass of electron
e=1.6*10**-19 # Charge of an electron
ef=3*e # Fermi Energy
#Calculations
k=((3/(8*math.pi))**(2.0/3.0))*((h**2)/(2*m))
k=ef/k
n=k**(1.5)
#Result
print("The number of free electrons concentration in metal is %.2f *10^28 per cubic meter "%(n*10**-28))
# Free electrons concentration in metal
import math
#Variable declaration
h=6.626*10**-34 # Planck's constant
m=9.1*10**-31 # Mass of electron
e=1.6*10**-19 # Charge of electron
ef=5.5*e # Fermi energy
# Calculation
k=((3/(8*math.pi))**(2.0/3.0))*((h**2)/(2*m))
k=ef/k
n=k**(1.5)
#Result
print("The number of free electrons concentration in metal is %.3f * 10^28 per cubic meter "%(n*10**-28))
#Answer is matching with the answer given in the book
# electrons concentration and termal velocity of electrons
import math
#variable declaration
h=6.626*10**-34 # Planck's constant
m=9.1*10**-31 # mass of electron
e=1.6*10**-19 # charge of electron
ef=7*e # Fermi energy
#calculations
k=((3/(8*math.pi))**(2.0/3.0))*((h**2)/(2*m))
k=ef/k
n=k**(1.5)
vth=math.sqrt(2*ef/m)
#Result
print("The number of free electrons concentration in metal is %.2f *10^28 per cubic meter "%(math.ceil(n*10**-28*10**2)/10**2))
print("\nThe termal velocity of electrons in copper is %.3f *10^6 m/s"%(math.floor(vth*10**-6*10**3)/10**3))