Page 1 of 1
FWHM size in TraceWin optimization and output
Posted: Fri 7 Jul 2023 18:50
by emo
Dear Didier,
I would like to ask if you could add a functionality in TraceWin.
Lately, I am using often the FWHM beam size to define the resolution of separating two beams with different mass-to-charge ratios.
Until now, I have been using the RMS size definition in the optimization and then I was extracting manually (and not very precise) the FWHM from the size projection in the 'Multiparticle phase space' plots (as shown in the plot).
- Example - FWHM size extraction from projection.png (152.48 KiB) Viewed 23957 times
However, with larger space charge and high order aberrations the particle distribution becomes skewed due to the tails and the results of the optimization are not predictable, i.e. it is difficult to predict what RMS size corresponds to the desired FWHM resolution.
Would it be easy to include the FWHM size definition into the DIAG_SIZE range of diagnostic elements? DIAG_SIZE50?
It would be great also to have the possibility to extract the FWHM size directly from the 'Beam parameters' window of the 'Multiparticle phase space' plots.
Thank you in advance for your answer.
Best regards,
Emil
Re: FWHM size in TraceWin optimization and output
Posted: Thu 13 Jul 2023 11:35
by Didier
Dear Emil,
I'm sorry to have taken so long to reply, but in the end your request wasn't as simple as that to implement and I'll probably have to do a lot of tests to fully validate this new development, and I haven't had the time to do them all.
That said, so, I've added the calcul of the full width at half-maximum (FWHM). Results are visibled in the emit. box of the beam distribution plots and in the "PAR_diag1.dat" file.
I'av add also 3 new diagnostics, BEAM_SIZE_FWHM, BEAM_DSIZE_FWHM, BEAM_DSIZE2_FWHM (see manual for details)
Regards,
Didier
Re: FWHM size in TraceWin optimization and output
Posted: Tue 22 Aug 2023 16:08
by emo
Dear Didier,
Thank you a lot for the FWHM additions.
It will help me save a lot of time in the future.
Best regards,
Emil
Re: FWHM size in TraceWin optimization and output
Posted: Fri 15 Sep 2023 13:59
by ibustinduy
Dear Didier,
I am trying to use this functionality to adjust the fieldmap amplitudes of a MultiHarmonic buncher, thus I am trying to minimize the "Wanted FHHM Phase spread (°)" at a certain location ~0.5m.
For that I am using the DIAG_SIZE_FWHM command, like this:
Code: Select all
VARIABLE Fr1 10.128
DRIFT 0.0010 1000 0 0 0
ADJUST 200 6 0 0 50 0.01
FREQ Fr1
FIELD_MAP 100 0.1 -90.0 30 0 38 0 0 MHB
ADJUST 200 6 0 -30 0 0.01
FREQ 2*Fr1
FIELD_MAP 100 0.1 -90.0 30 0 -14 0 0 MHB
ADJUST 200 6 0 0 5 0.01
FREQ 3*Fr1
FIELD_MAP 100 0.1 -90.0 30 0 10.0 0 0 MHB
ADJUST 200 6 0 -4 0 0.01
FREQ 4*Fr1
FIELD_MAP 100 0.1 -90.0 30 0 0.0 0 0 MHB
REPEAT_ELE 50 1
drift 10 1000
DIAG_SIZE_FWHM 200 1 0 0 10 0 0.5 0
drift 1e-5 75 0
REPEAT_ELE 11 1
drift 30 1000
end
DIAG_SIZE_FWHM 200 1 0 0 10 0 0.5 0
but looking at the output message, it seems it is trying to optimize the FWHM_x parameter, am I messing with the syntax or is there a bug?
kind regards!
Re: FWHM size in TraceWin optimization and output
Posted: Fri 15 Sep 2023 18:25
by Didier
Dear Ibon,
The rigth syntacx is following: "DIAG_SIZE_FWHM 200 0 0 0.5", I think there's some confusion with accuracy parameters.
Secondly, in envelope mode, it won't work because you're in CW mode, so select also matching "With partran"
Regards,
Didier
Re: FWHM size in TraceWin optimization and output
Posted: Mon 18 Sep 2023 12:21
by ibustinduy
Many Thanks!
The rigth syntacx is following: "DIAG_SIZE_FWHM 200 0 0 0.5", I think there's some confusion with accuracy parameters.
Many Thanks!, it definitely was a confusion with the accuracy parameters
Secondly, in envelope mode, it won't work because you're in CW mode, so select also matching "With partran"
The latter part Yes, I was using
«matching using Diagnostics with Partran», I am afraid I did attach an intermediate 'try & error' version.
BUT I am not sure about the CW mode comment, since this is MHB, is a device to be used at the 'LEBT' before the RFQ I was assuming CW mode was the correct way. Should I tick the CW box or not?, both seem to work which one is more accurate? in the attached picture I am showing both cases: CW mode ticked (left), not ticked (right)
kind regards!

Re: FWHM size in TraceWin optimization and output
Posted: Tue 19 Sep 2023 09:58
by Didier
Dear Ibon,
Clearly, I'll be using CW mode, as it's the most coherent in my opinion.
Regards,
Didier
Re: FWHM size in TraceWin optimization and output
Posted: Thu 11 Apr 2024 20:33
by wtam
Dear Didier,
Recently I attempt to run codes from a few months ago without any change, diag_size provides very different and incorrect results. I fixed my codes by changing it to diag_size_fwhm. Of course it is slightly different but it is what I expected. To be specific, the problematic code is "diag_size xx 0 0 10".
Best regards,
Wai-Ming
Re: FWHM size in TraceWin optimization and output
Posted: Fri 12 Apr 2024 10:26
by Didier
Dear Wai-Ming,
I made some tests with DIAG_SIZE without seing any problem. May be an simple example could help me to help you.
Regards,
Didier