Multiple matching locations in single command file

Moderators: cyao, michael_borland

Post Reply
mjoyce
Posts: 15
Joined: 28 Jul 2008, 12:56

Multiple matching locations in single command file

Post by mjoyce » 26 Jan 2009, 13:46

I have a lattice with 3 matching locations (in beamline order: D,S,R) . Each location has its own set of quads to use for optimizing.
I successfully matched at each location with three separate elegant runs, using the matched lattice of the previous run as the input for the next run.
I was also able to get a good result when I matched the D and S locations simultaneously. I cannot get a good solution by matching all three simultaneously. Here's what I want to know...can I set up the command file so that the input of one match is the solution of the previous match? In otherwords chain the matches together?

I've attached the command file that DOES NOT produce a good solution (along with the lattice)
thanks,
Michele
Attachments
ARC3.lte
(18.85 KiB) Downloaded 641 times
ARC3.match.ele
(4.11 KiB) Downloaded 730 times

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

Re: Multiple matching locations in single command file

Post by michael_borland » 26 Jan 2009, 15:32

Michele,

It is possible to perform the three matching steps in one elegant run. Basically, all you do is concatenate all the individual input files. In other words, instead of
% elegant run1.ele
% elegant run2.ele
% elegant run3.ele
use
% cat run1.ele run2.ele run3.ele > runAll.ele
% elegant runAll.ele

You just have to ensure that each run loads the lattice from the last run. You do this by one of two methods:
* Use save_lattice at the end of matching, then give the saved lattice filename as the run_setup/lattice parameter of the next run.
* Give a filename for run_setup/parameters, then use that filename with the load_parameters command:
&run_setup
...
parameters = %s.param1
&end
...
&optimize &end

&run_setup
...
parameters = %s.param2
&end

&load_parameters
filename = %s.param1
change_defined_values = 1
&end
...
&optimize &end

&run_setup
...
parameters = %s.param3
&end

&load_parameters
filename = %s.param2
change_defined_values = 1
&end
...
&optimize &end

etc.

The save_lattice method is faster. Using parameter files is nice if you need to modify the values in between runs or do some kind of postprocessing. Hope this helps.

--Michael

Post Reply