Page 1 of 1

Simple ring equil. bunch length calculation

Posted: 07 Jan 2013, 10:58
by hywel
Hi folks, I must be missing something, as I can't figure out a simple (non-tracking) way to return the equilibrium bunch length from Elegant. I've leafed through the par.lte and SPEAR examples and can't figure out a simple way to extract the values. Obviously, I can calculate them by hand and by using TAPAs (which is nice little tool), but I wanted to do it in Elegant using e.g. a .twi file and with the radiation integrals.

Cheers,

Hywel

Re: Simple ring equil. bunch length calculation

Posted: 07 Jan 2013, 11:11
by michael_borland
Hywel,

There's no straight-forward way to do it inside of elegant using the twiss output. My suggestions are
* Use the rf_setup and moments_output commands. This will give you the horizontal and vertical emittances, plus bunch length and energy spread.
* Use the GUI script longitCalcs
* Use the command-line script longitCmd
(The scripts should be in the distribution. If not, let me know and I'll post them here.)

I should probably add this calculation to the Twiss calculations when rf cavities are present.

--Michael

Re: Simple ring equil. bunch length calculation

Posted: 07 Jan 2013, 11:56
by hywel
Hi Michael,

Happy New Year! Thanks for the speedy reply as always. I'm using the .ele file below, and am getting a .mom file out at the end with s1 (nan),s12,c1,c2,ex and other values, but not sure how to interpret them. c5 is 561.6 so is the circumference of course (I've not used the moments command before).

I've got the longitCalcs and longitCmd scripts executing, but they can't find the OAGTclTk as it's not installed on my Mac. I downloaded the source code from http://www.aps.anl.gov/Accelerator_Syst ... html#TclTk but not sure which parts to build and which to not. I think working out the .ele file is the best route for me - I'm sure you can spot the obvious error in the stuff below.

PS the RF cavity is defined in the .lte file as:
rf: rfca,freq=499666667,volt=3.3e6,phase=173.61

----

&run_setup
lattice = "d2.lte",
echo_lattice = 1,
magnets = "%s.mag",

p_central = 5870.84,

use_beamline="d2ring",
default_order = 2
&end

&run_control
n_steps = 10
&end

&twiss_output
filename = "%s.twi",
matched=1,
statistics=1,
radiation_integrals=1,
&end

&rf_setup
harmonic = 936,
over_voltage = 3.29
&end

&moments_output
filename = %s.mom,
output_at_each_step=0,
final_values_only = 1,
matched = 1,
equilibrium = 1,
radiation = 1,
verbosity = 1
&end

Re: Simple ring equil. bunch length calculation

Posted: 07 Jan 2013, 12:14
by michael_borland
Hywel,

The .ele file you posted looks fine. If you can post (or send me) the .lte file, I can look in more detail.

--Michael