Warning: Trying to access array offset on value of type null in /home/site/wwwroot/lib/plugins/move/action/rename.php on line 42

Warning: Cannot modify header information - headers already sent by (output started at /home/site/wwwroot/lib/plugins/move/action/rename.php:42) in /home/site/wwwroot/inc/Action/Export.php on line 106

Warning: Cannot modify header information - headers already sent by (output started at /home/site/wwwroot/lib/plugins/move/action/rename.php:42) in /home/site/wwwroot/inc/Action/Export.php on line 106
atomic_weight

Table of Contents

Macro to generate Atomic Weight from Atomic Symbol

The macro in this page returns Atomic Weight based on Atomic Symbol.

Below atomic weight data were copied from the “Standard Atomic Weight” column in the “isotopes.txt” file in the TOPAS installation folder.

The atomic weight of some heavy atoms after No.109 are from www.periodictable.one

This macro has been tested working in v6 and v7.

The macro

Atomic_Number

macro AW {Atomic_Weight}
macro Atomic_Weight(Atom) {					
#if 
 (Atom == "H")	1.00794   	#elseif
 (Atom == "He")	4.002602  	#elseif
 (Atom == "Li")	6.941     	#elseif
 (Atom == "Be")	9.012182  	#elseif
 (Atom == "B")	10.811    	#elseif
 (Atom == "C")	12.0107   	#elseif
 (Atom == "N")	14.0067   	#elseif
 (Atom == "O")	15.9994   	#elseif
 (Atom == "F")	18.9984032	#elseif
 (Atom == "Ne")	20.1797   	#elseif
 (Atom == "Na")	22.989770 	#elseif
 (Atom == "Mg")	24.3050   	#elseif
 (Atom == "Al")	26.981538 	#elseif
 (Atom == "Si")	28.0855   	#elseif
 (Atom == "P")	30.973761 	#elseif
 (Atom == "S")	32.065    	#elseif
 (Atom == "Cl")	35.453    	#elseif
 (Atom == "Ar")	39.948    	#elseif
 (Atom == "K")	39.0983   	#elseif
 (Atom == "Ca")	40.078    	#elseif
 (Atom == "Sc")	44.955910 	#elseif
 (Atom == "Ti")	47.867    	#elseif
 (Atom == "V")	50.9415   	#elseif
 (Atom == "Cr")	51.9961   	#elseif
 (Atom == "Mn")	54.938049 	#elseif
 (Atom == "Fe")	55.845    	#elseif
 (Atom == "Co")	58.933200 	#elseif
 (Atom == "Ni")	58.6934   	#elseif
 (Atom == "Cu")	63.546    	#elseif
 (Atom == "Zn")	65.409    	#elseif
 (Atom == "Ga")	69.723    	#elseif
 (Atom == "Ge")	72.64     	#elseif
 (Atom == "As")	74.92160  	#elseif
 (Atom == "Se")	78.96     	#elseif
 (Atom == "Br")	79.904    	#elseif
 (Atom == "Kr")	83.798    	#elseif
 (Atom == "Rb")	85.4678   	#elseif
 (Atom == "Sr")	87.62     	#elseif
 (Atom == "Y")	88.90585  	#elseif
 (Atom == "Zr")	91.224    	#elseif
 (Atom == "Nb")	92.90638  	#elseif
 (Atom == "Mo")	95.94     	#elseif
 (Atom == "Tc")	98    		#elseif
 (Atom == "Ru")	101.07    	#elseif
 (Atom == "Rh")	102.90550 	#elseif
 (Atom == "Pd")	106.42    	#elseif
 (Atom == "Ag")	107.8682  	#elseif
 (Atom == "Cd")	112.411   	#elseif
 (Atom == "In")	114.818   	#elseif
 (Atom == "Sn")	118.710   	#elseif
 (Atom == "Sb")	121.760   	#elseif
 (Atom == "Te")	127.60    	#elseif
 (Atom == "I")	126.90447 	#elseif
 (Atom == "Xe")	131.293   	#elseif
 (Atom == "Cs")	132.90545 	#elseif
 (Atom == "Ba")	137.327   	#elseif
 (Atom == "La")	138.9055  	#elseif
 (Atom == "Ce")	140.116   	#elseif
 (Atom == "Pr")	140.90765 	#elseif
 (Atom == "Nd")	144.24    	#elseif
 (Atom == "Pm")	145    		#elseif
 (Atom == "Sm")	150.36    	#elseif
 (Atom == "Eu")	151.964   	#elseif
 (Atom == "Gd")	157.25    	#elseif
 (Atom == "Tb")	158.92534 	#elseif
 (Atom == "Dy")	162.500   	#elseif
 (Atom == "Ho")	164.93032 	#elseif
 (Atom == "Er")	167.259   	#elseif
 (Atom == "Tm")	168.93421 	#elseif
 (Atom == "Yb")	173.04    	#elseif
 (Atom == "Lu")	174.967   	#elseif
 (Atom == "Hf")	178.49    	#elseif
 (Atom == "Ta")	180.9479  	#elseif
 (Atom == "W")	183.84    	#elseif
 (Atom == "Re")	186.207    	#elseif
 (Atom == "Os")	190.23     	#elseif
 (Atom == "Ir")	192.217     	#elseif
 (Atom == "Pt")	195.078     	#elseif
 (Atom == "Au")	196.96655   	#elseif
 (Atom == "Hg")	200.59    	#elseif
 (Atom == "Tl")	204.3833    	#elseif
 (Atom == "Pb")	207.2    	#elseif
 (Atom == "Bi")	208.98038   	#elseif
 (Atom == "Po")	209   		#elseif
 (Atom == "At")	210   		#elseif
 (Atom == "Rn")	222   		#elseif
 (Atom == "Fr")	223   		#elseif
 (Atom == "Ra")	226   		#elseif
 (Atom == "Ac")	227   		#elseif
 (Atom == "Th")	232.0381    	#elseif
 (Atom == "Pa")	231.03588   	#elseif
 (Atom == "U")	238.02891   	#elseif
 (Atom == "Np")	237   		#elseif
 (Atom == "Pu")	244   		#elseif
 (Atom == "Am")	243   		#elseif
 (Atom == "Cm")	247   		#elseif
 (Atom == "Bk")	247   		#elseif
 (Atom == "Cf")	251   		#elseif
 (Atom == "Es")	252   		#elseif
 (Atom == "Fm")	257   		#elseif
 (Atom == "Md")	258   		#elseif
 (Atom == "No")	259   		#elseif
 (Atom == "Lr")	262   		#elseif
 (Atom == "Rf")	261   		#elseif
 (Atom == "Db")	262   		#elseif
 (Atom == "Sg")	266   		#elseif
 (Atom == "Bh")	264   		#elseif
 (Atom == "Hs")	277   		#elseif
 (Atom == "Mt")	268   		#elseif
 (Atom == "Ds")	281   		#elseif
 (Atom == "Rg")	272   		#elseif
 (Atom == "Cn")	285   		#elseif
 (Atom == "Nh")	286   		#elseif
 (Atom == "Fl")	289   		#elseif
 (Atom == "Mc")	289   		#elseif
 (Atom == "Lv")	293   		#elseif
 (Atom == "Ts")	294   		#elseif
 (Atom == "Og")	294   		#endif					
}				

Application Example: Generating Molecular Weight, and "cell_Z" the number of molecules in Unit Cell

This macro has been useful to me for checking “cell_Z” in pharmaceutical or organic crystals. For simplify, below application example is for an inorganic crystalline phase corundum.inp

RAW(corundum) 
 
   CuKa5(0.001)      
   Radius(173)
   LP_Factor(26.6)
   Full_Axial_Model(12, 15, 12, 4.6, 4.6)
   Slit_Width(0.3)
   Divergence(1)           
 
   Absorption(@, 26)
 
   ZE(@, 0.0)
 
   One_on_X(@, 0)
   bkg  @ 0 0 0 0 0 0
 
   STR(R_-3_C)
      phase_name "Corundum Al2O3"
      Trigonal(@ 4.7592, @ 12.992)
      site Al    x   0        y 0       z @ 0.35228  occ Al   1   beq @ 0.32 
      site O     x @ 0.3064   y 0       z   0.25     occ O    1   beq @ 0.33  
      scale @  0.0001
      CS_L(@, 100)
      Strain_L(@, 0.0100)
      view_structure
      r_bragg 0
      local mol_wgt = 2 * AW("Al") + 3 * AW("O");: 101.961276 'User types in this equation from the known molecular formula.
      local cell_Z = Round(Get(cell_mass)/mol_wgt);:6 ' The number of molecules in unit cell is automatically updated after refinement.

If any user in our open TOPAS community has suggestion or idea, or bug report on these macros, please kindly let me know and I am happy to learn from you: tony.wang@qut.edu.au