Exemple #1
0
def Hall_parameter(n,
                   T,
                   B,
                   ion_particle,
                   particle='e-',
                   coulomb_log=None,
                   V=None,
                   coulomb_log_method="classical"):
    r"""Calculate the ratio between the particle gyrofrequency and the
    particle-ion particle collision rate.

    All parameters apply to `particle`.

    Parameters
    ----------
    n : ~astropy.units.quantity.Quantity
        The density of particle s
    T : ~astropy.units.quantity.Quantity
        The temperature of particles
    B : ~astropy.units.quantity.Quantity
        The magnetic field
    ion_particle : str
        String signifying the type of ion.
    particle : str, optional
        String signifying the type of particles. Defaults to electrons.
    coulomb_log : float, optional
        Preset value for the Coulomb logarithm. Used mostly for testing purposes.
    V : ~astropy.units.quantity.Quantity
        The relative velocity between `particle` and ion particles.
    coulomb_log_method : str, optional
        Method used for Coulomb logarithm calculation. Refer to its documentation.

    See Also
    --------
    plasmapy.formulary.parameters.gyrofrequency
    plasmapy.formulary.parameters.fundamental_electron_collision_freq
    plasmapy.formulary.collisions.Coulomb_logarithm

    Returns
    -------
    astropy.units.quantity.Quantity
    """
    from plasmapy.formulary.collisions import (fundamental_ion_collision_freq,
                                               fundamental_electron_collision_freq)
    gyro_frequency = gyrofrequency(B, particle)
    gyro_frequency = gyro_frequency / u.radian
    if atomic.Particle(particle).particle == 'e-':
        coll_rate = fundamental_electron_collision_freq(T,
                                                        n,
                                                        ion_particle,
                                                        coulomb_log,
                                                        V,
                                                        coulomb_log_method=coulomb_log_method)
    else:
        coll_rate = fundamental_ion_collision_freq(T, n, ion_particle, coulomb_log, V)
    return gyro_frequency / coll_rate
Exemple #2
0
def Hall_parameter(
    n: u.m**-3,
    T: u.K,
    B: u.T,
    ion,
    particle="e-",
    coulomb_log=None,
    V=None,
    coulomb_log_method="classical",
):
    r"""Calculate the ratio between the particle gyrofrequency and the
    particle-ion particle collision rate.

    All parameters apply to `particle`.

    Parameters
    ----------
    n : ~astropy.units.quantity.Quantity
        The density of particle s
    T : ~astropy.units.quantity.Quantity
        The temperature of particles
    B : ~astropy.units.quantity.Quantity
        The magnetic field
    ion : str
        String signifying the type of ion.
    particle : str, optional
        String signifying the type of particles. Defaults to electrons.
    coulomb_log : float, optional
        Preset value for the Coulomb logarithm. Used mostly for testing purposes.
    V : ~astropy.units.quantity.Quantity
        The relative velocity between `particle` and ion particles.
    coulomb_log_method : str, optional
        Method used for Coulomb logarithm calculation. Refer to its documentation.

    See Also
    --------
    plasmapy.formulary.parameters.gyrofrequency
    plasmapy.formulary.parameters.fundamental_electron_collision_freq
    plasmapy.formulary.collisions.Coulomb_logarithm

    Returns
    -------
    astropy.units.quantity.Quantity

    Examples
    --------
    >>> from astropy import units as u
    >>> Hall_parameter(1e10 * u.m**-3, 2.8e3 * u.eV, 2.3 * u.T, 'He-4 +1')
    <Quantity 7.26446...e+16>
    >>> Hall_parameter(1e10 * u.m**-3, 5.8e3 * u.eV, 2.3 * u.T, 'He-4 +1')
    <Quantity 2.11158...e+17>

    """
    from plasmapy.formulary.collisions import (
        fundamental_ion_collision_freq,
        fundamental_electron_collision_freq,
    )

    gyro_frequency = gyrofrequency(B, particle)
    gyro_frequency = gyro_frequency / u.radian
    if particles.Particle(particle).particle == "e-":
        coll_rate = fundamental_electron_collision_freq(
            T, n, ion, coulomb_log, V, coulomb_log_method=coulomb_log_method)
    else:
        coll_rate = fundamental_ion_collision_freq(T, n, ion, coulomb_log, V)
    return gyro_frequency / coll_rate
Exemple #3
0
def Hall_parameter(
    n: u.m**-3,
    T: u.K,
    B: u.T,
    ion: Particle,
    particle: Particle,
    coulomb_log=None,
    V=None,
    coulomb_log_method="classical",
):
    r"""
    Calculate the ``particle`` Hall parameter for a plasma.

    The Hall parameter for plasma species :math:`s` (``particle``) is given by:

    .. math::

        β_{s} = \frac{Ω_{c s}}{ν_{s s^{\prime}}}

    where :math:`Ω_{c s}` is the gyrofrequncy for plasma species :math:`s`
    (``particle``) and :math:`ν_{s s^{\prime}}` is the collision frequency
    between plasma species :math:`s` (``particle``) and species
    :math:`s^{\prime}` (``ion``).

    **Aliases:** `betaH_`

    Parameters
    ----------
    n : `~astropy.units.quantity.Quantity`
        The number density associated with ``particle``.

    T : `~astropy.units.quantity.Quantity`
        The temperature of associated with ``particle``.

    B : `~astropy.units.quantity.Quantity`
        The magnetic field.

    ion : `~plasmapy.particles.particle_class.Particle`
        The type of ion ``particle`` is colliding with.

    particle : `~plasmapy.particles.particle_class.Particle`
        The particle species for which the Hall parameter is calculated for.
        Representation of the particle species (e.g., ``'p'`` for protons,
        ``'D+'`` for deuterium, or ``'He-4 +1'`` for singly ionized helium-4).
        If no charge state information is provided, then the particles are
        assumed to be singly charged.

    coulomb_log : `float`, optional
        Preset value for the Coulomb logarithm. Used mostly for testing purposes.

    V : `~astropy.units.quantity.Quantity`
        The relative velocity between ``particle`` and ``ion``.  If not provided,
        then the ``particle`` thermal velocity is assumed
        (`~plasmapy.formulary.speeds.thermal_speed`).

    coulomb_log_method : `str`, optional
        The method by which to compute the Coulomb logarithm.
        The default method is the classical straight-line Landau-Spitzer
        method (``"classical"`` or ``"ls"``). The other 6 supported methods
        are ``"ls_min_interp"``, ``"ls_full_interp"``, ``"ls_clamp_mininterp"``,
        ``"hls_min_interp"``, ``"hls_max_interp"``, and ``"hls_full_interp"``.
        Please refer to the docstring of
        `~plasmapy.formulary.collisions.Coulomb_logarithm` for more
        information about these methods.

    See Also
    --------
    ~plasmapy.formulary.frequencies.gyrofrequency
    ~plasmapy.formulary.collisions.fundamental_electron_collision_freq
    ~plasmapy.formulary.collisions.fundamental_ion_collision_freq
    ~plasmapy.formulary.collisions.Coulomb_logarithm

    Returns
    -------
    `~astropy.units.quantity.Quantity`
        Hall parameter for ``particle``.

    Notes
    -----
    * For calculating the collision frequency
      `~plasmapy.formulary.collisions.fundamental_electron_collision_freq` is used
      when ``particle`` is an electron and
      `~plasmapy.formulary.collisions.fundamental_ion_collision_freq` when
      ``particle`` is an ion.
    * The collision frequencies are calculated assuming a slowly moving
      Maxwellian distribution.

    Examples
    --------
    >>> import astropy.units as u
    >>> import pytest
    >>> from plasmapy.utils.exceptions import RelativityWarning

    >>> Hall_parameter(1e10 * u.m**-3, 2.8e2 * u.eV, 2.3 * u.T, 'He-4 +1', 'e-')
    <Quantity 2.500...e+15>
    >>> with pytest.warns(RelativityWarning):
    ...     Hall_parameter(1e10 * u.m**-3, 5.8e3 * u.eV, 2.3 * u.T, 'He-4 +1', 'e-')
    <Quantity 2.11158...e+17>
    """
    from plasmapy.formulary.collisions import (
        fundamental_electron_collision_freq,
        fundamental_ion_collision_freq,
    )

    gyro_frequency = frequencies.gyrofrequency(B, particle)
    gyro_frequency = gyro_frequency / u.radian
    if Particle(particle).symbol == "e-":
        coll_rate = fundamental_electron_collision_freq(
            T, n, ion, coulomb_log, V, coulomb_log_method=coulomb_log_method)
    else:
        coll_rate = fundamental_ion_collision_freq(T, n, ion, coulomb_log, V)
    return gyro_frequency / coll_rate