Documentation of user libs (user functions)

Functions to analyze β-NMR data (BNMR libs)

This is a collection of C++ classes using the musrfit user-functions interface in order to facilitate the usage in conjunction with musrfit. It consists of two libraries:

  • libBNMR contains functions to fit spin lattice relaxation (SLR) data.
  • libLineProfile contains functions to fit resonance lineshapes.

Note

Currently it is recommended to read in the data in ASCII format as a non-μSR fit (fit type 8).

libBNMR

In β-NMR the SLR is usually measured by implanting a pulse of \(^8\)Li with a length \(t_0\) into the sample. The asymmetry is measured both during the pulse and afterwards. For a a general spin relaxation function \(f(t)\) the time evolution of the asymmetry is then given by [Z. Salman, et al., PRL 96, 147601 (2006)]:

\[\begin{split}P(t) = \left\{\begin{matrix} \frac{\int_0^t e^{-(t-t')/\tau_{\mathrm{Li}}}f(t-t')dt'}{\int_0^t e^{-t'/\tau_{\mathrm{Li}}}dt' } & t\leq t_0\\[6pt] \frac{\int_0^{t_0}e^{-(t_0-t')/\tau_{\mathrm{Li}}}f(t-t')dt'}{\int_0^{t_0}e^{-t'/\tau_{\mathrm{Li}}}dt'} & t> t_0, \end{matrix}\right.\end{split}\]

where \(\tau_{\mathrm{Li}}=1.21\)s is the \(^8\)Li lifetime.

Functions

The libLineProfile library currently contains the following functions:

Exponential relaxation

userFcn libBNMR ExpRlx 1 2

The parameters are:

  1. pulse length \(t_0\) (ms)
  2. relaxation rate \(\sigma\) (ms\(^{-1}\))

This function implements \(f(t)=e^{-\sigma t}\).

Stretched exponential relaxation

userFcn libBNMR SExpRlx 1 2 3

The parameters are:

  1. pulse length \(t_0\) (ms)
  2. relaxation rate \(\sigma\) (ms\(^{-1}\))
  3. stretching exponent \(\beta\)

This function implements \(f(t)=e^{-(\sigma t)^{\beta}}\).

libLineProfile

In addition to some simple line shapes libLineProfile contains functions to fit chemical shift anisotropies in the powder average. Their functional form can be found in M. Mehring, Principles of High Resolution NMR in Solids (Springer 1983).

For an axially symmetric interaction it is given by:

\[\begin{split}I_{\mathrm ax}(f)=\left\{\begin{matrix} \frac{1}{2\sqrt{(f_\parallel-f_\perp)(f-f_\perp)}}& f\in(f_\perp,f_\parallel)\cup(f_\parallel,f_\perp)\\[6pt] 0 & \text{otherwise}\end{matrix} \right.\end{split}\]

where \(f_\parallel\) and \(f_\perp\) are the frequencies that would be observed if the field is oriented paralell or perpendicular to the symmetry axis, respectively.

In case of a completely anisotropic interaction, the powder average can be described by the frequencies along the three principle axis \(f_1,f_2,f_3\).
Assume without loss of generality that \(f_1<f_2<f_3\), then
\[\begin{split}I(f)&=\left\{\begin{matrix} \frac{K(m)}{\pi\sqrt{(f-f_1)(f_3-f_2)}},& f_3\geq f>f_2 \\[9pt] \frac{K(m)}{\pi\sqrt{(f_3-f)(f_2-f_1)}},& f_2>f\geq f_1\\[9pt] 0 & \text{otherwise} \end{matrix} \right. \\ \\ m&=\left\{\begin{matrix} \frac{(f_2-f_1)(f_3-f)}{(f_3-f_2)(f-f_1)},& f_3\geq f>f_2 \\[6pt] \frac{(f-f_1)(f_3-f_2)}{(f_3-f)(f_2-f_1)},& f_2>f\geq f_1\\[6pt] \end{matrix} \right. \\ \\ K(m)&=\int_0^{\pi/2}\frac{\mathrm d\varphi}{\sqrt{1-m^2\sin^2{\varphi}}},\end{split}\]

\(K(m)\) is the complete elliptic integral of the first kind.

Functions

The libLineProfile library currently contains the following functions:

Gaussian

userFcn  libLineProfile LineGauss 1 2

The parameters are:

  1. center of the line \(f_0\)
  2. FWHM of the line \(\sigma\)
The height of the peak is 1.
The functional form is given by
\[A(f)=e^{-\frac{4\ln 2 (f-f_0)^2}{ \sigma^2}}\]

Lorentzian

userFcn  libLineProfile LineLorentzian 1 2

The parameters are:

  1. center of the line \(f_0\)
  2. FWHM of the line \(w\)
The height of the peak is 1.
The functional form is given by
\[A(f)= \frac{w^2}{4(f-f_0)^2+w^2}\]

Laplacian

userFcn  libLineProfile LineLaplace 1 2

The parameters are:

  1. center of the line \(f_0\)
  2. FWHM of the line \(w\)
The height of the peak is 1.
The functional form is given by
\[A(f)=e^{-2\ln 2 \left|\frac{f-f_0}{w}\right|}\]

Skewed Lorentzian

userFcn  libLineProfile LineSkewLorentzian 1 2 3

The parameters are:

  1. center of the line \(f_0\)
  2. width of the line \(w\)
  3. skewness parameter \(a\)
The height of the peak is 1.
The functional form is given by
\[A(f)= \frac{w w_a}{4(f-f_0)^2+w_a^2}, \quad w_a=\frac{2w}{1+e^{a(f-f_0)}}\]

Skewed Lorentzian 2

userFcn  libLineProfile LineSkewLorentzian2 1 2 3

The parameters are:

  1. center of the line \(f_0\)
  2. width left of the center \(w_1\)
  3. width right of the center \(w_2\)
The height of the peak is 1.
The functional form is given by
\[\begin{split}A(f)= \left\{\begin{matrix}\frac{{w_1}^2}{4{(f-f_0)}^2+{w_1}^2},&f\leq f_0\\[9pt] \frac{{w_2}^2}{4{(f-f_0)}^2+{w_2}^2},&f>f_0\end{matrix}\right.\end{split}\]

Powder average of an axially symmetric interaction convoluted with a Lorentzian

userFcn  libLineProfile PowderLineAxialLor 1 2 3

The parameters are:

  1. frequency for the field oriented paralell to the symmetry axis \(f_\parallel\)
  2. frequency for the field oriented perpendicular to the symmetry axis \(f_\parallel\)
  3. FWHM of the Lorentzian \(w\)
The height of the peak is \(\sim\)1.
The functional form is given by
\[A(f)= I_{\mathrm ax}(f)\circledast\left( \frac{w^2}{4f^2+w^2} \right)\]

with \(I_{\mathrm ax}(f)\) defined above.

Powder average of an axially symmetric interaction convoluted with a Gaussian

userFcn  libLineProfile PowderLineAxialGss 1 2 3

The parameters are:

  1. frequency for the field oriented paralell to the symmetry axis \(f_\parallel\)
  2. frequency for the field oriented perpendicular to the symmetry axis \(f_\parallel\)
  3. FWHM of the Gaussian \(\sigma\)
The height of the peak is \(\sim\)1.
The functional form is given by
\[A(f)= I_{\mathrm ax}(f)\circledast\left( e^{-\frac{4\ln 2 (f-f_0)^2}{ \sigma^2}} \right)\]

with \(I_{\mathrm ax}(f)\) defined above.

Powder average of an anisotropic interaction convoluted with a Lorentzian

userFcn  libLineProfile PowderLineAsymLor 1 2 3 4

The parameters are:

  1. \(f_1\)
  2. \(f_1\)
  3. \(f_3\) frequencies along the principal axes
  4. FWHM of the Lorentzian \(w\)
The height of the peak is \(\sim\)1.
The functional form is given by
\[A(f)= I(f)\circledast\left( \frac{w^2}{4f^2+w^2} \right)\]

with \(I(f)\) defined above. Note that \(f_1<f_2<f_3\) is not required by the code.

Powder average of an anisotropic interaction convoluted with a Gaussian

userFcn  libLineProfile PowderLineAsymGss 1 2 3 4

The parameters are:

  1. \(f_1\)
  2. \(f_1\)
  3. \(f_3\) frequencies along the principal axes
  4. FWHM of the Gaussian \(\sigma\)
The height of the peak is \(\sim\)1.
The functional form is given by
\[A(f)= I(f)\circledast\left( e^{-\frac{4\ln 2 (f-f_0)^2}{ \sigma^2}} \right)\]

with \(I(f)\) defined above. Note that \(f_1<f_2<f_3\) is not required by the code.