File:Diffraction single slit.gif

Summary

Description
English: Diffraction from a slit as a function of the slit width.
Date
Source https://twitter.com/j_bertolotti/status/1236942357271998465
Author Jacopo Bertolotti
Permission
(Reusing this file)
https://twitter.com/j_bertolotti/status/1030470604418428929

Mathematica 12.0 code

p =.
\[Lambda] = 1;
k0 = (2 \[Pi])/\[Lambda];
U0 = HeavisidePi[x/p];
fU = InverseFourierTransform[U0, x, k];

p0 = Table[
   krange = 60 k0;
   \[Delta]k = 0.01 k0;
   zmax = 50;
   dU = Table[
     dfU = Table[fU E^(I Sqrt[k0^2 - k^2] z), {k, -krange, krange, \[Delta]k}];
     dim = Dimensions[dfU][[1]];
     RotateRight[Fourier[dfU], {Ceiling[dim/2]}]
     , {z, 0.001, zmax, \[Lambda]}];
   ListDensityPlot[Abs[dU[[All, 1 ;; -1 ;; 100]]], PlotRange -> All, ColorFunction -> "SunsetColors", DataRange -> {{-(k0/(2 \[Delta]k)), k0/(2 \[Delta]k)}, {0, zmax}}, LabelStyle -> {Black, Bold}, FrameLabel -> {"x/\[Lambda]", "z/\[Lambda]"}, PlotLabel -> "|E|"]
   , {p, 1, 50, 1}];
ListAnimate[p0]

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication.
The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.

Category:CC-Zero#Diffraction%20single%20slit.gifCategory:Self-published work
Category:Animations of optics Category:Animations of diffraction Category:Slit Category:Images with Mathematica source code Category:Animated GIF files
Category:Animated GIF files Category:Animations of diffraction Category:Animations of optics Category:CC-Zero Category:Images with Mathematica source code Category:Pages using deprecated source tags Category:Self-published work Category:Slit