34 this->declareParameter(
"Height", 1.0,
"scaling factor");
35 this->declareParameter(
"Centre", 0.0,
"Shift along the X-axis");
36 this->declareParameter(
"Tau", 1.25,
"Residence time");
37 this->declareParameter(
"L", 1.25,
"Jump length");
47 double hbar(0.658211626);
56 if (H < std::numeric_limits<double>::epsilon() || T < std::numeric_limits<double>::epsilon()) {
57 for (
size_t j = 0; j < nData; j++) {
58 out[j] = std::numeric_limits<double>::infinity();
64 auto G = hbar * (1 - (sin(Q * L) / (Q * L))) / T;
65 for (
size_t j = 0; j < nData; j++) {
66 auto E = xValues[j] - C;
67 out[j] += H * G / (G * G + E * E) / M_PI;
78 const double deltaF{0.1};
79 const size_t nParam = this->
nParams();
82 std::map<std::string, double> cutoff;
84 cutoff[
"Centre"] = 0.0001;
85 std::vector<double> out(nData);
89 for (
size_t iP = 0; iP < nParam; iP++) {
94 if (pName ==
"Height") {
98 this->
function1D(derivative.data(), xValues, nData);
101 double delta = cutoff[pName] >
fabs(pVal * deltaF) ? cutoff[pName] : pVal * deltaF;
104 this->
function1D(derivative.data(), xValues, nData);
105 for (
size_t i = 0; i < nData; i++) {
111 for (
size_t i = 0; i < nData; i++) {
#define DECLARE_FUNCTION(classname)
Macro for declaring a new type of function to be used with the FunctionFactory.
virtual void derivative(const FunctionDomain &domain, FunctionValues &values, const size_t order=1) const
double asDouble() const
Returns double value if attribute is a double, throws exception otherwise.
bool isActive(size_t i) const
Check if an active parameter i is actually active.
virtual Attribute getAttribute(const std::string &name) const
Return a value of attribute attName.
virtual void applyTies()
Apply the ties.
virtual double activeParameter(size_t i) const
Value of i-th active parameter.
virtual void setActiveParameter(size_t i, double value)
Set new value of i-th active parameter.
Represents the Jacobian in IFitFunction::functionDeriv.
virtual void set(size_t iY, size_t iP, double value)=0
Set a value to a Jacobian matrix element.
std::string parameterName(size_t i) const override
Returns the name of parameter i.
size_t nParams() const override
Total number of parameters.
double getParameter(size_t i) const override
Get i-th parameter.
Chudley-Elliots jump diffusion model.
void function1D(double *out, const double *xValues, const size_t nData) const override
Calculate function values on an energy domain.
void functionDeriv1D(Mantid::API::Jacobian *jacobian, const double *xValues, const size_t nData) override
analytical/numerical derivative with respect to fitting parameters We carry out analytical derivative...
The Logger class is in charge of the publishing messages from the framework through various channels.
Kernel::Logger g_log("ExperimentInfo")
static logger object