at.physics.energy_loss#
Functions
|
Computes the energy loss per turn. |
|
Get the TimeLag attribute of RF cavities based on frequency, voltage and energy loss per turn, so that the synchronous phase is zero. |
|
Adjust the TimeLag attribute of RF cavities based on frequency, voltage and energy loss per turn, so that the synchronous phase is zero. |
Classes
|
methods for the computation of energy losses. |
- class ELossMethod(*values)[source]#
Bases:
Enummethods for the computation of energy losses.
- INTEGRAL = 1#
The losses are obtained from \(E_{loss}=C_\gamma/2\pi . E^4 . I_2\). Takes into account bending magnets and wigglers.
- TRACKING = 2#
The losses are obtained by tracking without cavities. Needs radiation ON, takes into account all radiating elements
- get_energy_loss(ring, method=ELossMethod.INTEGRAL, orbit6=None)[source]#
Computes the energy loss per turn.
- Parameters:
ring (Lattice) – Lattice description
method (ELossMethod | None) – Method for energy loss computation. See
ELossMethod.orbit6 – 6d orbit to use as initial condition for tracking
- Returns:
eloss (float) – Energy loss per turn [eV]
- get_timelag_fromU0(ring, *, method=ELossMethod.TRACKING, cavpts=None, ts_tol=None)[source]#
Get the TimeLag attribute of RF cavities based on frequency, voltage and energy loss per turn, so that the synchronous phase is zero. Used in set_cavity_phase().
With several frequencies, all the synchronous points over one period of the lowest frequency are computed (see
_synchronous_points()). Among the stable ones, the deepest potential well is selected. A warning is issued when there are several.- Parameters:
ring (Lattice) – Lattice description
method (ELossMethod | None) – Method for energy loss computation. See
ELossMethod.cavpts (Type[Element] | Element | Callable[[Element], bool] | str | None | int | Sequence[int] | bool | Sequence[bool] | RefptsCode) – Cavity location. If None, use all cavities. This allows to ignore harmonic cavities.
ts_tol (float | None) – tolerance on the synchronous position, as a fraction of the period of the lowest frequency, default is 1.0e-9. The default can be changed by setting at.DConstant.TStol
- Returns:
timelag (float) – (ncav,) array of Timelag values
ts (float) – Time difference with the present value
- set_cavity_phase(ring, *, method=ELossMethod.TRACKING, refpts=None, cavpts=None, copy=False)[source]#
Adjust the TimeLag attribute of RF cavities based on frequency, voltage and energy loss per turn, so that the synchronous phase is zero. An error occurs if all cavities do not have the same frequency.
Warning
This function changes the time reference, this should be avoided
- Parameters:
ring (Lattice) – Lattice description
method (ELossMethod) – Method for energy loss computation. See
ELossMethod.cavpts (Type[Element] | Element | Callable[[Element], bool] | str | None | int | Sequence[int] | bool | Sequence[bool] | RefptsCode) – Cavity location. If None, use all cavities. This allows to ignore harmonic cavities.
copy (bool) – If True, returns a shallow copy of ring with new cavity elements. Otherwise, modify ring in-place.