%pylab inline
#import numpy as np # convert list to array
#import matplotlib.pyplot as plt
%pylab is deprecated, use %matplotlib inline and import the required libraries. Populating the interactive namespace from numpy and matplotlib
/home/cserti/Dropbox/okt/Meso-speci/Aharonov_Bohm_Heinzel.nb
The problem is in Eq.(17), namely in the parameter $D$ the $\cos (2\Phi)$ is the correct.
c & \sqrt{\varepsilon} & \sqrt{\varepsilon}\
\sqrt{\varepsilon} & a & b \
\sqrt{\varepsilon} & b & a
\end{bmatrix}$ and $S_R= \begin{bmatrix}
a & b & \sqrt{\varepsilon}\\
b & a & \sqrt{\varepsilon} \\
\sqrt{\varepsilon} & \sqrt{\varepsilon} & c
\end{bmatrix}$
where
$\varepsilon = \frac{1}{2}\left(1-c^2\right), a= \frac{1-c}{2},
b = - \frac{1}{2} (1+c)$
Note that in the book the other choice was used (claimed), but the correct result is given by this choice.
\cos^2(\Phi )}{A^2+B^2}$,
where $A=-2 \left(c^2+1\right) \cos (2 \Theta )+(c+1)^2 \cos (2 \Phi )+(c-1)^2$, and $B = -2 \left(c^2-1\right) \sin (2 \Theta )$
def TT(Phi,Theta,c):
szamlalo = 16*(1-c**2)**2 *sin(Theta)**2 * cos(Phi)**2
A = (-1 + c)**2 - 2 *(1 + c**2) *cos(2*Theta) + (1 + c)**2* cos(2*Phi)
B = -2* (-1 + c**2)* sin(2*Theta)
nev= A**2+B**2
res = szamlalo/nev
return res
def THeinzel(Phi,Theta,c):
## from the Book, but presumably it is WRONG, sometimes T < 0 !!
cos2t = cos(2*Theta)
cos2f = cos(2*Phi)
A = 5-4*c+6*c**2-4*c**3+5*c**4
B = (1+c)**4*cos2f**2
C = -4*(1-c)**2*(1+c**2)*cos2t
D = -2*(1+c)**2*cos(2*Phi)*(2*(1+c**2)*cos2t-(1-c)**2) ## a konyvben cos(Phi) van !!!!!
E = 8*c**2*cos(4*Theta)
szamlalo = 16*(1-c**2)**2 *sin(Theta)**2 * cos(Phi)**2
nev = A+B+C+D+E
res = szamlalo/nev
return res
TT(0.7,0.2,0.27),THeinzel(0.7,0.2,0.27)
(0.16810938321391078, 0.16810938321391075)
TT(2.17,5.2,0.27),THeinzel(2.17,5.2,0.27)
(0.9282062742935757, 0.9282062742935756)
Np=100
c=0.57
phi, theta = meshgrid(linspace(0,4*pi,Np),linspace(0,2*pi,Np))
# ,cmap='gist_heat_r', extend ='both' cmap='gray'
contourf(phi,theta,TT(phi,theta,c),cmap='rainbow', extend ='both')
title('c = '+str(c))
xlabel(r'$\Phi$',fontsize=12)
ylabel(r'$\Theta$',fontsize=12, rotation =0)
xlabels=['0',r'$\pi$',r'$2\pi$',r'$3\pi$',r'$4\pi$']
xticks([0,pi,2*pi,3*pi,4*pi],xlabels)
ylabels=['0',r'$\pi/2$',r'$\pi$',r'$3\pi/2$',r'$2\pi$']
yticks([0,pi/2,pi,3*pi/2,2*pi],ylabels)
show()
Np=100
c=0.9
phi, theta = meshgrid(linspace(0,4*pi,Np),linspace(0,2*pi,Np))
contourf(phi,theta,THeinzel(phi,theta,c),cmap='gray', extend ='both')
title('Heinzel, c = '+str(c))
xlabel(r'$\Phi$',fontsize=12)
ylabel(r'$\Theta$',fontsize=12, rotation =0)
xlabels=['0',r'$\pi$',r'$2\pi$',r'$3\pi$',r'$4\pi$']
xticks([0,pi,2*pi,3*pi,4*pi],xlabels)
ylabels=['0',r'$\pi/2$',r'$\pi$',r'$3\pi/2$',r'$2\pi$']
yticks([0,pi/2,pi,3*pi/2,2*pi],ylabels)
show()
c=0.27
theta = linspace(0.001,2*pi-0.001,100)
plot(theta,TT(0,theta,c),'r')
plot(theta,THeinzel(0,theta,c),'b--')
grid()
Np=100
c=0.27
phi, theta = meshgrid(linspace(0,4*pi,Np),linspace(0,2*pi,Np))
contourf(phi,theta,TT(phi,theta,c),cmap='gray', extend ='both') # ,cmap='gist_heat_r', extend ='both'
title('c = '+str(c))
xlabel(r'$\Phi$',fontsize=12)
ylabel(r'$\Theta$',fontsize=12, rotation =0)
xlabels=['0',r'$\pi$',r'$2\pi$',r'$3\pi$',r'$4\pi$']
xticks([0,pi,2*pi,3*pi,4*pi],xlabels)
ylabels=['0',r'$\pi/2$',r'$\pi$',r'$3\pi/2$',r'$2\pi$']
yticks([0,pi/2,pi,3*pi/2,2*pi],ylabels)
show()
/tmp/ipykernel_360359/2509615331.py:10: RuntimeWarning: invalid value encountered in divide res = szamlalo/nev