Page 1 of 1

Injection optimization

Posted: 18 Nov 2020, 07:18
by Saroj_Jena
I want to optimize the pulsed sextupole magnet (PSM) kicker strength for the injection process. I tried it after going through the example file of APS, but the input for the optimization part, I didn't understand it properly or my input file has error. I am using pelegant version 2019.1.1. please find the files as attachment and help me out. I am tracking 5000 particles, but for any strength of PSM, it shows only ~ 70-80 particles remaining after 10 turns. However for the strength of 150 -180 m^-2, and at the same location of PSM in the lattice (2nd straight section), it works fine in accelerator toolbox (AT). I want to estimate the tolerances of injected elements for this injection scheme using ELEGANT , looking into its versatility.


Thanks and Regards
Saroj Jena

Re: Injection optimization

Posted: 25 Nov 2020, 15:18
by michael_borland
Saroj,

Passes are counted starting at zero, so try setting FIRE_ON_PASS=0 on the MBUMPER element.

--Michael

Re: Injection optimization

Posted: 27 Nov 2020, 04:02
by Saroj_Jena
Thanks Michael,
After setting FIRE_ON_PASS=0, the injection tracking works fine. By hit and trial method I found a best sextupole strength of 360 1/m2. However, while I do an optimization run, it gives the output: optimum strength equals to initial guess only. Where I am doing mistake, can you please help me out. I am attaching the output screenshot and relevant input files. Also, how can I plot the phase space data for each turn separately with different color or mark. The command "sddsplot psminjection.w1 -column=x,xp -graph=dot" gives a plot of every turn data together in which I can't distinguish each turn phase space.


Thanks and regards
Saroj Jena

Re: Injection optimization

Posted: 28 Nov 2020, 23:19
by michael_borland
Saroj,

I made a number of modifications to your files. Please see attached. There are some comments added to the files to explain what I did. The script 'runScript' will run the whole thing, but it assumes you have 18 cores available so you may need to edit it.

One issue is that there's a bug in the parallel version in that the Transmission quantity used by the optimizer isn't correct. I used nLost instead, which gives the number of lost particles.

For plotting, you need to split the file into pages in order to get different colors, e.g.,

Code: Select all

sddsplot -split=page -graph=dot,vary -col=x,xp filename.sdds
There's an example in the runScript file.

--Michael

Re: Injection optimization

Posted: 01 Dec 2020, 23:10
by Saroj_Jena
Thanks Michael for quick reply. I could understand many things from the comment lines..
However, the suggested nLost in optimization routine is giving error. please find the screenshot of the error message.

With best Regards
Saroj Jena

Re: Injection optimization

Posted: 03 Dec 2020, 10:58
by michael_borland
Saroj Jena,

Can you verify that you are using the latest version of elegant (2020.4)?

--Michael

Re: Injection optimization

Posted: 06 Dec 2020, 23:15
by Saroj_Jena
Actually I was using elegant version 2019.1.1, in which it was giving error. Now I used latest version 2020.4 in which the optimization using nLost is working fine.

Thanks and regards
Saroj Jena