Hello everyone,
I tried to apply Martin Fisch's K factor macros on CPD-3 data but have some problems; could you please help me to fix it? where did I go wrong? how should we enter the XRF results?
Thank you very much!
Kind regards,
Eric
here is my INP file:
o_errors
 
'--------------------------------------------------------'
' K Factor calculation from external standard starts here
' OConnor & Raven, Powder Diffraction 3(1) (1988) 2-6
'--------------------------------------------------------'
 
xdd "C:\TOPAS5\Tutorial\Quantitative phase analysis\External Standard Method\CORUNDUM.RAW" 'XRD Pattern of external standard'
'rebin_with_dx_of 0.02
 
r_wp  0 r_exp  0 r_p  0 gof  0
 
bkg @  0 0 0 0 0 0
Specimen_Displacement(SD_Corundum, 0)
 
start_X 20
 
str 'Többens, D.M. et al., Mat. Sci. Forum 378 (2001) 288-293'
phase_name "Corundum"
a a_Corundum  4.76 min 4.74 max 4.78 
b = Get(a);
c c_Corundum  12.99 min 12.9 max 13.1
ga 120
space_group 167
site Al1 x =0;    y =0; z 0.3522 occ AL+3 1 beq 0.30
site O1  x 0.6937 y =0; z =1/4;  occ O-2  1 beq 0.33
 
scale Scale_Corundum  0.00001
 
CS_L(CSL_Corundum, 400 min 50 max 5000)
Strain_L(StrainL_Corundum, 0.01 min 0.001 max 1)
 
cell_volume Volume_Corundum  0
cell_mass Mass_Corundum  0
phase_MAC MAC_Corundum  0
weight_percent WP_Corundum 0
 
prm !Crystallinity_Corundum 98
 
prm Corundum_Lac = Get(mixture_MAC) Get(mixture_density_g_on_cm3);: 0
 
'Calculation of K-Factor from external standard'
prm !KFactor = Scale_Corundum * ( 1.660538921 * (Mass_Corundum/Volume_Corundum) ) * Volume_Corundum2 * MAC_Corundum  / (Crystallinity_Corundum) ;: 0
 
'Macro for wt.-% from scale, MAC, cell volume and KFactor'
macro wt_percent_K_MAC(result) { prm = ( ( Get(scale) * ( 1.660538921 * (Get(cell_mass)/Get(cell_volume)) ) * (Get(cell_volume))2) * MAC_Sample ) / KFactor ;: result }
 
'Dummy phases are used for energy dependent oxide MAC calculation'
macro d_str { dummy_str space_group P1 scale 0 a 1 b 1 c 1 site }
d_str Si occ Si+4 = 1; site O  occ O-2  = 2; prm MAC_SiO2    = Get(phase_MAC); :  35.81264
d_str Al occ Al+3 = 2; site O  occ O-2  = 3; prm MAC_Al2O3   = Get(phase_MAC); :  31.59020
d_str Fe occ Fe+3 = 2; site O  occ O-2  = 3; prm MAC_Fe2O3   = Get(phase_MAC); :  214.26272
d_str Ca occ Ca+2 = 1; site O  occ O-2  = 1; prm MAC_CaO     = Get(phase_MAC); :  124.46608
d_str Zn occ Zn+2 = 1; site O  occ O-2  = 1; prm MAC_ZnO     = Get(phase_MAC); :  48.611
d_str F  occ F-1  = 2; site Ca occ Ca+2 = 1; prm MAC_CaF2    = Get(phase_MAC); :  94.718
d_str Mg occ Mg+2 = 1; site O  occ O-2  = 1; prm MAC_MgO     = Get(phase_MAC); :  28.61699
d_str S  occ S    = 1; site O  occ O-2  = 3; prm MAC_SO3     = Get(phase_MAC); :  44.15801
d_str K  occ K+1  = 2; site O  occ O-2  = 1; prm MAC_K2O     = Get(phase_MAC); :  122.06126
d_str Na occ Na+1 = 2; site O  occ O-2  = 1; prm MAC_Na2O    = Get(phase_MAC); :  24.93736
d_str Ti occ Ti+4 = 1; site O  occ O-2  = 2; prm MAC_TiO2    = Get(phase_MAC); :  124.23941
d_str Sr occ Sr+2 = 1; site O  occ O-2  = 1; prm MAC_SrO     = Get(phase_MAC); :  97.04589
d_str P  occ P    = 2; site O  occ O-2  = 5; prm MAC_P2O5    = Get(phase_MAC); :  39.33911
d_str Mn occ Mn+3 = 2; site O  occ O-2  = 3; prm MAC_Mn2O3   = Get(phase_MAC); :  191.01235
d_str Cr occ Cr+3 = 2; site O  occ O-2  = 3; prm MAC_Cr2O3   = Get(phase_MAC); :  172.14416
d_str C  occ C    = 1; site B  occ O-2  = 2; prm MAC_LOI_CO2 = Get(phase_MAC); :  9.57292
d_str H  occ H    = 2; site O  occ O-2  = 1; prm MAC_LOI_H2O = Get(phase_MAC); :  10.23680
d_str La occ La+3 = 1; site B  occ B    = 6; prm MAC_LaB6    = Get(phase_MAC); :  237.33852
d_str Zr occ Zr+4 = 1; site Si occ Si+4 = 1; site O occ O-2  = 4; prm MAC_ZrSiO4 = Get(phase_MAC); :  83.19554
 
'-----------------------------------------------------------------------------'
' Part for phase quantification in sample using external standard starts here'
'-----------------------------------------------------------------------------'
 
xdd "C:\TOPAS5\Tutorial\Quantitative phase analysis\External Standard Method\CPD-3.raw" 'XRD Pattern of sample'
'rebin_with_dx_of 0.02
 
r_wp  0 r_exp  0 r_p  0 gof  0
 
bkg @ 0 0 0 0 0 0
Specimen_Displacement(@, 0)
 
'XRF wt.-% data of sample (change prm_with_error to prm for version 5)'
prm !SiO2     27.77_0
prm !Al2O3    31.78_0
prm !Fe2O3    0_0
prm !CaO      0_0
prm !ZnO      20.10_0
prm !CaF2     20.35_0
prm !MgO      0_0
prm !SO3      0_0
prm !K2O      0_0
prm !Na2O     0_0
prm !TiO2     0_0
prm !SrO      0_0
prm !P2O5     0_0
prm !Mn2O3    0_0
prm !Cr2O3    0_0
prm !ZrSiO4   0_0
prm !LaB6     0_0
prm !LOI_CO2  0_0 'Loss on ignition'
prm !LOI_H2O  0_0 'Loss on ignition'
 
'MAC calculation from XRF data'
prm !MAC_Sample = 
SiO20.01MAC_SiO2 + Al2O30.01MAC_Al2O3 + CaF20.01MAC_CaF2 +
Fe2O30.01MAC_Fe2O3 + CaO0.01MAC_CaO + ZnO0.01MAC_ZnO +
MgO0.01MAC_MgO + SO30.01MAC_SO3 + K2O0.01MAC_K2O + 
Na2O0.01MAC_Na2O + TiO20.01MAC_TiO2 + SrO0.01MAC_SrO + 
P2O50.01MAC_P2O5 + Mn2O30.01MAC_Mn2O3 + Cr2O30.01MAC_Cr2O3 + 
ZrSiO40.01MAC_ZrSiO4 + LaB60.01MAC_LaB6 + LOI_CO20.01MAC_LOI_CO2 + 
LOI_H2O0.01MAC_LOI_H2O;: 0
 
str 
		LVol_FWHM_CS_G_L( 1, 0, 0.89, 0,,,@, 1000)
		e0_from_Strain( 0,,,@, 0.1)
		r_bragg  0
		phase_MAC 0
		phase_name "Fluorite"
		MVW( 0, 0, 0)
		corrected_weight_percent  0
		space_group F_M_-3_M
		scale @ 0.0001
		K_Factor_WP( 0)
		Phase_LAC_1_on_cm( 0)
		Phase_Density_g_on_cm3( 0)
		Cubic(@ 5.46379)
		site Ca num_posns 0 x  0 y  0 z  0 occ Ca  1 beq  0.4856
		site F num_posns 0 x  0.25 y  0.25 z  0.25 occ F  1 beq  0.72
		Preferred_Orientation(@, 1_LIMIT_MAX_1 min =0; max =1;,, 1 1 1)
	str 
		LVol_FWHM_CS_G_L( 1, 0, 0.89, 0,,,@, 1000)
		e0_from_Strain( 0,,,@, 0.1_LIMIT_MIN_0.0001)
		r_bragg  0
		phase_MAC 0
		phase_name "Zincite"
		MVW( 0, 0, 0)
		corrected_weight_percent  0
		space_group P_63_M_C
		scale @ 0.0001
		K_Factor_WP( 0)
		Phase_LAC_1_on_cm( 0)
		Phase_Density_g_on_cm3( 0)
		Hexagonal(@ 3.24974,@ 5.2066)
		site Zn num_posns 0 x =1/3; :  0.3333333333 y =2/3; :  0.6666666667 z  0.00357 occ Zn+2  1 beq  0.5728
		site O num_posns 0 x =1/3; :  0.3333333333 y =2/3; :  0.6666666667 z  0.37903 occ O-2  1 beq  0.5257
		Preferred_Orientation(@, 1_LIMIT_MAX_1 min =0; max =1;,, 0 1 0)
	xo_Is 
		LVol_FWHM_CS_G_L( 1, 0, 0.89, 0,,,@, 200)
		xo @ 22.16326531
		peak_type pv
			pv_lor @ 0.5_LIMIT_MAX_1
			pv_fwhm @ 1
		I @ 24
 		wt_percent_K_MAC( 0) 'This macro reports phase amounts using the K-factor method'
 
 
for xdds { 'Instrument description for both XDDs'
	lam ymin_on_ymax 0.0001
	Lam_recs
	{ 0.0159  1.534753  3.6854
	  0.5691  1.540596  0.4370
	  0.0762  1.541058  0.6000
	  0.2517  1.544410  0.5200
	  0.0871  1.544721  0.6200 }
	LP_Factor(26.6)
	Rp 173
	Rs 173
	Slit_Width(0.3)
	Divergence (1)
	axial_conv
	  filament_length 12
	  sample_length 15
	  receiving_slit_length 12
	  primary_soller_angle 4.6
	  secondary_soller_angle 4.6 }