Fast tracking between non-periodic positions

Moderators: cyao, michael_borland

Post Reply
Teresia
Posts: 30
Joined: 04 Oct 2018, 08:42

Fast tracking between non-periodic positions

Post by Teresia » 02 Mar 2021, 04:58

Hi,

I am trying to simulate ion instabilities and would like to place ion elements within a periodic cell. Since the execution time with element-by-element tracking is long I was hoping to speed it up by splitting the ring into several ILMATRIX elements, but it seems ILMATRIX can only be used to split a ring at positions where the lattice is periodic. Is that the case? If so, is there some other way I could do it? I was looking at the EMATRIX element, but it doesn't seem to include non-linear effects in the same way as ILMATRIX.

Best regards,

Teresia

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

Re: Fast tracking between non-periodic positions

Post by michael_borland » 02 Mar 2021, 14:28

Teresia,

If you can compose your ring out of several non-periodic and at least one periodic segment, then there's a approach that may work:
  1. Use EMATRIX for the non-periodic segments.
  2. Use ILMATRIX for the periodic segment. The tunes, momentum compaction, etc, should be for the periodic segment only. However, the chromaticities and tune shifts with amplitude should be for the entire ring (or 1/N of the ring if you have N periodic inserts).
Another approach, which Joe Calvey has used, is to use concatenated high-order matrices. Normally, these are to be avoided in ring tracking since they are not symplectic, but for small amplitudes and a few thousand turns, it should be ok. (This can of course be tested by comparing to tracking with symplectic elements.) To use this, you need to make your lattice from DRIFT, QUAD, SEXT, and SBEN elements. Use default_order=3 and concat_order=3 in the run_setup command. Concatenation is done in segments separated by elements that are nonconcatenateable (e.g., BPMs, IONEFFECTS), so your lattice should ideally only have such elements at locations where you have a reason to put a breakpoint.

I'll think about how I can improve the ILMATRIX element to allow more general cases, but that will take some time.

--Michael

Teresia
Posts: 30
Joined: 04 Oct 2018, 08:42

Re: Fast tracking between non-periodic positions

Post by Teresia » 03 Mar 2021, 05:38

Hi Michael,

Thank you. Those are very good ideas. I will try them and see which works best for our lattice.

In case it helps to make ILMATRIX more general, I think the equivalent to ILMATRIX in AT (fastring) can split the ring at any position, but the idea behind that element might be slightly different. I have tried to understand if there is any significant difference between ILMATRIX and fastring, but so far I haven't had time to benchmark the non-linear part, which I'm expecting might be were differences are if they exist. Anyway, if it is of any use there are now both a Matlab and Python version.

Matlab:
https://github.com/atcollab/at/blob/mas ... fastring.m

Python:
https://github.com/atcollab/at/blob/mas ... astring.py

and they both call the same passmethods:

Linear (including average energy loss and radiation damping):
https://github.com/atcollab/at/blob/mas ... ix66Pass.c

Non-linear:
https://github.com/atcollab/at/blob/mas ... ltaQPass.c

Quantum diffusion:
https://github.com/atcollab/at/blob/mas ... DiffPass.c

Best regards,

Teresia

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

Re: Fast tracking between non-periodic positions

Post by michael_borland » 25 Mar 2021, 09:46

Teresia,

Thanks, I'll have a look and see if I can make ILMATRIX more general.

--Michael

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

Re: Fast tracking between non-periodic positions

Post by michael_borland » 25 Mar 2021, 12:16

Teresia,

If I read the MATLAB code correctly, it doesn't allow non-periodic positions. Like elegant, alphax and alphay can be nonzero, but the module has to be periodic.

I'll still think more about it.

--Michael

Post Reply