Optimizing on External Calculation

Moderators: cyao, michael_borland

Post Reply
JoelFrederico
Posts: 60
Joined: 05 Aug 2010, 11:32
Location: SLAC National Accelerator Laboratory

Optimizing on External Calculation

Post by JoelFrederico » 18 Apr 2011, 17:57

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.

michael_borland
Posts: 1959
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Optimizing on External Calculation

Post by michael_borland » 18 Apr 2011, 21:17

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

JoelFrederico
Posts: 60
Joined: 05 Aug 2010, 11:32
Location: SLAC National Accelerator Laboratory

Re: Optimizing on External Calculation

Post by JoelFrederico » 18 Apr 2011, 21:31

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

michael_borland
Posts: 1959
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Optimizing on External Calculation

Post by michael_borland » 18 Apr 2011, 22:45

Joel,

Ok, just in case you need it here is the sddsoptimize example.

--Michael
Attachments
optimizer.tar
(20 KiB) Downloaded 842 times

Post Reply