17using namespace CurveFitting;
19using namespace Kernel;
26 declareParameter(
"A0", 1.0,
"amplitude");
27 declareParameter(
"Alpha", 2.0,
"balance parameter");
28 declareParameter(
"Beta", 0.5,
"critical exponent");
29 declareParameter(
"CriticalTemp", 1.0,
"critical temperature");
38 for (
size_t i = 0; i < nData; i++) {
39 double formula = Amp * pow((1 - pow(xValues[i] / Tc, Alpha)), Beta);
41 if (!std::isfinite(formula)) {
54 for (
size_t i = 0; i < nData; i++) {
55 double xCalc = (xValues[i] / Tc);
56 double xCalcAlpha = pow(xCalc, Alpha);
58 double diffAmp = pow((1 - xCalcAlpha), Beta);
60 if (!std::isfinite(diffAmp)) {
64 double diffAmpMin = pow((1 - xCalcAlpha), Beta - 1);
66 if (!std::isfinite(diffAmpMin)) {
70 double diffAlpha = -Amp * Beta * xCalcAlpha * log(xCalc) * diffAmpMin;
71 double diffBeta = Amp * diffAmp * log(1 - xCalcAlpha);
73 if ((1 - xCalcAlpha) <= 0.0) {
76 double diffTc = (Amp * Alpha * Beta * xCalcAlpha * diffAmpMin) / Tc;
78 out->
set(i, 0, diffAmp);
79 out->
set(i, 1, diffAlpha);
80 out->
set(i, 2, diffBeta);
81 out->
set(i, 3, diffTc);
#define DECLARE_FUNCTION(classname)
Macro for declaring a new type of function to be used with the FunctionFactory.
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.
double getParameter(size_t i) const override
Get i-th parameter.
Provide Magnetic Order Paramtere fit function interface to IFunction.
void function1D(double *out, const double *xValues, const size_t nData) const override
Function you want to fit to.
void functionDeriv1D(API::Jacobian *out, const double *xValues, const size_t nData) override
Derivatives of function with respect to active parameters.