Hello,
This is my first time using elegant. I am attempting to model an energy compression system consisting of a magnetic chicane and a linear accelerator. I am using the TWLA element to model the accelerator followed by WAKE, TRWAKE elements to model the wakes of the TWLA. I have simulated my structure using shorter and shorter bunches and have found the structure's longitudinal and transverse wake functions are reasonably approximated by Bane's analytic equations:
where a, s_1, s_2 are based on the geometry of the structure.
1) For my accelerator geometry, the Bane's approximation equations are valid up to z=5mm (1.67e11 sec) behind the charge that excites the wake. The bunch entering the accelerator is 17mm (5.67e11 sec) long. Should I make my wake function input file zero for all times greater than t=1.67e11 sec? If I don't set the wake function to zero after t=1.67e11 sec, does Elegant apply an energy change to the tail of the beam that it should not (is not physical)? Does this upper limit of the approximation not matter if my simulated wakepotentials for short bunches follows the approximation further out than the upper limit of the analytic function?
2) The TRWAKE element include options to scale the transverse wake functions by the the beta functions of the accelerator. Will I need to compute the beta functions near my accelerating structure and use those values for xfactor, yfactor or is that only for special cases?
Thank you,
Evan
Applying Wakes to Energy Compressor
Moderators: cyao, michael_borland

 Posts: 1796
 Joined: 19 May 2008, 09:33
 Location: Argonne National Laboratory
 Contact:
Re: Applying Wakes to Energy Compressor
Evan,
To get the best results, you should find a way to extend the wake potential beyond 16.7 ps. Usually there are different approximations for short and long times, which can be joined into a single wake. Barring that, if the wake potential has at least dropped down to very small values by 16.7 ps but you still have particles beyond that, I suggest extended with zeros.
You only need to use the factor parameters on TRWAKE if (1) you are placing the TRWAKE elements in the actual location of the impedance. (2) lumping together many impedances into a single location, where the object locations have "significantly" different beta functions. Usually in linac modeling people ignore this subtlety as it tends to average out. If the impedance in question is distributed along the linac, you can split the linac into sections, so the weighting happens automatically. Otherwise, if you want to be really precise, set the factor parameter to (AverageOfBeta)/(BetaAtTRWAKE).
Michael
To get the best results, you should find a way to extend the wake potential beyond 16.7 ps. Usually there are different approximations for short and long times, which can be joined into a single wake. Barring that, if the wake potential has at least dropped down to very small values by 16.7 ps but you still have particles beyond that, I suggest extended with zeros.
You only need to use the factor parameters on TRWAKE if (1) you are placing the TRWAKE elements in the actual location of the impedance. (2) lumping together many impedances into a single location, where the object locations have "significantly" different beta functions. Usually in linac modeling people ignore this subtlety as it tends to average out. If the impedance in question is distributed along the linac, you can split the linac into sections, so the weighting happens automatically. Otherwise, if you want to be really precise, set the factor parameter to (AverageOfBeta)/(BetaAtTRWAKE).
Michael

 Posts: 6
 Joined: 01 Oct 2019, 09:34
Re: Applying Wakes to Energy Compressor
Hello,
Thank you for your reply. I've computed the wakefunction for my 16cell structure. They match the equations previously posted which are for a set of periodic cells. In the paper where the approximations are derived a distinction is made between the wakefunction of a single cell and an array of cells. The wakefunctions of a periodic structure is not just the wakefuction of a single cell multiplied by the number of cells in the structure.
Using the WAKE element and its default factor, I do not see any wake effect on the longitudinal phase space. Only when I put FACTOR=16 do I see an effect. Does using a factor of 16 effectively model a structure of 16*16 cells (not what I want)? Why is there no visible effect when FACTOR=1?
Looking at the LCLS example, I see a factor of ~86 was used however I cannot be sure whether their input wake was for a single cell or for a structure of ~80 cells.
This is the element in Elegant:
LONGWAKE:WAKE,INPUTFILE="baneLongWake.sdds",TCOLUMN="t",WCOLUMN="w",N_BINS=0,FACTOR="16 1 *"
Thanks,
Evan
Thank you for your reply. I've computed the wakefunction for my 16cell structure. They match the equations previously posted which are for a set of periodic cells. In the paper where the approximations are derived a distinction is made between the wakefunction of a single cell and an array of cells. The wakefunctions of a periodic structure is not just the wakefuction of a single cell multiplied by the number of cells in the structure.
Using the WAKE element and its default factor, I do not see any wake effect on the longitudinal phase space. Only when I put FACTOR=16 do I see an effect. Does using a factor of 16 effectively model a structure of 16*16 cells (not what I want)? Why is there no visible effect when FACTOR=1?
Looking at the LCLS example, I see a factor of ~86 was used however I cannot be sure whether their input wake was for a single cell or for a structure of ~80 cells.
This is the element in Elegant:
LONGWAKE:WAKE,INPUTFILE="baneLongWake.sdds",TCOLUMN="t",WCOLUMN="w",N_BINS=0,FACTOR="16 1 *"
Thanks,
Evan

 Posts: 1796
 Joined: 19 May 2008, 09:33
 Location: Argonne National Laboratory
 Contact:
Re: Applying Wakes to Energy Compressor
Evan,
It shouldn't be necessary to set FACTOR to 16 to get an effect. It will just multiply the effect by 16. Similar, with FACTOR=1, you'll just get the effect of the given wake without any additional scaling.
If you post your input files, I'll take a look.
Michael
It shouldn't be necessary to set FACTOR to 16 to get an effect. It will just multiply the effect by 16. Similar, with FACTOR=1, you'll just get the effect of the given wake without any additional scaling.
If you post your input files, I'll take a look.
Michael

 Posts: 6
 Joined: 01 Oct 2019, 09:34
Re: Applying Wakes to Energy Compressor
Hello,
I have attached the input, lattice and wake files.
I appreciate your help,
Evan
I have attached the input, lattice and wake files.
I appreciate your help,
Evan
 Attachments

 clsEcs.zip
 (9.03 KiB) Downloaded 239 times

 Posts: 1796
 Joined: 19 May 2008, 09:33
 Location: Argonne National Laboratory
 Contact:
Re: Applying Wakes to Energy Compressor
Evan,
The lattice file you sent didn't seem to use the WAKE element. However, it was easy enough to set up a simple beamline that consisted of just a CHARGE element and a WAKE element that uses the wake file you provided.
I find that as I vary the FACTOR parameter, the final momentum deviation varies linearly, as I would expect. The effect on the phase space is subtle for FACTOR=1 and obvious for FACTOR=16, but a factor of 16 will do that. Unless I'm missing something, the results seem fine.
Michael
The lattice file you sent didn't seem to use the WAKE element. However, it was easy enough to set up a simple beamline that consisted of just a CHARGE element and a WAKE element that uses the wake file you provided.
I find that as I vary the FACTOR parameter, the final momentum deviation varies linearly, as I would expect. The effect on the phase space is subtle for FACTOR=1 and obvious for FACTOR=16, but a factor of 16 will do that. Unless I'm missing something, the results seem fine.
Michael
 Attachments

 example.zip
 (6.68 KiB) Downloaded 238 times

 Posts: 6
 Joined: 01 Oct 2019, 09:34
Re: Applying Wakes to Energy Compressor
I deleted the Wake element while doing some testing and forgot to include it again before attaching the files. In any case, your response helps. I was expecting a larger effect.
Thanks for looking into my issue.
Evan
Thanks for looking into my issue.
Evan