QuadOverRf

Simple Elegant setup with a quadrupole superimposed to an RF accelerating structure.

Modeling principle in Elegant Modeling principle in Elegant

Initial bunch

Potential source of discrepancy: The initial Astra distribution sets t = 0 for all particles and distributes them along the z axis. This means that those with zStart > 0 are missing the effect of the fileds in the region between z = 0 and z = zStart. This can be better understood looking at the above comparison of the longitudinal phase spaces.

Final bunch

With these large Gaussian distributions it is difficult to quantify and judge the discrepancies between the two codes. In any case, it seems that there are important differences at least in the transverse phase spaces, where we note a clear difference in phase advance.

Only quadrupole (RF off)

Initial cross distribution

Final cross distribution

Large discrepancies between Elegant and Astra in the transverse as well as in the longitudinal phase space for particles with momentum different than the reference momentum of 200 MeV/c.

The analytical computation matches well with Astra.

Additional tests

Positive drift space, DRIFT vs. EMATRIX

Verification succesfull for the transverse and the longitudinal plane with a modeling up to 1st order. We know how to model a drift space with EMATRIX.
Non-negligible difference in the longitudinal phase space between 1st and 2nd order modeling.
Side note: Using exactly the same initial bunch or regenerating it with the same random_number_seed provide identical results.

Negative drift space, EMATRIX vs. DRIFT

Verification successful. We know how to model a negative drift with DRIFT. (From the previous section we knew how to model a drift space up to 1st order with EMATRIX and used this as a reference in this test.) We note again that the discrepancy between 1st and 2nd order is not negligible.

Initial bunch with vanishing longitudinal emittance, Elegant vs. Astra

Final bunch with vanishing longitudinal emittance after tracking, Elegant vs. Astra

Excellent agreement bewtween Astra and Elegant when the initial energy spread and bunch length are vanishing. As expected.

Difference with and without RF, stronger fileds by a factor 4

In this extreme case, there is something wrong going on in Elegant, at least for certain particles. See the y-py-phase space and pz distribution.
Even in this extreme case, everything seems to be fine in Astra.
As already observed above, there is something wrong going on in Elegant.
Due to the unphysical results from Elegant, this comparison does not make sense at this stage.