Optimizing on External Calculation
Moderators: cyao, michael_borland
-
- Posts: 60
- Joined: 05 Aug 2010, 11:32
- Location: SLAC National Accelerator Laboratory
Optimizing on External Calculation
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.
-
- Posts: 1959
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Optimizing on External Calculation
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
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
-
- Posts: 60
- Joined: 05 Aug 2010, 11:32
- Location: SLAC National Accelerator Laboratory
Re: Optimizing on External Calculation
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
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
-
- Posts: 1959
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: Optimizing on External Calculation
Joel,
Ok, just in case you need it here is the sddsoptimize example.
--Michael
Ok, just in case you need it here is the sddsoptimize example.
--Michael
- Attachments
-
- optimizer.tar
- (20 KiB) Downloaded 842 times