Friday, October 14, 2011

Ejs Open Source Single Slit Diffraction Model

Ejs Open Source Single Slit Diffraction Model
single slit diffraction that assumes 3 secondary sources at slit to create a diffraction pattern when width of slit, w = λ , wavelength
http://weelookang.blogspot.com/2011/10/ejs-open-source-single-slit-diffraction.html
https://dl.dropboxusercontent.com/u/44365627/lookangEJSS/export/ejs_model_wave_singleslit2wee03.jar
https://dl.dropboxusercontent.com/u/44365627/lookangEJSworkspace/export/ejs_users_sgeducation_lookang_wave_singleslit2wee03.jar
 author: fu-kwun hwang and lookang

 Ejs Open Source Single Slit Diffraction Model by Fu-Kwun Hwang remixed by lookang

reference:
Superposition of several waves http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=2082.0 by Fu-Kwun Hwang


Full screen applet
kindly hosted in NTNUJAVA Virtual Physics Laboratory by Professor Fu-Kwun Hwang http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=2314.0
alternatively, go direct to
http://www.phy.ntnu.edu.tw/ntnujava/index.php?board=28.0 Collaborative Community of EJS (Moderator: lookang) and register , login and download all of them for free :) This work is licensed under a Creative Commons Attribution 3.0 Singapore License
Author: Fu-Kwun Hwang and lookang



changes:

redesign the way the scalar-Field is calculated using a dynamic way that is always correct and to scale instead of the older way of 2 separate scalar-field.
Code:
for(int j=0;j  for(int k=0;k
  zsum[j][k]=0;
  }
 }

 
for(int i=0;i
 yc=yi+i*dy; // lay the source in y
 ycc[i] = yi+i*dy; // by lookang for drawing source
 
 for(int j=0;j
 //  if (x
   x=xmin+j*d;
 //   }
 //   else if (x>x1){
//  x=x1+j*d;
  // r=x-x1; // r is distance from array point x to slit position x1
//  x2=(x-xc)*(x-xc);
//  }
  for(int k=0;k
  y=ymin+k*d;
  
  if (x
    r=x-x1; // r is distance from array point x to slit position x1
    zsum[j][k]=Math.sin(kw*r-omega*t)*n; // need n to compensate for the magnitude
   }
  else if (x>=x1){
  r=Math.sqrt((x-xc)*(x-xc)+(y-yc)*(y-yc));
  zsum[j][k]+=Math.sin(kw*r-omega*t);
  }
  
  }
 }
}

add ns to n and draw the sources with checkbox
add wavelength and drawing checkbox etc
add width and checkbox
add type and colormode for different visualization especially cool is the 3D view that required a square array [200][200]
add step of step by step animation

enjoy!






other interesting single slit ejs applets
Single Slit diffraction http://www.phy.ntnu.edu.tw/ntnujava/index.php?topic=128.0 by Fu-Kwun Hwang
Like: intensity


Youtube
http://www.youtube.com/watch?v=sjmBcm84iA4







Engage (Why is the relevance to learning this effect called diffraction?)
Question:
Do you know why you hear the sound from the television clearly in your bedroom even though you can’t see the television (which is located in the living room) when the door is open?

hint: purpose an model of scientific explanation for this effect :)

Well the suggested answer is that the sound waves diffract (spreading or bending of waves through an aperture or around an obstacle) around the opening of the door.

Extension Question:
Then why light cannot (spreading or bending of waves through an aperture or around an obstacle) around the same door opening?

Answer:
Sound waves have wavelengths ranging from λ =  10^-2 m to 10 m for audible range, thus assuming the door opening is about w = 1 m , therefore w \approx \!\, λ , thus the spreading or bending of waves through an aperture or around an obstacle is more obvious.

Light waves wavelengths are λ about 10^-7 m, therefore w > λ, thus little diffraction is possible therefore light cannot diffraction through a door opening (aperture).


What is Diffraction?
Diffraction is the spreading or bending of waves through an aperture or around an obstacle.
Diffraction is only observable (significant) if the gap width, w is approximately equal or smaller than the wavelength, λ (i.e. w \approx \!\, λ; or w < λ) of the wave


http://en.wikipedia.org/wiki/Huygens%E2%80%93Fresnel_principle
http://upload.wikimedia.org/wikipedia/commons/thumb/6/60/Refraction_on_an_aperture_-_Huygens-Fresnel_principle.svg/2000px-Refraction_on_an_aperture_-_Huygens-Fresnel_principle.svg.png

Huygens[1] proposed that every point to which a luminous disturbance reaches becomes a source of a spherical wave, and the sum of these secondary waves determines the form of the wave at any subsequent time.
Same Huygens-Fresnel principle Refraction on an aperture (slit) but notice the secondary source space equally apart and start from center ending 1/2 space from the edge of slit which is more logical than end at the edge of the slit.
Same Animation Huygens-Fresnel principle Refraction on an aperture (slit) where w > λ with less diffraction (spreading or bending of waves through an aperture or around an obstacle) with the yellow barrier

Huygens assumed that the secondary waves traveled only in the "forward" direction and it is not explained in the theory why this is the case. He was able to provide a qualitative explanation of linear and spherical wave propagation, and to derive the laws of reflection and refraction using this principle.

http://electron9.phys.utk.edu/phys136d/modules/m9/diff.htm
Diffraction is a phenomenon whereby waves appear to bend around obstacles, or appear to spread out after passing through a small orifice. The occurrence of diffraction allows us, for example, to hear sounds from sources that are hidden from us by some obstacle or other.

http://www.physchem.co.za/OB12-wav/diffraction.htm the map reminds me that to easily remember this diffraction occurs when w slit width is comparable to λ wavelength.


Diffraction is a wave phenomenon and is also observed with water waves in a ripple tank. A wave spreads out (noticeable diffraction) when the size of the slit is comparable to or smaller than the wavelength. When wave passes through a small opening, comparable in size to the wavelength, in an obstacle (in this case yellow rectangles) , the wavefront on the other side of the opening resembles the wavefront shown below.
http://electron9.phys.utk.edu/phys136d/modules/m9/diff.htm
 In the Ejs simulation case,
when slit width is comparable in size to the wavelength w \approx \!\, λ , notice more diffraction (spreading or bending of waves through an aperture or around an obstacle) with the yellow barrier





same animation when slit width is comparable in size to the wavelength w \approx \!\, λ , notice more diffraction (spreading or bending of waves through an aperture or around an obstacle) with the yellow barrier
The wave spreads around the edges of the obstacle (yellow in this case).  This is the phenomenon of diffraction.  Therefore, diffraction is "spreading out " wave phenomenon.

http://electron9.phys.utk.edu/phys136d/modules/m9/diff.htm has some photo of the real ripple tank.
http://electron9.phys.utk.edu/phys136d/modules/m9/diff.htm when slit width is comparable in size to the wavelength





http://electron9.phys.utk.edu/phys136d/modules/m9/diff.htm when slit width >> in size than the wavelength
in Ejs,I managed to capture a similar computational model.

when slit width is comparable in size to the wavelength assuming 6 secondary sources, diffraction is noticeable





slit width >> in size ( w = 6*λ ) than the wavelength assuming 10 secondary sources. A wave goes largely straight when the size of the slit is much larger than the wavelength
I love Phet research and simulation
this is a great simulation called Wave Interference, under the water tab, the simulation breaks the 2D with a side view.


Wave Interference
Click to Run


I managed to figure out a cool way to generate a 3D visualization is Ejs.
when slit width is comparable in size to the wavelength assuming 6 secondary sources, diffraction is noticeable
 

slit width >> in size ( w = 6*λ ) than the wavelength assuming 10 secondary sources. A wave goes largely straight when the size of the slit is much larger than the wavelength

my favorable visualization is

Spectrum visualization of when slit width is comparable in size to the wavelength assuming 10 secondary sources, diffraction is noticeable

Spectrum visualization of slit width >> in size ( w = 5*λ ) than the wavelength assuming 10 secondary sources. A wave goes largely straight when the size of the slit is much larger than the wavelength
other interesting slit simulation are:
http://www.falstad.com/ripple/


Contribution to benefit the world at wikimedia


descDate Name Thumbnail Size User Description
13:26, 14 October 20115wavelength=slitwidthsprectrum.gif (file)580 KBLookang
13:26, 14 October 2011Wavelength=slitwidthspectrum.gif (file)580 KBLookang
13:26, 14 October 2011Wavelength=slitwidthblue3D.gif (file)483 KBLookang
13:26, 14 October 2011Wavelength=slitwidthblue.gif (file)768 KBLookang
13:26, 14 October 20116wavelength=slitwidthblue3D.gif (file)464 KBLookang
13:26, 14 October 20116wavelength=slitwidthblue.gif (file)527 KBLookang
13:26, 14 October 2011Wavelength=slitwidth.gif (file)825 KBLookang
13:26, 14 October 2011Diffractiongreen.gif (file)838 KBLookang
13:26, 14 October 2011Diffractionblacknwhitewavelength4timesslitwidth.gif (file)741 KBLookang
13:26, 14 October 2011Huygens Fresnel Principle.gif (file)796 KBLookang