mbtrack2.utilities.spectrum module¶
Module where bunch and beam spectrums and profile are defined.
- spectral_density(frequency: ndarray[tuple[int, ...], dtype[_ScalarType_co]], sigma: float, m: int = 1, k: int = 0, mode: str = 'Hermite') ndarray[tuple[int, ...], dtype[_ScalarType_co]][source]¶
Compute the spectral density of different modes for various values of the head-tail mode number, based on Table 1 p238 of [1].
Parameters¶
- frequencylist or numpy array
sample points of the spectral density in [Hz]
- sigmafloat
RMS bunch length in [s]
- mint, optional
head-tail (or azimutal/synchrotron) mode number
- kint, optional
radial mode number (such that |q|=m+2k, where |q| is the head-tail mode number)
- mode: str, optional
type of the mode taken into account for the computation: -“Hermite” modes for Gaussian bunches (typical for electrons) -“Chebyshev” for airbag bunches -“Legendre” for parabolic bunches (typical for protons) -“Sacherer” or “Sinusoidal” simplifying approximation of Legendre modes from [3]
Returns¶
numpy array
References¶
[1] : Handbook of accelerator physics and engineering, 3rd printing. [2] : Ng, K. Y. (2005). Physics of intensity dependent beam instabilities. WORLD SCIENTIFIC. https://doi.org/10.1142/5835 [3] : Sacherer, F. J. (1972). Methods for computing bunched beam instabilities. CERN Tech. rep. CERN/SI-BR/72-5 https://cds.cern.ch/record/2291670?ln=en
- gaussian_bunch_spectrum(frequency: ndarray[tuple[int, ...], dtype[_ScalarType_co]], sigma: float) ndarray[tuple[int, ...], dtype[_ScalarType_co]][source]¶
Compute a Gaussian bunch spectrum [1].
Parameters¶
- frequencyarray
sample points of the beam spectrum in [Hz].
- sigmafloat
RMS bunch length in [s].
Returns¶
- bunch_spectrumarray
Bunch spectrum sampled at points given in frequency.
References¶
[1] : Gamelin, A. (2018). Collective effects in a transient microbunching regime and ion cloud mitigation in ThomX. p86, Eq. 4.19
- gaussian_bunch(time: ndarray[tuple[int, ...], dtype[_ScalarType_co]], sigma: float) ndarray[tuple[int, ...], dtype[_ScalarType_co]][source]¶
Compute a Gaussian bunch profile.
Parameters¶
- timearray
sample points of the bunch profile in [s].
- sigmafloat
RMS bunch length in [s].
Returns¶
- bunch_profilearray
Bunch profile in [s**-1] sampled at points given in time.
- beam_spectrum(frequency: ndarray[tuple[int, ...], dtype[_ScalarType_co]], M: int, bunch_spacing: float, sigma: float | None, bunch_spectrum: ndarray[tuple[int, ...], dtype[_ScalarType_co]] | None = None) ndarray[tuple[int, ...], dtype[_ScalarType_co]][source]¶
Compute the beam spectrum assuming constant spacing between bunches [1].
Parameters¶
- frequencylist or numpy array
sample points of the beam spectrum in [Hz].
- Mint
Number of bunches.
- bunch_spacingfloat
Time between two bunches in [s].
- sigmafloat, optional
If bunch_spectrum is None then a Gaussian bunch with sigma RMS bunch length in [s] is assumed.
- bunch_spectrumarray, optional
Bunch spectrum sampled at points given in frequency.
Returns¶
beam_spectrum : array
References¶
- [1] Rumolo, G - Beam Instabilities - CAS - CERN Accelerator School:
Advanced Accelerator Physics Course - 2014, Eq. 9