openmc.stats.Maxwell

class openmc.stats.Maxwell(theta)[source]

Maxwellian distribution in energy.

The Maxwellian distribution in energy is characterized by a single parameter \(\theta\) and has a density function \(p(E) dE = c \sqrt{E} e^{-E/\theta} dE\).

Parameters:

theta (float) – Effective temperature for distribution in eV

Variables:

theta (float) – Effective temperature for distribution in eV

classmethod from_xml_element(elem: Element)[source]

Generate Maxwellian distribution from an XML element

Parameters:

elem (lxml.etree._Element) – XML element

Returns:

Maxwellian distribution generated from XML element

Return type:

openmc.stats.Maxwell

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 Maxwellian distribution

Parameters:

element_name (str) – XML element name

Returns:

element – XML element containing Maxwellian distribution data

Return type:

lxml.etree._Element