Confusion about the “2 steps matching optimization” in the MATCH command  [SOLVED]

https://www.dacm-logiciels.fr/tracewin
Post Reply
ChinaZY Song
Novice
Novice
Posts: 2
Joined: Mon 27 Oct 2025 15:53
Country:
China (cn)
China

Confusion about the “2 steps matching optimization” in the MATCH command

Post by ChinaZY Song »

I am trying to understand the “2 steps matching optimization for (1) and (2)” part in the MATCH command (see attached screenshot).
In the panel, there are three matching options:
(1)Calculate input matched beam
(2)Match with Family & Twiss commands
(3)Match using Diagnostics
Below that, it says “2 steps matching optimization for (1) and (2)”, and the first step mentions:
Set Twiss parameters at first period input and output equal.
I understand that this means the program tries to find periodic conditions for the Twiss parameters. However, my beamline is not a periodic structure — it is a linear transport from the low-energy section to the high-energy section of a neutron generator.

So my question is:
Why does the first step still require the Twiss parameters at the input and output to be equal?
How does this “first step” behave when the system is not periodic?
In my case, should I still keep this option checked when performing a normal matching (not a periodic one)?[/size]

Any clarification on how this 2-step optimization works internally in non-periodic cases would be very helpful.
Thanks in advance!
User avatar
FranceDidier
Administrator
Administrator
Posts: 1154
Joined: Wed 26 Aug 2020 14:40
Country:
France (fr)
France

Re: Confusion about the “2 steps matching optimization” in the MATCH command

Post by FranceDidier »

Dear ZY Song,

Indeed, step (1) presupposes that you have a defined periodic structure, so at least one LATTICE command somewhere, and I think the code will warn you if you try it without. This step is suitable for linear accelerators where a periodical structure is clearly defined. It makes no sense for transfer lines or other types of structure.

Step (2) & step (3) are two different maching steps with some nuances. I suggest you look at the two examples, "achromat_1.ini" & "achromat_3.ini" setting the achromatisity of a line with either based on option (2) or option (3). In general, I suggest you use step(3) only, as this matching option based on elements to be adjusted according to the diagnostics present in the line is much easier to understand and much more powerful than using step(2) procedures.

Regards,

Didier
ChinaZY Song
Novice
Novice
Posts: 2
Joined: Mon 27 Oct 2025 15:53
Country:
China (cn)
China

Re: Confusion about the “2 steps matching optimization” in the MATCH command

Post by ChinaZY Song »

I’m trying to understand how the “Match with Family & Twiss commands” option works in relation to the “2 steps matching optimization for (1) and (2)” section.
That section includes two stages:
First step: Set Twiss parameters at first period input and output equal
Second step: Phase advance smoothing for periodic structure. And for each step there are separate fields for the maximum number of iterations.

My question is specifically about how these two steps are used when I select “Match with Family & Twiss commands” (option 2):
(1)Are both steps actually used in this mode, or is only the first step relevant for the Family & Twiss matching?
(2)If my beamline is not periodic, should I set one of the steps (for example, the “phase advance smoothing” part) to zero?
In other words — for a single-pass, non-periodic transport line, which of these two steps are meaningful for “Match with Family & Twiss commands”?

I have already understood how the Diagnostics-based matching (option 3) works from the example files, but this part about (2) is still unclear to me.
I’d like to confirm which of these two steps I should actually configure, and whether one of them can safely be disabled (set to 0) when using Family & Twiss matching in a non-periodic case.

Thanks in advance for any clarification!
User avatar
FranceDidier
Administrator
Administrator
Posts: 1154
Joined: Wed 26 Aug 2020 14:40
Country:
France (fr)
France

Re: Confusion about the “2 steps matching optimization” in the MATCH command  [SOLVED]

Post by FranceDidier »

Dear ZY Song,

(1) Yes the two steps are done, but the second is only done, if the number of periods is sufficient and you have specified a sufficient number (>6) in the parameter (Nbr of phase advance period to smooth).

(2) None, as the parameters you enter will not be taken into account in any case.
But beware: Match using Family commands do more than just smooth out the phase advances of periodical structures; they also make more classic adaptations or ajustements, such as the example I have prposed to you.

But in a simpler way, if your structure is not periodic, use only method (3), which is simpler, more powerful and easier to understand.

Regards,

Didier
Post Reply