Skip to content

Commit 2696171

Browse files
authored
Improve radiation_parameters (#888)
* Add "EnergyLoss" elements in radiation_parameters * fix the emittance unit * Help of the energy loss element
1 parent 891eaca commit 2696171

File tree

4 files changed

+22
-2
lines changed

4 files changed

+22
-2
lines changed

atmat/atphysics/ParameterSummaryFunctions/atsummary.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
fprintf(' E: \t% 4.5f\n', smm.damping(3));
163163
fprintf(' Radiation Loss: \t\t% 4.5f [keV]\n', smm.radiation*1e6);
164164
fprintf(' Natural Energy Spread: \t% 4.5e\n', smm.naturalEnergySpread);
165-
fprintf(' Natural Emittance: \t\t% 4.5e [mrad]\n', smm.naturalEmittance);
165+
fprintf(' Natural Emittance: \t\t% 4.5e [m]\n', smm.naturalEmittance);
166166
fprintf(' Radiation Damping H: \t% 4.5f [ms] or %4.2f turns\n', smm.radiationDamping(1)*1e3, smm.radiationDamping(1)/smm.revTime);
167167
fprintf(' V: \t% 4.5f [ms] or %4.2f turns\n', smm.radiationDamping(2)*1e3, smm.radiationDamping(2)/smm.revTime);
168168
fprintf(' E: \t% 4.5f [ms] or %4.2f turns\n', smm.radiationDamping(3)*1e3, smm.radiationDamping(3)/smm.revTime);

atmat/lattice/element_creation/atenergyloss.m

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
% FAMNAME: family name
66
% ELOSS: Energy loss [eV]
77
% PASSMETHOD: Tracking methods, defaults to 'IdentityPass'
8+
%
9+
%the "energy loss" element is taken into account in ATSUMMARY: it adds damping by
10+
%contributing to the I2 integral, thus reducing the equilibrium emittance.
11+
%But it does not generate any diffusion. This makes sense only if the losses
12+
%summarised in the element occur in non-dispersive locations.
813

914
[rsrc,eloss,method]=decodeatargs({0,'IdentityPass'},varargin);
1015
[eloss,rsrc]=getoption(rsrc,'EnergyLoss',eloss);

pyat/at/lattice/elements.py

+6
Original file line numberDiff line numberDiff line change
@@ -1471,6 +1471,12 @@ class EnergyLoss(_DictLongtMotion, Element):
14711471
def __init__(self, family_name: str, energy_loss: float, **kwargs):
14721472
"""Energy loss element
14731473
1474+
the :py:class:`EnergyLoss` element is taken into account in
1475+
:py:func:`.radiation_parameters`: it adds damping by contributing to the
1476+
:math:`I_2` integral, thus reducing the equilibrium emittance. But it does not
1477+
generate any diffusion. This makes sense only if the losses summarised in
1478+
the element occur in non-dispersive locations.
1479+
14741480
Args:
14751481
family_name: Name of the element
14761482
energy_loss: Energy loss [eV]

pyat/at/physics/radiation.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
import numpy as np
1818
from scipy.linalg import inv, det, solve_sylvester
1919

20-
from ..lattice import Dipole, Wiggler, DConstant, test_mode
20+
from ..lattice import Dipole, Wiggler, EnergyLoss, DConstant, test_mode
2121
from ..lattice import Lattice, Element, check_radiation, Refpts, All
2222
from ..lattice import Quadrupole, Multipole, QuantumDiffusion
2323
from ..lattice import Collective, SimpleQuantDiff
2424
from ..lattice import frequency_control, set_value_refpts
25+
from ..constants import Cgamma
2526
from . import ELossMethod
2627
from . import find_mpole_raddiff_matrix, FDW, get_tunes_damp
2728
from . import find_orbit6, find_m66, find_elem_m66, Orbit
@@ -404,7 +405,13 @@ def harm(coef, h, phi):
404405
di5 = max(H0 * di3, d5lim)
405406
return np.array([di1, di2, di3, di4, di5])
406407

408+
def eloss_radiation(elem: EnergyLoss, coef):
409+
# Assuming no diffusion
410+
di2 = elem.EnergyLoss / coef
411+
return np.array([0.0, di2, 0.0, 0.0, 0.0])
412+
407413
Brho = ring.BRho
414+
elosscoef = Cgamma / 2.0 / pi * ring.energy**4
408415
integrals = np.zeros((5,))
409416

410417
if twiss is None:
@@ -418,6 +425,8 @@ def harm(coef, h, phi):
418425
integrals += element_radiation(el, vini, vend)
419426
elif isinstance(el, Wiggler) and el.PassMethod != "DriftPass":
420427
integrals += wiggler_radiation(el, vini)
428+
elif isinstance(el, EnergyLoss):
429+
integrals += eloss_radiation(el, elosscoef)
421430
return tuple(integrals)
422431

423432

0 commit comments

Comments
 (0)