openmc.stats.Normal

class openmc.stats.Normal(mean_value, std_dev)[source]

Normally distributed sampling.

The Normal Distribution is characterized by two parameters \(\mu\) and \(\sigma\) and has density function \(p(X) dX = 1/(\sqrt{2\pi}\sigma) e^{-(X-\mu)^2/(2\sigma^2)}\)

Parameters
  • mean_value (float) – Mean value of the distribution

  • std_dev (float) – Standard deviation of the Normal distribution

Variables
  • mean_value (float) – Mean of the Normal distribution

  • std_dev (float) – Standard deviation of the Normal distribution

classmethod from_xml_element(elem: Element)[source]

Generate Normal distribution from an XML element

Parameters

elem (lxml.etree._Element) – XML element

Returns

Normal distribution generated from XML element

Return type

openmc.stats.Normal

sample(n_samples=1, seed=None)[source]

Sample the univariate distribution

Parameters
  • n_samples (int) – Number of sampled values to generate

  • seed (int or None) – Initial random number seed.

Returns

A 1-D array of sampled values

Return type

numpy.ndarray

to_xml_element(element_name: str)[source]

Return XML representation of the Normal distribution

Parameters

element_name (str) – XML element name

Returns

element – XML element containing Watt distribution data

Return type

lxml.etree._Element