Optimization appears to ignore some linked terms and miscalculate the beam size
Posted: Thu 14 Jan 2021 16:54
Hi Everybody!
I'm trying to optimize a system of bends and quadrupoles. I want to use symmetry to optimize the lattice. An example is attached in zipped format, which contains an ini file, a dat file, and a cal file.
To enforce the symmetry, I have linked the elements in the way described by the manual, by giving them "the same matching element number n." This works for every element in the lattice but drift D4, which appears to be ignored. Since the cal file doesn't contain the optimized length for D4, I assume it is totally ignored by the optimizer. If I change the preceding MATCH_FAM_LENGTH command to "MATCH_FAM_LENGTH 4 7", i.e. I give it a separate element number, D4 appears in the optimizer. In the below image, element[10], which is D4, does not appear.
A different problem I am having with optimization is enforcing the SET_SIZE_MAX optimization constraint. The manual says that "[t]he sizes are the effective beam sizes (rms*sqrt(5) for bunched beam or rms*sqrt(4) for CW beam)". I want to limit the 5*rms beam size to 20 mm, so I calculate the size I should enter here is 9 mm. However, the optimizer shows that values smaller than 9 mm are violating the optimization term. In the above image, all of the beam sizes are smaller than the constraint, yet the beam size max criterion is in the 1e-2 range. If I use 20 mm in the SET_SIZE_MAX command, the optimizer happily lets the beam be 8.94 mm. I'd guess that criterion is being computed with 5*rms, instead of sqrt(5)*rms, but I'm not sure.
Thanks in advance for any help,
Finn
I'm trying to optimize a system of bends and quadrupoles. I want to use symmetry to optimize the lattice. An example is attached in zipped format, which contains an ini file, a dat file, and a cal file.
To enforce the symmetry, I have linked the elements in the way described by the manual, by giving them "the same matching element number n." This works for every element in the lattice but drift D4, which appears to be ignored. Since the cal file doesn't contain the optimized length for D4, I assume it is totally ignored by the optimizer. If I change the preceding MATCH_FAM_LENGTH command to "MATCH_FAM_LENGTH 4 7", i.e. I give it a separate element number, D4 appears in the optimizer. In the below image, element[10], which is D4, does not appear.
A different problem I am having with optimization is enforcing the SET_SIZE_MAX optimization constraint. The manual says that "[t]he sizes are the effective beam sizes (rms*sqrt(5) for bunched beam or rms*sqrt(4) for CW beam)". I want to limit the 5*rms beam size to 20 mm, so I calculate the size I should enter here is 9 mm. However, the optimizer shows that values smaller than 9 mm are violating the optimization term. In the above image, all of the beam sizes are smaller than the constraint, yet the beam size max criterion is in the 1e-2 range. If I use 20 mm in the SET_SIZE_MAX command, the optimizer happily lets the beam be 8.94 mm. I'd guess that criterion is being computed with 5*rms, instead of sqrt(5)*rms, but I'm not sure.
Thanks in advance for any help,
Finn