TWLA problem and extract transport elements in a cavity

Moderators: cyao, michael_borland

Post Reply
jcytsai
Posts: 41
Joined: 01 Oct 2012, 20:18

TWLA problem and extract transport elements in a cavity

Post by jcytsai » 14 Nov 2014, 12:33

Dear Michael and ELEGANT experts,

I have several problems/questions about linac models in ELEGANT. Let me describe below:

My goal is to find transport matrix elements (e.g. R5x, x=1,2...,6) within a (traveling-wave) linac. I use TWLA.
Now, assume the frequency is 2856MHz, peak accelerating gradient 25 MV/m, length 3 m, initial phase = 0.1396 rad (used in ELEGANT).

I attach two files (*.ele and *.lte) along with the following questions (Please check them):
Q1. I use a single TWLA element to implement the above situation, and the results work well. However, to achieve my goal, I split the single TWLA element into pieces with PHASE_REFERENCE already set (say, PHASE_REFERENCE=1), the output results become different from those by a single TWLA. I have no idea where I mistake. I set the length of the divided elements TWLA as c/f = (3e8/2856e6) = 0.1m, put a leading split TWLA, and the rest TWLA elements with phase referenced to the leading one.
The final momentum (beta*gamma) is 50.5 for a single TWLA setting, which is expected. However, the final momentum becomes 13.9 and 33 (with and without set PHASE=0.1396 in the split elements), which seem incorrect.
My question is: Where did I mistake and how should I correct such discrepancy?

Q2. It looks $divide_elements does not support TWLA elements yet. Is there an effective way to extract R5x elements within an accelerating cavity from ELEGANT output?

Thanks in advance for the help!
Cheng-Ying
Attachments
RF_comp.lte
(852 Bytes) Downloaded 179 times
RF_comp.ele
(1.2 KiB) Downloaded 169 times

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

Re: TWLA problem and extract transport elements in a cavity

Post by michael_borland » 17 Nov 2014, 13:55

Cheng-Ying,

The phase reference feature for TWLA is broken. It will be fixed in the next release, which I hope will be in the next few weeks.

Sorry for the inconvenience, and thanks for reporting the problem.

--Michael

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

Re: TWLA problem and extract transport elements in a cavity

Post by michael_borland » 17 Nov 2014, 14:12

Cheng-Ying,

Actually, TWLA is ok, but there's a problem with your file that causes the parser to ignore the phase reference setting.

The quotation mark that you use to terminate the method="... part of the element definition is not an ascii character. Perhaps you copied and pasted it from a program that uses another character set. In any case, when I fix this, it all works as expected.

See attached.

Code: Select all

% elegant RF_comp.ele
% sddsplot -col=t,p RF_compressor.out RF_compressor_split.out -graph=dot,vary
--Michael
Attachments
RF_comp.lte
(898 Bytes) Downloaded 204 times
RF_comp.ele
(2.44 KiB) Downloaded 191 times

jcytsai
Posts: 41
Joined: 01 Oct 2012, 20:18

Re: TWLA problem and extract transport elements in a cavity

Post by jcytsai » 17 Nov 2014, 15:41

Dear Michael,

Thank you for pointing out the quotation mark issue in my original file. Now the final momentum is resolved. By dividing the element of TWLA, now I can extract transport matrix elements R5x from the output file (*.mat). However, I found the output results (say, R56 vs. s), with and without dividing TWLA, are different. Without dividing the element, I know the output R56 only records the initial/entrance and final/exit of the element.

The final R56 (i.e. R56(s_exit)) should be the same for both with and without element division, is that right? But, it looks quite different (please see below the two attachments). Actually, I am not sure how ELEGANT calculates such transfer matrix elements inside TWLA. Could you refer me to some specific source file of ELEGANT or give some hints about the algorithm?

Thank you very much for the help!
Cheng-Ying
Attachments
R56_w_no_element_split.png
R56_w_no_element_split.png (4.67 KiB) Viewed 3176 times
R56_w_element_split.png
R56_w_element_split.png (5.3 KiB) Viewed 3176 times

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

Re: TWLA problem and extract transport elements in a cavity

Post by michael_borland » 18 Nov 2014, 12:54

Cheng-Ying,

The TWLA matrix is a basic rf cavity matrix, like that used for RFCA. It isn't expected to be reliable for low-energy beams.

Elegant has the ability to determine the matrix from tracking, which would be a better way to handle this. You might try using the analyze_map command, which also determines the matrix from tracking.

--Michael

jcytsai
Posts: 41
Joined: 01 Oct 2012, 20:18

Re: TWLA problem and extract transport elements in a cavity

Post by jcytsai » 18 Nov 2014, 14:23

Dear Michael,

Thanks very much for the reply. I just tried &analyze_map but it looks that the output (*.ana) only contains a single-turn matrix, that is, (say, for R56) a number. Is it possible to obtain R56(s) vs s along a section of beamline and (furthermore) within individual elements using &analyze_map?

Thanks!
Cheng-Ying

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

Re: TWLA problem and extract transport elements in a cavity

Post by michael_borland » 05 Dec 2014, 04:34

Cheng-Ying,

Sorry for not responding sooner. This isn't possible right now. I'll try to add something to the code for the next release that would allow computing the TWLA matrix from tracking automatically.

--Michael

jcytsai
Posts: 41
Joined: 01 Oct 2012, 20:18

Re: TWLA problem and extract transport elements in a cavity

Post by jcytsai » 06 Dec 2014, 20:49

Dear Michael,
Thank you very much for this information!
Best,
Cheng-Ying

Post Reply