How to add a error to bumper's waveform?
Moderators: cyao, michael_borland
How to add a error to bumper's waveform?
Is it possible to add a error to bumper's waveform? Thanks.
-
- Posts: 1933
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: How to add a error to bumper's waveform?
You can try various things depending on just what kind of error you want to include. If you want simple timing and amplitude errors, use the "error_control" and "error_element" commands. E.g.,
&run_control
...
&end
! Tell elegant that we'll be adding random errors and define log file for error values
&error_control error_log="%s.erl" &end
! Set 0.1% rms errors for the K1 angle
&error_element name=K1, item=ANGLE, amplitude=0.001, fractional=1 &end
! Set 10 ns rms errors for the K1 timing
&error_element name=K1, item=TIME_OFFSET, amplitude=10e-9 &end
! Do 10 random error ensembles
&run_setup n_steps=10 &end
...
If you want to literally modify the waveform, you need to be more sophisticated. Suppose that your ideal waveform is idealWf.sdds, with columns t and A for the time and amplitude. Suppose further that you want to add a sinusoidal modulation to the waveform with period 100 ns and 10% amplitude.
In your lattice file, define the bumper as
K1: BUMPER,WAVEFORM="nonIdealWf.sdds=t+AMod",...
Then, at the top of the command file do this
&subprocess command = "
sddsprocess idealWf.sdds nonIdealWf.sdds \"-define=column,AMod,t 100e-9 / 2 * pi * sin 0.1 * 1 + A *\"
" &end
Now, when you run the command file, it will generate a new nonIdealWf.sdds file that will then be loaded by elegant for that run. With a little more work, you can add random errors or make other variations. The -macro commandline argument can be helpful here, as can some shell scripting.
Hope this answers your question.
--Michael
&run_control
...
&end
! Tell elegant that we'll be adding random errors and define log file for error values
&error_control error_log="%s.erl" &end
! Set 0.1% rms errors for the K1 angle
&error_element name=K1, item=ANGLE, amplitude=0.001, fractional=1 &end
! Set 10 ns rms errors for the K1 timing
&error_element name=K1, item=TIME_OFFSET, amplitude=10e-9 &end
! Do 10 random error ensembles
&run_setup n_steps=10 &end
...
If you want to literally modify the waveform, you need to be more sophisticated. Suppose that your ideal waveform is idealWf.sdds, with columns t and A for the time and amplitude. Suppose further that you want to add a sinusoidal modulation to the waveform with period 100 ns and 10% amplitude.
In your lattice file, define the bumper as
K1: BUMPER,WAVEFORM="nonIdealWf.sdds=t+AMod",...
Then, at the top of the command file do this
&subprocess command = "
sddsprocess idealWf.sdds nonIdealWf.sdds \"-define=column,AMod,t 100e-9 / 2 * pi * sin 0.1 * 1 + A *\"
" &end
Now, when you run the command file, it will generate a new nonIdealWf.sdds file that will then be loaded by elegant for that run. With a little more work, you can add random errors or make other variations. The -macro commandline argument can be helpful here, as can some shell scripting.
Hope this answers your question.
--Michael
Re: How to add a error to bumper's waveform?
Dear all
I step in this conversation with a request, rather than an answer.
Would it be possible to have a working example of a bumper inserted in a ring with its waveform file?
I am trying to reproduce the effect of 4 kickers at injection and I am not sure how to do it.
Thanks for any help
Marco
I step in this conversation with a request, rather than an answer.
Would it be possible to have a working example of a bumper inserted in a ring with its waveform file?
I am trying to reproduce the effect of 4 kickers at injection and I am not sure how to do it.
Thanks for any help
Marco
-
- Posts: 1933
- Joined: 19 May 2008, 09:33
- Location: Argonne National Laboratory
- Contact:
Re: How to add a error to bumper's waveform?
Marco,
Here's an example. It is also in the elegant examples file under PAR/ejectionOptimization.
--Michael
Here's an example. It is also in the elegant examples file under PAR/ejectionOptimization.
--Michael
- Attachments
-
- ejectionOptimization.tar
- (20 KiB) Downloaded 157 times