## Scan quads to match phase advance?

Moderators: cyao, michael_borland

Zamank
Posts: 55
Joined: 03 Dec 2013, 10:57

### Scan quads to match phase advance?

Hi All,

Sorry I didn't know which forum to put this in because it seems like a scanning/matching/optimization question. Anyways, I was wondering if there was an example or if one can direct me to how I would go about:

-Having Elegant scan a specified number of quads (and their strengths, "K") to achieve a specified phase advance, as well as twiss parameters (mainly betax,y and alphax,y), at some location (marker).

I was doing this type of work with MAD, but my Elegant file has been so heavily modified and edited that it would be a pain to apply the changes to MAD.

Thank you in advance!

PS. Please let me know if any of this doesn't make sense!

michael_borland
Posts: 1796
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

### Re: Scan quads to match phase advance?

Zamank,

This is possible. You can use MARK elements in the the beamline and get information for the optimizer. For example

Code: Select all

``````M1: mark,fitpoint=1
M2: mark,fitpoint=1
bl: line=(...,M1,...,M2,...)
``````
Then, in the .ele file, you can use commands like

Code: Select all

``````&optimization_term term = "M1#1.betax 2 0.01 sene" &end
``````
which constrains betax at occurrence #1 of M1 to be 2m to within 0.01 m, or

Code: Select all

``````&optimization_term term = "M1#2.nux M1#1.nux - 0.5 0.01 sene" &end
``````
which constrains the phase advance between the first and second instances of M1 to be 0.5 (in units of 2Pi) to within 0.01.

There are several examples of using the optimizer in the elegant examples file. See multiPartMatching1 for a complex example.

--Michael

Zamank
Posts: 55
Joined: 03 Dec 2013, 10:57

### Re: Scan quads to match phase advance?

Great thanks Michael!