Optimizer Error Using Input Matrix Files

Moderators: cyao, michael_borland

Post Reply
Zamank
Posts: 58
Joined: 03 Dec 2013, 10:57

Optimizer Error Using Input Matrix Files

Post by Zamank » 21 May 2018, 03:50

Hi Michael,

I am revisting this topic because I wanted to vary the phase advance for a section of beamline but I am having issues doing so. I created a beamline using oscillation orbit data from BPMs and quads. The sections between quds are defined by a matrix txt file and the quad strengths are only to be varied.

I tried using the optimizer (simplex) to find the K1 values for the quads to satisfy the phase advance I wanted in the section, but even for the smallest phase advance, the optimizer is not finding solutions.

I think it may be the matrix txt files that is giving the optimizer problems but it may also be that I've been looking at this code for too long and can't see the mistake I have possibly made.

I attached a zip file of the *ele, *lte and *matrix.txt files. Any advice/help would be greatly appreciated!

help_optimizer.zip
(27.38 KiB) Downloaded 183 times

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

Re: Optimizer Error Using Input Matrix Files

Post by michael_borland » 22 May 2018, 16:46

I see two problems with this run:
1. The optimization_covariable commands result in inverting the sign of at least one quadrupole: Q25701_776. This (and possibly others like it) makes the matrix elements grow very large.
2. The lattice has strong x-y coupling, so the computations of phase advance, beta functions, etc, are not correct. The twiss_output command assumes that the beamline is uncoupled.

After fixing 1, you might try matrix-element-based fitting instead.

--Michael

Zamank
Posts: 58
Joined: 03 Dec 2013, 10:57

Re: Optimizer Error Using Input Matrix Files

Post by Zamank » 23 May 2018, 10:55

Awesome, thanks for the help Michael. I fixed 1 as you mentioned and I am testing around matching the matrix elements. I've been looking at the matrices and I think the coupling is weak enough in the (z, deltaP) coordinates that they can be ignored and just fit 4x4 Rxy matrix.

Zamank
Posts: 58
Joined: 03 Dec 2013, 10:57

Re: Optimizer Error Using Input Matrix Files

Post by Zamank » 13 Jun 2018, 12:18

Michael,

Just curious: How are the twiss function at the end computed? I tried using the "uncoupled" equations:

betax = R11^2*betax0 - 2*R11*R12*alphax0 + R12^2 gammax0

And do not get the same values calculated by Elegant.

Thanks in advance.

Post Reply