Interference and Diffraction

Initial Setup.

The screen is a distance L away, and is illuminated with laser light with λ .  Put all distances into millimeters for consistency and convenience.  Also, define a function θ[y] to relate the position 'y' on the screen to the angle θ of the light.  Lastly, we will look at a range of 'y' values on the screen running from -ymax to +ymax.

L = 2000;
λ = 550 * 10^(-6);
ymax = 100;  (* Needed for plots below *)

θ[y_] := ArcTan[y/L]

Single slit.

β[y_, a_] := 2 π a Sin[θ[y]]/λ
ss[y_, a_] := Piecewise[{{1, y == 0}}, (Sin[β[y, a]/2]/(β[y,a]/2))^2]

Also define a pair of convenience functions to make useful plots.  The first is an intensity plot such as is usually seen in the text; the second is a density plot intended to mimic what you actually see in lab.   In the DensityPlot, the very faint areas are hard to see.  Use the ColorFunction option to change the intensity mapping to bring out fainter details.

ssplot[a_] :=Plot[ss[y, a], {y, -ymax, ymax}, PlotRange->All,PlotLabel->StringForm["Single slit a = ``", a], ImageSize -> 520, AspectRatio ->1/3]
ssimg[a_] := DensityPlot[ss[y, a],{y,-ymax,ymax},{z,-1,1},PlotPoints->{400,10},ColorFunction->(GrayLevel[((#1)^(0.4`))]&),ImageSize->600,AspectRatio->1/6,Mesh->False]

Double slit.

ϕ[y_, d_] := 2 π d Sin[θ[y]]/λ
ds[y_, d_] := Cos[ϕ[y, d]/2]^2

dsplot[d_] :=Plot[ds[y, d], {y, -ymax, ymax}, PlotRange->All,PlotLabel->StringForm["Double slit d = ``", d], ImageSize -> 520, AspectRatio->1/3]
dsimg[d_] := DensityPlot[ds[y, d],{y,-ymax,ymax},{z,-1,1},PlotPoints->{800,10},ColorFunction->(GrayLevel[((#1)^(0.4`))]&),ImageSize->600,AspectRatio->1/6,Mesh->False]

Both:  Double slits of finite width.

dsfw[y_, a_, d_] := ss[y, a] * ds[y, d]

dsfwplot[a_, d_] :=Plot[dsfw[y, a, d], {y, -ymax, ymax}, PlotRange->All,PlotLabel->StringForm["Double slit a = ``, d = ``", a, d], ImageSize->520, AspectRatio->1/3]
dsfwimg[a_, d_] := DensityPlot[dsfw[y, a, d],{y,-ymax,ymax},{z,-1,1},PlotPoints->{400,10},ColorFunction->(GrayLevel[((#1)^(0.4`))]&),ImageSize->600,AspectRatio->1/6,Mesh->False]

Here is a graph that shows all three intensity plots working together to get the final result.

threeplot[a_, d_] :=Plot[{ss[y, a], ds[y, d],dsfw[y, a, d]}, {y, -ymax, ymax}, PlotRange->All,PlotLabel->StringForm["Double slit a = ``, d = ``", a, d], ImageSize->520, AspectRatio->1/3, PlotStyle->{Blue, Green, Black}, PlotPoints->400]

Single Slit graph and image

Manipulate[GraphicsColumn[{ssplot[a],ssimg[a]}], {{a, 0.03}, 0.01, 0.05, Appearance->"Open"}]

Ideal Double Slit graph and image

Manipulate[GraphicsColumn[{dsplot[d],dsimg[d]}], {{d,0.10}, 0.06, 0.16, Appearance->"Open"}]

Double Slit of Finite Width graph and image

GraphicsColumn[{ssimg[0.025], dsfwimg[0.025, 0.125]}]

Manipulate[threeplot[a, d], {a, 0.01, 0.08, Appearance->"Open"}, {d, 0.1, 0.5, Appearance->"Open"}]

Manipulate[GraphicsColumn[{dsfwplot[a, d],dsfwimg[a, d]}], {a, 0.01, 0.08, Appearance->"Open"}, {d, 0.06, 0.16, Appearance->"Open"}]

Make images for exporting

intdiffa = dsfwimg[0.035, 6*0.035]

(* Export["intdiffa.eps",intdiffa] *)

Now, change the slit width to 0.024 mm and the slit spacing to 0.096 mm.

intdiffb = dsfwimg[0.024, 0.096]

(* Export["intdiffb.eps",intdiffb]; *)

both = GraphicsColumn[{intdiffa, intdiffb}]

(* Export["bothimages.eps", both] *)