Hello Michael and All the Good People,
Recently I have been evaluating elegant for use at the Canadian Light Source. Until now we have primarily used the DIMAD code with some limited use of AT. One major drive for evaluating elegant is the ability to import RADIA generated kickmaps into the lattice. I like what I see so far with elegant but seem to have hit a snag. My snag concerns the optimization function of elegant. I'll try to detail my problem here and I have attached my elegant lattice and command files. As always, I am open to any constructive criticisms that may help me get more out of elegant (even if it doesn't directly relate to this issue!).
I am trying to learn elegant's optimization abilities by performing a task that I had previously done with DIMAD. I start with two cells of our lattice and put a very simple model of a 4.2T superconducting wiggler into the straight section which takes into account only the vertical focusing of the device:
DBF1:DRIFT, L=0.624
BMITMAT:EMATRIX, r11=1, r22=1, r33=1, r44=1, r55=1, r66=1, &
r43=-0.028
BMITFOCUS:LINE=(DB2, BMITMAT, DBF1, BMITMAT, DB2)
The parameter r43 was chosen to reproduce the same vertical tune shift that I measured from the real device. I then used DIMAD to compute values for the quadrupole strengths in the two cells surrounding the wiggler to match the beta functions, dispersion and their derivatives as well as to get the desired tune advance. It converged with this solution
QA41: KQUAD,L=0.18,K1=0.20335562554245E+01
QB41: KQUAD,L=0.18,K1=0.13001734942086E+01
QC42: KQUAD,L=0.26,K1=0.20459314819491E+01
QB42: KQUAD,L=0.18,K1=0.15712472303806E+01
QA42: KQUAD,L=0.18,K1=0.18839122868023E+01
QA51: KQUAD,L=0.18,K1=0.18168283397009E+01
QB51: KQUAD,L=0.18,K1=0.16562848609754E+01
QC51: KQUAD,L=0.26,K1=0.20459314819491E+01
QB52: KQUAD,L=0.18,K1=0.13001734942086E+01
QA52: KQUAD,L=0.18,K1=0.20335562554245E+01
meaning that a solution does exist.
I have tried to implement the same procedure in elegant. If I put the DIMAD solution into the elegant lattice file, I get the correct answer. However, if I try to find a solution in elegant using the same initial conditions as I did with DIMAD, elegant does not converge. I have tried with different initial conditions. At this point I'm stumped. Is elegant getting trapped in a local minimum of the optimization function? Am I doing something silly?
Thanks in advance,
Ward
Ward A. Wurtz
Accelerator Physicist
Accelerator Operations and Development
Canadian Light Source
University of Saskatchewan
101 Perimeter Road
Saskatoon, SK S7N 0X4
Canada
Phone: (306) 657-3810
Fax: (306) 657-3535
Email: ward.wurtz@lightsource.ca
Elegant Optimization Convergence Problems
Moderators: cyao, michael_borland
Elegant Optimization Convergence Problems
- Attachments
-
- bmit_quads.ele
- elegant command file used to match twiss parameters
- (3.28 KiB) Downloaded 803 times
-
- cls.lte
- elegant lattice file for cells 4 and 5 of the Canadian Light Source
- (3.32 KiB) Downloaded 810 times
Re: Elegant Optimization Convergence Problems
Hello All,
So, I seem to have solved this particular convergence issue by changing the lines
tolerance = 1e-12,
n_evaluations = 500,
to
tolerance = 1e-26,
n_evaluations = 5000,
in the optimization_setup command. It seems that I am allowing more evaluations before forcing the next pass by changing n_evaluations. I don't understand how changing the tolerance has any effect.
Cheers,
Ward
So, I seem to have solved this particular convergence issue by changing the lines
tolerance = 1e-12,
n_evaluations = 500,
to
tolerance = 1e-26,
n_evaluations = 5000,
in the optimization_setup command. It seems that I am allowing more evaluations before forcing the next pass by changing n_evaluations. I don't understand how changing the tolerance has any effect.
Cheers,
Ward
-
- Posts: 1951
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Elegant Optimization Convergence Problems
Ward,
Glad that you were able to solve the problem.
I've attached two alternatives methods of getting convergence:
1. bmit_quads1.ele --- Here I use the same penalty function, but adjust the optimization algorithm parameters. In particular, it is recommended to not have a large number passes. Instead, something like n_evaluations=1500, n_passes=3, n_restarts=5 is good. The meaning of these parameters is discussed in the manual page for optimization_setup.
2. bmit_quads2.ele --- Here I also change the penalty function. More specifically, I change the optimization_terms to use the "sene" (soft-edge not-equal) function. This allows me to state precisely what degree of convergence I want on each term. E.g., I've gone for 0.1% on the beta functions and 1e-4 on the tunes.
--Michael
Glad that you were able to solve the problem.
I've attached two alternatives methods of getting convergence:
1. bmit_quads1.ele --- Here I use the same penalty function, but adjust the optimization algorithm parameters. In particular, it is recommended to not have a large number passes. Instead, something like n_evaluations=1500, n_passes=3, n_restarts=5 is good. The meaning of these parameters is discussed in the manual page for optimization_setup.
2. bmit_quads2.ele --- Here I also change the penalty function. More specifically, I change the optimization_terms to use the "sene" (soft-edge not-equal) function. This allows me to state precisely what degree of convergence I want on each term. E.g., I've gone for 0.1% on the beta functions and 1e-4 on the tunes.
--Michael
- Attachments
-
- bmit_quads2.ele
- Using a penalty function that allows more precise adjustment of when the optimization has converged.
- (3.34 KiB) Downloaded 838 times
-
- bmit_quads1.ele
- Using the same penalty function, but adjusting optimization algorithm.
- (3.29 KiB) Downloaded 867 times
Re: Elegant Optimization Convergence Problems
Hi Michael,
Thank you for the tips. I will be putting them to good use.
Cheers,
Ward
Thank you for the tips. I will be putting them to good use.
Cheers,
Ward