Page 1 of 1

issue tracking with canonical kick elements and sync. tune calculation

Posted: 03 Jan 2018, 22:00
by Philippe Piot
Michael, All,
I have converted some file from madx into elegant to simulate an electron ring in elegant and I encounter two problems I seems to no be able to solve.
First I track particle through the ring (see tracking1.ele) and it works fine when I use the matrix elements. If I convert this lattice to include canonical kick (transforming quad in kquad, sextupole in ksext and sbend in csbend using the included script mk_canonical_elem.awk ) I observe that the beam is lost after a few turns (see tracking2.ele). I am attaching all my files the elements are all described in the elements.lte file
Second (and I suppose this is related), I have adapted the synchrotron-tune example to run on my lattice (see syncTune.ele) and even for the simple case of a lattice described with matrices I do not see the synchrotron oscillations.

Thank you for any suggestion. Sorry for dumping all my files, I tried to make things simpler (by modifying the corresponding PAR examples) but somehow it always work for this lattice so I suspect something is wrong in my .lte file.

Best, -- Philippe.

Re: issue tracking with canonical kick elements and sync. tune calculation

Posted: 08 Jan 2018, 09:04
by michael_borland
Philippe,

I looked at the file elements_can.lte, and found several statements with a missing comma, e.g.,

Code: Select all

M1R:  CSBEND,  L=0.3665191429, ANGLE=0.5235987756  , integration_order=4, n_kicks=20, &
             nonlinear=1, synch_rad=1n_kicks=10, synch_rad=1
The second line, in addition to having "synch_rad=1" twice, is missing a comma after the first occurrence. This would result in the n_kicks parameter being ignored, which could well be the source of the problem, particularly since it occurs in every CSBEND definition.

Similarly, you have a missing comma after "K1=..." in several statements of the form

Code: Select all

QA1R:  KQUADRUPOLE,  L= 0.21, K1 = -8.74423592  n_kicks=10, synch_rad=1
--Michael

Re: issue tracking with canonical kick elements and sync. tune calculation

Posted: 09 Jan 2018, 20:13
by Philippe Piot
Hi Michael,
Indeed fixing the error your pointed out fixed my issues (sorry for missing these ones!). I can now track with canonical kick but still if I use a modified version of the synchrotron tune example I always observe some energy loss (for instance the attached plot show the evolution of the mean energy as function of passes).
Is there something I am missing with the rf_setup? I defined my cavity in the elements_can.lte as a simple RFCA (no parameter defined). The ele file I am referring to is synchTune.ele .

Thank you, -- Philippe.

Re: issue tracking with canonical kick elements and sync. tune calculation

Posted: 10 Jan 2018, 10:24
by michael_borland
Phillipe,

I see three problems:

(1) There are still some element definition errors for CSBEND in elements_can.lte, as previously noted.

(2) You are using SYNCH_RAD=1 on the CSBEND, KQUAD, and KSEXT elements, but your beamline (iota_osc_sr) also includes an SREFFECTS element. This means you have twice the synchrotron radiation you want. You should either use element-by-element radiation or SREFFECTS, not both.

(3) The lattice has alphac<0, which rf_setup is not able to handle (the phase will be wrong). You can fix this but just defining the rf cavity as follows

Code: Select all

cavity: rfca, freq=3.000119966120951e+07, L=0.05, volt=1.406029992468405e+03, phase=0.570566001399379
I'll fix rf_setup in the next release to address this.

With these changes, there is still a slow linear drift in the momentum offset. I also see oscillations in the horizontal coordinates. This is synchro-betatron coupling from the large dispersion at the cavity, since I was able to greatly reduce the horizontal motion and the momentum offset drift by moving the cavity to a low-dispersion location.

With the cavity in the high-dispersion location, the beam is eventually lost. When the cavity is in a high-dispersion location, the kicks from the cavity result in a horizontal betatron oscillation. This is sufficient to cause path-lengthening, which causes drift in the phase. That causes increasingly large voltage kicks, and things run away.

--Michael

Re: issue tracking with canonical kick elements and sync. tune calculation

Posted: 10 Jan 2018, 10:35
by michael_borland
Philippe,

Actually, I think the synchro-betatron instability is a result of some error I introduced in my testing. If I use the following

Rf setup: frequency is 3.000119966120951e+07 Hz (h=4)
Voltage per cavity is 1.406029992468405e+02 V, phase is 5.739170477266787e+00 deg

it seems stable

--Michael

Re: issue tracking with canonical kick elements and sync. tune calculation

Posted: 11 Jan 2018, 05:52
by Philippe Piot
Hi Michael,
Thank you very much. It does work fine now. Out of curiosity how did you set up the phase and amplitude? Your number seems to be obtained from rf_setup Do you have already a version where rf_setup can handle alphac<0? If so would you be able to provide a patch so I could recompile ELEGANT accordingly? Thank you very much for all your help. -- Philippe.

Re: issue tracking with canonical kick elements and sync. tune calculation

Posted: 11 Jan 2018, 09:04
by michael_borland
Philippe,

Yes, there is a version that works for alphac<0. The relevant file is attached.

--Michael

Re: issue tracking with canonical kick elements and sync. tune calculation

Posted: 12 Jan 2018, 09:12
by michael_borland
Second try posting the fix.