8 template <
class T>
double ShOverId(
const T &x)
13 resVal = 1.0 + resVal * resVal / 6.0;
15 resVal = std::sinh(resVal) / resVal;
20 template <
class ScalarType> std::complex<double>
ComplexShRatio(
const ScalarType &k,
const ScalarType &alpha,
const ScalarType &beta)
22 double ss = alpha * alpha + beta * beta;
24 double constant = k * std::exp(alpha - k) / ss / (1 - std::exp(- 2.0 * k));
26 double realVal = constant * (alpha * (1.0 - std::exp(- 2.0 * alpha)) * std::cos(beta) + beta * (1.0 + std::exp(- 2.0 * alpha)) * std::sin(beta));
28 double imagVal = constant * (alpha * (1.0 + std::exp(- 2.0 * alpha)) * std::sin(beta) - beta * (1.0 - std::exp(- 2.0 * alpha)) * std::cos(beta));
30 return std::complex<double>(realVal, imagVal);
33 template <
class T1,
class T2,
class T3>
double ShRatio(
const T1 &k,
const T2 &alpha,
const T3 &beta)
35 double ss = alpha * alpha + beta * beta;
37 double resVal = k * exp(alpha - k) * (alpha * (1.0 - exp(- 2.0 * alpha)) * cos(beta) + beta * (1.0 + exp(- 2.0 * alpha)) * sin(beta)) / ss / (1 - exp(- 2.0 * k));
42 template <
class T>
double xi(
const T &k)
44 double resVal = k * k;
47 resVal = 1.0 / 3.0 - resVal / 45;
49 resVal = 1.0 / (k * tanh(k)) - 1.0 / resVal;
54 template <
class T>
double jtwo(
const T &k)
56 double jtwoVal = k * k;
59 jtwoVal = 1.0 / 3.0 + 2.0 * k * k / 45.0;
61 jtwoVal = 1.0 - 2.0 * (1.0 / (k * tanh(k)) - 1.0 / jtwoVal);
66 template <
class T>
double jfour(
const T &k)
68 double jfourVal = k * k;
71 jfourVal = 1.0 / 5.0 + 4.0 * k * k / 45.0;
73 jfourVal = 1.0 - 4.0 * (1.0 / (k * tanh(k)) - 3.0 * (1.0 - 2.0 * (1.0 / (k * tanh(k)) - 1.0 / jfourVal)) / jfourVal);
std::complex< double > ComplexShRatio(const ScalarType &k, const ScalarType &alpha, const ScalarType &beta)
double ShOverId(const T &x)
double ShRatio(const T1 &k, const T2 &alpha, const T3 &beta)