Replies: 7 comments
-
Hello, Be careful the frequency should be provided in Hz. The kick is then defined as:
In case you would like to produce a list as a function of turn number list = where In your case you define the frequency as: Maybe this is the problem? |
Beta Was this translation helpful? Give feedback.
-
Hello @swhite2401, Thank you for your answer. About the second reason, I indeed want the tune to be the kick angle frequency as I want a resonant excitation along the ring. I already put it to the test thought another code but the problem is that it is really slow (N_turns=~60k). I used a for loop to modifiy the kick angle as follow :
with ppre_kick func and fk2_activation
So I wanted to make my code faster and I was told to use 'VariableMultipole'. I think my problem is more about the first reason. I don't understand how to provide a new kick angle for every turn with this command, even though I read the documentation and source code multiple times. I may need a clear explanation of the VariableMultipole command if you have one and a small example could be precious. Thank you very much |
Beta Was this translation helpful? Give feedback.
-
Hello,
It's important to remember that you can only do 1 order at a time for each VariableMultipole element. This is defined by MaxOrder. So here I just set AmplitudeB to be 1 because then it is basically ignored, I give FuncB my table of Turn by Turn kicks. I know it is a horizontal kick because I give AmplitudeB and FuncB (as opposed to A for vertical) and I know it is a dipole kick because MaxOrder=0. FuncB should be an array of kicks that will be evaluated at each turn. One potential problem you could have is whether or not you use
or The former may run you into some problems without giving additional flags to track (because in the C part it will think it is in turn 1 every time). |
Beta Was this translation helpful? Give feedback.
-
Again, in
And the figure where you can see the horizontal motion excited as expected: |
Beta Was this translation helpful? Give feedback.
-
Thank you for both of your answers. I am glad you helped me, it worked. I thought that I would need to give the program an information about the number of turns. I don't want to offend anyone by saying this but the pyat documentation might need some additional information for newcomers. What you wrote in either of your responses is not displayed in the VariableMultipole doc. The small example from @swhite2401 could be of relevance in my opinion. Anyways, thank you for your time, |
Beta Was this translation helpful? Give feedback.
-
You are welcome, in many places the documentation is lacking and we need to improve it. |
Beta Was this translation helpful? Give feedback.
-
For sure the documentation would need to be improved we fully agree on that... |
Beta Was this translation helpful? Give feedback.
-
Hi everyone,
I want to implement a kicker magnet which provides a new kick every turn with
kick_list = np.cos(2*np.pi*np.arange(N_turns)*(tune_x))
and my VariableMultipole usage is as follows :
kicker = at.VariableMultipole(family_name='kicker', AmplitudeA=1e-7, FuncA = kick_list, mode=at.ACMode.ARBITRARY)
or
kicker = at.VariableMultipole(family_name='kicker', AmplitudeA=1e-7, FrequencyA = (2*np.pi*N_turns*(tune_x)), mode=at.ACMode.SINE)
The result is not as expected, it seems like the code only consider the kicker with one of the angles and does not change over turns. I guess there are some things I didn't understand and some things missing in my script. I am very new to this community (first intership in PSI) and I am sorry if the problem is basic to resolve.
Thank you,
Paul
Beta Was this translation helpful? Give feedback.
All reactions