1

The average energy of a free electron gas can be modeled as $$\epsilon=\frac{\int_0^\infty\frac{E^{3/2}dE}{\exp(E-\eta)+1}}{\int_0^\infty\frac{E^{1/2}dE}{\exp(E-\eta)+1}}$$

where $$\eta=\mu(T)/(k_B T)$$ $\mu(T)$ is the chemical potential which can be regarded as a constant.

Is there a way to obtain $T$ numerically in principal? I do know how to evaluate the fermi-integrals as well as their inverse if it helps.

OD IUM
  • 345

1 Answers1

2

This is a possible solution if you're familiar with python. There's a relation (at the time of writing this answer there is problem with this wiki entry, the argument of the polylog function is wrong) between the Fermi integral and the Polylogarithm:

$$ F_{s}(x)={\frac {1}{\Gamma (s+1)}}\int _{0}^{\infty }{\frac {t^{s}}{e^{t-x}+1}}\,dt = -{\rm Li}_{s+1}(-e^{x}) \tag{1} $$

This means

$$ \int _{0}^{\infty }{\frac {t^{s}}{e^{t-x}+1}}\,dt = -{\Gamma (s+1)} {\rm Li}_{s+1}(-e^{x}) \tag{2} $$

This a small script to calculate the average energy given a value of $\eta$

import mpmath
import scipy.optimize

# fermi-dirac integral
def fdint(s, eta):

    result = -mpmath.gamma(s + 1) * mpmath.polylog(s + 1, -np.exp(eta))
    return float('{}'.format(result.real))

# average energy from eta
def avge_eta(eta):

    return fdint(1.5, eta) / fdint(0.5, eta)

enter image description here

If you want to calculate $\eta$ (equivalently $T$) for a given value of $\epsilon$, add this function

# eta from average energy
def eta_avge(e):

    f = lambda x: avge_eta(x) - e
    results = scipy.optimize.newton(f, 1.0)
    return np.real(results)
caverac
  • 19,783
  • Thanks for your effort. – OD IUM Apr 19 '18 at 11:43
  • I'm a little confused though as I expected the energy to increase with eta. If i got it right, the ratio of the fermi-integrals can be expressed as 1.5*polylog(5/2,-exp(x))/polylog(3/2,-exp(x)) which gives the following plot: http://www.wolframalpha.com/input/?i=plot+polylog(5%2F2,-exp(x))%2Fpolylog(3%2F2,-exp(x)) – OD IUM Apr 19 '18 at 11:52
  • @ODIUM You're right, there's a problem with the Wiki entry I cited: a minus sign. Sorry, I didn't double check that before posting my answer – caverac Apr 19 '18 at 12:13