the definition of dispersion in Elegant

Moderators: cyao, michael_borland

Post Reply
Biaobin
Posts: 29
Joined: 17 Feb 2017, 09:03

the definition of dispersion in Elegant

Post by Biaobin » 13 Jan 2018, 01:08

Hi,

I encounter a confusion about the definition of dispersion. I can get the dispersion value from the *.twi file, which is derived by matrix method and we take it as etax. And I can also calculate it by tracking particles and then make some statistics calculation, which can directly be done with *.sig file as: etaxBeam = s16/s6.
But I find out that by these two methods I get different values, and they have simple relations as etax/etaxBeam equals about 0.48, why?

Thanks,
Biaobin

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: the definition of dispersion in Elegant

Post by michael_borland » 15 Jan 2018, 10:20

Biaobin,

If you are tracking a system with constant reference momentum, then s16/(s6*s6) should be the same as the dispersion computed by twiss_output.

If you are tracking a system with variable reference momentum, e.g., a linac, then s16/(s6*s6) is the *local* dispersion, whereas etax in twiss_output uses the initial delta (at the start of the linac) as the reference. So you'll see a difference related to the acceleration (and any other longitudinal dynamics, e.g., in a bunch compressor).

--Michael

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: the definition of dispersion in Elegant

Post by michael_borland » 15 Jan 2018, 10:25

Biaobin,

Actually, I was incorrect here. The default for twiss_output is to compute the local dispersion. This can be changed by setting the local_dispersion parameter to 0.

Because local_dispersion=1 in twiss_output, you'll see apparent inconsistencies with the transport matrix elements, which are always referenced the the initial coordinates. The local dispersion should be consistent with the effective dispersion computed from the beam moments, unless there is strong nonlinearity (e.g., if x and delta have a strong nonlinear correlation).

--Michael

Biaobin
Posts: 29
Joined: 17 Feb 2017, 09:03

Re: the definition of dispersion in Elegant

Post by Biaobin » 15 Jan 2018, 19:42

Hi Michael,
I double checked the simulation results with my calculation with Mathematica using first order matrix. It seems like:

1. when there are no acceleration, e.g. RFCA and RFCW, the R16 from *.mat is same with etax from *.twi, and are also same with etaxBeam calculated by s16/(s6*s6).
2. But when there are acceleration, R16 (*.mat file) will not be equal to etax (*.twi file), but R16 and etaxBeam (s16/(s6*s6)) have the relationship as:
etaxBeam=p2/p1 * R16, etaxpBeam=p2/p1 * R26,
where p1 is the initial energy, p2 is the final energy. But I still don 't understand how etax is gotten ?
Image
3. And I am also confused with the beta function when linac is added in the tracking. There is a paper published in NIM by Hara Toru titled "Transverse envelope analysis for accelerating relativistic electron beams in a linear accelerator as a photon source" in 2010. Dose elegant also use the same convention ?

The elegant input file is attached, I used the lattice layout as {dipole linac drift}, and the above results are got with local_dispersion=1. When I set local_dispersion=0, the etax is 0 along the line, so I still don't understand your words of "Because local_dispersion=1 in twiss_output, you'll see apparent inconsistencies with the transport matrix elements, which are always referenced the the initial coordinates."
Attachments
one.lte
(601 Bytes) Downloaded 173 times
two.ele
(1.36 KiB) Downloaded 176 times
etax.jpg

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: the definition of dispersion in Elegant

Post by michael_borland » 15 Jan 2018, 20:58

Biaobin,

It appears that twiss_output gives wrong results when there is acceleration in a region of high dispersion. If you have a sequence like "linac-bunchCompressor-linac-bunchCompressor..." the results should be fine.

The R16 value (from matrix_output) and the effective dispersion (computed from the sigma values) are correct, but they will differ. The former is just the matrix element from the beginning of the transport line, while the latter is referenced to the local energy spread. In an isochronous system, they'll be related by the ratio of the initial to final momentum. However, if there is momentum-dependent variation in path length from a bunch compressor followed by additional off-crest acceleration, this isn't assured.

The beta function in elegant under acceleration is defined so that betax = Sx^2/ex where ex is the geometric emittance. The other twiss parameters are defined similarly, e.g., gammax = (1+alphax^2)/betax = Sxp^2/ex.

I'll look into the twiss_output issue in the next few days and see if I can find a solution.

--Michael

Biaobin
Posts: 29
Joined: 17 Feb 2017, 09:03

Re: the definition of dispersion in Elegant

Post by Biaobin » 17 Jan 2018, 13:36

Hi Michael,

I encounter another confusion about R16 in *.mpr now. I carried my calculation with Mathematica using first order matrix, and I check my results with elegant output matrix. The line is arranged as (chicane, cavity-off-crest). The separate parts calculation of chicane and cavity agree well with elegant, but when I multiply them together, the full matrix is the same except R66.
I attached the elegant and Mathematica notebook file.

Thanks,
Biaobin
Attachments
ChicaneLinac.zip
(8.4 KiB) Downloaded 180 times

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: the definition of dispersion in Elegant

Post by michael_borland » 18 Jan 2018, 12:33

Biaobin,

I think the problem is that compared to elegant you have a different sign of R56 in the matrix of the chicane, but the same sign for R65 in the matrix of the cavity. This indicates a change of t to -t.

--Michael

Biaobin
Posts: 29
Joined: 17 Feb 2017, 09:03

Re: the definition of dispersion in Elegant

Post by Biaobin » 18 Jan 2018, 14:26

Hi Michael,

Thank you so much, I suspected this but ignored it so quickly. I changed the sign of R65 to be negative and maintained the sign of R56 being positive following the conversion of z>0 being head, z<0 being tail. The final results agree well with elegant now.

May I ask you one question you mentioned in the former reply of "In an isochronous system, they'll be related by the ratio of the initial to final momentum. However, if there is momentum-dependent variation in path length from a bunch compressor followed by additional off-crest acceleration, this isn't assured." I checked with (chicane1, linac1-off-crest, chicane2, linac2-off-crest, dogleg), the final etaxBeam actually will not be equal to the simple ratio with R16. Because in my current work, I need to leak out the dispersion from the start to suppress the MBI, so there is dispersion all along the whole line, and I want to calculate the dispersion at the entrance of dogleg. How could I use transfer matrix to get it instead of by tracking particles ? Is there some references related this question ? Sorry for bothering you so much.

Thanks,
Biaobin

Biaobin
Posts: 29
Joined: 17 Feb 2017, 09:03

Re: the definition of dispersion in Elegant

Post by Biaobin » 18 Jan 2018, 16:11

Hi Michael,

I think I have got the idea, since I have the total matrix, I can use the beam sigma matrix to carry out my calculation and use sig16/sig66 to get the final dispersion.

Thanks,
Biaobin

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: the definition of dispersion in Elegant

Post by michael_borland » 18 Jan 2018, 19:50

Biaobin,

For now, using the sigma matrix is definitely the most reliable way to do this. I'm hoping to come up with something else for the next release.

--Michael

Post Reply