Statistical Mechanics Prishat
Statistical Mechanics Prishat
Input:
import numpy as np
print(h,k,e)
bke = k/e
print(bke)
xef = np.linspace(-4,4,201)
shift = 1e-6
x = (energy - chempot)/temperature/bke
d = np.exp(x) + signature
return 1/d
d = np.exp(x) + signature
return 1/d
temp = 300
plt.legend()
plt.ylim(0,3)
plt.xlim(-4,4)
plt.show()
Output:
8.617333262145179e-05
2. #Fermi Dirac distribition at different temperatures
Input:
import numpy as np
bke = k/e
T = np.array([100,400,800])
print (T/bke)
x = (energy - chempot)/temperature/bke
d = np.exp(x) + signature
return 1/d
for l in T :
plt.plot(engf,fdist (engf,l,1),label=r"$T={l}$".format(l=l))
plt.legend(loc='best')
plt.show()
Output:
3. #Maxwell Boltzmann distribution at different temperatures
Input:
import numpy as np
bke = k/e
T = np.array([100,400,800])
print (T/bke)
x = (energy - chempot)/temperature/bke
d = np.exp(x) + signature
return 1/d
for l in T :
plt.plot(engf,fdist (engf,l,0),label=r"$T={l}$".format(l=l))
plt.ylim(0,1.5)
plt.xlim(-.01,0.3)
plt.legend(loc='best')
plt.show()
Output:
4. #Bose Eintein distribution
Input:
import numpy as np
bke = k/e
shift = 1e-6
T = np.array([100,400,800])
x = (energy - chempot)/temperature/bke
d = np.exp(x) + signature
return 1/d
for l in T :
plt.plot(eng,fdist (eng,l,-1),label=r"$T={l}$".format(l=l))
plt.ylim(0,1.5)
plt.xlim(-.01,0.3)
plt.legend(loc='best')
plt.show()
Output:
5. #Specific heat (Debye model)
Input:
import numpy as np
xd = dT/T
xil = bose(xd)
pre = 3/xd**3
return pre*res
debye = np.vectorize(debyescalar)
debyetemp = [428,105,2230]
debyemat= ["Al","Pb","C"]
conv = (np.pi/6)**(1/3)
print (conv)
#eintemp = conv*debyetemp
for t in debyetemp :
i = debyetemp.index(t)
el = debyemat[i]
plt.plot(temp,debye(temp,t),\
plt.ylabel(r"$C_v/(3Nk_B)$",fontsize=14)
plt.xlabel(r"$T$ (K)",fontsize = 14)
plt.legend()
plt.show()
Output:
6. #Two level system (Energy)
Input:
import numpy as np
return 2*np.cosh(1/w)
def pf(w) :
return sppf(w)**N
return np.log(sppf(w))
def U (w):
# calculates U/N\epsilon
return uw
# Internal Energy/N\epsilon
plt.plot(x, U (x))
plt.axhline(y = 0, ls = "--")
plt.ylabel(r"$U/(N\epsilon)$",fontsize = 14)
plt.title("Energy of two level system")
plt.show()
Output: