clear
clc
thetamax=pi/50;
while(1)
a=input('Enter slit width (in micro meter): ');
a=a*1e-6;
d=input('Enter slit seperation (in mm): ');
d=d*1e-3;
l=input('Enter wavelength (in nm): ');
l=l*1e-9;
s=input('Enter slit to screen distance (in m): ');
theta=-thetamax:1e-5:thetamax;
y=s*tan(theta);
alpha=pi*a*sin(theta)/l;
beta=pi*d*sin(theta)/l;
x1=cos(beta).^2;
x2=(sin(alpha)./alpha).^2;
x=x1.*x2;
plot(y,x,'b',y,x2,'--r');
title('Double slit diffraction Mahesha MG 2012');
xlabel('Distance in m');
ylabel('Intensity');
hold all;
ch= input('Press 1 to continue and 0 to exit: ');
if ch == 0
break;
end
end

Enter slit width (in micro meter): 30
Enter slit seperation (in mm): 0.15
Enter wavelength (in nm): 557
Enter slit to screen distance (in m): 0.5
Press 1 to continue and 0 to exit: 0

__OUTPUT__

__
__

The equations of term of alpha and beta shoud be divided by wavelength. Please, correct them.

ReplyDeletealpha=pi*a*sin(theta)/l; here l is wavelength. It is correct.

DeleteThank you Mahesha for your contribution. But I have juste a small question:how can I display (visualize) the frange pattern obtained in the focalization plane, which is not flat (like this presented here), but convex?

DeleteThank you Mahesha MG. I have a small question: what happen if the screen is not flat(plane) but convex?

ReplyDeletewhat if we need the graph to be plotted on inensity against pixels how should we change the program?

ReplyDelete