Skip to content

U0 error in fast_ring #1029

@lcarver

Description

@lcarver

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.

  1. 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.

  1. 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.

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions