Optimizer gets lengths wrong by a factor of 10
Posted: 14 Feb 2020, 16:52
I'm trying to optimize a beam that allows some of the quadrupoles to "float" as I don't really care where they go as long as the total drift is fixed.
I constrain the total drift using the following command:
When the optimization is done, it thinks it has done a great job:
Terms of equation:
And the values output by the optimizer look good:
However, when I look at the new lattice file, the values for the lengths are off by exactly a factor of 10:
It seems like this is either an obvious bug or I don't understand something that goes in to optimization. I don't have this problem with quad strengths. Note that these lengths aren't the only terms being optimized.
I constrain the total drift using the following command:
Code: Select all
&optimization_term
term = "MDL-D.02.L MDL-D.03.L + 0.296 0.01 sene",
weight = 1
&end
Terms of equation:
Code: Select all
1*(MDL-D.02.L MDL-D.03.L + 0.296 0.01 sene): 0.000000000000000e+00
Code: Select all
Optimum values of variables and changes from initial values:
MDL-D.02.L: 2.999999999977450e-01 2.751999999977450e-01 (was 2.480000000000000e-02) (near limit)
MDL-D.03.L: 4.776695252676775e-03 -2.330474732322504e-05 (was 4.800000000000000e-03)
Code: Select all
"MDL-D.02": EDRIFT,L=2.99999999997745
"MDL-D.03": EDRIFT,L=0.04776695252676776