#This source code is public domain
#Author: Christian Schirm
import numpy,scipy, pylab
from scipy import integrate
from matplotlib.font_manager import FontProperties
import matplotlib.pyplot as plt
TDebye=396. #Aluminium (Springermaterials)
def J(x): return integrate.quad(lambda z: z**5/((numpy.exp(z)-1)*(1-numpy.exp(-z))), 0, x)[0]
c=5.8075 * 30
def BG(T): return c*(T/TDebye)**5*J(TDebye/T)
R0=5
x=range(1,300)
y=[BG(i)+R0 for i in x]
plt.clf()
fig=plt.figure(figsize=(4.5, 3.5))
fig.subplotpars.bottom=0.13
y1=plt.plot(x,y,'r-')
y2=plt.plot([x[0],x[-1]],[R0]*2,'b--')
plt.xlabel(u'Temperatur (K)')
plt.ylabel(u'Widerstand ($\Omega$)')
plt.axis([None,None,0,None])
plt.grid(True)
pylab.text(70,30,r'Elektron-Phonon + Rest', {'rotation': 36, 'color': 'r', 'fontsize': 14})
pylab.text(140,6,r'Rest', { 'color': 'b', 'fontsize': 14})
plt.show()
#plt.savefig('RRR.svg')