Page 1 of 2

Multiple error of dipole, Quadrupole, and sextupole in ELEGANT

Posted: 14 Sep 2015, 09:01
by gwei
According to multiple error of PEP II,
Multipole error of PEP II magnets.jpg
Multipole error of PEP II magnets
and definition in ELEGANT, I made ELEGANT input as follow for Quadrupole and Sextupole
QSPDS02: KQUAD, L=0.8, K1=-0.0696970675375, TILT=0, N_KICKS=20,&
systematic_multipoles="quadSysMult.sdds",&
random_multipoles="quadRanMult.sdds"
SXT02: KSEXT, L=0.5, K2=-1.1938196234, TILT=0, N_KICKS=10,&
systematic_multipoles="sextSysMult.sdds",&
random_multipoles="sextRanMult.sdds"

quadSysMult.sdds:
SDDS1
&parameter name=referenceRadius, units=m, type=double, &end
&column name=LEGOorder, type=long, &end
&column name=an, type=double, &end
&column name=bn, type=double, &end
&column name=order, type=long, &end
&data mode=ascii, &end
! page number 1
4.490000000000000e-02
12
3 1.030000000000000e-03 0.000000000000000e+00 2
4 5.600000000000000e-04 0.000000000000000e+00 3
5 4.800000000000000e-04 0.000000000000000e+00 4
6 2.370000000000000e-03 0.000000000000000e+00 5
7 0.000000000000000e-06 0.000000000000000e+00 6
8 0.000000000000000e-06 0.000000000000000e+00 7
9 0.000000000000000e+00 0.000000000000000e+00 8
10 -3.10000000000000e-03 0.000000000000000e+00 9
11 0.000000000000000e+00 0.000000000000000e+00 10
12 0.000000000000000e+00 0.000000000000000e+00 11
13 0.000000000000000e+00 0.000000000000000e+00 12
14 -2.63000000000000e-03 0.000000000000000e+00 13

Here I list only systematic error for Quadrupole, it may be the similar case for others
Question 1: Am I right in this sdds file? it has two columns for order, and two columns for data
I am worry about the order may be wrong. And are the last two column for skew error?

For Dipole, it seems a little complicated, I calculated bn in ELEGANT
bn=n!*X^(-n)*(∆B)/B
Multipole error of PEP II dipole to ELEGANT.jpg
Multipole error of PEP II dipole to ELEGANT
Then for dipole of CSBEND
BXAF: CSBEND, L=8, ANGLE=0.07333499518, TILT=0, &
E1=0.0, E2=0.0, K1=0.0, B2=0.000667, N_KICKS=20
&error_element name=B*, element_type=*BEN*, item=B2, amplitude=2.13e-3, type="gaussian", cutoff=3.0, after=MERRORSTART, before=MERRORSTOP,
bind=0, fractional=0, additive=1 &end
&error_element name=B*, element_type=*BEN*, item=B3, amplitude=2.13e-1, type="gaussian", cutoff=3.0, after=MERRORSTART, before=MERRORSTOP,
bind=0, fractional=0, additive=1 &end
&error_element name=B*, element_type=*BEN*, item=B4, amplitude=5.69e+1, type="gaussian", cutoff=3.0, after=MERRORSTART, before=MERRORSTOP,
bind=0, fractional=0, additive=1 &end
&error_element name=B*, element_type=*BEN*, item=B5, amplitude=1.21e+4, type="gaussian", cutoff=3.0, after=MERRORSTART, before=MERRORSTOP,
bind=0, fractional=0, additive=1 &end
Question 2: Am I right for those systematic and random error for CSBEND?

Question 3: When we do tracking for 1000 turns, are those random errors changed in different turns or not?

Re: Multiple error of dipole, Quadrupole, and sextupole in ELEGANT

Posted: 14 Sep 2015, 09:37
by michael_borland
Not sure what the question is here...

--Michael

Re: Multiple error of dipole, Quadrupole, and sextupole in ELEGANT

Posted: 14 Sep 2015, 10:29
by gwei
michael_borland wrote:Not sure what the question is here...

--Michael
I finished the questions. I met some problem of upload pictures that moment

Re: Multiple error of dipole, Quadrupole, and sextupole in ELEGANT

Posted: 14 Sep 2015, 11:18
by michael_borland
The SDDS file for the quadrupole multipoles looks fine, except the entry for LEGOOrder=4 is incorrect (seems you copied the random rather than the systematic value). If is not a problem to have the extra order column (LEGOOrder); elegant will only look at the order, an (upright multiple), and bn (skew multipole) columns. To see better what is what, try sddsprintout

Code: Select all

% sddsprintout quadSysMult.sdds -column=*
Also, since conventions for "an" and "bn" differ, I recommend using the column names "normal" and "skew" instead of "an" and "bn", in order to avoid confusion. (This is available in elegant 27 and later.)

The dipole setup looks correct. At least the equation is correct. I didn't check the actual values. You may also use "f2", "f3", "f4", ... instead of "b2", "b3", ..., provided you give a value for the XREFERENCE parameter. This avoids the need to translate the values.

--Michael

Re: Multiple error of dipole, Quadrupole, and sextupole in ELEGANT

Posted: 14 Sep 2015, 11:20
by michael_borland
In answer to your question, the random multipole values vary from step to step, but are fixed from turn to turn. If you run several error seeds (&run_setup n_steps parameter), you'll get different values for the random multipole contributions.

If you do only a single run, then you can change the random_number_seed in &run_setup to get different random values. By default, the seed is fixed for all runs (so things reproduce).

--Michael

Re: Multiple error of dipole, Quadrupole, and sextupole in ELEGANT

Posted: 14 Sep 2015, 11:37
by gwei
michael_borland wrote:The SDDS file for the quadrupole multipoles looks fine, except the entry for LEGOOrder=4 is incorrect (seems you copied the random rather than the systematic value). If is not a problem to have the extra order column (LEGOOrder); elegant will only look at the order, an (upright multiple), and bn (skew multipole) columns. To see better what is what, try sddsprintout

Code: Select all

% sddsprintout quadSysMult.sdds -column=*
Also, since conventions for "an" and "bn" differ, I recommend using the column names "normal" and "skew" instead of "an" and "bn", in order to avoid confusion. (This is available in elegant 27 and later.)

The dipole setup looks correct. At least the equation is correct. I didn't check the actual values. You may also use "f2", "f3", "f4", ... instead of "b2", "b3", ..., provided you give a value for the XREFERENCE parameter. This avoids the need to translate the values.

--Michael
Thank you very much for your kindly quick answer.
And by the way, what are meanings of LEGOorder and order?
It seems for a sextupole field, LEGOorder is 3, but order is 2.
Is it right?

Re: Multiple error of dipole, Quadrupole, and sextupole in ELEGANT

Posted: 14 Sep 2015, 11:40
by michael_borland
LEGO and elegant use different conventions for the order of multipoles. E.g., LEGO uses order=1 for dipoles, while elegant uses order=0, etc. The SDDS file has a column for each convention.

You can learn more about the convention in elegant from the manual, particularly section 9.1 and the manual entry for KQUAD.

--Michael

Re: Multiple error of dipole, Quadrupole, and sextupole in ELEGANT

Posted: 14 Sep 2015, 11:45
by gwei
michael_borland wrote:LEGO and elegant use different conventions for the order of multipoles. E.g., LEGO uses order=1 for dipoles, while elegant uses order=0, etc. The SDDS file has a column for each convention.

You can learn more about the convention in elegant from the manual, particularly section 9.1 and the manual entry for KQUAD.

--Michael
Thank you very much!

Re: Multiple error of dipole, Quadrupole, and sextupole in ELEGANT

Posted: 21 Mar 2018, 04:41
by Cai_Meng
Dear Michael,

To understand the random mulitploe and systematic mulipole, for one step, the systematic mulipole value is same for one type magnet and the random multipole value is different for each magnet even same type; for different step, the systematic multipole value is different for one type magnet. Is the understanding right or not?
Another question, in the manual the random multipole value is rms, how about the distribution and the cutoff?

Thank you very much!
Best regards,
Cai

Re: Multiple error of dipole, Quadrupole, and sextupole in ELEGANT

Posted: 21 Mar 2018, 08:08
by michael_borland
Cai,

The systematic multipoles are fixed values. They represent the multipole errors that are part of the magnet design and will be present even if the magnet is built exactly as designed. So, for example, in a quadrupole we'll have 12-pole, 20-pole, 28-pole, etc., which is unavoidable because the hyperbolic pole profile must be truncated to build a physical magnet. As you stated, these should be the same for magnets of the same family, though elegant gives you the freedom to define these however you like.

The random multipoles represent the effects of construction errors: inaccurate machining, variations in magnetic material, inaccurate assembly, etc. These are generated with a gaussian distribution and a 2-sigma cutoff. The rms levels can be obtained from measurements on a large set of magnets, or using the program sddsrandmult to estimate the effect of anticipated construction errors.

--Michael