script taking into account distribution at an earlier time

Moderators: cyao, michael_borland

Post Reply
Philippe Piot
Posts: 83
Joined: 20 Aug 2008, 13:18
Location: Northern Illinois University & Argonne National Laboratory
Contact:

script taking into account distribution at an earlier time

Post by Philippe Piot » 08 Dec 2017, 17:16

All,
I am trying to simulate a transformation (stochastic cooling) with a script that needs to modify the distribution at a given location (the "kicker" location) given the phase space distribution detected at an upstream location (the "pickup" location). I do this in a ring and need the distribution to be updated at each pass. Is there a way to do such a thing in elegant?

I was first using a WATCH element to dump the phase space at the pickup location and using a script command to apply the corrective kick downstream. My script looks at the file dumped by the WATCH element to get the info on the upstream distribution. A problem I could not figure out with such an approach is that the WATCH file cannot be rewritten at each pass (it looks like it just increases in size as the distribution from each pass is appended to the file).

Please let me know if any good suggestion/better solution. Thank you, -- Philippe.

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

Re: script taking into account distribution at an earlier time

Post by michael_borland » 08 Dec 2017, 18:04

Philippe,

It's not pretty, but you could do the following: Include a SCRIPT element at the location of the pickup. It wouldn't transform the beam, but merely copies the input to the output. It would also copy the input to a third file for later use by another SCRIPT that simulates the correction element.

--Michael

Philippe Piot
Posts: 83
Joined: 20 Aug 2008, 13:18
Location: Northern Illinois University & Argonne National Laboratory
Contact:

Re: script taking into account distribution at an earlier time

Post by Philippe Piot » 12 Dec 2017, 07:52

Thank you Michael. This works fine. Best, -- Philippe.

Post Reply