Page 1 of 1

Using linked elements when matching

Posted: 18 Dec 2008, 09:47
by astecpete
Hi Michael,

I'd like to link up some quadrupole k-values and have them vary simultaneously as i do some twiss optimisation.
I have two "master" quads, LIN-S1-MAG-QUAD-01 and LIN-S1-MAG-QUAD-02. Then i have two sets of "slave" quads, LIN-S*-MAG-QUAD-01 (and -02), where * = 2 ... 16. i have inserted the following:

&link_elements
target = LIN-S*-MAG-QUAD-01
exclude = LIN-S1-MAG-QUAD-01
item = K1
source = LIN-S1-MAG-QUAD-01
source_position = "before"
mode = "dynamic"
equation = K1 sto
&end

&link_elements
target = LIN-S*-MAG-QUAD-02
exclude = LIN-S1-MAG-QUAD-02
item = K1
source = LIN-S1-MAG-QUAD-02
source_position = "before"
mode = "dynamic"
equation = K1 sto
&end

&link_control
summarize_links = 1
verbosity = 0
&end

The link_control output says i have done the right thing. But when i set up my twiss optimisation with LIN-S1-MAG-QUAD-01.K1 etc. as the optimisation variables it alters the K1 of this magnet only and leaves all the others unchanged :?:

Where am i going wrong?

Pete

Re: Using linked elements when matching

Posted: 18 Dec 2008, 09:58
by michael_borland
Pete,

The only thing I see wrong is that your equation is "K1 sto". You only need "K1". However, I'm not convinced that this should cause it not to work.

If fixing this doesn't resolve the problem, please send me the input files and I'll have a closer look.

Also, you can try setting summarize_links=1 and verbosity=1 in the link_control command to get more information.

--Michael

Re: Using linked elements when matching

Posted: 18 Dec 2008, 10:56
by astecpete
Just sent you the files - thanks for looking at this Michael