Skip to content
Projects

plasma_plots.theory.beams

Charged-particle beams: perveance, ion optics, beam envelopes and beam–gas processes, in SI units.

Voltages are in V, currents in A, lengths in m, angles in rad (unless a function says otherwise), densities in m⁻³, cross sections in m² and speeds in m/s. Particles have the mass mass (kg) and the charge charge (C); the defaults are electrons, as in parameters, which this module reuses for the constants and the plasma frequency. Pass mass=proton_mass or mass=mass_number * proton_mass for ions.

Examples

The Child–Langmuir limit of a 5 mm radius, 4 mm gap proton extraction aperture at 30 kV, and the generalized perveance of a 1 A, 30 keV proton beam:

>>> print(
... f"{child_langmuir_aperture(30e3, 5e-3, 4e-3, mass=proton_mass):.4g} A"
... )
1.389 A
>>> print(f"{perveance(1.0, 30e3, mass=proton_mass, kind='generalized'):.4g}")
0.125

Functions

NameDescription
aperture_lens_focal_lengthCompute the focal length of a thin aperture lens, f = 4V / (E₂ − E₁) (Davisson–Calbick).
beam_divergence_gaussianCompute the divergence of a beam with a Maxwellian transverse velocity spread.
beam_plasma_frequencyCompute the beam plasma frequency of a beam of density n in its rest frame, seen from the lab.
beam_speedCompute the speed v and the Lorentz factor γ of a particle accelerated through a voltage.
child_langmuir_apertureCompute the space-charge-limited current through a circular aperture, I = π r² J_CL.
emittance_growth_space_chargeCompute the rms emittance growth ε_f/ε_i of a non-uniform beam from its field energy.
kv_envelopeCompute the rms envelope of a beam in a drift without space charge, in closed form.
kv_envelope_odeIntegrate the KV rms envelope equation with space charge and focusing, using RK4.
neutral_beam_attenuationCompute the surviving fraction of a beam, exp(−∫ n σ dl).
optimal_perveanceCompute the perveance P = I/V^(3/2) of the optimum (minimum-divergence) extraction, in A/V^1.5.
perveanceCompute the perveance of a beam.
pierce_angleReturn the Pierce electrode angle, 67.5° (3π/8) from the beam axis.
space_charge_compensation_timeCompute the time to space-charge compensate a beam by ionising the background gas.
stripping_fractionCompute the fraction of a beam lost (stripped or ionised) on a target, 1 − exp(−∫ n σ dl).

aperture_lens_focal_lengthfunction#

def aperture_lens_focal_length(voltage, field_before, field_after)

Compute the focal length of a thin aperture lens, f = 4V / (E₂ − E₁) (Davisson–Calbick).

Parameters

NameTypeDescription
voltagefloat or array_likePotential of the aperture relative to the cathode, i.e. the kinetic energy per charge at the aperture, in V.
field_beforefloat or array_likeAxial field E₁ upstream of the aperture, in V/m, positive when it accelerates the particles along their direction of motion (independent of the sign of the charge).
field_afterfloat or array_likeThe same downstream, E₂.

Returns

float or numpy.ndarray
The focal length in m: positive for a converging lens (E₂ > E₁, e.g. the entrance of an accelerating gap), negative for a diverging one, infinite if E₁ = E₂.

Examples

A 30 kV aperture with 0 on the plasma side and 10 kV/cm after it:

>>> print(f"{aperture_lens_focal_length(30e3, 0.0, 1e6):.4g} m")
0.12 m

beam_divergence_gaussianfunction#

def beam_divergence_gaussian(ion_temperature, beam_energy, definition='1/e')

Compute the divergence of a beam with a Maxwellian transverse velocity spread.

The transverse velocity in each plane has the standard deviation √(T/m) and the axial speed is √(2E/m), so the rms divergence is θ_rms = √(T / (2E)) and the half angle at which the angular distribution has fallen to 1/e is θ_1/e = √2 θ_rms = √(T/E) (small angles).

Parameters

NameTypeDefaultDescription
ion_temperaturefloat or array_likerequiredTransverse temperature T of the extracted particles, in eV.
beam_energyfloat or array_likerequiredBeam kinetic energy E, in eV.
definition('1/e', 'rms')"1/e"Which divergence to return.

Returns

float or numpy.ndarray
The divergence in rad.

Examples

A 1 eV ion temperature at 30 keV:

>>> print(f"{beam_divergence_gaussian(1.0, 30e3) * 1e3:.4g} mrad")
5.774 mrad

beam_plasma_frequencyfunction#

def beam_plasma_frequency(density, mass=electron_mass, charge=elementary_charge, gamma=1.0, direction='longitudinal')

Compute the beam plasma frequency of a beam of density n in its rest frame, seen from the lab.

ω_pb = √(n q² / (ε₀ γ³ m)) for longitudinal oscillations and √(n q² / (ε₀ γ m)) for transverse ones, with n the lab-frame density (the non-relativistic limit is plasma_frequency()).

Parameters

NameTypeDefaultDescription
densityfloat or array_likerequiredBeam density n in the lab frame, in m⁻³ (current / (q v π r²) for a uniform round beam).
massfloat or array_likeelectron_massParticle mass (kg) and charge (C). Default: electron.
chargefloat or array_likeelectron_massParticle mass (kg) and charge (C). Default: electron.
gammafloat or array_like1.0Lorentz factor of the beam. Default: 1.
direction('longitudinal', 'transverse')"longitudinal"

Returns

float or numpy.ndarray
ω_pb in rad/s.

Examples

A 1e16 m⁻³ proton beam:

>>> print(f"{beam_plasma_frequency(1e16, mass=proton_mass):.4g} rad/s")
1.317e+08 rad/s

beam_speedfunction#

def beam_speed(voltage, mass=electron_mass, charge=elementary_charge, relativistic=False)

Compute the speed v and the Lorentz factor γ of a particle accelerated through a voltage.

Parameters

NameTypeDefaultDescription
voltagefloat or array_likerequiredAccelerating voltage V in V, so the kinetic energy is q V.
massfloat or array_likeelectron_massParticle mass (kg) and charge (C). Default: electron.
chargefloat or array_likeelectron_massParticle mass (kg) and charge (C). Default: electron.
relativisticboolFalseIf True, γ = 1 + q V / (m c²) and v = c √(1 − 1/γ²); otherwise v = √(2 q V / m) and γ = 1.

Returns

speed, gamma : float or numpy.ndarray

Examples

>>> v, gamma = beam_speed(511e3, relativistic=True)
>>> print(f"{v / speed_of_light:.4f} {gamma:.4f}")
0.8660 2.0000

child_langmuir_aperturefunction#

def child_langmuir_aperture(voltage, radius, gap, mass=electron_mass, charge=elementary_charge)

Compute the space-charge-limited current through a circular aperture, I = π r² J_CL.

J_CL = (4 ε₀ / 9) √(2 q / m) V^(3/2) / d² is the planar Child–Langmuir current density across the gap d, taken uniform over the aperture. Edge effects (the Kirstein–Coupland corrections for large r/d) are not included, so this is the leading-order limit for r ≲ d.

Parameters

NameTypeDefaultDescription
voltagefloat or array_likerequiredExtraction voltage V in V.
radiusfloat or array_likerequiredAperture radius r in m.
gapfloat or array_likerequiredGap d between the emitting surface (plasma meniscus) and the electrode, in m.
massfloat or array_likeelectron_massParticle mass (kg) and charge (C). Default: electron.
chargefloat or array_likeelectron_massParticle mass (kg) and charge (C). Default: electron.

Returns

float or numpy.ndarray
The current in A.

Examples

>>> print(
... f"{child_langmuir_aperture(30e3, 5e-3, 4e-3, mass=proton_mass):.4g} A"
... )
1.389 A

emittance_growth_space_chargefunction#

def emittance_growth_space_charge(field_energy_initial, tune_depression, field_energy_final=0.0)

Compute the rms emittance growth ε_f/ε_i of a non-uniform beam from its field energy.

For a round, axisymmetric beam in continuous focusing, the nonlinear space-charge force changes the rms emittance according to Wangler’s theorem, d(ε²)/ds = −32π ε₀ K ⟨x²⟩ d[(W − W_u)/λ²]/ds (the edge emittance, 16 times the squared rms emittance), where W is the field energy per unit length of the beam, W_u that of the rms-equivalent uniform beam and λ the line charge density. If the rms radius stays constant and the beam starts matched, with the tune depression μ = σ/σ₀ (so K x_rms² = 4 k₀² x_rms⁴ (1 − μ²) and ε² = k₀² x_rms⁴ μ²), this integrates to

ε_f²/ε_i² = 1 + ½ (1/μ² − 1) (u_i − u_f), u = U/w₀ = 16π ε₀ (W − W_u)/λ²,

with the dimensionless nonlinear field energy factor u (w₀ = λ²/(16π ε₀)) of the initial and final charge distributions. It is zero for a uniform (KV) distribution, so a beam that relaxes to a uniform one, u_f = 0, has the largest growth. The ½ (1/μ² − 1) form with u_f = 0 is Eq. (1) of Kikuchi and Horioka, who quote it from Reiser; the u_f ≠ 0 generalisation and the reduction to the tune depression were derived from the Lund slides’ Wangler theorem as above.

Parameters

NameTypeDefaultDescription
field_energy_initialfloat or array_likerequiredu_i = U/w₀ of the initial distribution. For a Gaussian it is 2γ_E − 1 = 0.1544 (γ_E is Euler’s constant), for a KV beam 0.
tune_depressionfloat or array_likerequiredμ = σ/σ₀ of the initial matched beam, 0 < μ ≤ 1.
field_energy_finalfloat or array_like0.0u_f of the final distribution. Default: 0 (relaxation to a uniform beam).

Returns

float or numpy.ndarray
The ratio ε_f/ε_i of the rms emittances. Values below 1 occur for u_f > u_i.

Raises

ValueError
If ε_f²/ε_i² would be negative, which means the assumptions (constant rms radius) fail.

Examples

A Gaussian beam with tune depression 0.2 that relaxes to a uniform beam:

>>> print(f"{emittance_growth_space_charge(2 * np.euler_gamma - 1, 0.2):.4f}")
1.6891

kv_envelopefunction#

def kv_envelope(z, radius0, slope0, emittance)

Compute the rms envelope of a beam in a drift without space charge, in closed form.

Solves x” = ε²/x³ (the Kapchinskij–Vladimirskij envelope equation for K = 0 and no focusing): x(z)² = x₀² + 2 x₀ x₀’ z + (x₀’² + ε²/x₀²) z². With a waist (x₀’ = 0) this is the hyperbola x² = x₀² + (ε z / x₀)². With space charge or focusing use kv_envelope_ode().

Parameters

NameTypeDescription
zfloat or array_likeDistance along the drift in m.
radius0float or array_likerms radius x₀ at z = 0, in m.
slope0float or array_likeEnvelope slope x₀’ at z = 0 (rad).
emittancefloat or array_likeUnnormalized rms emittance ε in m·rad.

Returns

float or numpy.ndarray
The rms radius x(z) in m.

Examples

A 1 mm waist with ε = 1 mm·mrad, 10 m downstream:

>>> print(f"{kv_envelope(10.0, 1e-3, 0.0, 1e-6) * 1e3:.4g} mm")
10.05 mm

kv_envelope_odefunction#

def kv_envelope_ode(z, radius0, slope0, emittance, perveance=0.0, focusing=None, steps_per_interval=50)

Integrate the KV rms envelope equation with space charge and focusing, using RK4.

Solves x” + κ(z) x = ε²/x³ + K/(4 x) for a round beam with the generalized perveance K (perveance(), kind="generalized") and the focusing strength κ(z) in m⁻². The K/(4x) term is the space-charge force of a uniform-density beam (KV edge radius a = 2x obeys a” = K/a). The integrator is a hand-written fixed-step fourth-order Runge–Kutta.

Parameters

NameTypeDefaultDescription
zarray_likerequiredIncreasing 1-D positions in m; the beam starts at z[0] with radius0 and slope0.
radius0float or array_likerequiredrms radius (m) and its slope at z[0]; they broadcast with the other parameters.
slope0float or array_likerequiredrms radius (m) and its slope at z[0]; they broadcast with the other parameters.
emittancefloat or array_likerequiredUnnormalized rms emittance ε in m·rad.
perveancefloat or array_like0.0Generalized perveance K (dimensionless). Default: 0.
focusingcallableNonefocusing(z) returns κ(z) in m⁻² (a scalar or something that broadcasts with the radius). Default: a drift (κ = 0).
steps_per_intervalint50RK4 steps between consecutive entries of z.

Returns

radius, slope : numpy.ndarray
x and x’ at each z, shape (len(z), *broadcast shape).

Examples

Without space charge this reproduces kv_envelope():

>>> x, _ = kv_envelope_ode([0.0, 10.0], 1e-3, 0.0, 1e-6)
>>> print(f"{x[-1] * 1e3:.4g} mm")
10.05 mm

neutral_beam_attenuationfunction#

def neutral_beam_attenuation(density, cross_section, length=None, positions=None, axis=-1)

Compute the surviving fraction of a beam, exp(−∫ n σ dl).

Use either a path length for a constant n σ, or positions (sample points along the path) with arrays of the density and/or cross section there, integrated with the trapezoidal rule along axis. Particles are lost at the rate n σ per unit length by ionisation, charge exchange or stripping, so this serves both for a neutral beam in a plasma or gas target and for a negative-ion beam stripped on gas.

Parameters

NameTypeDefaultDescription
densityfloat or array_likerequiredTarget density n in m⁻³.
cross_sectionfloat or array_likerequiredTotal loss cross section σ in m² (a constant, or an array e.g. from σ(E(l))).
lengthfloat or array_likeNonePath length in m, for constant n σ.
positionsarray_likeNoneIncreasing positions l along axis of the arrays, in m; given instead of length.
axisint-1The axis of density/cross_section along which positions runs.

Returns

float or numpy.ndarray
The fraction of the beam that is neither ionised nor stripped.

Examples

1e19 m⁻³ at σ = 1e-20 m² over 5 m:

>>> print(f"{neutral_beam_attenuation(1e19, 1e-20, length=5.0):.4f}")
0.6065

optimal_perveancefunction#

def optimal_perveance(aspect_ratio, mass=electron_mass, charge=elementary_charge)

Compute the perveance P = I/V^(3/2) of the optimum (minimum-divergence) extraction, in A/V^1.5.

The optimum is the Child–Langmuir perveance of the aperture, P_opt = (4π ε₀ / 9) √(2 q / m) (r/d)² with the aspect ratio r/d of aperture radius over gap. This is the planar space-charge-limited scaling, used here as the leading-order estimate of the perveance of minimum divergence; it ignores the curvature of the plasma meniscus and the fringe fields, so real optima deviate from it. It equals child_langmuir_aperture(V, r, d) / V**1.5; this function takes only the geometry.

Parameters

NameTypeDefaultDescription
aspect_ratiofloat or array_likerequiredAperture radius over gap, r/d.
massfloat or array_likeelectron_massParticle mass (kg) and charge (C). Default: electron.
chargefloat or array_likeelectron_massParticle mass (kg) and charge (C). Default: electron.

Returns

float or numpy.ndarray
P_opt in A/V^(3/2).

Examples

Electrons and protons at r/d = 1 (the ratio is √(m_p/m_e) = 42.8):

>>> print(
... f"{optimal_perveance(1.0):.4g} {optimal_perveance(1.0, mass=proton_mass):.4g}"
... )
7.332e-06 1.711e-07

perveancefunction#

def perveance(current, voltage, mass=electron_mass, charge=elementary_charge, kind='A/V^1.5', relativistic=False)

Compute the perveance of a beam.

kind="A/V^1.5" gives P = I / V^(3/2). kind="generalized" gives the dimensionless K = q I / (2π ε₀ m γ³ v³), which is 2 I / (I₀ β³ γ³) with I₀ = 4π ε₀ m c³ / q and is the space-charge strength in the envelope equation (kv_envelope()).

Parameters

NameTypeDefaultDescription
currentfloat or array_likerequiredBeam current I in A.
voltagefloat or array_likerequiredAccelerating voltage V in V.
massfloat or array_likeelectron_massParticle mass (kg) and charge (C). Default: electron.
chargefloat or array_likeelectron_massParticle mass (kg) and charge (C). Default: electron.
kind('A/V^1.5', 'generalized')"A/V^1.5"Which perveance to return.
relativisticboolFalseUse the relativistic v and γ for the generalized perveance (see beam_speed()).

Returns

float or numpy.ndarray
P in A/V^(3/2), or the dimensionless K.

Examples

>>> print(f"{perveance(1.0, 30e3, mass=proton_mass):.4g} A/V^1.5")
1.925e-07 A/V^1.5
>>> print(f"{perveance(1.0, 30e3, mass=proton_mass, kind='generalized'):.4g}")
0.125

pierce_anglefunction#

def pierce_angle(degrees=True)

Return the Pierce electrode angle, 67.5° (3π/8) from the beam axis.

For an infinite planar beam edge, the Pierce electrode holds the equipotential of the Child–Langmuir flow along a plane inclined by 67.5° to the axis (22.5° to the emitting surface), which makes the beam edge straight and parallel.

Parameters

NameTypeDefaultDescription
degreesboolTrueReturn degrees (default) or radians.

Returns

float
The angle between the focusing electrode and the beam axis.

Examples

>>> pierce_angle()
67.5

space_charge_compensation_timefunction#

def space_charge_compensation_time(gas_density, cross_section, beam_speed)

Compute the time to space-charge compensate a beam by ionising the background gas.

The beam ionises the gas at the rate n_b n_g σ v_b per unit volume, and the produced slow ions (or electrons) are trapped by the beam potential, so the compensating density reaches the beam density n_b after τ = 1 / (n_g σ v_b). This is the build-up time in the absence of losses.

Parameters

NameTypeDescription
gas_densityfloat or array_likeBackground gas density n_g in m⁻³ (p / k_B T).
cross_sectionfloat or array_likeBeam-impact ionisation cross section σ in m².
beam_speedfloat or array_likeBeam speed v_b in m/s (beam_speed()).

Returns

float or numpy.ndarray
τ in s.

Examples

30 keV protons in a gas of 2.4e17 m⁻³ (about 1e-3 Pa) with σ = 1e-20 m²:

>>> v, _ = beam_speed(30e3, mass=proton_mass)
>>> print(f"{space_charge_compensation_time(2.4e17, 1e-20, v) * 1e6:.4g} us")
173.8 us

stripping_fractionfunction#

def stripping_fraction(density, cross_section, length=None, positions=None, axis=-1)

Compute the fraction of a beam lost (stripped or ionised) on a target, 1 − exp(−∫ n σ dl).

The complement of neutral_beam_attenuation() and takes the same arguments: the fraction of a negative-ion beam that is neutralised in a gas cell, or of an atomic beam that is ionised.

Parameters

Examples

>>> print(f"{stripping_fraction(1e19, 1e-20, length=5.0):.4f}")
0.3935