In [1]:
%pylab inline
In [2]:
def BJ(j,x):
return (2*j+1)/(2*j)/tanh((2*j+1)/(2*j)*x)-1/(2*j)/tanh(x/(2*j))
def L(x):
return 1/tanh(x)-1/x
x=linspace(-5,5,1000);
figure(figsize=(12,6))
fs=30
plot(x,BJ(0.5,x),'k',label=r'$\mathcal{B}_{1/2}(x)$',lw=3);
plot(x,BJ(1,x),'k--',label=r'$\mathcal{B}_{1}(x)$',lw=3);
plot(x,BJ(2,x),'k-.',label=r'$\mathcal{B}_{2}(x)$',lw=3);
plot(x,L(x),'k:',label=r'$\mathcal{L}(x)$',lw=3);
ylim(-1,1)
xlim(-5,5)
legend(loc='lower right',fontsize=fs)
xticks(fontsize=fs)
yticks(linspace(-1.,1.,5),fontsize=fs)
xticks(linspace(-5,5,5),fontsize=fs)
xlabel(r'$x$',fontsize=fs)
grid()
savefig('Brillouin.png',pad_inches=0.0,bbox_inches='tight')
In [3]:
x=linspace(-20,20,1000);
figure(figsize=(12,6))
fs=30
plot(x,1/tanh(x)-1/x,label=r'$\mathcal{L}(x)$',lw=3);
plot(x,x/3,'--',label=r'$x/3$',lw=3)
plot(x,x**0,':',label=r'$1$',lw=3)
plot(x,0*x**0,'k-')
ylim(-2,2)
legend(loc='lower right',fontsize=fs)
xticks(fontsize=fs)
yticks(linspace(-2,2,5),fontsize=fs)
xticks(linspace(-16,16,5),fontsize=fs)
xlabel(r'$x$',fontsize=fs)
grid()
savefig('Langevin.png',pad_inches=0.0,bbox_inches='tight')
In [15]:
figure(figsize=(6,6))
fs=30
x=linspace(0.01,3,1000)
plot(x,1/tanh(x),label=r'$\coth(x)$',lw=3)
plot(x,1/x+x/3,'--',label=r'$\frac{1}{x}+\frac{x}{3}$',lw=3)
plot(x,x**0,'-.',lw=3)
ylim(0,3)
xlabel(r'$x$',fontsize=fs)
xticks(linspace(0,3,4),fontsize=fs)
yticks(linspace(0,3,4),fontsize=fs)
legend(fontsize=fs)
grid()
savefig('coth.png',pad_inches=0.0,bbox_inches='tight')
In [ ]: