mbtrack2.utilities.misc module

This module defines miscellaneous utilities functions.

effective_impedance(ring: Synchrotron, imp: Impedance, m: int, mu: int, sigma: float, M: int, tuneS: float, xi: float | None = None, mode: str = 'Hermite')[source]

Compute the effective (longitudinal or transverse) impedance. Formulas from Eq. (1) and (2) p238 of [1].

Parameters

ring : Synchrotron object imp : Impedance object mu : int

coupled bunch mode number, goes from 0 to (M-1) where M is the number of bunches

mint

head-tail (or azimutal/synchrotron) mode number

sigmafloat

RMS bunch length in [s]

Mint

Number of bunches.

tuneSfloat

Synchrotron tune.

xifloat, optional

(non-normalized) chromaticity

mode: str, optional

type of the mode taken into account for the computation: -“Hermite” modes for Gaussian bunches

Returns

Zefffloat

effective impedance in [ohm] or in [ohm/m] depanding on the impedance type.

References

[1] : Handbook of accelerator physics and engineering, 3rd printing.

head_tail_form_factor(ring: Synchrotron, imp: Impedance, m: int, sigma: float, tuneS: float, xi: float | None = None, mode: str = 'Hermite', mu: int = 0)[source]

Compute the head-tail form factor for the effective impedance. Formulas from Eq. (3) p238 of [1]. Parameters ———- ring : Synchrotron object

Synchrotron parameters.

impImpedance object

Impedance spectrum.

mint

Head-tail (or azimutal/synchrotron) mode number.

sigmafloat

RMS bunch length in [s].

tuneSfloat

Synchrotron tune.

xifloat, optional

(non-normalized) chromaticity.

mode: str, optional

Type of the mode taken into account for the computation: -“Hermite” modes for Gaussian bunches.

muint, optional

Coupled bunch mode number, goes from 0 to (M-1) where M is the number of bunches. Default is 0.

Returns

denfloat

Head-tail form factor in [ohm] or in [ohm/m] depending on the impedance type.

References

[1] : Handbook of accelerator physics and engineering, 3rd printing.

tune_shift_from_effective_impedance(Zeff)[source]
yokoya_elliptic(x_radius: float, y_radius: float) tuple[float, float, float, float, float][source]

Compute Yokoya factors for an elliptic beam pipe.

Parameters

x_radiusfloat

Horizontal semi-axis of the ellipse in [m].

y_radiusfloat

Vertical semi-axis of the ellipse in [m].

Returns

yoklongfloat

Yokoya factor for the longitudinal impedance.

yokxdipfloat

Yokoya factor for the dipolar horizontal impedance.

yokydipfloat

Yokoya factor for the dipolar vertical impedance.

yokxquadfloat

Yokoya factor for the quadrupolar horizontal impedance.

yokyquadfloat

Yokoya factor for the quadrupolar vertical impedance.

References

[1] : M. Migliorati, L. Palumbo, C. Zannini, N. Biancacci, and V. G. Vaccaro, “Resistive wall impedance in elliptical multilayer vacuum chambers.” Phys. Rev. Accel. Beams 22, 121001 (2019). [2] : R.L. Gluckstern, J. van Zeijts, and B. Zotter, “Coupling impedance of beam pipes of general cross section.” Phys. Rev. E 47, 656 (1993).

beam_loss_factor(impedance: Impedance, frequency: ndarray[tuple[int, ...], dtype[_ScalarType_co]], spectrum: ndarray[tuple[int, ...], dtype[_ScalarType_co]], ring: Synchrotron) float[source]

Compute “beam” loss factor using the beam spectrum, uses a sum instead of integral compared to loss_factor [1].

Parameters

impedance : Impedance of type “long” frequency : array

Sample points of spectrum.

spectrumarray

Beam spectrum to consider.

ring : Synchrotron object

Returns

kloss_beamfloat

Beam loss factor in [V/C].

References

[1]Handbook of accelerator physics and engineering, 3rd printing.

Eq (3) p239.

double_sided_impedance(impedance: Impedance)[source]

Add negative frequency points to single sided impedance spectrum following symetries depending on impedance type.

Parameters

impedanceImpedance object

Single sided impedance