Page 1 of 1
Optimizing on External Calculation
Posted: 18 Apr 2011, 17:57
by JoelFrederico
So I'm trying to run an optimization based on a calculation that elegant is incapable of doing. (We define a "core emittance" of 95% of the particles and would like to optimize on that, it's a rather involved story.) Is there a way of doing that? I was thinking I could use a script element to call a script that would set the calculated value somewhere, and elegant would proceed to read that calculated value and use it in its optimization routines. I just can't find a way to do that.
Re: Optimizing on External Calculation
Posted: 18 Apr 2011, 21:17
by michael_borland
Joel,
There's no general way to do this in elegant, although now that someone asks for it, it will be easy to add in the next release.
Here are my suggestions for now:
1. Use a script element at the end of the beamline. The script should remove the 5% of the particles that you are not interested in. The built-in emittance computation may then give you what you want.
2. Use the program sddsoptimize, part of the SDDS/EPICS toolkit (available on our web site). I'm trying to dig up an example and will post it if I find one.
--Michael
Re: Optimizing on External Calculation
Posted: 18 Apr 2011, 21:31
by JoelFrederico
Michael,
Thanks! I think your first suggestion will be close enough for now, I will double-check.
It would be a useful feature to have in the future. We are creating two bunches at an interaction point by collimating along the beamline with script elements. This would enable optimization on bunch separation, sigmas from gaussian fits (our beam has tails that cause numerically calculated sigmas to be significantly different from the gaussian fits), etc.
Joel
Re: Optimizing on External Calculation
Posted: 18 Apr 2011, 22:45
by michael_borland
Joel,
Ok, just in case you need it here is the sddsoptimize example.
--Michael