Page 1 of 1

set_sync_phase

Posted: Tue 28 Feb 2023 04:44
by wtam
Dear Didier,

When using SET_SYNC_PHASE for a field map, I often run into an error:
SET_SYNC_PHASE command failed
Synchronous phase out of reach
Cavity field probably too high

Sometimes I can avoid the error by changing the sync phase by 1 or 2 degrees. The field map is designed for drift tube length for the correct ion energy. Do you have any idea why the error and how to avoid it?

Best regards,
Wai-Ming

Re: set_sync_phase

Posted: Tue 28 Feb 2023 09:31
by Didier
Dear Wai-Ming,

I know that this error can happen sometimes. If you could send me a very simplified example generating this error, I could look more specifically at why your case is problematic and how to fix it.

Regards,

Didier

Re: set_sync_phase

Posted: Wed 1 Mar 2023 05:26
by wtam
Dear Didier,

Please see attachment. The attached project demonstrated the problem. This project is almost identical to the example project that I used for another post (Phase Offset). The only difference is that the strength of the field map is 10x stronger here. My experience is that the problem occurs more often when the accelerating voltage is high relative to the beam voltage.

Best regards,
Wai-Ming

Re: set_sync_phase

Posted: Wed 1 Mar 2023 11:36
by Didier
Dear Wai-Ming,

When the fields are very strong, the synchronous phase can quickly become complicated to calculate. It should be kept in mind that the synchronous phase is not a physical quantity but a value derived from a definition (see the manual chapter on this definition). This also means that not all synchronous phases are necessarily attainable.
You are typically in these somewhat complex cases. You have two solutions, either increase the calculation step, which solves the problem in your case, or change the definition, which I suggest considering your Example (Page "Main" -> button: "Simulation options" -> Option:" Use new synchonous phase definition"), which also solves your case. Or do both.

Regards,

Didier

Re: set_sync_phase

Posted: Wed 1 Mar 2023 21:07
by wtam
Dear Didier,

Thank you.
"Use new synchronous phase definition" works. How do I change the calculation step?

It triggers another question: how can I control the "lattice" command, such as calculation step?
To my understanding, both "set_sync_phase" and "lattice" are optimization. However, unlike "match_fem_xxx" and "adjust", I do not have to check any boxes on the Matching tab for them to run.

Best regards,
Wai-Ming

Re: set_sync_phase

Posted: Wed 1 Mar 2023 22:53
by Didier
Dear Wai-Ming,

Calculation step -> Page "Main" -> Entry "No. of calculation steps per".
You have a similar step to set in the multi-particle page for the traking mode.
Yes, lattice and set_sync_phase are based on a specific optimisation algorithm, but the user does not need to activate or set parameters for these commands.

Regards,

Didier

Re: set_sync_phase

Posted: Thu 2 Mar 2023 20:42
by wtam
Dear Didier,

Thank you.
I would like to make a request to make SET_SYNC_PHASE and ADJUST work together. In my application, I want to optimize the phase for other beam optics. But the initial phase value that makes physics sense to me is the synchronous phase. If I start with an arbitrary absolute phase, the optimization usually cannot find the desired solution because the initial value is too far. Or other work around?

Best regards,
Wai-Ming

Re: set_sync_phase  [SOLVED]

Posted: Mon 6 Mar 2023 09:40
by Didier
Dear Wai-Ming,

I don't quite agree with this approach, for me the only relevant and physical value is the RF phase, so the input phase (TraceWin). This is the only value that is controllable via command-control. The synchronous phase is obviously relevant for machine physicists but it depends on its definition and can vary from one code to another.
It is extremely complex to make SET_SYNC_PHASE and ADJUST work together because SET_SYNC_PHASE is really a patch. For this reason I took a more machine-realistic approach by developing the TUNE_CAVITY command which allows you to set a cavity as it would be done in the control application.

Regards,

Didier

Re: set_sync_phase

Posted: Tue 9 May 2023 15:48
by wtam
Dear Didier, and other colleagues,

Can you command on the difficulty with set_sync_phase when the voltage is too high relative to the input beam energy? Is it a pure mathematical and optimization difficulty? Or is it physical so that one should avoid when it happens in the model?

Best regards,
Wai-Ming

Re: set_sync_phase

Posted: Wed 10 May 2023 01:32
by Didier
Dear Wai-Ming,

With the usual definition, it is a mathematical problem preventing to reach some synchronous phase values which are just impossible to obtain with this synchonous phase model. With the new definition it's more of an optimization algorithm problem. That said, if the field is really to exesive, it just becomes physically impossible whatever the definition.

Regards,

Didier