23 const double p = 7.0 / 3.0 - 4.0 * std::sqrt(3.0) /
M_PI;
24 double Czero(
double packing);
25 double S2(
double packing);
33 setName(
"InterferenceHardDisk");
35 throw std::runtime_error(
"InterferenceFunctionHardDisk::validateParameters: "
36 "radius and density must be positive and packing ratio between "
67 m_q = 2.0 * std::sqrt(qx * qx + qy * qy) *
m_radius;
75 return 1.0 / (1.0 - rho * c_q);
93 double numerator = 1.0 + packing + 3.0 *
p * packing * packing -
p * std::pow(packing, 3);
94 double denominator = std::pow(1.0 - packing, 3);
95 return -numerator / denominator;
98 double S2(
double packing)
100 double factor = 3.0 * packing * packing / 8.0;
101 double numerator = 8.0 * (1.0 - 2.0 *
p) + (25.0 - 9.0 *
p) *
p * packing
102 - (7.0 - 3.0 *
p) *
p * packing * packing;
103 double denominator = 1.0 + packing + 3.0 *
p * packing * packing -
p * std::pow(packing, 3);
104 return factor * numerator / denominator;
109 return 2.0 * (std::acos(x) - x * std::sqrt(1.0 - x * x)) /
M_PI;
Defines classes RealIntegrator, ComplexIntegrator.
Defines class InterferenceFunctionHardDisk.
Defines namespace MathFunctions.
Defines class RealParameter.
T y() const
Returns y-component in cartesian coordinate system.
T x() const
Returns x-component in cartesian coordinate system.
Pure virtual base class of interference functions.
RealParameter & registerParameter(const std::string &name, double *parpointer)
void setName(const std::string &name)
Percus-Yevick hard disk interference function.
InterferenceFunctionHardDisk * clone() const override final
Returns a clone of this ISample object.
InterferenceFunctionHardDisk(double radius, double density, double position_var=0)
double iff_without_dw(const kvector_t q) const override final
Calculates the structure factor without Debye-Waller factor.
double getParticleDensity() const override final
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 Bessel_J0(double x)
Bessel function of the first kind and order 0.
double Czero(double packing)
double S2(double packing)
const double radius(5 *Units::nanometer)