/// <summary> /// /// </summary> /// <param name="X"></param> /// <param name="P"></param> /// <param name="Y"></param> /// <remarks> /// P[0]: M_0, /// P[1]: M_infinity /// P[2]: tau_relax /// P[3]: beta /// P[4]: invviscosity /// </remarks> public void Evaluate(double[] X, double[] P, double[] Y) { double x = X[0]; if (_useFrequencyInsteadOmega) { x *= (2 * Math.PI); } double w_r = x * P[2]; // omega scaled with tau Complex result = P[1] + (P[0] - P[1]) * Kohlrausch.ReIm(P[3], w_r); if (_useFlowTerm) { result = 1 / ((1 / result) - Complex.I * P[4] / x); } if (_logarithmizeResults) { Y[0] = Math.Log10(result.Re); Y[1] = Math.Log10(result.Im); } else { Y[0] = result.Re; Y[1] = result.Im; } }
public void Evaluate(double[] X, double[] P, double[] Y) { double x = X[0]; if (_useFrequencyInsteadOmega) { x *= (2 * Math.PI); } double w_r = x * P[2]; // omega scaled with tau Complex result = P[0] + P[1] * Kohlrausch.ReIm(P[3], w_r); Y[0] = result.Re; if (this._useFlowTerm) { if (this._isDielectricData) { Y[1] = -result.Im + P[4] / (x * 8.854187817e-12); } else { Y[1] = -result.Im + P[4] / (x); } } else { Y[1] = -result.Im; } }
public void Evaluate(double[] X, double[] P, double[] Y) { double x = X[0]; if (_useFrequencyInsteadOmega) { x *= (2 * Math.PI); } Complex result = P[0]; int iPar = 1; int i; for (i = 0, iPar = 1; i < _numberOfRelaxations; i++, iPar += 3) { result += P[0 + iPar] * Kohlrausch.ReIm(P[2 + iPar], P[1 + iPar] * x); } // note: because it is a susceptiblity, the imaginary part is still negative if (_useFlowTerm) { if (_isDielectricData) { result.Im -= P[iPar] / (x * 8.854187817e-12); } else if (_invertViscosity) { result.Im -= P[iPar] / (x); } else { result.Im -= 1 / (P[iPar] * x); } } if (_invertResult) { result = 1 / result; // if we invert, i.e. we calculate the modulus, the imaginary part is now positive } else { result.Im = -result.Im; // else if we don't invert, i.e. we calculate susceptibility, we negate the imaginary part to make it positive } if (_logarithmizeResults) { result.Re = Math.Log10(result.Re); result.Im = Math.Log10(result.Im); } Y[0] = result.Re; Y[1] = result.Im; }
public void Evaluate(double[] X, double[] P, double[] Y) { double x = X[0]; if (_useFrequencyInsteadOmega) { x *= (2 * Math.PI); } double w_r = x * P[2]; // omega scaled with tau Complex result = 1 / P[1] + (1 / P[0] - 1 / P[1]) * Kohlrausch.ReIm(P[3], w_r); if (this._useFlowTerm) { result.Im -= P[4] / (x); } result = 1 / result; Y[0] = result.Re; Y[1] = result.Im; }
public void TestRe2() { double result = Kohlrausch.Re(0.03125, Math.Exp(-5 / 0.03125)); }
public void TestRe1() { double result = Kohlrausch.Re1(0.5, 1024); }
public void TestIm2SmallBeta() { double beta = 1 / 32.0; double result = Kohlrausch.Im2SmallBeta(beta, Math.Exp(-5 / beta)); }
public void TestIm2() { double beta = 63 / 32.0; double result = Kohlrausch.Im2(beta, Math.Exp(2.65625 / beta)); }
public void TestIm1() { double result = Kohlrausch.Im1(1.0 + 4 / 32.0, 1); }