New in Wolfram Mathematica 7: Enhanced Fourier Analysis  previous | next 
Compute a Laser Diffraction Pattern
Compute the diffraction pattern for light through convolution and visualize it at different distances from the source.
In[1]:=

Click for copyable input
\[Lambda] = 6328/10^6;
In[2]:=

Click for copyable input
source[y_] := UnitBox[y]
In[3]:=

Click for copyable input
kernel[y_, t_] := 

 Exp[-I \[Pi]/4] Exp[I \[Pi] y^2/(\[Lambda] t)]/Sqrt[\[Lambda] t]
In[4]:=

Click for copyable input
u[x_, t_] = 

 Piecewise[{{Convolve[source[y], kernel[y, t], y, x, 

     Assumptions -> t > 0], t > 0}}, source[x]]
Out[4]=

In[5]:=

Click for copyable input
GraphicsGrid[

 Partition[

  Table[Plot[Abs[u[x, \[Mu]/\[Lambda]]]^2, {x, -2, 2}, 

    AxesOrigin -> {0, 0}, Ticks -> {Automatic, {2}}, Filling -> Axis, 

    AspectRatio -> 1/4, 

    PlotRange -> {All, {0, 2}}], {\[Mu], {0, 2^-6, 2^-5, 2^-4, 2^-3, 

     2^-2, 2^-1, 1}}], 2], AspectRatio -> 1.2]
Out[5]=