irfpy.util.formula

A collection of plasma physics related formulae.

Todo

Extended implementation should be done in irfpy.util.physics.

Collection of formulae which are really frequently used.

  • plasma frequency (plasma_freq_mksa())

  • gyro frequency

  • gyro radius

  • gyro period

  • Debye length

  • Ion acoustic velocity

  • Electron-volt to kelvin conversion (eV2K())

The unit system is complecated. MKSA is very useful for theory, but not for practical. In this module, MKSA is used only when _mksa is specified in the method. Practically, we uses km, amu, sec, nT, eV, and so on. Thus, most of functions uses the PPUS (plasma physisist unit system).

For example, there are two methods to calculate Debye length. debye_length_mksa() is for MKSA, and debye_length() is in PPUS.

This is for one of the typical solar wind conditon. Typical debye length is 10m.

>>> print('%.2f' % debye_length_mksa(1.6e-19, 3e6, 50000))
8.92

This is for similar condition in plasma physist unit, i.e. q=1, n=3 cm-3, and T=5eV. Returned unit is in km.

>>> print('%.4f' % debye_length(1, 3, 5))
0.0096

List of formulation

\[ \begin{align}\begin{aligned}\omega_\mathrm{pe} \mathrm{[/s]} = 5.641\times 10^4 \times \sqrt{n \mathrm{[/cc]}}\\f_\mathrm{pe} \mathrm{[/s]} = 8.979\times 10^3 \times \sqrt{n \mathrm{[/cc]}}\\\omega_\mathrm{pi} \mathrm{[/s]} = 1.317\times 10^3 \times \sqrt{n \mathrm{[/cc]}}\\f_\mathrm{pi} \mathrm{[/s]} = 2.095\times 10^2 \times \sqrt{n \mathrm{[/cc]}}\\\omega_\mathrm{ge} \mathrm{[/s]} = 1.759\times 10^2 \times B \mathrm{[nT]}\\f_\mathrm{ge} \mathrm{[/s]} = 2.799\times 10^1 \times B \mathrm{[nT]}\\\omega_\mathrm{gi} \mathrm{[/s]} = 9.579\times 10^{-2} \times B \mathrm{[nT]}\\f_\mathrm{gi} \mathrm{[/s]} = 1.525\times 10^{-2} \times B \mathrm{[nT]}\\T_\mathrm{ge} \mathrm{[s]} = 3.572\times 10^{-2} \times \frac{1}{B\mathrm{[nT]}}\\T_\mathrm{gi} \mathrm{[s]} = 6.559\times 10^1 \times \frac{1}{B \mathrm{[nT]}}\\R_\mathrm{ge} \mathrm{[km]} = 5.686\times 10^{-3} \times \frac{v \mathrm{[km/s]}}{B \mathrm{[nT]}}\\R_\mathrm{gi} \mathrm{[km]} = 1.044\times 10^1 \times \frac{v \mathrm{[km/s]}}{B \mathrm{[nT]}}\\\lambda_\mathrm{De} \mathrm{[km]} = 7.434\times 10^{-3} \times \sqrt{\frac{T_\mathrm{e} \mathrm{[eV]}}{n \mathrm{[/cc]}}}\end{aligned}\end{align} \]
irfpy.util.formula.plasma_afreq_mksa(mass, charge, density)[source]

Returns the plasma angular frequency, wp=sqrt(n e**2)/(m eps0)

irfpy.util.formula.plasma_afreq(mass_amu, charge_qe, density__cm3)[source]

Returns the plasma angular frequency (wp) in plasma unit.

irfpy.util.formula.plasma_afreq_el(density__cm3)[source]

Returns the electron’s plasma angular frequency (wpe).

irfpy.util.formula.plasma_afreq_pr(density__cm3)[source]

Returns the proton’s plasma angular frequency (wppi).

irfpy.util.formula.plasma_freq_mksa(mass, charge, density)[source]

Returns the plasma frequency, fp = wp / 2 pi.

irfpy.util.formula.plasma_freq(mass_amu, charge_qe, density__cm3)[source]
irfpy.util.formula.plasma_freq_el(density__cm3)[source]
irfpy.util.formula.plasma_freq_pr(density__cm3)[source]
irfpy.util.formula.gyro_afreq_mksa(mass, charge, magfield)[source]

Return the gyro angular frequency in Hz, wg = qB / m.

irfpy.util.formula.gyro_freq_mksa(mass, charge, magfield)[source]

Return the gyro angular frequency in Hz, fg = qB / 2 pi m.

irfpy.util.formula.gyro_afreq(mass_amu, charge_qe, magfield_nT)[source]
irfpy.util.formula.gyro_freq(mass_amu, charge_eq, magfield_nT)[source]
irfpy.util.formula.gyro_afreq_el(magfield_nT)[source]
irfpy.util.formula.gyro_freq_el(magfield_nT)[source]
irfpy.util.formula.gyro_afreq_pr(magfield_nT)[source]
irfpy.util.formula.gyro_freq_pr(magfield_nT)[source]
irfpy.util.formula.gyro_period_mksa(mass, charge, magfield)[source]
irfpy.util.formula.gyro_period(mass_amu, charge_qe, magfield_nT)[source]
irfpy.util.formula.gyro_period_el(magfield_nT)[source]
irfpy.util.formula.gyro_period_pr(magfield_nT)[source]
irfpy.util.formula.gyro_radius_mksa(mass, charge, magfield, velocity)[source]

Returns a gyro_radius, rg = v / wg = mv / qB

irfpy.util.formula.gyro_radius(mass_amu, charge_qe, magfield_nT, velocity_km_s)[source]

Returns a gyro_radius in the unit system of plasma scientist.

irfpy.util.formula.gyro_radius_el(magfield_nT, velocity_km_s)[source]
irfpy.util.formula.gyro_radius_pr(magfield_nT, velocity_km_s)[source]
irfpy.util.formula.debye_length_mksa(charge, density, temperature)[source]

Returns the Debye length, Ld = sqrt( eps0 kB T / n e**2)

irfpy.util.formula.debye_length(charge_qe, density__cc, temperature_eV)[source]

Debye length in PPUS.

irfpy.util.formula.debye_length_el(density__cc, temperature_eV)[source]
irfpy.util.formula.debye_length_pr(density__cc, temperature_eV)[source]
irfpy.util.formula.ion_acoustic_speed_mksa(temperature_el, mass_ion=1.67262192369e-27, gamma=3)[source]

Returns the ion acoustic speed in m/s.

The ion acoustic speed, S0, is calculated by S0 = sqrt( gamma * kB * Te / mi )

@param temperature_el electron temperature in K @param mass_ion Ion mass in kg @param gamma The ratio of specific heat for electrons.

irfpy.util.formula.ion_acoustic_speed(temperature_el_eV, mass_ion_amu, gamma=3)[source]

Returns the ion acoustic speed in km/s.

The ion acoustic speed, S0, is calculated by S0 = sqrt( gamma * kB * Te / mi )

@param temperature_el electron temperature in K @param mass_ion Ion mass in kg @param gamma The ratio of specific heat for electrons.

irfpy.util.formula.eV2K(temp_eV)[source]

Convert from eV to Kelvin

Electron volt is used to specify the temperature. Here the function provides the conversion from eV to K. The factor is \(q_e/k_B\sim 1.16\times 10^4\).

Parameters:
temp_eVfloat

The temperature in electron volts.

Returns:
temp_Kfloat

Corresponding temperature in Kelvins.