- type: setup command.
- function: set up for chromaticity correction.
- sequence: should follow twiss_output.
- Command syntax, including use of equations and subcommands, is discussed in 7.2.

&chromaticity

STRING sextupoles = NULL;

STRING lower_limits = NULL;

STRING upper_limits = NULL;

STRING exclude = NULL;

double dnux_dp = 0;

double dnuy_dp = 0;

double sextupole_tweek = 1e-3;

double correction_fraction = 0.9;

long n_iterations = 5;

double tolerance = 0;

STRING strength_log = NULL;

long change_defined_values = 0;

double strength_limit = 0;

long use_perturbed_matrix = 0;

long exit_on_failure = 0;

long update_orbit = 0;

long verbosity = 1;

double dK2_weight = 1;

STRING response_matrix_output = NULL;

STRING correction_matrix_output = NULL;

&end

STRING sextupoles = NULL;

STRING lower_limits = NULL;

STRING upper_limits = NULL;

STRING exclude = NULL;

double dnux_dp = 0;

double dnuy_dp = 0;

double sextupole_tweek = 1e-3;

double correction_fraction = 0.9;

long n_iterations = 5;

double tolerance = 0;

STRING strength_log = NULL;

long change_defined_values = 0;

double strength_limit = 0;

long use_perturbed_matrix = 0;

long exit_on_failure = 0;

long update_orbit = 0;

long verbosity = 1;

double dK2_weight = 1;

STRING response_matrix_output = NULL;

STRING correction_matrix_output = NULL;

&end

- sextupoles — List of names of elements to use to correct the chromaticities. Several names may be given and names may include wildcards. If so, then sextupoles in each group are changed by the same amount for each iteration. This would typically be used when the sextupoles are nominally identical (though perhaps differing in strength because of introduced errors). If that’s not the case, the iteration may fail to converge.
- lower_limits, upper_limits — Lists of lower and upper limits for each family. The input style is
unusual for elegant, given that lists of numbers are to be provided in a string. For
example
&chromaticity

sextupoles = "S1 S2 S3",

lower_limits = "0 -1.5 0",

upper_limits = "1.75 0 1.25"

...

&end - strength_limit — Deprecated. Limit on the absolute value of sextupole strength (K
_{2}). - exclude — List of names of elements to exclude. This may be used to exclude some sextupoles that are matched by wildcards in the sextupole list.
- dK2_weight — Weighting factor that is used to minimize the mean-square changes in K
_{2}values in the event that there are more than two families. - dnux_dp, dnuy_dp — Desired chromaticity values.
- sextupole_tweek — Amount by which to tweak the sextupoles to compute derivatives of chromaticities with respect to sextupole strength. [The word “tweak” is misspelled “tweek” in the code.]
- correction_fraction — Fraction of the correction to apply at each iteration. In some cases, correction is unstable at this number should be reduced.
- n_iterations — Number of iterations of the correction to perform.
- tolerance — Stop iterating when chromaticities are within this value of the desired values.
- strength_log — The (incomplete) name of an SDDS file to which the sextupole strengths will be written. Recommended value: “%s.ssl”. May be used with load_parameters.
- change_defined_values — Changes the defined values of the sextupole strengths. This means that when the lattice is saved (using save_lattice), the sextupoles will have the corrected values. This would be used for correcting the chromaticity of a design lattice, for example, but not for correcting chromaticity of a perturbed lattice.
- use_perturbed_matrix — If nonzero, requests use of the perturbed correction matrix in performing correction. For difficult lattices with large errors, this may be necessary to obtain correction. In general, it is not necessary and only slows the simulation.
- exit_on_failure — If nonzero, then failure to reach the desired chromaticities within the tolerance results in the program exiting.
- update_orbit — If non-zero, the orbit calculation is updated after each n
^{th}adjustment of the sextupoles. If this is needed, it may also help to use reduce the n_iterations parameter and set the correction_iterations parameter of run_setup to a larger value; this will cause elegant to cycle through orbit, tune, and chromaticity correction multiple times, which will help converge to a fully-corrected result. - verbosity — Increasing positive values result in increasing amounts of information printed during execution.
- response_matrix_output, correction_matrix_output — The (incomplete) names of SDDS files to which the response and correction matrices will be written.

closed_orbit