Skip to content
Snippets Groups Projects
Commit 74817b09 authored by Anthony Lim's avatar Anthony Lim
Browse files

refs #19802 fixed documentation for dynamicKuboToyabe

parent 90bc0329
No related merge requests found
...@@ -128,23 +128,26 @@ double integral(double func(const double, const double, const double), ...@@ -128,23 +128,26 @@ double integral(double func(const double, const double, const double),
// f1: function to integrate // f1: function to integrate
double f1(const double x, const double G, const double w0) { double f1(const double x, const double G, const double w0) {
// G = Delta in doc
// x = dummy time variable
return (exp(-G * G * x * x / 2) * sin(w0 * x)); return (exp(-G * G * x * x / 2) * sin(w0 * x));
} }
// Static Zero Field Kubo Toyabe relaxation function // Static Zero Field Kubo Toyabe relaxation function
// Also called Lorentzian Kubo-Toyabe
double ZFKT(const double x, const double G) { double ZFKT(const double x, const double G) {
// q = Delta^2 t^2 in doc
const double q = G * G * x * x; const double q = G * G * x * x;
return (0.3333333333 + 0.6666666667 * exp(-0.5 * q) * (1 - q)); return (0.3333333333 + 0.6666666667 * exp(-0.5 * q) * (1 - q));
} }
// Static non-zero field Kubo Toyabe relaxation function // Static non-zero field Kubo Toyabe relaxation function
double HKT(const double x, const double G, const double F) { double HKT(const double x, const double G, const double F) {
// q = Delta^2 t^2 in doc
const double q = G * G * x * x; const double q = G * G * x * x;
// Muon gyromagnetic ratio * 2 * PI // Muon gyromagnetic ratio * 2 * PI
const double gm = 2 * M_PI * PhysicalConstants::MuonGyromagneticRatio; const double gm = 2 * M_PI * PhysicalConstants::MuonGyromagneticRatio;
// w = omega_0 in doc
double w; double w;
if (F > 2 * G) { if (F > 2 * G) {
// Use F // Use F
...@@ -153,7 +156,7 @@ double HKT(const double x, const double G, const double F) { ...@@ -153,7 +156,7 @@ double HKT(const double x, const double G, const double F) {
// Use G // Use G
w = gm * 2 * G; w = gm * 2 * G;
} }
// r = Delta^2/omega_0^2
const double r = G * G / w / w; const double r = G * G / w / w;
double ig; double ig;
...@@ -169,8 +172,10 @@ double HKT(const double x, const double G, const double F) { ...@@ -169,8 +172,10 @@ double HKT(const double x, const double G, const double F) {
(1 - 2 * r * (1 - exp(-q / 2) * cos(w * x)) + 2 * r * r * w * ig); (1 - 2 * r * (1 - exp(-q / 2) * cos(w * x)) + 2 * r * r * w * ig);
if (F > 2 * G) { if (F > 2 * G) {
// longitudinal Gaussian field
return ktb; return ktb;
} else { } else {
//
const double kz = ZFKT(x, G); const double kz = ZFKT(x, G);
return kz + F / 2 / G * (ktb - kz); return kz + F / 2 / G * (ktb - kz);
} }
...@@ -223,6 +228,7 @@ double DynamicKuboToyabe::getDKT(double t, double G, double F, double v, ...@@ -223,6 +228,7 @@ double DynamicKuboToyabe::getDKT(double t, double G, double F, double v,
// Generate dynamic Kubo Toyabe // Generate dynamic Kubo Toyabe
for (int k = 0; k < tsmax; k++) { for (int k = 0; k < tsmax; k++) {
double y = gStat[k]; double y = gStat[k];
// do integration
for (int j = k - 1; j > 0; j--) { for (int j = k - 1; j > 0; j--) {
y = y * (1 - hop) + hop * gDyn[k - j] * gStat[j]; y = y * (1 - hop) + hop * gDyn[k - j] * gStat[j];
} }
......
...@@ -12,7 +12,7 @@ Description ...@@ -12,7 +12,7 @@ Description
Dynamic Kubo Toyabe fitting function for use by Muon scientists defined Dynamic Kubo Toyabe fitting function for use by Muon scientists defined
by by
.. math:: G_z \left(t\right) = g_z\left(t\right) e^{-\nu t} + \nu \int_0^t g_z\left(\tau\right) e^{-\nu\tau} G_z\left(t-\tau\right) d\tau .. math:: G_z \left(t\right) = g_z\left(t\right) + \nu \int_0^t g_z\left(\tau\right) G_z\left(t-\tau\right) d\tau
where :math:`g_z\left(t\right)` is the static KT function, and :math:`\nu` the muon hopping rate. where :math:`g_z\left(t\right)` is the static KT function, and :math:`\nu` the muon hopping rate.
...@@ -31,6 +31,11 @@ small values will lead to long calculation times, while large values will produc ...@@ -31,6 +31,11 @@ small values will lead to long calculation times, while large values will produc
.. properties:: .. properties::
References
----------
[1] `Hayano et al., PRB 20 (1979) 50 <https://journals.aps.org/prb/abstract/10.1103/PhysRevB.20.850>`_.
.. categories:: .. categories::
.. sourcelink:: .. sourcelink::
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment