Fraunhofer Diffraction (Double Slit)

s=4;

fig1[θ_,a_,d_,k_]:=ParametricPlot[
{{x Cos[θ]+a Sin[k x]Sin[θ]-d/2-s/2,-x Sin[θ]+a Sin[k x]Cos[θ]},{x Cos[θ]-d/2-s/2,-x Sin[θ]},{x Cos[θ]+a Sin[k x]Sin[θ]+d/2+s/2,-x Sin[θ]+a Sin[k x]Cos[θ]},{x Cos[θ]+d/2+s/2,-x Sin[θ]}},{x,0,95},PlotPoints->20,
PlotStyle->{{Red,Thickness[0.004]},{Black,Dashing[{0.01,0.01}],Thickness[0.001]}},
Axes->False];

(*two light rays*)
fig2[d_,λ_,graph2_]:=Graphics[
{Thickness[0.01],Line[{{-60.0,1},{-s-d/2,1}}],
Line[{{-d/2,1},{d/2,1}}],
Line[{{d/2+s,1},{60,1}}],
Dashing[{0.01,0.01}],Thickness[0.001],
If[graph2,Gray,Black],
If[graph2,
Table[{Circle[{-d/2-s/2,0},i λ],Circle[{d/2+s/2,0},i λ]},{i,1,15}],
{Dashing[{1,0}],Text[Style["d",16,Italic],{0,-3}],
Text[Style["L",16,Italic],{48,-38}],
Text[Style["\!\(\*FractionBox[\(L\\ λ\), \(d\)]\)",15],{0,-69}],
Arrowheads[{-.02,.02}],Arrow[{{-d/2-s/2,-5},{d/2+s/2,-5}}],Arrow[{{50,0},{50,-75}}],Line[{{-150 λ/4/d,-75},{-150 λ/4/d,-70}}],
Line[{{150 λ/4/d,-75},{150 λ/4/d,-70}}],
Arrow[{{-150 λ/4/d,-73},{150 λ/4/d,-73}}],
Line[{{-d/2-s/2,0},{-d/2-s/2,-10}}],
Line[{{d/2+s/2,0},{d/2+s/2,-10}}]}]}];

(*two slits and notes*)
fig3[a_,d_,k_]:=DensityPlot[(Abs[Cos[ k d/150x]])/(( k d/150 Abs[x])+a),{x,-65,65},{c,-85,-75},PlotPoints->15,ColorFunction->GrayLevel,ColorFunctionScaling->True];

(*interference pattern*)
fig4[a_,d_,k_]:=Plot[5 (a^2)(((Cos[ k d/150x]))^2)/(((( k d/100Abs[x]))^2)+15)-75,{x,-65,65},PlotStyle->{Blue,Thickness[0.005]}];

Manipulate[
k=2π/λ;
(*Dependence of the Intensity *)
Show[If[graph1,{fig1[θ,a,d,k],fig2[d,λ,graph2],fig3[a,d,k],fig4[a,d,k]},{fig1[θ,a,d,k],fig2[d,λ,graph2],fig3[a,d,k]}],PlotRange->{{-60,60},{-80,0}},Frame->None,AspectRatio->3/5,ImageSize->500],
Grid[{{
Item[Control[{{θ,3.14/3,"θ"},3 3.14/4,3.14/4,0.02,ImageSize->Medium,Appearance->"Labeled"}]
,Alignment->Right],
Item[Control[{{λ,8,"λ"},8,12,1,ImageSize->Medium,Appearance->"Labeled"}]
,Alignment->Right]},
{Item[Control[{{a,6,"A"},2,10,.01,ImageSize->Medium,Appearance->"Labeled"}]
,Alignment->Right],
Item[Control[{{d,15,"d"},10,20,ImageSize->Medium,Appearance->"Labeled"}]
,Alignment->Right]},
{Item[Control[{{graph1,True,"graph"},{True,False}}]],Item[Control[{{graph2,True,"circle"},{True,False}}]]}},Spacings->{4,0}],
ControlPlacement->Top,TrackedSymbols->True,SaveDefinitions->True]

CAPTION

This Demonstration shows the interference pattern produced by two light waves of the same wavelength diffracted through two narrow slits. You can adjust the wavelength of the light, the amplitude, and the distance between the slits. Changing the angle, you can see the phase displacement of the light waves and the formation of the maxima and minima of the light intensity.

THIS NOTEBOOK IS THE SOURCE CODE FROM

"Fraunhofer Diffraction (Double Slit)" from the Wolfram Demonstrations Project
 http://demonstrations.wolfram.com/FraunhoferDiffractionDoubleSlit/

Contributed by: Volodymyr Holovatsky (Chernivtsi National University, Ukraine)

After work by: Fernand Brunschwig, Hans-Joachim Domke

A full-function Wolfram Mathematica system (Version 6 or higher) is required to edit this notebook.
GET WOLFRAM MATHEMATICA »

© Wolfram Demonstrations Project & Contributors   |   Terms of Use   |   Make a new version of this Demonstration »