DECLARE SUB Pager () PRINT CHR$(12); REM pi = 4! * ATN(1!) REM REM ge copeland REM dept of physics REM old dominion university REM norfolk va 23529 REM - revised 3/2001 REM 30 PRINT " N Slit Diffraction " 40 PRINT 60 PRINT 70 PRINT "The intensity of light as a function of position, y, measured" 80 PRINT "along a screen from the center of the diffraction pattern" 90 PRINT "is given by" 100 PRINT 110 PRINT , "I(y)= I0 * sin ^2(b) * sin ^2 ( n * alpha)" 120 PRINT , " --------- ---------------" 130 PRINT , " b^2 n^2 sin^2 (alpha)" 140 PRINT 150 PRINT "where:" 160 PRINT , " b = pi * a * y / ( wavelength * l)" 170 PRINT , "and pi = 3.14159" 180 PRINT , " a = slit width (m)" 190 PRINT , " y = distance from maximum (M)" 195 PRINT , " f = focal length of a postive the lens." 200 PRINT , "alpha = pi*d /(wavelength *f)" 210 PRINT , " d = separation of the center of the slits." 220 PRINT "and n = number of slits." CALL Pager 230 PRINT "Input the separation between slits "; 240 INPUT d dmm = d * .001 250 PRINT 260 PRINT "Input the number of slits"; 270 INPUT n 280 PRINT "Select the focal length of the positive lens(m) < 1m"; 290 INPUT l 300 IF l <= 0 THEN 280 310 IF l < 1! THEN 340 320 PRINT "Best to select a focal length less than one meter" 330 GOTO 280 340 PRINT "Select the slit width between 1 u and 1 mm"; 350 INPUT a amm = a 360 IF a < 1 THEN 390 370 PRINT "Best to keep slit diameter between one micron and one millameter" 380 GOTO 340 390 IF a < .0001 THEN 370 400 PRINT 410 PRINT "We will consider optical wavelengths only!" 420 PRINT "Input the wavelength in nanometers" 421 PRINT "Let's keep wavelength between 400 and 700 nm." 430 INPUT w 440 IF w < 400 THEN 400 450 IF w > 700 THEN 400 460 p1 = 4! * ATN(1!) REM make stuff in MKS system a = a * .001 w = w * 1E-09 490 PRINT 500 PRINT "You have selected a lens of focal length "; l; " meters" 510 PRINT "and a slit of width "; a; "meters at a wavelength" 520 PRINT "of "; w * 1E+09; "nm and "; n; " slits separated by "; d1; " meters." 530 PRINT 540 PRINT "Are these the input parameters you wish to use "; 550 INPUT a1$ 560 IF a1$ = "NO" OR a1$ = "no" OR a1$ = "No" THEN 230 562 IF a1$ = "yes" OR a1$ = "YES" OR a1$ = "Yes" THEN 570 564 GOTO 490 570 REM calculations REM ys= ystart is found and we evaluate yeval from -ys to +ys REM Then write out the Values of Intensity(i) vs y(i) 680 DIM Intensity(601), y(601) REM set ys=position of the second min of the diffraction pattern ys = 2! * w * l / a yinc = 2 * ys / 500 I = 0 FOR yup = -ys TO ys STEP yinc I = I + 1 b = pi * a * yup / (w * l) alpha = pi * d * yup / (w * l) top = SIN(b) ^ 2 * SIN(n * alpha) ^ 2 bot = b * b * (n * SIN(alpha)) ^ 2 Intensity(I) = top / bot y(I) = yup NEXT yup 960 REM calculations completed 1400 REM tektronix output here write labels and the data in plttek.dat 1410 OPEN "plttek.dat" FOR OUTPUT AS #3 1412 PRINT #3, 1 1414 PRINT #3, 1 1420 PRINT #3, I 1430 PRINT #3, " Relative Intensity" 1440 PRINT #3, "Position <"; s0; " meters>" 1450 PRINT #3, n; "slits a="; amm; "mm d ="; dmm; "mm wave = "; w * 1E+09; " nm" 1455 PRINT #3, "Fraunhofer Diffraction" 1460 FOR j = 1 TO I 1470 PRINT #3, y(j), Intensity(j) 1480 NEXT j CLOSE #3 1485 PRINT "Now do the plot using WPLOT in windows." CHAIN "tek2wplt.bas" 1490 STOP 1500 END SUB Pager PRINT " Push RETURN to Continue"; INPUT DUN$ PRINT CHR$(12); END SUB