MercuryDPM
Trunk
|
Contains a vector with radii and probabilities of a user defined particle size distribution (PSD) More...
#include <PSD.h>
Classes | |
class | RadiusAndProbability |
Class which stores radii and probabilities of a PSD. This class should be used as a vector<PSD::RadiusAndProbability>. More... | |
Public Types | |
enum | TYPE { TYPE::CUMULATIVE_NUMBER_DISTRIBUTION, TYPE::CUMULATIVE_LENGTH_DISTRIBUTION, TYPE::CUMULATIVE_VOLUME_DISTRIBUTION, TYPE::CUMULATIVE_AREA_DISTRIBUTION, TYPE::PROBABILITYDENSITY_NUMBER_DISTRIBUTION, TYPE::PROBABILITYDENSITY_LENGTH_DISTRIBUTION, TYPE::PROBABILITYDENSITY_AREA_DISTRIBUTION, TYPE::PROBABILITYDENSITY_VOLUME_DISTRIBUTION } |
Enum class which stores the possible types of CDFs and PDFs. Particle size distributions can be represented by different probabilities based on number of particles, length of particles, surface area of particles or volume of particles. More... | |
Public Member Functions | |
PSD () | |
Constructor; sets everything to 0 or default. More... | |
PSD (const PSD &other) | |
Copy constructor with deep copy. More... | |
~PSD () | |
Destructor; default destructor. More... | |
PSD * | copy () const |
Creates a copy on the heap and returns a pointer. More... | |
void | printPSD () const |
Prints radii and probabilities of the PSD vector. More... | |
Mdouble | drawSample () |
Draw a sample radius from a CUMULATIVE_NUMBER_DISTRIBUTION. More... | |
Mdouble | insertManuallyByVolume (Mdouble volume) |
Draw sample radius manually per size class and check the volumeAllowed of each size class to insert the PSD as accurate as possible. More... | |
void | validateCumulativeDistribution () |
Validates if a CDF starts with zero and adds up to unity. More... | |
void | validateProbabilityDensityDistribution () |
Validates if the integral of the PDF equals to unity. More... | |
MERCURY_DEPRECATED void | setPSDFromVector (std::vector< RadiusAndProbability > psd, TYPE PSDType) |
Deprecated version of reading in PSDs from a vector. More... | |
void | setPSDFromCSV (const std::string &fileName, TYPE PSDType, bool headings=false, Mdouble unitScalingFactorRadii=1.0) |
read in the PSD vector with probabilities and radii saved in a .csv file. More... | |
void | setDistributionUniform (Mdouble radMin, Mdouble radMax, int numberOfBins) |
create a PSD vector for a uniform distribution. More... | |
void | setDistributionNormal (Mdouble mean, Mdouble standardDeviation, int numberOfBins) |
create a PSD vector for a normal distribution. More... | |
void | convertProbabilityDensityToCumulative () |
Converts a PDF to a CDF by integration. More... | |
void | convertCumulativeToProbabilityDensity () |
Converts a CDF to a PDF by derivation. More... | |
void | convertProbabilityDensityToProbabilityDensityNumberDistribution (TYPE PDFType) |
convert any PDF to a PROBABILITYDENSITY_NUMBER_DISTRIBUTION. More... | |
void | convertProbabilityDensityNumberDistributionToProbabilityDensityVolumeDistribution () |
convert a PROBABILITYDENSITY_NUMBER_DISTRIBUTION to a PROBABILITYDENSITY_VOLUME_DISTRIBUTION. More... | |
void | convertCumulativeToCumulativeNumberDistribution (TYPE CDFType) |
convert any other CDF to a CUMULATIVE_NUMBER_DISTRIBUTION. More... | |
void | cutoffCumulativeNumber (Mdouble quantileMin, Mdouble quantileMax, Mdouble minPolydispersity=0.1) |
cutoff the PSD at given quantiles. More... | |
void | cutoffAndSqueezeCumulative (Mdouble quantileMin, Mdouble quantileMax, Mdouble squeeze, Mdouble minPolydispersity=0.1) |
cutoff the PSD at given quantiles and make it less polydisperse by squeezing it. More... | |
Mdouble | getMinRadius () const |
Get smallest radius of the PSD. More... | |
Mdouble | getMaxRadius () const |
Get largest radius of the PSD. More... | |
std::vector< RadiusAndProbability > | getParticleSizeDistribution () const |
Get the PSD vector. More... | |
void | setParticleSizeDistribution (std::vector< RadiusAndProbability >) |
set the PSD by a suitable vector. More... | |
int | getInsertedParticleNumber () const |
Get the number of particles already inserted into the simulation. More... | |
Mdouble | getNumberDx (Mdouble x) const |
Calculate a certain diameter (e.g. D10, D50, D90, etc.) from a percentile x of the number based PSD. More... | |
Mdouble | getVolumeDx (Mdouble x) const |
Calculate a certain diameter (e.g. D10, D50, D90, etc.) from a percentile x of the volume based PSD. More... | |
Mdouble | getRadiusByQuantile (Mdouble quantile) const |
Calculate the quantile of the PSD. More... | |
Mdouble | getVolumetricMeanRadius () const |
get a volumetric mean radius of the PSD. More... | |
Mdouble | getSizeRatio () const |
get the size ratio (width) of the PSD. More... | |
void | cutHighSizeRatio () |
Check if the size ratio is too high and cut it. More... | |
void | computeRawMomenta () |
compute raw momenta of the user defined PSD. More... | |
void | computeCentralMomenta () |
compute central momenta of the user defined PSD. More... | |
void | computeStandardisedMomenta () |
compute standardised momenta of the user defined PSD. More... | |
std::array< Mdouble, 6 > | getMomenta () const |
get momenta of the user defined PSD. More... | |
Private Attributes | |
std::vector< RadiusAndProbability > | particleSizeDistribution_ |
std::array< Mdouble, 6 > | momenta_ {} |
std::vector< int > | nParticlesPerClass_ |
std::vector< Mdouble > | volumePerClass_ |
Friends | |
bool | operator< (const PSD::RadiusAndProbability &l, const PSD::RadiusAndProbability &r) |
determines if a certain value of the PSD vector is lower than another one. Used for std::lower_bound() More... | |
bool | operator< (const PSD::RadiusAndProbability &l, Mdouble r) |
determines if a certain value of the PSD vector is lower than a double. More... | |
std::ostream & | operator<< (std::ostream &os, PSD::RadiusAndProbability &p) |
Writes to output stream. More... | |
std::istream & | operator>> (std::istream &is, PSD::RadiusAndProbability &p) |
Reads from input stream. More... | |
Mdouble | operator== (PSD::RadiusAndProbability l, Mdouble r) |
Determines if a certain value of the PSD vector is equal to a double. More... | |
Contains a vector with radii and probabilities of a user defined particle size distribution (PSD)
Stores radii and probabilities of a particle size distribution (PSD) in a vector of type PSD::RadiusAndProbability and converts them to a PSD which can be used by insertionBoundaries which insert particles into a simulation:
Cumulative distribution function (CDF): gives percentage of particles p_i whose radius r is less than a certain radius r_i. It requires p_0 = 0 and p_end = 1. The CDF's probabilities can be number, length, area or volume based. The cumulative number distribution function (CUMULATIVE_NUMBER_DISTRIBUTION) is used as PSD in MercuryDPM, as it can be interpreted as the probability that a particle's radius is less than r_i: CDF(r<r_i) = p_i.
Probability density function (PDF): p_i is the percentage of particles whose radius is between r_i-1 and r_i. It requires p_0=0 and sum(p_i)=1. The PDF's probabilities can also be number, length, area or volume based. PDF's are utilized to convert any type of PDF to a probability number density function (PROBABILITYDENSITY_NUMBER_DISTRIBUTION) which in a next step are converted to the default CUMULATIVE_NUMBER_DISTRIBUTION.
Sieve data: p_i is the percentage of particles whose radius is between r_i and r_i+1. It requires sum(p_i)=1. relation to PDF: p_i = p(PDF)_i-1. Sieve data is not yet used in this class.
Default distribution is the CUMULATIVE_NUMBER_DISTRIBUTION.
|
strong |
Enum class which stores the possible types of CDFs and PDFs. Particle size distributions can be represented by different probabilities based on number of particles, length of particles, surface area of particles or volume of particles.
Definition at line 71 of file PSD.h.
PSD::PSD | ( | ) |
PSD::PSD | ( | const PSD & | other | ) |
Copy constructor with deep copy.
Copy constructor
Definition at line 41 of file PSD.cc.
References momenta_, and particleSizeDistribution_.
|
default |
Destructor; default destructor.
Destructor. Since there are no pointers in this class, there is no need for any actions here.
void PSD::computeCentralMomenta | ( | ) |
compute central momenta of the user defined PSD.
Compute the central momenta of the PSD from their respective raw momenta.
Definition at line 876 of file PSD.cc.
References computeRawMomenta(), and momenta_.
Referenced by computeStandardisedMomenta().
void PSD::computeRawMomenta | ( | ) |
compute raw momenta of the user defined PSD.
Compute the raw momenta of the inserted PSD by converting it to a PDF, calculating the moments m_i according to \( m_i = \sum_{j=0}^n \) scaling it by the number of particles inserted into the simulation (moments are computed from a PROBABILITYDENSITY_NUMBER_DISTRIBUTION) and converting it back to a CDF. See Wikipedia for details.
Definition at line 856 of file PSD.cc.
References convertCumulativeToProbabilityDensity(), convertProbabilityDensityToCumulative(), getInsertedParticleNumber(), and momenta_.
Referenced by computeCentralMomenta().
void PSD::computeStandardisedMomenta | ( | ) |
compute standardised momenta of the user defined PSD.
Compute the standardised momenta of the PSD from their respective central momenta.
Definition at line 890 of file PSD.cc.
References computeCentralMomenta(), and momenta_.
void PSD::convertCumulativeToCumulativeNumberDistribution | ( | TYPE | CDFType | ) |
convert any other CDF to a CUMULATIVE_NUMBER_DISTRIBUTION.
converts any of the CDFTypes to a the default CUMULATIVE_NUMBER_DISTRIBUTION based on their TYPE.
[in] | PDFType | Type of the PDF: PROBABILITYDENSITY_LENGTH_DISTRIBUTION, PROBABILITYDENSITY_AREA_DISTRIBUTION or PROBABILITYDENSITY_VOLUME_DISTRIBUTION, Where L = Length, A = Area and V = Volume. |
Definition at line 609 of file PSD.cc.
void PSD::convertCumulativeToProbabilityDensity | ( | ) |
Converts a CDF to a PDF by derivation.
Convert any type of CDF to a PDF. Probabilities are derivated for each radius by substracting the CDF probabilities (i.e. pPDF_i = pCDF_i - pCDF_i-1).
Definition at line 502 of file PSD.cc.
References particleSizeDistribution_, and validateProbabilityDensityDistribution().
Referenced by computeRawMomenta(), getVolumeDx(), getVolumetricMeanRadius(), insertManuallyByVolume(), setPSDFromCSV(), and setPSDFromVector().
void PSD::convertProbabilityDensityNumberDistributionToProbabilityDensityVolumeDistribution | ( | ) |
convert a PROBABILITYDENSITY_NUMBER_DISTRIBUTION to a PROBABILITYDENSITY_VOLUME_DISTRIBUTION.
converts a PROBABILITYDENSITY_NUMBER_DISTRIBUTION to a PROBABILITYDENSITY_VOLUME_DISTRIBUTION. Used for getVolumetricMeanRadius() and insertManuallyByVolume().
Definition at line 584 of file PSD.cc.
References particleSizeDistribution_, and mathsFunc::square().
Referenced by getVolumeDx(), getVolumetricMeanRadius(), and insertManuallyByVolume().
void PSD::convertProbabilityDensityToCumulative | ( | ) |
Converts a PDF to a CDF by integration.
Convert any type of PDF to a CDF. Probabilities are integrated for each radius by cumulatively summing them up (i.e. p_i = p_i + p_i-1).
Definition at line 487 of file PSD.cc.
References particleSizeDistribution_, and validateCumulativeDistribution().
Referenced by computeRawMomenta(), getVolumeDx(), insertManuallyByVolume(), setPSDFromCSV(), and setPSDFromVector().
void PSD::convertProbabilityDensityToProbabilityDensityNumberDistribution | ( | TYPE | PDFType | ) |
convert any PDF to a PROBABILITYDENSITY_NUMBER_DISTRIBUTION.
converts any of the PDFTypes to a PROBABILITYDENSITY_NUMBER_DISTRIBUTION based on their TYPE. This is a helper function which enables the convertProbabilityDensityToCumulative function to convert the psd into the default TYPE (CUMULATIVE_NUMBER_DISTRIBUTION).
[in] | PDFType | Type of the PDF: PROBABILITYDENSITY_LENGTH_DISTRIBUTION, PROBABILITYDENSITY_AREA_DISTRIBUTION or PROBABILITYDENSITY_VOLUME_DISTRIBUTION, Where L = Length, A = Area and V = Volume. |
Definition at line 522 of file PSD.cc.
References ERROR, logger, particleSizeDistribution_, PROBABILITYDENSITY_AREA_DISTRIBUTION, PROBABILITYDENSITY_LENGTH_DISTRIBUTION, PROBABILITYDENSITY_VOLUME_DISTRIBUTION, and mathsFunc::square().
Referenced by insertManuallyByVolume(), setPSDFromCSV(), and setPSDFromVector().
PSD * PSD::copy | ( | ) | const |
void PSD::cutHighSizeRatio | ( | ) |
Check if the size ratio is too high and cut it.
Checks if the Size ratio of the PSD is too high and cuts the PSD at head and tail by 10 percent to avoid inaccurate results.
Definition at line 789 of file PSD.cc.
References cutoffCumulativeNumber(), getSizeRatio(), logger, and WARN.
void PSD::cutoffAndSqueezeCumulative | ( | Mdouble | quantileMin, |
Mdouble | quantileMax, | ||
Mdouble | squeeze, | ||
Mdouble | minPolydispersity = 0.1 |
||
) |
cutoff the PSD at given quantiles and make it less polydisperse by squeezing it.
Cuts off the CDF at given minimum and maximum quantiles, applies a minimum polydispersity at the base and squeezes the distribution to make it less polydisperse.
[in] | quantileMin | undersize quantile to cut off the lower part of the CDF. |
[in] | quantileMax | oversize quantile to cut off the upper part of the CDF. |
[in] | squeeze | applies a squeezing factor ([0,1]) which determines the degree the PDF gets squeezed. |
[in] | minPolydispersity | applies a minimum of polydispersity ([0,1]) at the base of the CDF. |
Definition at line 702 of file PSD.cc.
References cutoffCumulativeNumber(), and getNumberDx().
void PSD::cutoffCumulativeNumber | ( | Mdouble | quantileMin, |
Mdouble | quantileMax, | ||
Mdouble | minPolydispersity = 0.1 |
||
) |
cutoff the PSD at given quantiles.
Cuts off the CDF at given minimum and maximum quantiles and applies a minimum polydispersity at the base.
[in] | quantileMin | undersize quantile to cut off the lower part of the CDF. |
[in] | quantileMax | oversize quantile to cut off the upper part of the CDF. |
[in] | minPolydispersity | Applies a minimum of polydispersity ([0,1]) at the base of the CDF. |
Definition at line 668 of file PSD.cc.
References getRadiusByQuantile(), getSizeRatio(), INFO, and logger.
Referenced by cutHighSizeRatio(), and cutoffAndSqueezeCumulative().
Mdouble PSD::drawSample | ( | ) |
Draw a sample radius from a CUMULATIVE_NUMBER_DISTRIBUTION.
Draws a sample probability of a real uniform distribution. A random number is generated in range [0,1] and by linear interpolation a suitable radius is returned. This function is only valid for CumulativeNumberDistributions as particles are drawn and not volumes, areas or lengths.
Definition at line 109 of file PSD.cc.
References particleSizeDistribution_.
int PSD::getInsertedParticleNumber | ( | ) | const |
Get the number of particles already inserted into the simulation.
Gets the number of particles already inserted into the simulation by summing up the particles inserted in each class.
Definition at line 840 of file PSD.cc.
References nParticlesPerClass_.
Referenced by computeRawMomenta().
Mdouble PSD::getMaxRadius | ( | ) | const |
Mdouble PSD::getMinRadius | ( | ) | const |
std::array< Mdouble, 6 > PSD::getMomenta | ( | ) | const |
Calculate a certain diameter (e.g. D10, D50, D90, etc.) from a percentile x of the number based PSD.
Gets the diameter from a certain percentile of the number based PSD.
[in] | x | double which determines the obtained diameter as a percentile of the PSD. |
Definition at line 720 of file PSD.cc.
References getRadiusByQuantile().
Referenced by cutoffAndSqueezeCumulative().
std::vector< PSD::RadiusAndProbability > PSD::getParticleSizeDistribution | ( | ) | const |
Get the PSD vector.
Gets the vector containing radii and probabilities of the PSD.
Definition at line 821 of file PSD.cc.
References particleSizeDistribution_.
Calculate the quantile of the PSD.
gets the radius from a certain quantile of the PSD
[in] | quantile | double which determines the returned radius as a quantile of the PSD. |
Definition at line 744 of file PSD.cc.
References logger.
Referenced by cutoffCumulativeNumber(), getNumberDx(), and getVolumeDx().
Mdouble PSD::getSizeRatio | ( | ) | const |
get the size ratio (width) of the PSD.
Gets the size ratio (width) of the PSD defined by the ratio of minimum to maximum particle radius.
Definition at line 778 of file PSD.cc.
References getMaxRadius(), and getMinRadius().
Referenced by cutHighSizeRatio(), cutoffCumulativeNumber(), and setPSDFromCSV().
Calculate a certain diameter (e.g. D10, D50, D90, etc.) from a percentile x of the volume based PSD.
Gets the diameter from a certain percentile of the volume based PSD.
[in] | x | double which determines the obtained diameter as a percentile of the PSD. |
Definition at line 730 of file PSD.cc.
References convertCumulativeToProbabilityDensity(), convertProbabilityDensityNumberDistributionToProbabilityDensityVolumeDistribution(), convertProbabilityDensityToCumulative(), and getRadiusByQuantile().
Mdouble PSD::getVolumetricMeanRadius | ( | ) | const |
get a volumetric mean radius of the PSD.
Gets a radius such that a monodisperse system has the same number of particles as a polydisperse system. (i.e. mean += p_i * 0.5*(r_i^3 + r_i-1^3)
Definition at line 762 of file PSD.cc.
References convertCumulativeToProbabilityDensity(), convertProbabilityDensityNumberDistributionToProbabilityDensityVolumeDistribution(), and mathsFunc::cubic().
Draw sample radius manually per size class and check the volumeAllowed of each size class to insert the PSD as accurate as possible.
Draws a sample probability of a real uniform distribution within a given size class. A random number is generated in the size class range [r_i,r_i+1] and by linear interpolation a suitable radius is returned. from a CUMULATIVE_VOLUME_DISTRIBUTION the volumeAllowed of each class is checked to insert the PSD as accurate as possible. This function is only valid for cumulativeNumberDistributions as particles are drawn and not volumes, areas or lengths. Furthermore this insertion routine is most accurate for non-continuous particle insertion.
[in] | volume | volume of the geometry to be filled. |
Definition at line 137 of file PSD.cc.
References convertCumulativeToProbabilityDensity(), convertProbabilityDensityNumberDistributionToProbabilityDensityVolumeDistribution(), convertProbabilityDensityToCumulative(), convertProbabilityDensityToProbabilityDensityNumberDistribution(), nParticlesPerClass_, particleSizeDistribution_, constants::pi, PROBABILITYDENSITY_VOLUME_DISTRIBUTION, and volumePerClass_.
void PSD::printPSD | ( | ) | const |
Prints radii and probabilities of the PSD vector.
Prints the radii [m] and probabilities [%] of the psd vector. It currently supports nanometers, micrometers, milimeters and meters as size units.
Definition at line 71 of file PSD.cc.
References INFO, logger, and particleSizeDistribution_.
create a PSD vector for a normal distribution.
sets the particle size distribution to a discretised normal (gaussian) cumulative number distribution, which covers the range of 3 * standardDeviation (99,73% of all values covered).
[in] | mean | Double representing the mean of the particle size distribution |
[in] | standardDeviation | Double representing the standard deviation of the particle size distribution |
[in] | numberOfBins | Integer determining the number of bins (aka. particle size classes or resolution) of the particle size distribution |
Definition at line 314 of file PSD.cc.
References constants::i, helpers::linspace(), logger, particleSizeDistribution_, and validateCumulativeDistribution().
create a PSD vector for a uniform distribution.
sets the particle size distribution to a discretised uniform (linear) cumulative number distribution
[in] | radMin | Double representing The smallest particle radius of the particle size distribution |
[in] | radMax | Double representing the biggest particle radius of the particle size distribution |
[in] | numberOfBins | Integer determining the number of bins (aka. particle size classes or resolution) of the particle size distribution |
Definition at line 290 of file PSD.cc.
References constants::i, helpers::linspace(), particleSizeDistribution_, and validateCumulativeDistribution().
Referenced by CubeInsertionBoundary::set(), Chute::setupInitialConditions(), and ChuteWithHopper::setupInitialConditions().
void PSD::setParticleSizeDistribution | ( | std::vector< RadiusAndProbability > | particleSizeDistribution | ) |
set the PSD by a suitable vector.
sets the PSD from a vector of the PSD::RadiusAndProbability class; used to read in PSDs from a restart file.
[in] | particleSizeDistribution | vector containing the radii and probabilities specifying the PSD. |
Definition at line 830 of file PSD.cc.
void PSD::setPSDFromCSV | ( | const std::string & | fileName, |
TYPE | PSDType, | ||
bool | headings = false , |
||
Mdouble | unitScalingFactorRadii = 1.0 |
||
) |
read in the PSD vector with probabilities and radii saved in a .csv file.
creates the PSD vector from probabilities and radii saved in a .csv file. Radii should be located at the first column and probabilities at the second column of the file. The Type of PSD will be converted to the default cumulative number distribution function (CUMULATIVE_NUMBER_DISTRIBUTION) for further processing.
[in] | fileName | Name of the .csv file containing the radii and probabilities of the PSD. |
[in] | PSDType | Type of the PSD: CUMULATIVE_VOLUME_DISTRIBUTION, CUMULATIVE_NUMBER_DISTRIBUTION, CUMULATIVE_LENGTH_DISTRIBUTION, CUMULATIVE_AREA_DISTRIBUTION, PROBABILITYDENSITY_VOLUME_DISTRIBUTION, PROBABILITYDENSITY_NUMBER_DISTRIBUTION, PROBABILITYDENSITY_LENGTH_DISTRIBUTION PROBABILITYDENSITY_AREA_DISTRIBUTION. |
[in] | headings | If TRUE the file is assumed to have headings and the first row will be skipped. If FALSE the file has no headings and the file will be read in as is. Default is FALSE. |
[in] | unitScalingFactorRadii | Scaling factor of radii to match SI-units. |
Definition at line 418 of file PSD.cc.
References convertCumulativeToProbabilityDensity(), convertProbabilityDensityToCumulative(), convertProbabilityDensityToProbabilityDensityNumberDistribution(), CUMULATIVE_AREA_DISTRIBUTION, CUMULATIVE_LENGTH_DISTRIBUTION, CUMULATIVE_VOLUME_DISTRIBUTION, csvReader::getFirstColumn(), csvReader::getSecondColumn(), getSizeRatio(), constants::i, INFO, logger, particleSizeDistribution_, PROBABILITYDENSITY_AREA_DISTRIBUTION, PROBABILITYDENSITY_LENGTH_DISTRIBUTION, PROBABILITYDENSITY_NUMBER_DISTRIBUTION, PROBABILITYDENSITY_VOLUME_DISTRIBUTION, csvReader::read(), csvReader::setHeader(), validateCumulativeDistribution(), and validateProbabilityDensityDistribution().
MERCURY_DEPRECATED void PSD::setPSDFromVector | ( | std::vector< RadiusAndProbability > | psdVector, |
TYPE | PSDType | ||
) |
Deprecated version of reading in PSDs from a vector.
creates the psd vector from radii and probabilities filled in by hand. The Type of PSD will be converted to the default cumulative number distribution function (CUMULATIVE_NUMBER_DISTRIBUTION) for further processing.
[in] | psdVector | Vector containing radii and probabilities ([0,1]). |
[in] | PSDType | Type of the PSD: CUMULATIVE_VOLUME_DISTRIBUTION, CUMULATIVE_NUMBER_DISTRIBUTION, CUMULATIVE_LENGTH_DISTRIBUTION, CUMULATIVE_AREA_DISTRIBUTION, PROBABILITYDENSITY_VOLUME_DISTRIBUTION, PROBABILITYDENSITY_NUMBER_DISTRIBUTION, PROBABILITYDENSITY_LENGTH_DISTRIBUTION, PROBABILITYDENSITY_AREA_DISTRIBUTION. |
Definition at line 352 of file PSD.cc.
References convertCumulativeToProbabilityDensity(), convertProbabilityDensityToCumulative(), convertProbabilityDensityToProbabilityDensityNumberDistribution(), CUMULATIVE_AREA_DISTRIBUTION, CUMULATIVE_LENGTH_DISTRIBUTION, CUMULATIVE_VOLUME_DISTRIBUTION, particleSizeDistribution_, PROBABILITYDENSITY_AREA_DISTRIBUTION, PROBABILITYDENSITY_LENGTH_DISTRIBUTION, PROBABILITYDENSITY_NUMBER_DISTRIBUTION, PROBABILITYDENSITY_VOLUME_DISTRIBUTION, validateCumulativeDistribution(), and validateProbabilityDensityDistribution().
void PSD::validateCumulativeDistribution | ( | ) |
Validates if a CDF starts with zero and adds up to unity.
Validates if a distribution is cumulative by first checking if the psd vector is empty and that the scaling of probabilities is in the range [0,1]. Also it checks if each consecutive value is higher than the latter value (i.e. assuming piecewise linear CDF: p_i > p_i-1). Further it replaces probabilities if the CDF does not start with zero or does not end with unity (i.e. p_0=0 and p_end=1)
Definition at line 210 of file PSD.cc.
References constants::i, INFO, logger, and particleSizeDistribution_.
Referenced by convertProbabilityDensityToCumulative(), setDistributionNormal(), setDistributionUniform(), setPSDFromCSV(), and setPSDFromVector().
void PSD::validateProbabilityDensityDistribution | ( | ) |
Validates if the integral of the PDF equals to unity.
Validates if a PDF is valid by first checking if the PDF starts with zero (i.e. p_0=0). Further it checks if the integral is equal to unity (i.e. assuming piecewise constant PDF: sum(p_i)=1).
Definition at line 251 of file PSD.cc.
References INFO, logger, and particleSizeDistribution_.
Referenced by convertCumulativeToProbabilityDensity(), setPSDFromCSV(), and setPSDFromVector().
|
friend |
determines if a certain value of the PSD vector is lower than another one. Used for std::lower_bound()
Required to use std::lower_bound for finding when the probability is higher than a certain value.
Definition at line 913 of file PSD.cc.
|
friend |
determines if a certain value of the PSD vector is lower than a double.
required to use std::lower_bound for finding when the probability provided as a double is higher than a certain value.
Definition at line 924 of file PSD.cc.
|
friend |
|
friend |
Determines if a certain value of the PSD vector is equal to a double.
Required to use std::distance to find the index of the PSD size class in which a particle has to be inserted
Definition at line 933 of file PSD.cc.
|
friend |
|
private |
Array of doubles which stores the moments of a user defined discrete PROBABILITYDENSITY_NUMBER_DISTRIBUTION.
Definition at line 307 of file PSD.h.
Referenced by computeCentralMomenta(), computeRawMomenta(), computeStandardisedMomenta(), getMomenta(), and PSD().
|
private |
Vector of integers which represents the number of inserted particles in each size class. The classes in this vector are defined to contain the particles between size r_i and r_i-1. (e.g. size class 12 consists of particles between size class 12 and 11 of the PDF)
Definition at line 314 of file PSD.h.
Referenced by getInsertedParticleNumber(), and insertManuallyByVolume().
|
private |
Vector of the PSD::RadiusAndProbability class which stores radii and probabilities of the PSD.
Definition at line 301 of file PSD.h.
Referenced by convertCumulativeToProbabilityDensity(), convertProbabilityDensityNumberDistributionToProbabilityDensityVolumeDistribution(), convertProbabilityDensityToCumulative(), convertProbabilityDensityToProbabilityDensityNumberDistribution(), drawSample(), getParticleSizeDistribution(), insertManuallyByVolume(), printPSD(), PSD(), setDistributionNormal(), setDistributionUniform(), setPSDFromCSV(), setPSDFromVector(), validateCumulativeDistribution(), and validateProbabilityDensityDistribution().
|
private |
Vector of doubles which stores the volume of inserted particles for each size class. This vector is used in the insertManuallyByVolume() function to check if the volumeAllowed per class is exceeded and thus no further particles should be added to a certain class. The classes in this vector are defined to contain the volume of particles between size r_i and r_i-1. (e.g. size class 12 consists of the particles' volume between size class 12 and 11 of the PDF)
Definition at line 323 of file PSD.h.
Referenced by insertManuallyByVolume().