Author Topic: Bastin PROZA Matrix Corrections  (Read 8049 times)

Probeman

  • Emeritus
  • *****
  • Posts: 2860
  • Never sleeps...
    • John Donovan
Bastin PROZA Matrix Corrections
« on: February 04, 2016, 09:18:49 AM »
I've always suspected that something was not quite right with the CalcZAF implementation of Bastin's PROZA matrix correction and this week Brian Joy discovered the typos (apparently) that were causing the problem.

Here is an error distribution using the Bastin PROZA correction in CalcZAF on Bastin's k-ratio database:



and after Brian's tweaks, here is the new error distribution:



I'd say that is an improvement!   I suggest that everyone should download the latest CalcZAF (or Probe for EPMA) msi installer, v. 11.2.8, to get this update.
The only stupid question is the one not asked!

Brian Joy

  • Professor
  • ****
  • Posts: 296
Re: Bastin PROZA Matrix Corrections
« Reply #1 on: February 04, 2016, 11:12:09 AM »
But I'm not quite done with it yet...

As noted by Bastin and Heijligers in Electron Probe Quantitation, p. 160, the equations they give for beta/(2*alpha) only provide an approximation of the beta parameter.  In order to maintain internal consistency, the value of this parameter must then be refined.  Below is some Fortran 90/95 code (i = emitter and j = absorber) in which I implement a simple iterative procedure taken and slightly modified from GMRFILM that forces the integral of phi(rho*z) to be equal (within specified tolerance) to (R/S)*(1/Q(U0)) determined from PAP.  I'm still fiddling with it, but I think it's working alright:

   ! Approximation of beta:
   R_b_2a = ( gamma(j) - 2.D0 * alpha(i,j) * FZ(i,j) / SQRT( Pi ) ) &
      / ( gamma(j) - phi_0(i,j) )

   IF ( ( R_b_2a >= 1.D0 ) .OR. ( R_b_2a < 0.D0 ) ) THEN
      R_b_2a = 0.5D0
      alpha(i,j) = ( ( phi_0(i,j) + gamma(j) ) * SQRT( Pi ) ) / ( 4.D0 * FZ(i,j) )   
   END IF

   IF ( ( R_b_2a < 1.D0 ) .AND. ( R_b_2a >= 0.9D0 ) ) THEN
      beta(i,j) = 0.9628832D0 - 0.9642440D0 * R_b_2a
   ELSE IF ( ( R_b_2a < 0.9D0 ) .AND. ( R_b_2a >= 0.8D0 ) ) THEN
      beta(i,j) = 1.122405D0 - 1.141942D0 * R_b_2a
   ELSE IF ( ( R_b_2a < 0.8D0 ) .AND. ( R_b_2a >= 0.7D0 ) ) THEN
      beta(i,j) = 13.43810D0 * EXP( -5.180503D0 * R_b_2a )
   ELSE IF ( ( R_b_2a < 0.7D0 ) .AND. ( R_b_2a >= 0.57D0 ) ) THEN
      beta(i,j) = 5.909606D0 * EXP( -4.015891D0 * R_b_2a )
   ELSE IF ( ( R_b_2a < 0.57D0 ) .AND. ( R_b_2a >= 0.306D0 ) ) THEN
      beta(i,j) = 4.852357D0 * EXP( -3.680818D0 * R_b_2a )
   ELSE IF ( ( R_b_2a < 0.306D0 ) .AND. ( R_b_2a >= 0.102D0 ) ) THEN
      beta(i,j) = ( 1.D0 - 0.5379956D0 * R_b_2a ) / ( 1.685638D0 * R_b_2a )
   ELSE IF ( ( R_b_2a < 0.102D0 ) .AND. ( R_b_2a >= 0.056D0 ) ) THEN
      beta(i,j) = ( 1.D0 - 1.043744D0 * R_b_2a ) / ( 1.604820D0 * R_b_2a )
   ELSE IF ( ( R_b_2a < 0.056D0 ) .AND. ( R_b_2a >= 0.03165D0 ) ) THEN
      beta(i,j) = ( 1.D0 - 2.749786D0 * R_b_2a ) / ( 1.447465D0 * R_b_2a )
   ELSE IF ( ( R_b_2a < 0.03165D0 ) .AND. ( R_b_2a >= 0.0D0 ) ) THEN
      beta(i,j) = ( 1.D0 - 4.894396D0 * R_b_2a ) / ( 1.341313D0 * R_b_2a )
   END IF
   
   beta(i,j) = beta(i,j) * ( 2.D0 * alpha(i,j) )
   
   ! Refinement of beta(i,j), adapted from GMRFILM by R. Waldo:
   beta0 = beta(i,j)
   y1 = beta(i,j) / ( 2.D0 * alpha(i,j) ) 
   DO
      beta1 = beta0
      y2 = ARFC( y1 ) / R_b_2a * y1
      beta0 = y2 * ( 2.D0 * alpha(i,j) )
      IF ( ABS( ( beta1 - beta0 ) / beta1 ) < 1.D-4 ) EXIT
      y1 = y2     
   END DO
   beta(i,j) = y1 * ( 2.D0 * alpha(i,j) )


For mixtures, FZ(i,j) is replaced by FZ_mix(i), gamma(j) is replaced by gamma_mix, phi_0(i,j) is replaced by phi_0_mix(i), alpha(i,j) is replaced by alpha_mix(i), and beta(i,j) is replaced by beta_mix(i).

The ARFC function is equivalent to ZAFErrorFunction in CalcZAF and evaluates the polynomial that multiplies the exponential factor in the approximation for the complementary error function, as in Abramowitz and Stegun, Handbook of Mathematical Functions, p. 299, eq. 7.1.26.
« Last Edit: February 05, 2016, 06:34:59 AM by Brian Joy »
Brian Joy
Queen's University
Kingston, Ontario
JEOL JXA-8230

Probeman

  • Emeritus
  • *****
  • Posts: 2860
  • Never sleeps...
    • John Donovan
Re: Bastin PROZA Matrix Corrections
« Reply #2 on: February 04, 2016, 12:26:42 PM »
Hi Brian,
This is excellent work.  I'm glad the GMRFILM source code I sent you helped.

Please let me know when you're done "fiddling" and I'll implement your beta refinement!   :)
john
The only stupid question is the one not asked!

Brian Joy

  • Professor
  • ****
  • Posts: 296
Re: Bastin PROZA Matrix Corrections
« Reply #3 on: February 05, 2016, 10:51:14 AM »
I’ve tested the iterative refinement of the PROZA beta parameter, and I haven’t seen any problems with it.  Presumably the starting guess is always close enough to the final value so that convergence won’t ever be an issue.

The histogram below is taken from Bastin and Heijligers (1990), p. 82.



Note that their database of 877 analyses of “medium-to-high Z elements” appears to include one duplicate analysis and also includes nine analyses of boron in boron carbide.

Regarding MACs, Bastin and Heijligers state specifically that they used Heinrich’s MAC30 model.  It’s difficult/impossible to know exactly what MACs they were substituting for B Ka at this point, and so I’ve assumed the respective values for B Ka in B and B Ka in C to be 3400 and 6500 cm^2/g.  Also, they make no mention of the fluorescence correction applied (probably Reed, 1965); I’ve used Reed’s (1990) revised model – it shouldn’t make a substantial difference since the fluorescence correction is very small in most cases.  One exception to this is the case of Cu Ka measured in Au-Cu alloys (48 analyses), as the energy of Au La is just above that of the Cu K absorption edge.  I've applied Reed's (1965) weighting factors in treatment of K-L and L-K fluorescence and have not considered secondary fluorescence of/by M lines.

Applying the above to the 876 data compiled by Bastin and Heijligers, I get k_calc/k_meas average = 0.9956 and RMS = 0.0274, which are close to their results.  My respective minimum and maximum k_calc/k_meas are 0.8914 and 1.1765.  The latter corresponds to Cu La in Cu-Au alloy containing 19.83 wt% Cu analyzed at potential = 40 kV and takeoff angle = 52.5 degrees.  I don’t have a pretty histogram of my own to show at the moment.

Edit: Here is a histogram of my results, with bin width equal to that used by Bastin and Heijligers.

« Last Edit: February 06, 2016, 10:32:52 PM by Brian Joy »
Brian Joy
Queen's University
Kingston, Ontario
JEOL JXA-8230

Probeman

  • Emeritus
  • *****
  • Posts: 2860
  • Never sleeps...
    • John Donovan
Re: Bastin PROZA Matrix Corrections
« Reply #4 on: February 05, 2016, 10:56:52 AM »
Applying the above, I get k_calc/k_meas average = 0.9956 and RMS = 0.0274, which are close to their results.  My respective minimum and maximum k_calc/k_meas are 0.8914 and 1.1765.  The latter corresponds to Cu La in Au for 19.83 wt% Cu analyzed at potential = 40 kV and takeoff angle = 52.5 degrees.  I don’t have a pretty histogram of my own to show at the moment.

Hi Brian,
Very cool.

If you can send me your new FORTRAN code that I need to add to the Proza correction,  I can perform a before and after error histogram for us.
john
The only stupid question is the one not asked!

Brian Joy

  • Professor
  • ****
  • Posts: 296
Re: Bastin PROZA Matrix Corrections
« Reply #5 on: February 07, 2016, 08:07:43 AM »
And here is the histogram that I get when I apply my coding of PROZA to the 192 B Ka k-ratios presented in Bastin and Heijligers (1997).  I’ve used the Bastin MACs contained in the CalcZAF file empmac.dat, except for B Ka in O (16500 cm^2/g) from Pouchou and Pichoir (also in empmac.dat).  (Note that the Bastin and Heijligers MACs changed over time.)  The mean value of B Ka k_calc/k_meas is 1.0036, and RMS deviation is 0.0506.  Overall, the most problematic compounds are the borides of La, Ta, W, and U, for which the model produces strongly positive deviations at lower accelerating potentials (4-6 kV) and strongly negative deviations at higher potentials (esp. 30 kV).

« Last Edit: February 08, 2016, 03:50:23 PM by Brian Joy »
Brian Joy
Queen's University
Kingston, Ontario
JEOL JXA-8230

Brian Joy

  • Professor
  • ****
  • Posts: 296
Re: Bastin PROZA Matrix Corrections
« Reply #6 on: February 20, 2016, 10:42:55 AM »
I stumbled across a minor typo in the Bastin et al. (1986, Scanning 8:45-67) k-ratio database.  In their analysis numbered 147 (analysis 146 once the duplicate analysis 58 is omitted), the Cu Ka k-ratio determined in Au-Cu alloy (19.83 wt% Cu) at potential = 48.5 kV should be 0.209, not 0.218.  See the original reference, Heinrich et al. (1971, NBS Spec. Pub. 260-28), Table 11.
« Last Edit: February 20, 2016, 12:02:36 PM by Brian Joy »
Brian Joy
Queen's University
Kingston, Ontario
JEOL JXA-8230

Probeman

  • Emeritus
  • *****
  • Posts: 2860
  • Never sleeps...
    • John Donovan
Re: Bastin PROZA Matrix Corrections
« Reply #7 on: February 20, 2016, 01:00:55 PM »
I stumbled across a minor typo in the Bastin et al. (1986, Scanning 8:45-67) k-ratio database.  In their analysis numbered 147 (analysis 146 once the duplicate analysis 58 is omitted), the Cu Ka k-ratio determined in Au-Cu alloy (19.83 wt% Cu) at potential = 48.5 kV should be 0.209, not 0.218.  See the original reference, Heinrich et al. (1971, NBS Spec. Pub. 260-28), Table 11.

Hi Brian,
Good eyes!

I re-calculated with the original database and get this using Proza:



Note that most of the high side outliers are from low concentrations- so who knows?



Now running the Bastin k-ratio database with the corrected k-ratio, we get almost exactly the same result, just a very slightly worse std dev!



The original and corrected databases are attached below.
« Last Edit: April 14, 2020, 12:34:45 PM by John Donovan »
The only stupid question is the one not asked!

Brian Joy

  • Professor
  • ****
  • Posts: 296
Re: Bastin PROZA Matrix Corrections
« Reply #8 on: February 20, 2016, 02:43:27 PM »
Note that RMS deviation is smaller (2.74%) if the MAC30 MACs are used, with a couple of substitutions noted in my post above.
Brian Joy
Queen's University
Kingston, Ontario
JEOL JXA-8230

Probeman

  • Emeritus
  • *****
  • Posts: 2860
  • Never sleeps...
    • John Donovan
Re: Bastin PROZA Matrix Corrections
« Reply #9 on: February 20, 2016, 06:21:00 PM »
Note that RMS deviation is smaller (2.74%) if the MAC30 MACs are used, with a couple of substitutions noted in my post above.

Yup.  It's those boron k-ratios that are the nasty bits.   ;D
The only stupid question is the one not asked!