'This program calculates the differential scattering cross section for free 'electrons incident on a central potential in the Born approximation. 'The potential is a model potential for an atomic hydrogen target. 'The electron energy e is 500 eV and can easily be changed. 'This program outputs the cross section for angles between 0 and 180 'degrees in units of angstrom^2. CLS 'Here constants are declared. pi = 3.14159: hbarm = 7.62003: a0 = .529 'hbarm =(hbar^2)/m in units of eV*angstrom^2. rmax = 3: nr = 15000 'The constants rmax, and nr (even) may be changed to test the program. dr = rmax / nr DEF fnv (q, r) = 14.3998 * (1 / r + 1 / a0) * EXP(-2 * r / a0) * SIN(q * r) * r 'This routine calculates the energy-dependent variables. Here you 'can change the energy. e = 500 k2 = 2 * e / hbarm: k = SQR(k2) 'Here we open a file to store our cross section. a$ = "b" + RIGHT$(STR$(e), 3) + ".dat" OPEN a$ FOR OUTPUT AS #1 PRINT "angle", "sigma" PRINT #1, "angle", "sigma" 'Calculate the cross section for theta=0. 'numerical integration using Simpson's rule h = dr sum = 0 fac = 2 FOR i = 1 TO nr - 1 r = i * h IF fac = 2 THEN fac = 4 ELSE fac = 2 sum = sum + fac * 14.3998 * (1 / r + 1 / a0) * EXP(-2 * r / a0) * r ^ 2 NEXT i sum = sum + 14.3998 * (1 / rmax + 1 / a0) * EXP(-2 * rmax / a0) * rmax ^ 2 sum = sum * h / 3 cross = (2 * sum / hbarm) ^ 2 PRINT theta, cross PRINT #1, theta, cross 'Now calculate the cross section for the other angles. FOR theta = 5 TO 180 STEP 5 th = theta * pi / 180 q = 2 * k * SIN(th / 2) 'numerical integration using Simpson's rule h = dr sum = 0 fac = 2 FOR i = 1 TO nr - 1 r = i * h IF fac = 2 THEN fac = 4 ELSE fac = 2 sum = sum + fac * fnv(q, r) NEXT i sum = sum + fnv(q, rmax) sum = sum * h / 3 cross = (2 * sum / (q * hbarm)) ^ 2 PRINT theta, cross PRINT #1, theta, cross NEXT theta CLOSE