<jupyter_start><jupyter_text>Bose-Einstein CondensationConsider the function as $f(z,x)$ defined:   $$ f(z,x) = \frac{z x^{1/2}}{\exp(x) - z} $$   and the integral over $x$,$$I(z) = \int_0^{\infty} f(z,x) dx $$Here, $z$ is a positive real number.<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline
import scipy.integrate<jupyter_output><empty_output><jupyter_text>Spectral Number density function $f$<jupyter_code>def f(z,x):
    return z*np.sqrt(x)/(np.exp(x) - z)

x_vec = np.linspace(0,2,1000)

plt.figure(dpi=150)
colors = plt.cm.viridis(np.linspace(0,1,6))
for i,z in enumerate([0.1,0.5,0.9,0.99]):
    f_vec = f(z,x_vec)
    plt.plot(x_vec,f_vec,color=colors[i],label="z = {:.1f}".format(z))
plt.legend()
plt.xlabel(r"$x$",fontsize=14)
plt.ylabel(r"$f(z,x)$",fontsize=14)
ax = plt.gca()
ax.xaxis.set_major_locator(plt.MaxNLocator(5))
ax.yaxis.set_major_locator(plt.MaxNLocator(5))<jupyter_output><empty_output><jupyter_text>Observe in the above plot, as $z \rightarrow 1$ i.e.$\mu \rightarrow 0$ ($z = e^{\beta \mu}$), the $x = 0$ looks like it is getting increasingly occupied. This is the formation of Bose-Einstein condensate.  Total number density function $I$<jupyter_code>def I(z):
    return scipy.integrate.quad(lambda x : f(z,x),0,np.inf)[0]
z_vec = np.linspace(0,1,1000)
plt.figure(dpi=150)

I_vec = np.array([I(z) for z in z_vec])
plt.plot(z_vec,I_vec,color="r")
plt.xlabel(r"$z$",fontsize=14)
plt.ylabel(r"$I(z)$",fontsize=14)
ax = plt.gca()
ax.xaxis.set_major_locator(plt.MaxNLocator(5))
ax.yaxis.set_major_locator(plt.MaxNLocator(5))
z = 1
scipy.integrate.quad(lambda x : f(z,x),0,np.inf)[0]<jupyter_output>/home/qmdlab/.local/lib/python3.6/site-packages/ipykernel_launcher.py:2: RuntimeWarning: overflow encountered in exp
{'fraction_non_alphanumeric': 0.18591549295774648, 'fraction_numerical': 0.03211267605633803, 'mean_word_length': 6.075697211155378, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '93991', 'license': 'MIT', 'n_tokens_mistral': 817, 'n_tokens_neox': 774, 'n_words': 132, 'path': 'Bose-Einstein Condensation.ipynb', 'repo_name': 'sandeshkalantre/random-numerical-experiments', 'size': '1775'}