Page 1 of 1

Fitting Beam Size Measurements

Posted: 17 Sep 2010, 11:40
by tennant
Hi,

We have (rms) beam size measurements at various points along a transport channel. I'd like to use Elegant to vary the Twiss parameters at the entrance of the the transport channel to minimize the difference between observed and simulated beam sizes. I suppose I could create an optimization_term for each beam size measurement but that would become unwieldy to manually enter each new set of measurements. I've got to believe there is a faster way to do this...

Thanks,
chris

Re: Fitting Beam Size Measurements

Posted: 20 Sep 2010, 11:42
by tennant
So I grossly overestimated my ability to do what I described in my previous post and now have more fundamental questions. I want to vary the Twiss parameters and emittance at the start of a transport channel to minimize the difference between measured and simulated beam sizes at various locations. Presumably I use the 'Twiss' element to generate the optimization_variables for the beta and alpha in each plane. How do I vary the emittance? And how do I generate an optimization_term for the measured beam size? At the moment I have 'Watch' elements at all viewer locations in the lattice. Can I do something like: term = "Viewer01.SX(Y) 0.5e-3 - sqr"?

Thanks.
chris

Re: Fitting Beam Size Measurements

Posted: 27 Sep 2010, 11:01
by michael_borland
Chris,

Please see the attached file for an example of how to do this.

--Michael

Re: Fitting Beam Size Measurements

Posted: 27 Sep 2010, 13:11
by tennant
Michael,

Thanks for the example. I (think) I understand what you are doing, however when I apply it to my file I run into problems. After the optimizer runs, it has not changed any of the twiss parameters or emittances and the value of the fit function is ridiculously high. I don't understand it. I'm attaching the .ele and .lte if you'd like to have a look. I'm not expecting a super fit of the data, but I'm certainly something better than I'm currently getting!

Thanks,
chris

Re: Fitting Beam Size Measurements

Posted: 27 Sep 2010, 13:45
by michael_borland
Chris,

I think the basic problem is that your MARK elements have names that begin with a digit. This is ok until you use them in RPN expressions. RPN doesn't properly recognize variable names beginning a sequence that looks like a number. So 8F03.SX gets interpreted as "8".

Another problem is that you refer to markers (e.g., 8F12) that don't exist. Finally, you use ".SX" and ".SY" instead of ".Sx" and ".Sy".

--Michael

Re: Fitting Beam Size Measurements

Posted: 28 Sep 2010, 08:25
by tennant
Ah, yes. Thank you. I also forgot to put the occurrence in (i.e. TV8F06#1.Sx).

Re: Fitting Beam Size Measurements

Posted: 28 Sep 2010, 13:28
by tennant
One more question, I've seen how you can change the Twiss parameters and emittance with the 'twiss' and 'emittance' elements, respectively. Is there a straightforward way to vary the initial longitudinal parameters (i.e. bunch length and energy spread) for fitting purposes?

Re: Fitting Beam Size Measurements

Posted: 28 Sep 2010, 13:31
by michael_borland
Chris,

You can use a MAGNIFY element to do this in a relative fashion (i.e., using factors relative to the initial bunch length or energy spread).

I should really add longitudinal emittance and beta function transformation in the same fashion as for transverse...

--Michael

Re: Fitting Beam Size Measurements

Posted: 11 Mar 2013, 17:04
by jtobin
Hi Michael,
Is there now an element to vary the initial bunch length? Will be an useful one. Thanks!
-Charles

Re: Fitting Beam Size Measurements

Posted: 11 Mar 2013, 17:07
by michael_borland
jtobin wrote:Hi Michael,
Is there now an element to vary the initial bunch length? Will be an useful one. Thanks!
-Charles
Charles,

You should be able to do this with the MAGNIFY element, e.g.,

Code: Select all

MAGS: magnify,ms=2
should multiply the bunch length by a factor of 2. May not work well if the beam has a significant velocity spread.

--Michael