Skip to content
Projects

plasma_plots.theory.collisions

Coulomb collisions in SI units: the Coulomb logarithm, collision rates, Spitzer resistivity and the slowing down of fast ions.

Densities are in m⁻³, temperatures and energies in eV, and ions have the mass mass_number × m_p and the charge charge_number × e (the conventions of parameters). Times are in s, frequencies in 1/s, resistivities in Ω m, energy loss rates in eV/s.

Examples

The Coulomb logarithm and Spitzer resistivity of a 1 keV, 1e19 m⁻³ hydrogen plasma:

>>> lnl = coulomb_logarithm(1e19, 1000.0)
>>> print(f"{lnl:.2f}, {spitzer_resistivity(1000.0, ln_lambda=lnl):.3e} ohm m")
15.94, 2.667e-08 ohm m

Functions

NameDescription
beam_driven_currentCompute the beam-driven current I_b = I_f [1 − (Z_b/Z_eff)(1 − G)] of fast ions born at one energy and pitch.
beam_stopping_fast_ionCompute the energy loss of a fast ion on electrons and ions (Stix), or its energy after a time.
bootstrap_coefficient_l31Compute the coefficient L₃₁ of Sauter et al., which is the trapped-electron correction G of the beam current.
collision_frequenciesCompute the NRL electron and ion collision rates and the electron-ion momentum-transfer rate.
coulomb_logarithmCompute the Coulomb logarithm ln Λ of the NRL Plasma Formulary.
critical_energyCompute the critical energy E_c, where a fast ion's drag on the ions equals that on the electrons.
electron_shielding_factorCompute F = j/j_f = 1 − (Z_b/Z_eff)(1 − G), the ratio of the net beam-driven current to the fast-ion current.
fast_ion_parallel_pathCompute ∫ v_∥ dt, the distance a fast ion travels along B while it slows down from E to rest.
pitch_angle_momentsCompute the pitch ξ = v_∥/v of a fast ion that slows down from E₀ to E: its mean, mean square and width.
pitch_scattering_exponentCompute the exponent β = Z_eff/[Z] of the pitch-angle evolution of a slowing-down fast ion.
slowing_down_timeCompute the Spitzer slowing-down time τ_s of a fast ion on the electrons, or the time to slow down.
spitzer_resistivityCompute the Spitzer parallel resistivity η_∥ = α₀(Z) Z_eff m_e ν_e / (n_e e²).

beam_driven_currentfunction#

def beam_driven_current(birth_rate, major_radius, energy, density, temperature, beam_mass_number=1.0, beam_charge_number=1.0, ion_mass_number=1.0, ion_charge_number=1.0, ions=None, ln_lambda=None, initial_pitch=1.0, g=0.0)

Compute the beam-driven current I_b = I_f [1 − (Z_b/Z_eff)(1 − G)] of fast ions born at one energy and pitch.

Each ion born with parallel speed circulates and carries Z_b e v_∥/(2π R) of current, so a birth rate S gives the fast-ion current I_f = Z_b e S L/(2π R), L = ∫ v_∥ dt of fast_ion_parallel_path() (the Ohkawa estimate with the slowing-down and the pitch evolution). The electron return current reduces it by electron_shielding_factor(). A local, large-aspect-ratio estimate: no orbits, trapped fast ions or losses.

Parameters

NameTypeDefaultDescription
birth_ratefloat or array_likerequiredNumber of fast ions born per second, S.
major_radiusfloat or array_likerequiredMajor radius R of the surface, in m.
energyrequiredAs in fast_ion_parallel_path().
densityrequiredAs in fast_ion_parallel_path().
temperaturerequiredAs in fast_ion_parallel_path().
beam_mass_numberrequiredAs in fast_ion_parallel_path().
beam_charge_numberrequiredAs in fast_ion_parallel_path().
ion_mass_numberrequiredAs in fast_ion_parallel_path().
ion_charge_numberrequiredAs in fast_ion_parallel_path().
ionsrequiredAs in fast_ion_parallel_path().
ln_lambdarequiredAs in fast_ion_parallel_path().
initial_pitchrequiredAs in fast_ion_parallel_path().
gfloat or array_like0.0Trapped-electron correction G. Default: 0 (uniform plasma).

Returns

dict of float or numpy.ndarray
"fast_ion" I_f in A, "shielding" F, "net" I_b = F I_f in A.

Examples

>>> kw = dict(
... density=1e19,
... temperature=1000.0,
... beam_mass_number=2.0,
... ion_mass_number=2.0,
... ion_charge_number=2.0,
... ln_lambda=17.0,
... )
>>> # 1 MW of 80 keV deuterons at R = 1.7 m, in a plasma of Z = 2 ions (Z_eff = 2)
>>> s = 1e6 / (80e3 * ev_to_joule)
>>> out = beam_driven_current(s, 1.7, 80e3, **kw)
>>> print(
... f"{out['fast_ion'] / 1e3:.1f} kA {out['shielding']:.2f} {out['net'] / 1e3:.1f} kA"
... )
247.4 kA 0.50 123.7 kA

beam_stopping_fast_ionfunction#

def beam_stopping_fast_ion(energy, density, temperature, beam_mass_number=1.0, beam_charge_number=1.0, ion_mass_number=1.0, ion_charge_number=1.0, ions=None, ln_lambda=None, time=None)

Compute the energy loss of a fast ion on electrons and ions (Stix), or its energy after a time.

With the ion drag and electron drag of the model of the module docstring, dE/dt = −(2E/τ_s) [1 + (E_c/E)^(3/2)]: the first term is the loss to the electrons, the second to the ions. Given time t, the energy after t follows from integrating dv/dt: v³ = (v₀³ + v_c³) exp(−3t/τ_s) − v_c³, so E = E₀ [(1 + (E_c/E₀)^(3/2)) e^(−3t/τ_s) − (E_c/E₀)^(3/2)]^(2/3), and 0 once that is negative (the ion has thermalised).

Parameters

NameTypeDefaultDescription
energyfloat or array_likerequiredEnergy E of the fast ion, in eV.
densityfloat or array_likerequiredElectron density (m⁻³) and temperature (eV).
temperaturefloat or array_likerequiredElectron density (m⁻³) and temperature (eV).
beam_mass_numberfloat or array_like1.0Mass (proton masses) and charge number of the fast ion. Default: 1.
beam_charge_numberfloat or array_like1.0Mass (proton masses) and charge number of the fast ion. Default: 1.
ion_mass_numberoptional1.0The plasma ions, as in critical_energy().
ion_charge_numberoptional1.0The plasma ions, as in critical_energy().
ionsoptional1.0The plasma ions, as in critical_energy().
ln_lambdafloat or array_likeNoneCoulomb logarithm. Default: the "ei" form (Z = 1).
timefloat or array_likeNoneIf given, return the energy after this time, in s.

Returns

dict or float or numpy.ndarray
Without time: the energy loss rates in eV/s (positive numbers) as a dict with "electrons", "ions" and "total". With time: the energy in eV.

Examples

>>> kw = dict(
... density=1e19,
... temperature=1000.0,
... beam_mass_number=2.0,
... ion_mass_number=2.0,
... ln_lambda=17.0,
... )
>>> loss = beam_stopping_fast_ion(80e3, **kw)
>>> print(f"{loss['electrons']:.3e} {loss['ions']:.3e} eV/s")
6.807e+05 7.664e+04 eV/s
>>> print(
... f"{beam_stopping_fast_ion(80e3, time=0.02, **kw) / 1e3:.1f} keV after 20 ms"
... )
66.0 keV after 20 ms

bootstrap_coefficient_l31function#

def bootstrap_coefficient_l31(z_eff, trapped_fraction, collisionality=0.0)

Compute the coefficient L₃₁ of Sauter et al., which is the trapped-electron correction G of the beam current.

L₃₁ = [1 + 1.4/(Z_eff + 1)] X − 1.9/(Z_eff + 1) X² + 0.3/(Z_eff + 1) X³ + 0.2/(Z_eff + 1) X⁴, X = f_t / [1 + (1 − 0.1 f_t) √ν_e* + 0.5 (1 − f_t) ν_e*/Z_eff].

Parameters

NameTypeDefaultDescription
z_efffloat or array_likerequiredEffective charge of the plasma ions.
trapped_fractionfloat or array_likerequiredEffective trapped fraction f_t of the flux surface (0 for a straight plasma).
collisionalityfloat or array_like0.0Electron collisionality ν_e* (0: banana regime, the default). The definition of ν_e* differs between the two sources read (Z_eff included or not), so it is an input.

Returns

float or numpy.ndarray
L₃₁ = G, between 0 (no trapped electrons) and about 1.

Examples

>>> print(f"{bootstrap_coefficient_l31(1.0, 0.3):.3f}")
0.429
>>> print(f"{bootstrap_coefficient_l31(2.0, 0.3, collisionality=1.0):.3f}")
0.193

collision_frequenciesfunction#

def collision_frequencies(density, temperature, ion_temperature=None, mass_number=1.0, charge_number=1.0, ion_density=None, ln_lambda=None)

Compute the NRL electron and ion collision rates and the electron-ion momentum-transfer rate.

Parameters

NameTypeDefaultDescription
densityfloat or array_likerequiredElectron density n_e, in m⁻³.
temperaturefloat or array_likerequiredElectron temperature T_e, in eV.
ion_temperaturefloat or array_likeNoneIon temperature T_i, in eV. Default: T_e.
mass_numberfloat or array_like1.0Ion mass in proton masses (μ). Default: 1.
charge_numberfloat or array_like1.0Ion charge number Z. Default: 1.
ion_densityfloat or array_likeNoneIon density n_i, in m⁻³. Default: n_e/Z.
ln_lambdafloat or array_likeNoneCoulomb logarithm. Default: the "ei" form of coulomb_logarithm().

Returns

dict of float or numpy.ndarray
In 1/s: "electron", ν_e = √2 n_e e⁴ ln Λ / (12 π^(3/2) ε₀² m_e^½ T_e^(3/2)), the NRL electron collision rate (2.91e-6 n_e[cm⁻³] ln Λ T_e[eV]^(−3/2)); "ion", ν_i = n_i Z⁴ e⁴ ln Λ / (12 π^(3/2) ε₀² m_i^½ T_i^(3/2)), the NRL ion collision rate (4.80e-8 Z⁴ μ^(−½) n_i ln Λ T_i^(−3/2)); and "electron_ion", the momentum-transfer rate of the electrons on the ions, ν_ei = Z² n_i / n_e × ν_e, which is 1/τ_e of Braginskii.

Examples

>>> nu = collision_frequencies(
... 1e19, 100.0, ion_temperature=50.0, mass_number=2.0
... )
>>> print(f"{nu['electron']:.3e} {nu['ion']:.3e} {nu['electron_ion']:.3e}")
3.964e+05 1.308e+04 3.964e+05

coulomb_logarithmfunction#

def coulomb_logarithm(density, temperature, kind='ei', charge_number=1)

Compute the Coulomb logarithm ln Λ of the NRL Plasma Formulary.

Parameters

NameTypeDefaultDescription
densityfloat or array_likerequiredElectron density n_e, in m⁻³.
temperaturefloat or array_likerequiredElectron temperature T_e, in eV.
kind('ei', 'ee')"ei""ei": electron-ion collisions, with the formulary’s two regimes: for T_e below 10 Z² eV, ln Λ = 23 − ln(n_e^½ Z T_e^(−3/2)); above, ln Λ = 24 − ln(n_e^½ T_e⁻¹) (n_e in cm⁻³). "ee": electron-electron collisions, ln Λ = 23.5 − ln(n_e^½ T_e^(−5/4)) − [10⁻⁵ + (ln T_e − 2)²/16]^½.
charge_numberfloat or array_like1Ion charge number Z (only for "ei"). Default: 1.

Returns

float or numpy.ndarray
ln Λ.

Examples

>>> print(f"{coulomb_logarithm(1e19, 100.0):.2f}") # 24 - ln(sqrt(1e13) / 100)
13.64
>>> # below 40 eV
>>> print(f"{coulomb_logarithm(1e19, 5.0, charge_number=2):.2f}")
9.75
>>> print(f"{coulomb_logarithm(1e19, 100.0, kind='ee'):.2f}")
13.64

critical_energyfunction#

def critical_energy(temperature, beam_mass_number=1.0, ion_mass_number=1.0, ion_charge_number=1.0, ions=None)

Compute the critical energy E_c, where a fast ion’s drag on the ions equals that on the electrons.

E_c = ½ m_b v_c² with v_c³ = (3√π/4) m_e v_Te³ Σ_j n_j Z_j² / (n_e m_j) and v_Te = √(2 T_e/m_e), i.e. E_c = 14.8 T_e A_b [Σ_j (n_j/n_e) Z_j² / A_j]^(2/3). It does not depend on the density. Above E_c the fast ion heats the electrons, below it the ions.

Parameters

NameTypeDefaultDescription
temperaturefloat or array_likerequiredElectron temperature T_e, in eV.
beam_mass_numberfloat or array_like1.0Mass of the fast ion A_b, in proton masses. Default: 1.
ion_mass_numberfloat or array_like1.0Mass number and charge number of a single plasma ion species, with n_i = n_e/Z. Defaults: 1 (hydrogen).
ion_charge_numberfloat or array_like1.0Mass number and charge number of a single plasma ion species, with n_i = n_e/Z. Defaults: 1 (hydrogen).
ionssequence of (float, float, float)NoneSeveral plasma ion species as (n_j/n_e, Z_j, A_j) tuples, in place of the single species (e.g. [(0.45, 1, 2), (0.45, 1, 3), (0.025, 4, 4)]).

Returns

float or numpy.ndarray
E_c in eV.

Examples

>>> print(
... f"{critical_energy(1000.0, beam_mass_number=2.0, ion_mass_number=2.0) / 1e3:.2f} keV"
... )
18.65 keV
>>> # a D beam in a 50:50 D-T plasma (the sum of 0.5/2 + 0.5/3 is 5/12)
>>> print(
... f"{critical_energy(10e3, 2.0, ions=[(0.5, 1, 2), (0.5, 1, 3)]) / 1e3:.0f} keV"
... )
165 keV

electron_shielding_factorfunction#

def electron_shielding_factor(beam_charge_number, z_eff, g=0.0)

Compute F = j/j_f = 1 − (Z_b/Z_eff)(1 − G), the ratio of the net beam-driven current to the fast-ion current.

The electrons are dragged along by the fast ions and carry a return current −(Z_b/Z_eff)(1 − G) times the fast-ion current (for a beam speed well below v_Te). G is the trapped-electron correction: 0 in a straight (uniform) plasma, where F = 1 − Z_b/Z_eff and the current of a beam in a plasma of its own charge (Z_eff = Z_b) cancels completely.

Parameters

NameTypeDefaultDescription
beam_charge_numberfloat or array_likerequiredCharge number of the fast ion and effective charge of the plasma ions.
z_efffloat or array_likerequiredCharge number of the fast ion and effective charge of the plasma ions.
gfloat or array_like0.0Trapped-electron correction G (e.g. bootstrap_coefficient_l31()). Default: 0.

Returns

float or numpy.ndarray
F.

Examples

>>> print(f"{electron_shielding_factor(1.0, 2.0):.3f}")
0.500
>>> print(f"{electron_shielding_factor(1.0, 1.0, g=0.3):.3f}")
0.300

fast_ion_parallel_pathfunction#

def fast_ion_parallel_path(energy, density, temperature, beam_mass_number=1.0, beam_charge_number=1.0, ion_mass_number=1.0, ion_charge_number=1.0, ions=None, ln_lambda=None, initial_pitch=1.0)

Compute ∫ v_∥ dt, the distance a fast ion travels along B while it slows down from E to rest.

With dt = τ_s v² dv/(v³ + v_c³) and ⟨ξ⟩(v) of pitch_angle_moments(), L = ξ₀ τ_s v_c ∫₀^x u³/(1 + u³) [u³ (1 + x³)/(x³ (1 + u³))]^(β/3) du, with x = v₀/v_c. The integral is done by 200-point Gauss-Legendre quadrature.

Parameters

NameTypeDefaultDescription
energyfloat or array_likerequiredBirth energy E₀, in eV.
densityfloat or array_likerequiredElectron density (m⁻³) and temperature (eV).
temperaturefloat or array_likerequiredElectron density (m⁻³) and temperature (eV).
beam_mass_numberfloat or array_like1.0Mass (proton masses) and charge number of the fast ion. Default: 1.
beam_charge_numberfloat or array_like1.0Mass (proton masses) and charge number of the fast ion. Default: 1.
ion_mass_numberoptional1.0The plasma ions, as in critical_energy().
ion_charge_numberoptional1.0The plasma ions, as in critical_energy().
ionsoptional1.0The plasma ions, as in critical_energy().
ln_lambdafloat or array_likeNoneCoulomb logarithm. Default: the "ei" form (Z = 1).
initial_pitchfloat or array_like1.0Birth pitch ξ₀. Default: 1.

Returns

float or numpy.ndarray
L in m.

Examples

>>> kw = dict(
... density=1e19,
... temperature=1000.0,
... beam_mass_number=2.0,
... ion_mass_number=2.0,
... ln_lambda=17.0,
... )
>>> print(f"{fast_ion_parallel_path(80e3, **kw) / 1e3:.1f} km")
276.7 km

pitch_angle_momentsfunction#

def pitch_angle_moments(energy, initial_energy, critical_energy_ev, exponent=1.0, initial_pitch=1.0)

Compute the pitch ξ = v_∥/v of a fast ion that slows down from E₀ to E: its mean, mean square and width.

Pitch scattering on the ions with the Lorentz operator (ν_d/2) ∂_ξ (1 − ξ²) ∂_ξ gives d⟨ξ⟩/dt = −ν_d ⟨ξ⟩ and d⟨ξ²⟩/dt = ν_d (1 − 3⟨ξ²⟩) exactly, and the speed follows the drag of beam_stopping_fast_ion(), dv/dt = −(v³ + v_c³)/(τ_s v²). With ν_d = β v_c³/(τ_s v³) and R = v³ (v₀³ + v_c³) / [v₀³ (v³ + v_c³)] = (E/E₀)^(3/2) (1 + (E₀/E_c)^(3/2)) / (1 + (E/E_c)^(3/2)):

.. math:: \langle\xi\rangle = \xi_0 R^{\beta/3}, \qquad \langle\xi^2\rangle = \tfrac13 + (\xi_0^2 - \tfrac13) R^{\beta}

for ions that start with the single pitch ξ₀. The width is σ = [⟨ξ²⟩ − ⟨ξ⟩²]^½, which grows from 0 to 1/√3 (isotropy) as the ion slows. Above E_c, R ≈ 1: the ion keeps its pitch while it loses most of its energy to the electrons; below E_c it scatters (R ∝ E^(3/2)).

Parameters

NameTypeDefaultDescription
energyfloat or array_likerequiredEnergy E of the ion, in eV (E ≤ E₀).
initial_energyfloat or array_likerequiredBirth energy E₀, in eV.
critical_energy_evfloat or array_likerequiredThe critical energy E_c, in eV (critical_energy()).
exponentfloat or array_like1.0β of pitch_scattering_exponent(). Default: 1.
initial_pitchfloat or array_like1.0Birth pitch ξ₀ of every ion. Default: 1 (parallel).

Returns

dict of float or numpy.ndarray
"mean" ⟨ξ⟩, "mean_square" ⟨ξ²⟩ and "width" σ.

Examples

>>> ec = critical_energy(1000.0, 2.0, 2.0)
>>> m = pitch_angle_moments(ec, 80e3, ec, exponent=1.0)
>>> print(f"{m['mean']:.3f} {m['width']:.3f}") # at E_c
0.822 0.167
>>> m = pitch_angle_moments(1000.0, 80e3, ec, exponent=1.0)
>>> print(f"{m['mean']:.3f} {m['width']:.3f}") # nearly isotropic
0.239 0.534

pitch_scattering_exponentfunction#

def pitch_scattering_exponent(beam_mass_number=1.0, ion_mass_number=1.0, ion_charge_number=1.0, ions=None)

Compute the exponent β = Z_eff/[Z] of the pitch-angle evolution of a slowing-down fast ion.

The pitch scattering rate on the plasma ions is ν_d = Z_eff Γ/v³ and the energy drag on them is Γ [Z]/v² per unit mass, with Z_eff = Σ_j (n_j/n_e) Z_j² and [Z] = A_b Σ_j (n_j/n_e) Z_j²/A_j (the sum in critical_energy()). Hence ν_d = β v_c³/(τ_s v³). For one plasma ion species with n_i = n_e/Z, β = A_i/A_b: 1 for a beam in a plasma of its own isotope, independent of Z. Impurities raise Z_eff faster than [Z]: β grows.

Parameters

NameTypeDefaultDescription
beam_mass_numberfloat or array_like1.0Mass of the fast ion A_b, in proton masses. Default: 1.
ion_mass_numberfloat or array_like1.0A single plasma ion species, as in critical_energy(). Defaults: 1.
ion_charge_numberfloat or array_like1.0A single plasma ion species, as in critical_energy(). Defaults: 1.
ionssequence of (float, float, float)NoneSeveral species as (n_j/n_e, Z_j, A_j) tuples, in place of the single species.

Returns

float or numpy.ndarray
β (dimensionless).

Examples

>>> print(f"{pitch_scattering_exponent(2.0, 2.0):.2f}") # D in D
1.00
>>> # D beam in a D plasma with 5 % carbon 6+ (n_C/n_e = 0.05)
>>> ions = [(0.7, 1, 2), (0.05, 6, 12)]
>>> print(f"{pitch_scattering_exponent(2.0, ions=ions):.2f}")
2.50

slowing_down_timefunction#

def slowing_down_time(density, temperature, beam_mass_number=1.0, beam_charge_number=1.0, ln_lambda=None, energy=None, final_energy=0.0, critical_energy_ev=None)

Compute the Spitzer slowing-down time τ_s of a fast ion on the electrons, or the time to slow down.

τ_s = 3 (2π)^(3/2) ε₀² m_b T_e^(3/2) / (n_e Z_b² e⁴ m_e^½ ln Λ), which is 6.3e8 A_b T_e[eV]^(3/2) / (Z_b² n_e[cm⁻³] ln Λ) s: the time in which the ion’s speed would fall by a factor e if only the electrons acted. With energy given, return the time to slow from that energy to final_energy in the presence of the ion drag as well (Stix): t = (τ_s/3) ln[(1 + (E/E_c)^(3/2)) / (1 + (E_f/E_c)^(3/2))], from dv/dt = −(v³ + v_c³)/(τ_s v²).

Parameters

NameTypeDefaultDescription
densityfloat or array_likerequiredElectron density n_e, in m⁻³.
temperaturefloat or array_likerequiredElectron temperature T_e, in eV.
beam_mass_numberfloat or array_like1.0Mass (proton masses) and charge number of the fast ion. Default: 1.
beam_charge_numberfloat or array_like1.0Mass (proton masses) and charge number of the fast ion. Default: 1.
ln_lambdafloat or array_likeNoneCoulomb logarithm. Default: the "ei" form of coulomb_logarithm().
energyfloat or array_likeNoneInitial energy E of the fast ion, in eV. If given, return the time to reach final_energy instead of τ_s. Needs critical_energy_ev.
final_energyfloat or array_like0.0Final energy, in eV. Default: 0 (the time to thermalise, in this model).
critical_energy_evfloat or array_likeNoneThe critical energy E_c, in eV (from critical_energy()). Use np.inf for the electron drag alone.

Returns

float or numpy.ndarray
τ_s in s, or the slowing-down time in s.

Examples

>>> tau = slowing_down_time(1e19, 1000.0, beam_mass_number=2.0, ln_lambda=17.0)
>>> print(f"{tau * 1e3:.2f} ms")
235.04 ms
>>> ec = critical_energy(1000.0, beam_mass_number=2.0, ion_mass_number=2.0)
>>> t = slowing_down_time(
... 1e19, 1000.0, 2.0, ln_lambda=17.0, energy=80e3, critical_energy_ev=ec
... )
>>> print(f"{ec / 1e3:.1f} keV, {t * 1e3:.1f} ms")
18.7 keV, 179.5 ms

spitzer_resistivityfunction#

def spitzer_resistivity(temperature, z_eff=1.0, ln_lambda=None, density=None)

Compute the Spitzer parallel resistivity η_∥ = α₀(Z) Z_eff m_e ν_e / (n_e e²).

Here ν_e is the electron collision rate of collision_frequencies() for Z = 1, so η_∥ = α₀(Z_eff) × 1.03e-4 Z_eff ln Λ T_e[eV]^(−3/2) Ω m, which is 1.67e-9 ln Λ Z_eff / T_e[keV]^(3/2) Ω m for Z_eff = 1 (1.65e-9 with the NRL’s 0.51 in place of 0.5129).

Parameters

NameTypeDefaultDescription
temperaturefloat or array_likerequiredElectron temperature T_e, in eV.
z_efffloat or array_like1.0Effective charge Σ n_j Z_j² / n_e. Default: 1.
ln_lambdafloat or array_likeNoneCoulomb logarithm. Default: computed from density ("ei" form, with Z = z_eff).
densityfloat or array_likeNoneElectron density, in m⁻³. Needed only without ln_lambda.

Returns

float or numpy.ndarray
η_∥ in Ω m (it does not depend on the density except through ln Λ).

Examples

>>> # about 1.65e-9 * 17
>>> print(f"{spitzer_resistivity(1000.0, ln_lambda=17.0):.3e} ohm m")
2.844e-08 ohm m
>>> print(
... f"{spitzer_resistivity(1000.0, z_eff=2.0, ln_lambda=17.0):.3e} ohm m"
... )
4.888e-08 ohm m