Wrong interference pattern (Double-Slit experiment)

14 visualizaciones (últimos 30 días)
Apostolis
Apostolis el 8 de Jun. de 2022
I want to simulate the double slit experiment. The width of each slit is 0.1 and the distance between them 10. My try at the code is the following (using Split Step Fourier Function)
clc; clear all; format long;
N=1024; L=100; x=(L/N)*(-N/2:N/2-1); dx=x(2)-x(1);
k=(2*pi/L)*[0:N/2-1 -N/2:-1];
z=linspace(-50,50,1);
w=10; uin=exp(-(x/w).^2).*exp(1i*k.*z); % initial condition
%figure(1); plot(x,abs(uin),'r');
a=1/10; d=10;
if (x>=0) & (x<=a)
po=zeros(1,N);
elseif (x>=10+a) & (x<=10+2*a)
po=zeros(1,N);
elseif (x>a) & (x<10+a)
po=10*ones(1,N);
else
po=ones(1,N);
end;
S=1000; zmax=20; h=zmax/S; z=0; count=0; dim=0; savestep=10; u0=uin;
for m=1:S
u1=ifft(fft(u0).*exp(-1i*0.5*h*k.^2)); % First step of SSF
u2=exp(1i*h*po).*u1; % Second step of SSF
u3=ifft(fft(u2).*exp(-1i*0.5*h*k.^2)); % Second step of SSF
u0=u3; z=z+h; count=count+1;
if (count==savestep)
dim=dim+1; field(dim,:)=u0; pot(dim,:)=po; z1(dim)=z; count=0;
end;
end;
[X,Z]=meshgrid(x,z1);
figure(2); surf(X,Z,abs(field)); shading interp; axis square; axis tight; view([0 90]);
As you can see, this is not what I should be getting. I think that po should be somewhat different, but I don't know how. Any help would be appreciated.

Respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Productos


Versión

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by