## Random alignement errors for repeated lattice

Moderators: cyao, michael_borland

twatanabe
Posts: 22
Joined: 15 Jan 2009, 20:30

### Random alignement errors for repeated lattice

Hi Michael,

Suppose the ring consists of 40 cells like,
CELL_A: LINE=(L0, SX0, L1, Q1, L2, SX1, L2, SX3,,,,)
RING: LINE=(40*CELL_A)
where SX0, SX1, SX3, ,,,, are sextupoles, then one wants to apply random alignment errors as,
&error_element name="SX1", item="dx", amplitude=30.e-6, type="gaussian", cutoff=3.0, bind=0, fractional=0 &end
in order to obtain dynamic aperture with alignment errors with SX1. In the case, does all the fourty sextupoles have same error for each cell?
If so, what is the easiest way to differently apply random error to each SX1, such that the SX1 in the first cell has 12e-6 dx error, while that in the second cell has -35e-6 dx error,,,,.
I know it is straightforward to give different names to each SX1, like SX1_cell1, SX1_cell2, and repeat it 40 times, but I am wondering if there is easier way to do the same thing, because I would like to apply alignment errors to hundreds of magnets...

Thank you,
Takahiro

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

### Re: Random alignement errors for repeated lattice

Takahiro,

By default, the same error is given to all elements with the same name. This is controlled by the "bind" parameter in &error_element. If you set this to 0, then even elements with the same name will get different values for the error.

This feature can be useful if you have split elements. E.g.,
sx: sext,...
d1: drift,...
cell: line=(2*q1,d1,2*sx,d1,2*q2,d1)

In this case, you'd use bind=1 and bind_number=2, so that successive pairs of Q1, SX, or Q2 elements would get the same error.

--Michael

twatanabe
Posts: 22
Joined: 15 Jan 2009, 20:30

### Re: Random alignement errors for repeated lattice

Michael,

Thank you for the reply. It would be helpful if I could continue the question a bit more.
Like I wrote in the first post, "bind=0" is called in &error_element. Then if I see .fin file as,
sdds2stream parTrack.fin -param=dSX1.DX
then I only find a single error for SX1. (More precisely, I only find a single value for each element name, such as SX0, SX1,,,, in .fin file. I do not find different values for the same element name but in different cell.)

So it seemed to me all the SX's in each cell has the same error shown in "dSX1.DX" in .fin file. Did you mean that since I use "bind=0", each SX1
should have different values for the error cell by cell? If so, where could I find all the error settings elegant applied?
Thank you,

Takahiro

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

### Re: Random alignement errors for repeated lattice

Takahiro,

You can get information on all the errors from the error log file. To get this, add a command like the following before your first error_elements command:
&error_control
error_log = %s.erl
&end

--Michael

twatanabe
Posts: 22
Joined: 15 Jan 2009, 20:30

### Re: Random alignement errors for repeated lattice

Michael,

Thank you. Now I am able to see all the errors that are different with each other for every single magnet.

Best Regards,
Takahiro

Posts: 4
Joined: 29 Nov 2011, 08:58

### Re: Random alignement errors for repeated lattice

Hello,

I have a following problem. I have a lattice with magnets which are sliced. Each slice have different name, because of different gradient value, e.g. quad is combined from 3 slices SQFO=(SQFo_1, SQFo_2, SQFo_3) and I have 24 such a quads in the lattice. I would like to assign errors in such a way that consecutive elements (slices) for one SQFO : SQFo_1..SQFo_3 got the same error value, but different from next SQFO. For the error_element command I used name=SQFo_* and bind=1, and now the problem begins if I use bind_number=3, it will assign the same error for first 3 SQFo_1 elements, and different value for next 3.. etc and this I understand, but in the manuals is written that if one wants to assign error to elements with different names (what is in this case) should use the bind_across_name. But it isn't mentioned if this must be used instead of bind_number. Anyway I tried first to use bind_number=0, bind_across_names=3, but this results in having the same error for all components (24 SQFO), then I set bind_number=3, bind_across_names=1, but in this case it returned me following values: 3 successive SQFo_1 have the same error, whereas all (24) successive SQFo_2 and SQFo_3 had the same error as first SQFo_1. Then I set also bind_number=3, bind_across_names=3,but in this case I got the same result as for bind_number=3, bind_across_names=1. Is this some kind of bug or I misunderstand the commands. Is there any possibility to assign the same error for magnet which is define by slices with different names?

Best regards,

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

### Re: Random alignement errors for repeated lattice

Unfortunately, this is a combination that &error_elements was never designed to handle. It was always assumed that if you are binding across names, then bind_number=0.

There are two ways to accomplish what you want:
* Generate the errors externally to elegant and use the &load_parameters command to load them. You can pattern the error file after the error log that is produced by elegant (&error_control command). This is by far the most flexible approach.
* Use &error_elements together with &link_elements as in the attached example. This is quite easy and will handle the case you are interested in.

--Michael
Attachments
errorBinding.tar.gz