jaxrts.helpers.mass_from_number_fraction

jaxrts.helpers.mass_from_number_fraction(number_fractions, elements)[source]

Calculate the mass fraction of a mixture.

Parameters:
  • number_fractions (array_like) – The number fractions of each chemical element.

  • elements (list) – The masses of the respective chemical elements.

Returns:

ndarray – The mass fractions of the chemical elements in the mixture.

Raises:

ValueError – If the lengths of number_fractions and elements are not the same.

Examples

>>> number_fractions = [1/3, 2/3]
>>> elements = [jaxrts.Element("C"), jaxrts.Element("H")]
>>> calculate_mass_fraction(number_fractions, elements)
Array([0.85627718, 0.14372282], dtype=float64)

Examples using jaxrts.helpers.mass_from_number_fraction

Multi-Species Plasmas

Multi-Species Plasmas

Moving edges vs cold ionoization edges

Moving edges vs cold ionoization edges

Saha equation for hot jupiter materials

Saha equation for hot jupiter materials