 (42S) X-Ray Spectrometric Calculations - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Software Libraries (/forum-10.html) +--- Forum: General Software Library (/forum-13.html) +--- Thread: (42S) X-Ray Spectrometric Calculations (/thread-15148.html) (42S) X-Ray Spectrometric Calculations - Eddie W. Shore - 06-06-2020 02:05 PM Introduction The program XRAY contains a menu of several calulations involving flat crystal spectronomers, which include: [ >EW ]: Energy wavelength conversion, where E * λ = 12.39852. E = energy and λ = wagelengtgh [ →N ]: Store n, where n is the nth crystal. You can calculate for any crystal and have any number of crystals for this program. [ANGLE]: Calculates the double diffraction angle, in degrees, of any crystal given n, E, and λ by using the Bragg Equation: θ = 2 * asin( (12.39852 * n) / (E * d) ) where d = the spacing of the crystal planes You will be prompted for E and d each time. [E KEV]: Uses the Bragg Equation to calculate energy (E), given n, d, and θ. You will be prompted for d and θ each time. [ENRGY]: Calculates the energy resolving power (δ) at an X-ray given its line energy (E), double refraction angle (θ), and angular divergence of the collimator (δ)). ENERGY = (E * 1000 * δ° * π / 180) / tan θ Enter δ in degrees. HP 42S/DM42/Free42 Program: XRAY This program is based on the HP 11C/HP 15C program as published by Török (see source) Code: ```00 { 241-Byte Prgm } 01▸LBL "XRAY" 02 DEG 03▸LBL 00 04 ">EW" 05 KEY 1 GTO 01 06 "→N" 07 KEY 2 GTO 02 08 "ANGLE" 09 KEY 3 GTO 03 10 "E KEV" 11 KEY 4 GTO 04 12 "ENRGY" 13 KEY 5 GTO 05 14 "EXIT" 15 KEY 6 GTO 06 16 MENU 17▸LBL 07 18 STOP 19 GTO 07 20▸LBL 01 21 EXITALL 22 1/X 23 12.39852 24 × 25 STOP 26 GTO 00 27▸LBL 02 28 EXITALL 29 STO 01 30 GTO 00 31▸LBL 03 32 EXITALL 33 12.39852 34 RCL× 01 35 "E?" 36 PROMPT 37 ÷ 38 "2d?" 39 PROMPT 40 ÷ 41 ASIN 42 2 43 × 44 "DBL ANGLE=" 45 AVIEW 46 STOP 47 GTO 00 48▸LBL 04 49 EXITALL 50 12.39852 51 RCL× 01 52 "2d?" 53 PROMPT 54 ÷ 55 "DBL ANGLE?" 56 PROMPT 57 2 58 ÷ 59 SIN 60 1/X 61 × 62 "E=" 63 AVIEW 64 STOP 65 GTO 00 66▸LBL 05 67 EXITALL 68 "DBL ANGLE?" 69 PROMPT 70 2 71 ÷ 72 TAN 73 1/X 74 "DELTA?" 75 PROMPT 76 →RAD 77 × 78 "E?" 79 PROMPT 80 × 81 1ᴇ3 82 × 83 "ENERGY=" 84 AVIEW 85 STOP 86 GTO 00 87▸LBL 06 88 CLMENU 89 EXITALL 90 .END.``` You can download this program here: https://drive.google.com/open?id=1k12l9Un9LgtrdC3139jS3SGYjNF30Qni Note N is stored in Register R01. Every other memory register can be used. Example For a two-crystal spectrometer with properties: Crystal 1 (n = 1): 6.285 Å (angstrom) (d) Crystal 2 (n = 2): 7.285 Å Angular divergence: 0.31° (δ) An M_α wave with wavelength 3.415 Å enters the system. Find the energy of this M_α wave and the double refraction angle for each crystal. Also was the energy-resolving power of each of the crystals. [ XEQ ] (XRAY) 3.415 ( >EN ) Result: E = 3.63061 keV (store this in R00) [STO] 00 1st Crystal [ R/S ] 1 ( →N ) (ANGL) "E?" [RCL] 00 [R/S] "2d?" 6.285 [R/S] Result: DBL ANGLE = 65.82494 (ENRGY) "DBL ANGLE?" [ R/S ] (since θ is still on the X stack) "DELTA?" 0.31 [STO] 02 [R/S] "E?" [RCL] 00 [R/S] Result: ENERGY= 30.34969 eV 2nd Crystal [ R/S ] 2 ( →N ) (ANGL) "E?" [RCL] 00 [R/S] "2d?" 7.285 [R/S] Result: DBL ANGLE = 139.28586 (ENRGY) "DBL ANGLE?" [ R/S ] (since θ is still on the X stack) "DELTA?" [RCL] 02 [R/S] "E?" [RCL] 00 [R/S] Result: ENERGY= 7.28859eV Source: Török, I. (1990), Line identification and other simple wavelength‐dispersive x‐ray spectrometric calculations using a pocket calculator. X‐Ray Spectrom., 19: 159-161. doi:10.1002/xrs.1300190314 Blog post: http://edspi31415.blogspot.com/2020/06/hp-42sdm42free42-x-ray-spectrometric.html