-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undulator dipoles #571
base: master
Are you sure you want to change the base?
Undulator dipoles #571
Conversation
… in the lattice. example provided
Good question @simoneliuzzo , I was thinking to use a wiggler element, and did try to use pyat to calculate the radiation integrals with no sucess. o |
Thank you @oscarxblanco |
@lcarver and @swhite2401 suggested to give the possibility to define an undulator that has both the radiation effects and the kick map effects. However both elements are thick. How to put them together? @oscarxblanco and @lfarv may be have some ideas? |
Hello @simoneliuzzo do you want me to review this PR? |
Dear @swhite2401, |
Dear @oscarxblanco , do you know if we can put 0 length in InsertionDeviceKickMap element? thank you |
@simoneliuzzo It is not possible because Length is divided by 2Nslice in IdTablePass.c (line 56). I would suggest to create a new element with Length and IntegratedLength. That new element should inherit (all or most) properties from InsertionDeviceKickMap. Best regards, |
Hi all, sorry to come late in the discussion, but I have strong concerns about what you can get out of this model… The field model that you build with this method is a succession of hard-edge dipoles. This is unrealistic, the field cannot jump from positive to negative so what you simulate has nothing to do with a real undulator field. For standard dipoles, you know that taking into account the fringe field is tricky and uses empirical approximations: see the different methods presently implemented. Usually the fringe field effect is neglected (which is probably sometimes wrong). But an insertion device in only fringe fields, nowhere you'll get a flat top ! The simplest field model for insertion devices is Halbach's field expansion which is used if With kx2 + kx2 = k2. As you can see, it's rather different from a succession of dipoles. For instance, By(s) is a cosine wave. For a realistic field, you need to combine several harmonics in k. So now, what you can get from this "dipole" model:
As a 1st check: could you make a comparison with The problem with The only correct passmethod for insertion device is "IDTablePass": it's the only way to define a realistic field, in particular the decay of the By field along x, critical for the horizontal aperture. I don't see how you could "combine" dipoles and ID tables: you must forget the dipoles in tracking I am not an expert in insertion devices, most of what I know comes from discussions with P. Elleaume, who was very suspicious about models based on Halbach's field expansion. You have at ESRF experts in IDs, a discussion of ID field modelling would be very useful to clarify all this! |
Dear @lfarv I understand and completely agree with your description. The problem for me is that there is no wiggler or undulator method doing really all that we would like to see from an ID or wiggler pass. IdTablePass and WigglerLinearPass do not give the correct emittance and energy loss. Dipoles model do not give the correct tracking. This pull request is open simply to point out this rather important missing feature for a code that is used mostly by synchrotron light sources. I did not intend to merge the methods I have submitted, but only to trigger this discussion (and share the files) to think about what should be done in order to have what we we really need: a method to add to an AT lattice an ID that gives the correct tracking and global parameters. Concerning the dipole model we recently compared the radiated power computed by the dipole model and the values obtained from formulas and from the control system: 93KeV from the dipoles model, 100KeV from the cavities. |
I am preparing the test with wiggler pass and will share the result as soon as they are ready |
Here a first figure: beta-beating and dispersion deviation with kickmpas (IdTablePass), dipoles, WigglerLinearPass WigglerLinearPass gives result rather different from IdTablePass and dipole model. Thanks to this figure, I am an even more "confused" user. |
I am unable to continue the tests with Wiggler element. Even if the optics are visible with plot_beta(), at.envelope_parameters gives an error: Unstable Ring. and the lattice file if you want to try your self. I now realize that the Wiggler Element does not use WigglerLinearPass but GWigSymplecticPass! |
I switched pass Method for the wiggler element to WiggLinearPass. now the optics return nan So I think that the either the Wiggler element has some problem or I am not using the correct element. Likely the second. |
Lattice with WiggLinearPass element: |
@simoneliuzzo: I'm sorry, I made a confusion for passmethods: the right one should be You are talking of a W150 ID. With this long period of 150 mm, you are in a favorable situation for the dipole model ! On the other hand,
I have other questions, so I'll continue later |
Dear @lfarv, @oscarxblanco, @swhite2401 and @lcarver, @lcarver noticed that the new passmethod #632 could solve the problem we are discussing here. By adding to the undulator pass also the energy loss field, we may have an undulator model for AT that reproduces both the kickmaps effects and the energy loss per turn. regards |
@simoneliuzzo can we close this PR? Now that the wiggler passmethod is fixed this seems to be obsolete to me right? |
I try to add a method to create an undulator made of dipoles.
an example demo is provided in the pyat/examples/undulators
How to merge such list of elements (that gives the correct emittance and energy loss) with an IdTablePass element?