# PielaszekSphere

wojdyr edited this page Feb 9, 2011 · 10 revisions

# Complicated formula

Quoting [1]:

It has been shown that the diffraction peak profile for a polydispersive powder can be expressed as [2]:

where q is the scattering vector, <R> is the average grain size (in image analysis denoted by E(d)) and σ is the standard deviation (indicated also as SD(d)) of the grain size. The above expression assumes that grain sizes obey a Gamma distribution[...] that is a good approximation of the log-normal distribution in practical applications. [...] Having a peak profile in analytical form, one is able to fit the curve given by expression (1) to an experimental diffraction peak and readily obtain <R> and σ as refined fit parameters.

The formula above assumes that grains are spherical, the size distribution is a gamma distribution (which is similar to log-normal; AFAIK it's not possible to derive an analytical formula of peak shape assuming the log-normal distribution), and there is no strain.

The intensity and position of peak should be adjustable. We replace the constant factor (2 π)−1/2 with variable h and we add a parameter for the maximum position (`center`). The latter can be easily done by substituting x with q: `q = x-center`.

Now we can define the formula in Fityk:

```define Pielaszek3(h, center, r, s) =
h * r^3 / (q^4*s^6 * (1+q^2*s^4/r^2)^(r^2/(2*s^2)) * (r^2/s^2 - 1)*(r^2/s^2 - 2)*(r^2/s^2 - 3))
* (3 * (1 + q^2*s^4/r^2)^(r^2/(2*s^2)) * (2 + q^2*s^4/r^2 * (r^2/s^2 - 2) * (r^2/s^2 - 3))
- 6 * (1 + q^2*s^4/r^2)^1.5 * cos((r^2/s^2 - 3)*atan(q*s^2/r))
- 6 * q*s^2/r*(1 + q^2*s^4/r^2)*(r^2/s^2 - 3) * sin((r^2/s^2 - 2)*atan(q*s^2/r)))
where q = (x-center)
```

This command must be in a single line.

Note that the value for q=0 can be calculated only in a limit. This will prevent fitting when `center` is very close to one of the points.

It would be convenient to have default values of parameters defined, so that peak can be added with one mouse click. The height of the peak is equal 0.75 h <R>. Let's assume that the default <R>/σ=4. The peak detection algorithm can estimate `center` (position), `height`, `area` and `hwhm` (half width at half maximum). If the default values are expressed in terms of these parameters, such a peak can be created with one click:

```define Pielaszek(h=0.4*height*hwhm, center=center+1e-5, r=3.2/hwhm, s=0.8/hwhm) = ...
```

The peak position is shifted a bit (by 10−5) to avoid evaluation of the formula for q=0 (at least at the beginning).

R. Pielaszek derived also a similar formula with the assumption of cubic grains (not published). This formula is implemented in Fityk as a built-in function PielaszekCube.

1. T. Wejrzanowski, R. Pielaszek, A. Opalińska, H. Matysiak, W. Łojkowski and K.J. Kurzydłowski, Quantitative methods for nanopowders characterization, Applied Surface Science 253 (2006) 204–208, http://dx.doi.org/10.1016/j.apsusc.2006.05.089
2. R. Pielaszek, Analytical expression for diffraction line profile for polydispersive powders, Appl. Crystallography, Proceedings of the XIX Conference, Kraków, Poland, September 2003. p. 43.