In this experiment, the language program, Vpython, would be introduced and be used to get the visualization of the electric field through the space. Besides that, the countour plot of the electric field could also be obtained by using Vpython. With all the visualizations, it allows us to analyze how the electric changes when different wavelengths, or different seperation between the two sources was adjusted. The equation used in this experiment was
E0=A*cos(2*pi*r/wavelength)/r
From here, it shows that the electric filed would be changed based on the wavelength, and also the distance between the two sources, which is also denoted as r in this equation.
Here shows the sample Vpython code:
from visual
import *
import pylab
as pimport mpl_toolkits.mplot3d.axes3d as p3
wavelength =
2.0e-3
scrnDist =
5.0e-2scrnWdth = 2.4e-2
xs=0
ys=0
A=1
N=100
dX=scrnDist/N
Xcoords=arange(dX,scrnDist+2*dX,dX)
dY=scrnDist/N
Ycoords=arange(-scrnDist/2,scrnDist/2+2*dY,dY)
[xd,yd]=meshgrid(Xcoords,Ycoords)
r=sqrt((xd-xs)**2+(yd-ys)**2)
E0=A*cos(2*pi*r/wavelength)/r
#print E0
For this code, each Eo will be the ouput, and when we change some of the code, such as adding
fig=p.figure()
Efield=p3.Axes3D(fig)
Efield.plot_wireframe(xd,yd,E0)
Efield.set_xlabel('Xd')
Efield.set_ylabel('Yd')
Efield.set_zlabel('E0')
fig2=p.figure()
p.contour(xd,yd,E0)
p.show()
The program then will output the 3-D visualization and also the contour plot.
For wavelengh 2mm, the electirc field:
For wavelengh 4mm, the electirc field:
For wavelengh 8mm, the electirc field:
From the three above cases, it shows that when the wavelength is increased, the lines on the coutour plot became less intense, and the same situation was also applied to the electric wave on the 3D visualization.
The 3-D diagram and countour plot for wavelength as 4mm was obtained:
Now, the wavelengh would be adjusted and if it agrees to the prediction, when the wavelength is increased, the the intensity between lines would become larger, and the intensity between lines would become smaller when the wavelengh is decreased.
The 3-D diagram and countour plot for wavelength as 8mm was obtained:
As predicted, the lines became less intense when the wavelengh is increased.
The 3-D diagram and countour plot for wavelength as 8mm was obtained:
As predicted, the lines became more intense when the wavelengh is decreased.
Now the visulizations would be analyzed when the distance between two sources was adjusted:
As we can see here, the distance between two most intence points became wider as desired.Now the parameters were changed, the wavelengh now was 600 nm, screen distance was 50nm, screen width was 30 nm, and the souce seperation wsa 0.016nm
This time the intsensity would only be plot at points on the screen, the code was replaced and changed to :
p,plot(yd[:,N], Itot[:,N]
p.show()
Now the new visulization of intensity for the new parameters was:
The left diagram showed the intensity when the wavelengh is small, and the right diagram showed the intensity when the wavelengh was increased. Therefore, the space between lines got wider as the wavelengh was increased.
With these point only diagrams, it still showed that the wavelengh was one of the main factors which caused the changing of intensity.
No comments:
Post a Comment