Fitting Beam Size Measurements
Moderators: cyao, michael_borland
Fitting Beam Size Measurements
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
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
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
Thanks.
chris
-
- Posts: 1951
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Fitting Beam Size Measurements
Chris,
Please see the attached file for an example of how to do this.
--Michael
Please see the attached file for an example of how to do this.
--Michael
- Attachments
-
- beamSizeMatch1.tar.gz
- (1.37 KiB) Downloaded 849 times
Re: Fitting Beam Size Measurements
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
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
-
- Posts: 1951
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Fitting Beam Size Measurements
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
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
Ah, yes. Thank you. I also forgot to put the occurrence in (i.e. TV8F06#1.Sx).
Re: Fitting Beam Size Measurements
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?
-
- Posts: 1951
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Fitting Beam Size Measurements
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
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
Hi Michael,
Is there now an element to vary the initial bunch length? Will be an useful one. Thanks!
-Charles
Is there now an element to vary the initial bunch length? Will be an useful one. Thanks!
-Charles
-
- Posts: 1951
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Fitting Beam Size Measurements
Charles,jtobin wrote:Hi Michael,
Is there now an element to vary the initial bunch length? Will be an useful one. Thanks!
-Charles
You should be able to do this with the MAGNIFY element, e.g.,
Code: Select all
MAGS: magnify,ms=2
--Michael