34 this->declareParameter(
"Height", 1.0,
"scaling factor");
35 this->declareParameter(
"Centre", 0.0,
"Shift along the X-axis");
36 this->declareParameter(
"DiffCoeff", 2.3,
"Diffusion coefficient (10^(-5)cm^2/s)");
53 if (H < std::numeric_limits<double>::epsilon() || D < std::numeric_limits<double>::epsilon()) {
54 for (
size_t j = 0; j < nData; j++) {
55 out[j] = std::numeric_limits<double>::infinity();
64 for (
size_t j = 0; j < nData; j++) {
65 auto E = xValues[j] - C;
66 out[j] += H * G / (G * G + E * E) / M_PI;
77 const double deltaF{0.1};
78 const size_t nParam = this->
nParams();
81 std::map<std::string, double> cutoff;
82 cutoff[
"DiffCoeff"] = 0.2;
83 cutoff[
"Centre"] = 0.0001;
84 std::vector<double> out(nData);
88 for (
size_t iP = 0; iP < nParam; iP++) {
93 if (pName ==
"Height") {
97 this->
function1D(derivative.data(), xValues, nData);
100 double delta = cutoff[pName] >
fabs(pVal * deltaF) ? cutoff[pName] : pVal * deltaF;
103 this->
function1D(derivative.data(), xValues, nData);
104 for (
size_t i = 0; i < nData; i++) {
110 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.
Fick's law for diffusion.
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