link_elements

Moderators: cyao, michael_borland

Post Reply
MDP
Posts: 25
Joined: 02 Jul 2010, 07:33
Location: DESY Hamburg/Germany

link_elements

Post by MDP » 23 Mar 2015, 08:44

Dear Elegant users and experts,

we had some problems using link_elements and I hope to find some help here in the forum.

Many of the quads in our beamline are split in two halfs in order to be able to position a marker in the center (the markers represent strip line BPMs). The two halfs are indicated with the suffixes .U (upstream) and .D (downstream). The plan was to link the strength of the second half of the quad to the strength of its first half.

It turned out that the quadrupole strength is correctly listed in the parameter file (which I get from run_setup) after the elegant run. However, when I plot the twiss functions using sddsplot, it is clearly visible that the second half of the quads is still set to K1 = 0 (as it is by default).

Did I do something wrong in my files?
I would appreciate if you could help me to solve this problem.


Best, Matthias
Attachments
FLASH1.sdds
(5.38 KiB) Downloaded 211 times
FLASH1.lte
(55.95 KiB) Downloaded 222 times
FLASH1.ele
(3.29 KiB) Downloaded 219 times

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

Re: link_elements

Post by michael_borland » 23 Mar 2015, 09:08

Matthias,

The problem is that your &twiss_output command is in immediate mode, while &link_elements always has a deferred action. There are three solutions:
* Set output_at_each_step=1 in the &twiss_output and &matrix_output commands.
* Remove the &link_elements command and use features of &load_parameters to do the job

Code: Select all

&load_parameters
        filename = FLASH1.sdds
        change_defined_values = 1
        allow_missing_elements = 1
&end
&load_parameters
        filename = FLASH1.sdds
        change_defined_values = 1
        allow_missing_elements = 1
        include_item_pattern = K1,
        include_name_pattern = Q*.U,
        edit_name_command = %/.U/.D/
&end
* Modify your lattice file to use the name name of the upstream and downstream parts of each magnet.

--Michael

MDP
Posts: 25
Joined: 02 Jul 2010, 07:33
Location: DESY Hamburg/Germany

Re: link_elements

Post by MDP » 23 Mar 2015, 09:15

Hi Michael,

thank you for the fast response and for your help!
I will see which one of the three solutions is the best. We will have to use these quads also for matching in the future.

Best, Matthias

Post Reply