IonizationState¶
-
class
plasmapy.particles.ionization_state.
IonizationState
(particle: plasmapy.particles.particle_class.Particle, ionic_fractions=None, *, T_e: Unit("K") = <Quantity nan K>, kappa: numbers.Real = inf, n_elem: Unit("1 / m3") = <Quantity nan 1 / m3>, tol: Union[float, int] = 1e-15)¶ Bases:
object
Representation of the ionization state distribution of a single element or isotope.
Parameters: - particle (str, integer, or Particle) – A
str
orParticle
instance representing an element or isotope, or an integer representing the atomic number of an element. - ionic_fractions (ndarray, list, tuple, or Quantity; optional) – The ionization fractions of an element, where the indices
correspond to integer charge. This argument should contain the
atomic number plus one items, and must sum to one within an
absolute tolerance of
tol
if dimensionless. Alternatively, this argument may be aQuantity
that represents the number densities of each neutral/ion. - T_e (Quantity, keyword-only, optional) – The electron temperature or thermal energy per particle.
- n_elem (Quantity, keyword-only, optional) – The number density of the element, including neutrals and all ions.
- tol (float or integer, keyword-only, optional) – The absolute tolerance used by
isclose
when testing normalizations and making comparisons. Defaults to1e-15
.
Raises: AtomicError
– If the ionic fractions are not normalized or contain invalid values, or if number density information is provided through bothionic_fractions
andn_elem
.InvalidParticleError
– If the particle is invalid.
Examples
>>> states = IonizationState('H', [0.6, 0.4], n_elem=1*u.cm**-3, T_e=11000*u.K) >>> states.ionic_fractions[0] # fraction of hydrogen that is neutral 0.6 >>> states.ionic_fractions[1] # fraction of hydrogen that is ionized 0.4 >>> states.n_e # electron number density <Quantity 400000. 1 / m3> >>> states.n_elem # element number density <Quantity 1000000. 1 / m3>
Notes
Calculation of collisional ionization equilibrium has not yet been implemented.
Attributes Summary
T_e
Return the electron temperature. Z_mean
Return the mean integer charge Z_most_abundant
Return a list
of the integer charges with the highest ionic fractions.Z_rms
Return the root mean square integer charge. atomic_number
Return the atomic number of the element. base_particle
Return the symbol of the element or isotope. element
Return the atomic symbol of the element. equil_ionic_fractions
Return the equilibrium ionic fractions for temperature T_e
or the temperature set in the IonizationState instance.integer_charges
Return an array with the integer charges. ionic_fractions
Return the ionic fractions, where the index corresponds to the integer charge. ionic_symbols
Return the ionic symbols for all charge states. isotope
Return the isotope symbol for an isotope, or None
if the particle is not an isotope.kappa
Return the kappa parameter for a kappa distribution function for electrons. n_e
Return the electron number density assuming a single species plasma. n_elem
Return the total number density of neutrals and all ions. number_densities
Return the number densities for each state. tol
Return the absolute tolerance for comparisons. Methods Summary
equilibrate
(T_e)Set the ionic fractions to collisional ionization equilibrium for temperature T_e
.info
(minimum_ionic_fraction)Print quicklook information for an IonizationState
instance.normalize
()Normalize the ionization state distribution (if set) so that the sum becomes equal to one. Attributes Documentation
-
T_e
¶ Return the electron temperature.
-
Z_mean
¶ Return the mean integer charge
-
Z_most_abundant
¶ Return a
list
of the integer charges with the highest ionic fractions.Examples
>>> He = IonizationState('He', [0.2, 0.5, 0.3]) >>> He.Z_most_abundant [1] >>> Li = IonizationState('Li', [0.4, 0.4, 0.2, 0.0]) >>> Li.Z_most_abundant [0, 1]
-
Z_rms
¶ Return the root mean square integer charge.
-
atomic_number
¶ Return the atomic number of the element.
-
base_particle
¶ Return the symbol of the element or isotope.
-
element
¶ Return the atomic symbol of the element.
-
equil_ionic_fractions
¶ Return the equilibrium ionic fractions for temperature
T_e
or the temperature set in the IonizationState instance. Not implemented.
-
integer_charges
¶ Return an array with the integer charges.
-
ionic_fractions
¶ Return the ionic fractions, where the index corresponds to the integer charge.
Examples
>>> hydrogen_states = IonizationState('H', [0.9, 0.1]) >>> hydrogen_states.ionic_fractions array([0.9, 0.1])
-
ionic_symbols
¶ Return the ionic symbols for all charge states.
-
kappa
¶ Return the kappa parameter for a kappa distribution function for electrons.
The value of
kappa
must be greater than1.5
in order to have a valid distribution function. Ifkappa
equalsinf
, then the distribution function reduces to a Maxwellian.
-
n_e
¶ Return the electron number density assuming a single species plasma.
-
n_elem
¶ Return the total number density of neutrals and all ions.
-
number_densities
¶ Return the number densities for each state.
-
tol
¶ Return the absolute tolerance for comparisons.
Methods Documentation
-
equilibrate
(T_e: Unit("K") = <Quantity nan K>)¶ Set the ionic fractions to collisional ionization equilibrium for temperature
T_e
. Not implemented.
-
info
(minimum_ionic_fraction: numbers.Real = 0.01) → None¶ Print quicklook information for an
IonizationState
instance.Parameters: minimum_ionic_fraction (Real) – If the ionic fraction for a particular ionization state is below this level, then information for it will not be printed. Defaults to 0.01. Example
>>> He_states = IonizationState( ... 'He', ... [0.941, 0.058, 0.001], ... T_e = 5.34 * u.K, ... kappa = 4.05, ... n_elem = 5.51e19 * u.m ** -3, ... ) >>> He_states.info() IonizationState instance for He with Z_mean = 0.06 ---------------------------------------------------------------- He 0+: 0.941 n_i = 5.18e+19 m**-3 He 1+: 0.058 n_i = 3.20e+18 m**-3 ---------------------------------------------------------------- n_elem = 5.51e+19 m**-3 n_e = 3.31e+18 m**-3 T_e = 5.34e+00 K kappa = 4.05 ----------------------------------------------------------------
-
normalize
() → None¶ Normalize the ionization state distribution (if set) so that the sum becomes equal to one.
- particle (str, integer, or Particle) – A