FITEXC – DIFFRACTION PROFILE FITTING PROGRAM RUN IN MS EXCEL

We present our custom made diffraction fitting program FitExc for the basic treatment of the 1D diffraction profiles, in particular, the Intensity(2θ) of X-ray, synchrotron or neutron diffraction measurements. In the current state, the program allows for simultaneous fitting of up to three profiles in one data set and is intended to be used mainly for precise lattice parameters determination or fitting of overlapped peaks. The entire program is built in the common MS Excel environment, it does not require any installation and is free to use.


Introduction
X-ray crystallography is a powerful tool with many applications: it is often used to determine the lattice parameters, the complete structure of solids, to examine the phase composition, residual stresses or texture.For multiple applications the precise examination of measured 1D Intensity(2θ) diffraction profiles represents a crucial part of data processing.
There are various programs for detailed diffraction profile fitting available.Many of them offer complex solutions implementing the Rietveld refinement process [1] (such as X'Pert Highscore Plus [2], TOPAS [3] or FullProf [4]).On the other hand, there are many applications, where quick and precise fitting of few diffraction peaks and their closest neighbourhood is sufficient.Even in this field, a few programs are used, such as Fityk [5].Unfortunately, the majority of the programs for X-ray diffraction (XRD) data analysis does not, to our knowledge and experience, allow the user to fully control or customize all the aspects of the fitting in an easily accessible way, nor are they userfriendly or quick enough for easier applications and batch processing.Although the simple fitting of a few diffraction maxima might also be done manually (for example using the Origin software [6]), the approach is often clumsy and require wider knowledge of such environment.
We developed a simple user-friendly diffraction profile fitting program FitExc that does not suffer from mentioned disadvantages, yet provides precise results for basic applications.The program, first introduced in [7], is based on the Microsoft Excel environment, which is immediately available on the majority of computers today.Excel's interface together with Visual Basic for Applications-based macros create a lightweight but powerful tool for the diffraction peak fitting.Another advantage is the immediate possibility to implement user's own scripts for various kinds of analyses such as macroscopic residual stress determination or the analysis of the crystallite size and strain using the Williamson-Hall plot.

Program interface and fitting functions
In the attempt to make FitExc as user-friendly as possible, the clickable interface with buttons, drop-down lists and check-boxes was created over the hidden worksheets used for the calculations.Actions are macro-powered and the overall approach is straightforward.First, user is asked to select the file to be loaded.PANalytical .xrdmlfiles are supported as well as standard .xy,.xyeor .txtfiles (multiple columns in the ordinary textfile).Next, the fitting function and the radiation spectrum can be specified.Standard Cauchy, Gauss, Pearson VII and pseudo-Voigt functions are implemented, as well as their split variants for dealing with possible asymmetry.As for the radiation, user may choose from different X-ray tube presets or define his own spectrum containing up to 7 components with desired wavelength, relative intensity and width (Figure 1) [8].Therefore, the program might be used not only for XRD, but also for neutron or synchrotron diffraction data fitting.
On the main fitting page, where the measured data and fitted function are plotted (Figure 2), the entire data processing is controlled.In the current state, up to three profiles might be fitted for one loaded dataset, in the future, the ability to use more than three profiles is to be added.Each of the profiles is defined by

function formula (f (2θ))
Cauchy Table 1.Implemented fitting functions with following parameters: intensity at maximum A1, angular position of the maximum A2 , the relative width A3 and the shape parameter A4 [9].four parameters A 1−4 , where A 1 is the intensity at maximum, A 2 the 2θ position of the maximum, A 3 is the relative width parameter and A 4 is the shape parameter.The simple formulas for such defined functions are denoted in Table 1 [9].
In the case of asymmetric profiles, instead of one A 3 and A 4 parameter, two sets of parameters (A 31 , A 41 and A 32 , A 42 ) are used -one pair for the left and one pair for the right side of the peak.For background fitting, the constant, linear and quadratic forms were implemented so far.The program also calculates the integral intensity of the fitted reflections using analytical formulas where possible and numerical approach for the Pearson VII based functions.The loaded 2θ might be restricted if needed.
As one of the advantages, the user is immediately able to fix some parameters that will not be changed during fitting.This makes the program very effective for fitting of complex patterns and multiple overlapped peaks.
Fitting algorithm is based on general reduced gradient non-linear least squares method.It is implemented using the Solver (solver.xlam)add-in and the standard worksheet environment of MS Excel run in the background.
To evaluate the goodness of the fit the standard discrepancy factors R P , R W P , R exp and χ 2 are calculated and their values might be compared with those before fit.

Additional functionality
For processing of multiple data, our program allows loading of multiple files.These are then fitted automatically one after another.In case that .xrdmlfile containing multiple scans is loaded, the batch feature is enabled automatically providing the tool to fit the datasets sequentially.This feature has already been used for determination of the temperature development of selected lattice parameters of magnetic shape memory (MSM) alloys [10].As our program enables determination of very small changes of the lattice parameters, their temperature evolution is clearly observable even in narrow temperature intervals (Figure 3).
Fitting algorithm is stable enough even for fitting of multiple peaks with great intensity differences  (so far even with two orders difference the results were reliable).To review a situation, the user may immediately choose between the linear and logarithmic scale of the main graph by clicking a single button.
Once the good fit is obtained, all the results including the basic settings might be stored in the easily accessible results worksheet.The procedure for easy recovery of the parameters of the fit to the fitting worksheet is also implemented.

Conclusions
We developed a new simple diffraction profile fitting program FitExc.This lightweight and user-friendly program can be run on any PC with MS Excel (2003 or later) installed.It is intended mainly for the precise fitting of the single reflections (especially their 2θ positions) based on selected or user-defined spectra of the radiation source and for fitting of overlapped peaks.This allows the precise determination of the lattice parameters, observation of their evolution or study of the residual stresses.
The program is free to use.To get your own copy, please visit http://people.fjfi.cvut.cz/vertapet/.

Figure 1 .
Figure 1.Program interface: Initial settings worksheet shown after the data file is chosen.Here the basic settings can be specified, such as the spectrum of the radiation, function for fitting or initialisation of the new peak parameters.

Figure 2 .
Figure 2. Program interface: The main worksheet for data fitting.User is able to start the fitting, preset or check the fitted parameters, fix them if needed and to see the measured and fitted data including the difference curve.

Figure 3 .
Figure 3. Application example: precisely determined lattice parameters a and b of Ni-Mn-Ga MSM alloy and their evolution while heating.The sudden change denotes the structural transformation [10].