22 const double p = 7.0 / 3.0 - 4.0 * std::sqrt(3.0) /
M_PI;
23 double Czero(
double packing);
24 double S2(
double packing);
32 setName(
"InterferenceHardDisk");
34 throw std::runtime_error(
"InterferenceFunctionHardDisk::validateParameters: "
35 "radius and density must be positive and packing ratio between "
66 m_q = 2.0 * std::sqrt(qx * qx + qy * qy) *
m_radius;
74 return 1.0 / (1.0 - rho * c_q);
89 double Czero(
double packing)
91 double numerator = 1.0 + packing + 3.0 * p * packing * packing - p * std::pow(packing, 3);
92 double denominator = std::pow(1.0 - packing, 3);
93 return -numerator / denominator;
96 double S2(
double packing)
98 double factor = 3.0 * packing * packing / 8.0;
99 double numerator = 8.0 * (1.0 - 2.0 * p) + (25.0 - 9.0 * p) * p * packing
100 - (7.0 - 3.0 * p) * p * packing * packing;
101 double denominator = 1.0 + packing + 3.0 * p * packing * packing - p * std::pow(packing, 3);
102 return factor * numerator / denominator;
107 return 2.0 * (std::acos(x) - x * std::sqrt(1.0 - x * x)) /
M_PI;
Defines Bessel functions in namespace Math.
Defines classes RealIntegrator, ComplexIntegrator.
Defines class InterferenceFunctionHardDisk.
Defines class RealParameter.
T y() const
Returns y-component in cartesian coordinate system.
T x() const
Returns x-component in cartesian coordinate system.
Abstract base class of interference functions.
void setName(const std::string &name)
RealParameter & registerParameter(const std::string &name, double *parpointer)
Percus-Yevick hard disk interference function.
InterferenceFunctionHardDisk * clone() const override
Returns a clone of this ISampleNode object.
double iff_without_dw(const kvector_t q) const override
Calculates the structure factor without Debye-Waller factor.
InterferenceFunctionHardDisk(double radius, double density, double position_var=0)
double getParticleDensity() const override
If defined by this interference function's parameters, returns the particle density (per area).
double packingRatio() const
double integrand(double x) const
To integrate a real function of a real variable.
double integrate(const std::function< double(double)> &f, double lmin, double lmax)
RealParameter & setNonnegative()
RealParameter & setUnit(const std::string &name)
double J0(double x)
Bessel function of the first kind and order 0.