Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
74817b09
Commit
74817b09
authored
7 years ago
by
Anthony Lim
Browse files
Options
Downloads
Patches
Plain Diff
refs #19802 fixed documentation for dynamicKuboToyabe
parent
90bc0329
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Framework/CurveFitting/src/Functions/DynamicKuboToyabe.cpp
+10
-4
10 additions, 4 deletions
Framework/CurveFitting/src/Functions/DynamicKuboToyabe.cpp
docs/source/fitfunctions/DynamicKuboToyabe.rst
+6
-1
6 additions, 1 deletion
docs/source/fitfunctions/DynamicKuboToyabe.rst
with
16 additions
and
5 deletions
Framework/CurveFitting/src/Functions/DynamicKuboToyabe.cpp
+
10
−
4
View file @
74817b09
...
@@ -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
];
}
}
...
...
This diff is collapsed.
Click to expand it.
docs/source/fitfunctions/DynamicKuboToyabe.rst
+
6
−
1
View file @
74817b09
...
@@ -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::
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment