DECLARE SUB PAGER () REM REM REM GE Copeland REM Department of Physics REM Old Dominion University REM Norfolk VA 23504 REM pi = 4 * ATN(1) h = 6.626176E-34 K = 1.380662E-23 c = 299792458# PRINT CHR$(12); 200 PRINT "BLACK BODY SPECTRUM" 210 PRINT 220 PRINT " This program enables the student to calculate the black" 230 PRINT "body spectrum of an object at a given temperature." 240 PRINT "Do you wish to go directly to calculations?(Yes or No)"; 242 INPUT ANS$ 244 IF ANS$ = "Yes" OR ANS$ = "YES" OR ANS$ = "yes" THEN 1210 246 IF ANS$ = "No" OR ANS$ = "NO" OR ANS$ = "no" THEN 250 ELSE 240 250 PRINT " The level of this program is about the 2nd year physics" PRINT "level. " 300 PRINT 310 PRINT "In 1900, Max Planck was able to solve a problem that had stumped" 320 PRINT "all of greatest scientists of the 19th century. The problem was" 330 PRINT "how to calculate the spectrum of a body at a non-zero temperature." 340 PRINT "A BLACK body is defined as one that absorbs all radiation incident" 350 PRINT "upon it. Of course, no real object is a real back body, but many" 355 PRINT "can emit or absorb in a fashion almost identical to a black body." 360 PRINT 370 PRINT " The spectrum of an object can be characterized using either the" 380 PRINT "intensity as a function of frequency, I=I(f), or as a function of" 390 PRINT "wavelength,l, I=I(l). We use l instead of lambda." 400 CALL PAGER 410 PRINT " Both Rayleigh & Jeans had worked on the thermal radiation problem" 420 PRINT "and had devised a means to get the spectrum on the red side of the" 430 PRINT "single peak observed in the continuum spectra of hot bodies. But" 440 PRINT "when their formula was applied on the blue side of the peak, it" 450 PRINT "predicted an infinite amount of energy is radiated in the UV." 460 PRINT "This ultraviolet catastrophy was the great puzzle that Planck was" 470 PRINT "able to solve. His solution involved a radical step:" 480 PRINT , "THE QUANTIZATION OF ENERGY." 490 PRINT " A close approximation to a black body consists of a small hole in a" 500 PRINT "large enclosure, a cavity. Thus, black body radiation is many times" 510 PRINT "called CAVITY radiation. Thermal agitation of electrons in the" 520 PRINT "walls of the cavity causes the emission of E&M waves via " 530 PRINT "the laws of E+M. The thermal agitation may be considered to be a " 540 PRINT "SUPERPOSITION of simple harmonic oscillators of many frequencies." 550 PRINT "Since the observed spectrum is a continuous distribution, we assume" 560 PRINT "that the electrons have a continuous range of possible frequencies." 570 PRINT "The electrons in the walls of the cavity may also absorb the waves" 580 PRINT "they emit. Thus a standing wave pattern is set up inside the cavity." 590 PRINT "Since the cavity is much larger than the wavelengths of the waves," 600 PRINT "the frequencies that the cavity supports are very close together," 610 PRINT "the spectrum will appear continous." 620 CALL PAGER 630 PRINT "Let u(f) be the energy density of the standing waves inside the" 640 PRINT "cavity at an absolute temperature of T. (f= frequency in Hz)." 650 PRINT " Wien showed from a thermodynamic analysis that u(f) must have the" 660 PRINT "form of:" 670 PRINT , "u(f) = f^3 F(f/T)" 680 PRINT "where F is any differentiable function that depends upon the RATIO" 690 PRINT "of f/T only!" 700 PRINT "This is clearly correct. Next Lord Rayleigh and Sir James Jeans" 710 PRINT "attemped separately to determine the form of the function F(f/T)." 720 PRINT "They used the principle of equipartition of energy and applied it" 730 PRINT "to the standing waves in the cavity. Roughly stated it says:" 740 PRINT 750 PRINT , " For a system in thermal equilibrium, " 760 PRINT , "the average energy for each degree of freedom is" 770 PRINT , " equal to kT/2. Where k is Boltzmann"; s; constant.; "" 780 PRINT " Each mode in the cavity has 2 degrees of freedom (polarizations)" 790 PRINT "and they showed correctly that the number of modes whose frequency" 800 PRINT "is less than f in a cavity of volumne V, is:" 810 PRINT , "8 Pi V f^3" 820 PRINT , "-----------" 830 PRINT , " 3 c^3" 840 PRINT "where c is the speed of light." 850 CALL PAGER 860 PRINT "The energy in the range from f to f+df is just the differential of" 870 PRINT "the above quantity *(kT)." 880 PRINT "and the energy per unit volume is :" 890 PRINT , " u(f) df = 8 pi f^2 (kT) df" 900 PRINT , " ----------" 910 PRINT , " c^3" 920 PRINT " This is the required form!!!!!!" 930 CALL PAGER 940 PRINT " Unfortunately, this result is NOT correct as Jeans and Rayleigh " 950 PRINT "knew. What is wrong???? The assumption of continuous energy of the" 960 PRINT "electrons." 970 PRINT " Planck solved this problem in detail and published his result." 980 PRINT "Few people appreciated the work and the result. However, Albert" 990 PRINT "Einstein read the paper and took the Quantization of energy idea to" 1000 PRINT "explain the photoelectric effect. Both men received Nobel Prizes" 1010 PRINT "for their work. Planck at first fitted the observed spectrum to a" 1020 PRINT "empirical formula known as the Planck distribution formula" 1030 PRINT " 8 Pi f ^2 hf" 1040 PRINT "u(f) = -------- *[ ------------]" 1050 PRINT " c^3 exp( hf/kT) -1" 1070 CALL PAGER 1080 PRINT " The INTENSITY of the spectrum has units of energy crossing a" 1090 PRINT "unit area in a unit of time. In the MKS system intensity is thus" 1100 PRINT "in Watts/m^2. Intensity in terms of frequency is called I(f)." 1110 PRINT "It is given by I(f) = c u(f)/4." 1120 PRINT "The total spectrum integrated over all frequencies from 0 to 00" 1130 PRINT "is the radiated power per unit area of the source. This was" 1140 PRINT "known to be proportional to the FOURTH POWER " 1150 PRINT "of the absolute temperature before Placnck derived it." 1160 PRINT "The result is known as the Stefan-Boltzmann law. " 1170 PRINT "Power emitted per unit area = const * T ^4" 1180 PRINT "Planck integrated I(f) over all frequencies and determined the" 1190 PRINT "correct value of the Stefan constant, the value of the" 1200 PRINT "Planck constant, and the value of the charge on the electron!" 1210 REM 1220 PRINT "WAVELENGTH SCALE" 1230 PRINT "Input the temperature in Kelvin" 1232 INPUT T 1240 IF T < 0 THEN GOTO 1230 ELSE 1250 1250 REM 1291 Lmax = .0028978 / T 1295 PRINT "The maximum of the spectrum in wavelength occurs at a" 1296 PRINT "wavelength of "; Lmax; " meters = "; Lmax * 1000000!; "microns." 1300 PRINT 1305 c1 = 2! * c ^ 2 * h c2 = h * c / (K) STEFAN = 5.67E-08 1320 PRINT "The integral of the intensity I(w) over all wavelengths yields" 1325 PRINT "the radiated POWER per UNIT area of the blackbody. Planck" 1330 PRINT "derived this quantity and compared it with the STEFAN-" 1340 PRINT "BOLTZMANN LAW. For the temperature you have selected, the" 1342 Power = STEFAN * (T ^ 4) 1345 PRINT "radiated power is = "; Power; " Watts/m^2." 1400 PRINT " The spectra as a function of frequency will now be calculated" 1410 PRINT "for a frequency range that covers 10 decades in wavelength." 1415 REM lcen = INT(LOG(Lmax) / LOG(10)) REM PRINT "Lcen="; lcen 1500 REM ^^^^^^^ 1510 DIM i(250), w(250), wave(250) 1520 DIM dF(19) 1530 DATA 1.,1.5,2.,2.5,3.,3.5,4.,4.5,5.,5.5,6.0,6.5,7.0,7.5,8.,8.5,9.,9.5 1535 FOR i = 1 TO 18 READ dF(i) NEXT i 1537 n = 0 1540 FOR J = lcen - 6 TO lcen + 5 1550 FOR i = 1 TO 18 1555 n = n + 1 1556 w(n) = dF(i) * 10 ^ (J) 1560 NEXT i REM PRINT n, w(n) 1562 NEXT J 1570 REM FINISHED wavelengths c1 = 1.1904397D-16 c2 = 1.438769E-02 REM PRINT "c1,c2"; c1, c2 REM OPEN "errors.dat" FOR OUTPUT AS #3 nreal = 0 1600 FOR i = 1 TO n IF c2 / (T * w(i)) = 0 THEN REM PRINT #3, "c2/(T*w(i)) =0 error when i=", i GOTO 1620 END IF IF c2 / (T * w(i)) > 88 THEN REM PRINT #3, " c2/(T*w(i))>88 when w=", w(i) GOTO 1620 END IF nreal = nreal + 1 1610 i(nreal) = c1 / w(i) ^ 2 1611 i(nreal) = i(nreal) / (EXP(c2 / (T * w(i))) - 1!) 1612 i(nreal) = i(nreal) * w(i) ^ -3 IF i(nreal) = 0 THEN nreal = nreal - 1 GOTO 1620 END IF wave(nreal) = w(i) REM PRINT #3, "exp ="; EXP(c2 / (T * w(i))) REM PRINT #3, "ok"; i; " & w and i"; wave(nreal), i(nreal) REM if (i) = 0 THEN GOTO 1620 1620 NEXT i 1621 REM nreal = nreal - 1 1625 REM PRINT #3, "at end of loop Nreal = "; nreal 1630 REM OUTPUT REM CLOSE #3 REM PRINT "Closed #3"; 1632 PRINT "Plot the data"; INPUT PLOT$ 1635 IF PLOT$ = "Yes" OR PLOT$ = "YES" OR PLOT$ = "yes" THEN 1800 1636 IF PLOT$ = "No" OR PLOT$ = "NO" OR PLOT$ = "no" THEN STOP ELSE 1632 1800 REM GRAPHICS 1802 OPEN "PLTTEK.DAT" FOR OUTPUT AS #2 1804 PRINT #2, 1 1806 PRINT #2, 1 1808 PRINT #2, nreal 1810 PRINT #2, " INTENSITY [W/m^2]" PRINT #2, "Wavelength (m)" 1830 PRINT #2, "Blackbody spectrum T = "; T; " K" PRINT #2, "Wavelength of max Inten ="; Lmax; " m Power/area ="; Power; " w/m^2" 1845 FOR i = 1 TO nreal PRINT #2, wave(i), i(i) 1860 NEXT i CLOSE #2 1865 PRINT "NOW say run TEK2WPLOT to convert the data file. Then go to WPLOT." 1867 PRINT "See _The Observation and analysis of stellar photospheres_ by David Gray" CHAIN "tek2wplt.exe" 2050 END 2000 SUB PAGER 2010 PRINT , "Push RETURN to continue:"; 2020 INPUT DUM$ 2030 PRINT CHR$(12); END SUB