Page 1 of 1

Beamline is unstable when matched=1 is set in twiss_output

Posted: 25 Jan 2024, 13:27
by WEI-HOU
Hello,

I am using Elegant to optimize FODO lattice parameters for given drift, quad's lengths and phase advance.
However, I run into some problems where Elegant cannot find the periodic solution of my FODO lattice.

For example, this set of parameter works fine.

Code: Select all

elegant elegant.ele -macro=driftlength=4.24,quadlength=0.2,phaseadv=0.4
However, this set of parameters does not work, even though there's only 1-mm increases in drift spaces.

Code: Select all

elegant elegant.ele -macro=driftlength=4.241,quadlength=0.2,phaseadv=0.4

Code: Select all

************************** Summary of warnings ****************************
3 types of warnings were recorded:
5* twiss_output: beamline unstable for y plane.
4* twiss_output: beamline unstable for x plane.
1* optimize: Maximum number of passes reached in simplex optimization
*****************************************************************************
How can I solve this problem?
Thanks.

Re: Beamline is unstable when matched=1 is set in twiss_output

Posted: 25 Jan 2024, 15:30
by michael_borland
You can include the drift length as a variable in the optimization and then add an optimization term to make it equal the desired value.

See attached file.

--Michael

Re: Beamline is unstable when matched=1 is set in twiss_output

Posted: 25 Jan 2024, 17:13
by WEI-HOU
Hello Michael,

Unfortunately, it does not work when I am trying other parameters.
Is there an alternative to calculate the periodic solution?
Thanks.

Regards
Wei Hou

Re: Beamline is unstable when matched=1 is set in twiss_output

Posted: 25 Jan 2024, 17:17
by michael_borland
Wei Hou,

The basic problem is that a stable periodic solution will not always exist for arbitrary values of the cell parameters. You can set the quadrupole K1 values to something quite small (e.g., |K1|=0.001) to make it less likely that the initial conditions are unstable.

--Michael