Skip to content

ExactCFBend model incompatible with Xsuite/MAD-X #1344

@nikitakuklev

Description

@nikitakuklev

As part of apollo benchmarks we try to find exact-ish model matches as safe converter paths. When doing so for ExactCFBend and xsuite Bend, assumption was that in the limit of large number of steps, any splitting scheme would converge.

However, this was only true for k1=0 case (pure dipole). For k1 != 0, there is a systematic difference. After some agent-assisted poking, this seems to be because the elements are modelling truly different fields.

  • xsuite uses MAD-X definition of field and kick (B_y = k1·x exactly on midplane, with geometric feed-down). Specifically, Δpx += -k1·x + h·k1·(-x² + 0.5·y²)

  • impactx follows Tim's paper, per @cemitch99 original PR, and does toroidal harmonics with terms like Δpx += -(1+hx)·log(1+hx)·(k1/h) = -k1·x - 0.5·h·k1·x² + ...

The difference between the two is sextupolar order and higher, cannot be compensated exactly by adjusting higher order terms.

I am not making an argument as to which is more 'correct'. But being realistic, MADX/Xsuite is the de facto standard for many many existing machines and it is mandatory to have elements that match their as-designed physics at least as an option, especially for an element as popular as a combined function bend.


Given I'm working on Genesis stuff, seems appropriate to include some LLM opinions after making agents argue about it. Don't have magnet design experience, so trustworthiness unknown.

Toroidal (ImpactX) = what you get if you bend a straight quadrupole into an arc — the natural field of curved hyperbolic poles. The gradient weakens on the outside because flux lines spread.

MAD-X (xsuite) = what you get after engineers deliberately shim the poles to force a perfectly linear gradient across the aperture. The outside gap is squeezed tighter to compensate for the natural spreading.

Real magnets are built to match MAD-X — designers specify k1 assuming polynomial fields, then engineers shim the iron in 3D FEA to cancel the curvature effects. So when you track with xsuite/MAD-X convention, you're modeling the actual shimmed hardware. ImpactX models the "unshimmed" natural curved pole.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions