Page 1 of 1

R56 issue?

Posted: 05 Dec 2017, 11:33
by simona.bettoni
Hi,
we are trying to run Elegant. We generated a lattice file of MAD-X and Elegant. We plot the dispersion with the two codes and we obtain similar result, but when we try to plot R56 we have a discrepancy of a factor 2.
We tried with two versions of Elegant (both of them of 2017) and with different lattices.
I upload the relevant Elegant files, the plots of the dispersion and R56 for MAD-X and Elegant.
To generate R56 we used the command:
&matrix_output
SDDS_output = %s.mat
SDDS_output_order = 2
&end
in the .ele file.
We have also a tool to compute (and we measured in the machine) R56, and this is fitting with the MAD-X expectations.
It is possible that we are doing something really wrong doing the computation of R56...
Many thanks for any suggestion,
Simona.

Re: R56 issue?

Posted: 05 Dec 2017, 12:44
by michael_borland
Simona,

Is there acceleration in the system? If so, that could cause a misunderstanding of what the reference momentum is supposed to be. In elegant, R56 is defined as ds/dpIntial, where pInitial is the momentum at the start of the beamline. In many cases, people compute ds/dpChicaneInput, which is a different number when there is acceleration.

To say more, I'd need a copy of your .ele and .lte files.

--Michael

Re: R56 issue?

Posted: 05 Dec 2017, 12:45
by michael_borland
Sorry, that should be
R56 = ds/dpIntial*pInitial0, etc.

--Michael

Re: R56 issue?

Posted: 06 Dec 2017, 03:51
by simona.bettoni
Sorry, I thought I uploaded all of them, but not. Here they are.
The section where we see the discrepancy in SINBC02.
Thanks.

Re: R56 issue?

Posted: 06 Dec 2017, 11:50
by michael_borland
Simona,

As I suspected, the problem is that MAD-X is not correctly taking into account the change in beam momentum. It is computing the local R56, resulting from a local change in delta, rather than the R56 with respect to the initial delta. Hence, the total R56 computed by MAD-X is not really the total R56. The factor-of-two error is approximately the ratio of the initial energy to the energy at the main chicane.

To prove this, I ran a tracking simulation and computed the R56 from that. As you can see, it agrees well with the matrix analysis from elegant.
checkR56.png
checkR56.png (10.68 KiB) Viewed 16843 times
I've also attached my files so you can see how I did the calculation. (Note: I changed your lattice file, turning RFCWs into RFCAs and adding a misalignment element that allows me to vary the initial delta).

As for why your measurements are agreeing with MAD-X, I can't be sure, but suspect you are varying and measuring the energy at the chicane, rather than the entrance of the linac. If you wan to check that calculation with elegant, you need to simulate just the chicane, not the linac plus chicane.

--Michael

Re: R56 issue?

Posted: 11 Dec 2017, 10:44
by simona.bettoni
Many thanks for your reply.