DECLARE SUB pager () REM ge copeland REM dept of physics REM old dominion university REM 2/14/2001 10 DIM w(50), f(50), in(50), eng(50) 20 PRINT CHR$(12); PRINT "Program Rydberg" 30 PRINT "This program calculates the wavelenths of hydrogenic" 40 PRINT "spectral lines for any combination of permitted quantum" 50 PRINT "numbers." 60 PRINT 70 PRINT "For an one electron moving in the field of" 80 PRINT "a nucleus with Z protons, the wavenumber of" 90 PRINT "a transition between a Bohr orbit is given by:" 100 PRINT 110 PRINT 120 PRINT , "w = Z^2 * R *[ 1/ l^2 - 1/ u^2 ]" 130 PRINT 140 PRINT "where:" 150 PRINT , "w = wavenumber (cm^-1) = 1/lambda" 160 PRINT , "Z = proton number" 170 PRINT , "R = the Rydberg constant" 180 PRINT , "which varies with nuclear mass.....reduced mass." 190 PRINT , "l = the lower quantum number" 200 PRINT , "u = the upper quantum number" 210 PRINT 220 CALL pager 230 PRINT "if l=1 Lyman series" 240 PRINT "if l=2 Balmer series" 250 PRINT "if l=3 Ritz-Paschen series" 260 PRINT "if l=4 Brackett series." 270 PRINT 280 PRINT "where both quantum numbers u and l are the principal" 290 PRINT "quantum number..called...n." 300 PRINT "The value of the Rydberg constant is 1.09737*10^7 m^-1." 310 PRINT 320 PRINT "How do you wish to plot the final spectrum? Using the scale by:" PRINT "1. Wavelength 2.wavenumber " 330 INPUT a1 340 a3 = a1 350 IF a3 <> INT(a3) THEN 320 360 IF a3 < 1 THEN 320 370 IF a3 > 2 THEN 320 380 PRINT 390 PRINT "Now select the value of the atomic number"; 400 INPUT z 410 IF z < 1 THEN 390 420 IF z > 92 THEN 390 430 IF z <> INT(z) THEN 390 440 PRINT 450 PRINT "Input the nuclear mass Hydrogen = 1"; 460 INPUT m 470 PRINT 480 PRINT "Input the lower quantum number"; 490 INPUT l 500 IF l <> INT(l) THEN 540 510 IF l < 1 THEN 540 520 IF l > 4 THEN 540 530 GOTO 560 540 PRINT "We will require n to be a positive interger less than 4!" 550 GOTO 480 560 REM 570 PRINT "" 580 CALL pager 590 PRINT 600 PRINT "This program will calculate an entire series of " 610 PRINT "spectral lines for a one-electron species." 620 PRINT "Output will be a file for use by the program WPLOT" PRINT "that displays the spectrum." 660 PRINT 670 PRINT "The intensity of spectral lines is not determined by the old" 680 PRINT "quantum theory.....so here they will be approximated by an" 690 PRINT "exponential function I l> = exp(-[e(u)-E ground]/kT)" 700 PRINT "where :" 710 PRINT , "k = Boltzmann's constant" 720 PRINT , "E = the energy of the upper state <0" 730 PRINT , "T = absolute temperature = fixed here as 30000 Kelvin." 740 PRINT , " i(u > l) = the intensity of the transition of u to l." 750 PRINT PRINT " Of course, the more correct answer is:" PRINT " I (u->l) = [E(u)-E(lower)] * A(u-l) *exp(-[e(u)-E ground]/kT) " PRINT " There are no easy ways to generate the Einstein A coefficients" PRINT " and so we just use the Boltzman factor. The frequency factor that" PRINT " is contained in the energy difference and the A transition probabilities" PRINT " are ignored." REM mks units 760 h = 6.6260735D-34 770 c = 299792458# 780 t = 30000! 790 k = 1.380658D-23 800 r = 10973731.534# REM reduced mass correction below 810 r = r * (m / (m + 1 / 1830)) qp = 1.60217733D-19 kt = k * t hc = h * c Eion = -hc * r * z ^ 2 PRINT "Ionization Potential is "; Eion / qp; " eV" 830 PRINT "Do you want to see the numerical output - NO or YES" 840 INPUT A2$ 850 IF A2$ = "NO" OR A2$ = "no" THEN 950 860 PRINT " Rydberg series for n(l)="; l; "and z="; z 870 PRINT 880 IF a1 = 1 THEN 900 890 IF a1 = 2 THEN 930 900 PRINT "upper wavelength intensity upper" 910 PRINT "u", " ", "relative", "u" 920 GOTO 950 930 PRINT "upper wavenumber intensity upper" 940 PRINT "u", " ", "relative", "u" 950 REM open the data file and write headers OPEN "plttek.dat" FOR OUTPUT AS #2 PRINT #2, 1 PRINT #2, 1 PRINT #2, 3 * (50 - l) IF a1 = 2 THEN PRINT #2, " Relative intensity" PRINT #2, "Wavenumber ---->" PRINT #2, "Rydberg series for n'' = "; l; " and z ="; z PRINT #2, " Temperature ="; t; "K" ELSE PRINT #2, "Relative Intensity" PRINT #2, "Wavelength ----->" PRINT #2, "Rydberg series for n lower ="; l; " & z ="; z PRINT #2, "Temp="; t; "K & mass ="; m; " amu 50-l lines" END IF nc = 0 REM Print "kt="; kt; "in ev"; kt / qp REM Print "nc; freq; de(nc); de(nc) / kt; exp(de/kt) in(nc)" FOR u = l + 1 TO 50 STEP 1 nc = nc + 1 eng(nc) = -hc * r * z * z * (1 / (l * l) - 1 / (u * u)) f(nc) = z * z * r * c * (1 / (l * l) - 1 / (u * u)) in(nc) = EXP(-(Eion - eng(nc)) / kt) REM Print nc; f(nc); eng(nc) / qp; de(nc) / kt; " "; exp(eng(nc) / kt); " "; in(nc) w(nc) = c / f(nc) REM print nc, w(nc) IF A2$ = "NO" OR A2$ = "no" THEN GOTO 1000 IF a1 = 1 THEN PRINT nc, w(nc) * 1E+10, in(nc), nc ELSE PRINT nc, (1 / w(nc)) * .01, in(nc), nc END IF 1000 IF a1 = 2 THEN PRINT #2, (1 / w(nc)) * .01, 0 PRINT #2, (1 / w(nc)) * .01, in(nc) PRINT #2, (1 / w(nc)) * .01, 0 ELSE PRINT #2, w(nc) * 1E+10, 0 PRINT #2, w(nc) * 1E+10, in(nc) PRINT #2, w(nc) * 1E+10, 0 END IF 1140 NEXT u CLOSE #2 PRINT "Now converting data file via TEK2WPLT." CHAIN "tek2wplt.exe" END SUB pager PRINT "To continue press Return"; INPUT t$ PRINT CHR$(12); END SUB