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).
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
FWHM size in TraceWin optimization and output
Re: FWHM size in TraceWin optimization and output
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
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
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
Thank you a lot for the FWHM additions.
It will help me save a lot of time in the future.
Best regards,
Emil
-
- Novice
- Posts: 3
- Joined: Fri 15 Sep 2023 13:10
- Country:
Western Sahara (eh)
Re: FWHM size in TraceWin optimization and output
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:
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!
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!
- Attachments
-
- MultiHarmonicBuncher_10MHz_MHB_N14.zip
- (4.09 KiB) Downloaded 821 times
-
- Captura de pantalla de 2023-09-15 13-49-01.png (677.15 KiB) Viewed 18798 times
Re: FWHM size in TraceWin optimization and output
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
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
-
- Novice
- Posts: 3
- Joined: Fri 15 Sep 2023 13:10
- Country:
Western Sahara (eh)
Re: FWHM size in TraceWin optimization and output
Many Thanks!
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!

Many Thanks!, it definitely was a confusion with the accuracy parametersThe rigth syntacx is following: "DIAG_SIZE_FWHM 200 0 0 0.5", I think there's some confusion with accuracy parameters.
The latter part Yes, I was using «matching using Diagnostics with Partran», I am afraid I did attach an intermediate 'try & error' version.Secondly, in envelope mode, it won't work because you're in CW mode, so select also matching "With partran"
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!

- Attachments
-
- CW_or_not.png (321.96 KiB) Viewed 18047 times
Re: FWHM size in TraceWin optimization and output
Dear Ibon,
Clearly, I'll be using CW mode, as it's the most coherent in my opinion.
Regards,
Didier
Clearly, I'll be using CW mode, as it's the most coherent in my opinion.
Regards,
Didier
-
- Skilled
- Posts: 111
- Joined: Mon 7 Dec 2020 06:17
- Location: Boston
- Country:
United States of America (us)
Re: FWHM size in TraceWin optimization and output
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
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
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
I made some tests with DIAG_SIZE without seing any problem. May be an simple example could help me to help you.
Regards,
Didier