# Distribution functions

Enums

enum class EDistributionFunction : uint8_t

  Types of distribution functions.

  Values:

  enumerator MANUAL

    Manual distribution.

  enumerator NORMAL

    Normal distribution.

  enumerator RRSB

    Rosin-Rammler-Sperling-Bennett distribution.

  enumerator GGS

    Gates-Gaudin-Schuhmann distribution.

  enumerator LOG_NORMAL

    Log-normal distribution.

Functions

std::vector<double> CreateDistribution(EDistributionFunction _type, const std::vector<double> &_x, double _param1, double _param2)

  Returns the given probability density function.

  Available functions:

  - EDistributionFunction::NORMAL: y(x) = \frac{1}{\sqrt{2\pi\sigma^{2}}}e^{-\frac{(x-\mu)^{2}}{2\sigma^{2}}},

    with \sigma \neq 0, \mu - mean value, \sigma - standard deviation.

  - EDistributionFunction::LOG_NORMAL: y(x) = \frac{1}{x\sigma\sqrt{2\pi}}e^{-\frac{(\ln x-\mu)^{2}}{2\sigma^{2}}},

    with \sigma > 0 and x > 0, \mu - mean value, \sigma - standard deviation.

  - EDistributionFunction::RRSB: y(x) = \frac{k}{\lambda}\left(\frac{x}{\lambda}\right)^{k-1}e^{-\left(\frac{x}{\lambda}\right)^{k}},

    with \lambda \neq 0, k > 0 and x > 0, \lambda - characteristic size, k - distribution modulus.

  - EDistributionFunction::GGS: y(x) = \frac{m}{x_{max}}\left(\frac{x}{x_{max}}\right)^{m-1},

    with x_{max} > 0, m > 0 and 0 \le x \le x_{max}, x_{max} - maximum size, m - distribution modulus.

  - EDistributionFunction::MANUAL: returns a vector of zeroes.

  Returns an empty vector if the constraints on function parameters are not satisfied.

  Parameters:

    - _type – Type of the distribution function.

    - _x – Points for which the distribution has to be generated.

    - _param1 – First parameter of the distribution function:

      - EDistributionFunction::NORMAL: mean \mu

      - EDistributionFunction::LOG_NORMAL: mean \mu

      - EDistributionFunction::RRSB: characteristic size \lambda

      - EDistributionFunction::GGS: maximum size x_{max}

    - _param2 – Second parameter of the distribution function:

      - EDistributionFunction::NORMAL: standard deviation \sigma

      - EDistributionFunction::LOG_NORMAL: standard deviation \sigma

      - EDistributionFunction::RRSB: distribution modulus k

      - EDistributionFunction::GGS: distribution modulus m

  Returns:

    Distribution.