change charge in the elegant runfile

Moderators: cyao, michael_borland

Post Reply
jzemella
Posts: 8
Joined: 27 Nov 2013, 11:23

change charge in the elegant runfile

Post by jzemella » 27 Nov 2013, 11:27

Hi,

I like to track particle disrtibutions with different charges.
I know the way to change the charge in my lattice file (.lte).
But I like to have one lattice file (.lte) and change everything else in the run definition file (.ele).

Is there a way to do this?

Cheers, Johann

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

Re: change charge in the elegant runfile

Post by michael_borland » 27 Nov 2013, 11:58

Johann,

You can use the vary_elements command. Suppose your CHARGE element is called Q:

Code: Select all

&run_setup
...
&end

&run_control
n_indices = 1
&end

&vary_element
name=Q, item=TOTAL, initial=0, final=1e-9, index_number=0, index_limit=11 
&end

! Insertion beam definition (bunched_beam or sdds_beam)

&track &end

This would vary the TOTAL field of element Q from 0 to 1e-9, taking on 11 values.

Another method is using the &alter_elements command and a commandline macro. E.g.,

Code: Select all

...
&run_setup
 ...
 rootname = <rootname>
&end

&alter_elements name=Q, item=TOTAL, value=<charge> &end
...
This would then be executed with a command such as

Code: Select all

% elegant template.ele -macro=rootname=run-1000,charge=1e-9
% elegant template.ele -macro=rootname=run-100,charge=1e-10
If you have a batch system, you can make a loop and submit the different jobs to different nodes.

--Michael

jzemella
Posts: 8
Joined: 27 Nov 2013, 11:23

Re: change charge in the elegant runfile

Post by jzemella » 28 Nov 2013, 03:25

I 've tried it but I did something wrong :-(
Now it works thanks

JOhann

Post Reply