Hello,
I am using Elegant for longitudinal jitter simulations. The &error_element command is used to add RF phase and cavity voltage errors. I have 1001 injection beam files (inj_0001.sdds to inj_1001.sdds) from the injector's simulation results. I want to simulate injection beam errors by randomly selecting an injection beam file in each step of the calculation. Assume n_steps=101 in run_control, how to randomly select one injection beam file from 1001 injection beam files at each step of the computation? Can input_list &sdds_beam in work? If it works, how to proceed?
Many thanks for any suggestion,
Zhenbiao
How to randomly select one injection beam file from 1001 injection beam files
Moderators: cyao, michael_borland
-
- Posts: 2006
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: How to randomly select one injection beam file from 1001 injection beam files
Zhenbiao,
I would combine the input beam files and randomize their order, as follows
This assigns a random number to each page of the combined file, then sorts by that random number.
In elegant, you then use
--Michael
I would combine the input beam files and randomize their order, as follows
Code: Select all
sddscombine inj_????.sdds -pipe=out \
| sddsprocess -pipe -define=parameter,sortOrder,rnd \
| sddssort -pipe=in randomizedBeams.sdds -parameter=sortOrder
In elegant, you then use
Code: Select all
&sdds_beam
input = randomizedBeams.sdds,
track_pages_separately = 1
&end
Re: How to randomly select one injection beam file from 1001 injection beam files
Dear Michael,
Many thanks for your quick reply. It works well.
Best regards,
Zhenbiao
Many thanks for your quick reply. It works well.
Best regards,
Zhenbiao