-
Notifications
You must be signed in to change notification settings - Fork 30
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
Simplified radiation integrals in wigglers #188
Conversation
@TeresiaOlsson: I ran your lattice with the various IDs, here is what I get. Can you check this? |
I the computation is correct, I'll then go through:
|
Thank you @lfarv. I will check it. So I understand correctly, is the self-dispersion included in these numbers or not? |
@TeresiaOlsson: the self-induced dispersion is neglected in I4 and I5, except as a lower limit for the I5 contribution. But in any case, it's completely negligible compared to other contributions (a few tens of microns…). It's included in I1 (the computation is obvious), though it is also negligible there. |
There is something odd with K04, but it was there before too so I have to check that. Maybe I have done something wrong in the lattice file for that one. Otherwise, I think I1 looks really good now, but I'm a bit surprised that the self-dispersion is negligible for I5. Even for the strong wigglers I12 and I15 that seems to be the case when I calculate the effect on the emittance. I get the same emittance contribution using your AT results as I get from Elegant. |
@lfarv No, sorry. I did something wrong again. The self-dispersion isn't at all negligible for I12 and I15. I get the following emittance contributions: I12: Elegant: -15.50097252 pm rad, AT: -8.861909069 pm rad |
@TeresiaOlsson: You are right, but as I told you, I take the effect of the self-induced dispersion as a lower limit for the I5 contribution (in case the lattice dispersion is 0, or less that ~100um). For the wiggler I12, I get for the I5 integral:
So in this case, the final result is only due to the the self-induced dispersion. Now we have 1.88E-07 from Elegant and 1.95E-07 from AT. I cannot add both contributions in AT, but the results should be larger than 1.95E-07, so I do not understand that the Elegant value is lower. It's however a 3.5% difference which I think is acceptable, but cannot explain your difference in emittance. I2 and I3 are similar, so the wiggler description is the same. There must be something else, I'm looking… For K04, I2 and I3 are different, so probably the wiggler I'm using by running your scripts is not the same that the one used in Elegant. |
For I12, I find indeed -15pm in AT, as Elegant does !! I check now for I15 |
-14pm for I15, it looks correct… |
Hmm. Did you get this without doing any changes? |
Absolutely no change ! |
Interesting, but very nice! Are these latest changes in the wiggler_integrals branch? Then I can test it myself and check what I did. Sounds like something is wrong in my calculation of the emittance contribution from the integrals. |
In fact, the reduction is due to the increase of I2 (strong wiggler, both codes agree), while I5 contributes on the other hand to a (small) increase. But It's not so sensitive to I5! |
No change in the wiggler_integrals branch, please try it ! |
To go on with I12/I15: a wiggler in a zero dispersion straight is a "damping wiggler": its contribution to the excitation (emittance increase, I5) is small, unless the period is very large, while its radiated power (damping, I2) is large therefore reducing the emittance. I think I could completely remove the self-induced contribution without changing a lot the emittance (the reduction would be slightly larger). In a dispersive section, it's completely different. |
That makes sense. And in the dispersive midstraights the results look good because the lattice dispersion is so large compared to the self-dispersion. Do you think the current implementation could run into problems if we for example try to put I12 in the position of K02? So a strong wiggler in a section with large dispersion? |
I figured out my error so I also get it to agree now. A bit worse for I15, but still within what I think could be considered acceptable between codes. I12: Elegant: -15.50097252 pm rad, AT: -15.25016664 pm rad So I would say it works :) |
No problem, you can try I12 in K02 location ! As soon as the dispersion if larger than 1 mm, it is dominant by far. The most critical point is long periods and large field, since the self-induced dispersion scales with Bmax^2*Lw^2. By the way, there is still a debug printout, I'll remove it ! |
Hi Teresia, when for your comparison with ELEGANT, are you sure to slice enough your dipoles in your computation. |
@lnadolski I think so. Our Elegant lattice is more tested than the AT lattice so if there is a problem with the dipoles I would expect it to rather be in the AT lattice, but for the bare lattice we have good agreement between Elegant and AT. |
@lfarv Are you planning to do some more changes to this branch before merging it to |
@TeresiaOlsson: Still remains the upgrade of |
@lfarv Then I won't tell my colleagues to start using it just yet. They might be eager. |
For me the branch is now ready (except for python). However, we still miss tests for:
|
@lfarv I asked my colleagues about it today, but they had no experience of using any of these in Elegant except for elliptical wigglers, but then only with kick maps which doesn't include the radiation effects. So I'm not sure if Elegant can be used for testing these. |
I tested as much as I could the vertical, elliptical and helicoidal wigglers. |
@lfarv , I want to thank you for your comprehensive effort on this issue. |
Last tuning before merging, if no objection ! |
The radiation integrals now give two independent ways of computing the damping times. Comparing the results give a clear indication that @mashl: I guess that you computation of the diffusion matrix is built on top of |
Wigglers with a PassMethod of 'DriftPass' are ignored in integral computation so that it's easy to 'open' a wiggler simply by setting its PassMethod to 'Driftpass' |
By neglecting the self-induced dispersion in computation of I4 and I5, radiation integrals in wigglers are computed faster and more accurately