Hello,
There are 2 problems with fast_ring, one has a super easy fix, the other is not so clear.
When you have a fast_ring the energy loss is implemented as part of the M66 matrix of the linear tracking. This is different to simple_ring, where it is taken into account separately in SimpleRadiation element.
get_energy_loss returns 0 for a fast ring with radiation on. This is because of line 86:
for e in ring:
if e.PassMethod.endswith("RadPass"):
ot = e.track(np.zeros(6), energy=energy, particle=particle)
delta += ot[4]
return -delta * energy
the line should read:
if e.PassMethod.endswith("RadPass") or e.PassMethod == 'Matrix66Pass':
in order to properly include energy loss in fast rings.
- With this simple fix, there is a more subtle problem. The following explains it all.
import at
ring = at.load_mat('/machfs/carver/Repo/EBSlattices/AT/S28F.mat', mat_key = 'LOW_EMIT_RING_INJ')
ring.enable_6d()
print(ring.energy_loss)
fr, frrad = at.fast_ring(ring)
print(fr.energy_loss)
print(frrad.energy_loss)
output:
2532503.734930845
-0.0
2531722.924583611
The U0 from the fast_ring is different from the full lattice.
Hello,
There are 2 problems with
fast_ring, one has a super easy fix, the other is not so clear.When you have a
fast_ringthe energy loss is implemented as part of theM66matrix of the linear tracking. This is different tosimple_ring, where it is taken into account separately inSimpleRadiationelement.get_energy_lossreturns 0 for a fast ring with radiation on. This is because of line 86:the line should read:
if e.PassMethod.endswith("RadPass") or e.PassMethod == 'Matrix66Pass':in order to properly include energy loss in fast rings.
output:
The U0 from the
fast_ringis different from the full lattice.