-
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
Fix the energy loss computation #877
Conversation
Unfortunately, this induces a small change in the "guess" orbit used as a starting point for find_orbit6. And consequently, the very small change in the resulting closed orbit affect the results of emittance and chromaticity computations. The Matlab/python comparison is slightly worse, so the unit tests have been once again modified. |
In my understanding, the problem occurs only for the So should we envisage to change the |
@swhite2401 and @simoneliuzzo : running the |
There may still be errors when computing the "guess" orbit, if the RF voltage is really insufficient. It is now watched in find_orbit and re-raised so that the full information is available:
As it is now, find_orbit stops. Alternately, one could choose to continue with 0.0 synchronous phase. What is you advice ? |
I think I could be useful to give some more advice on how to fix the issue...if the reason is really the voltage it should appear in the error message, with maybe a printout of the energy loss/turn and voltage |
As you can see in the error report above, the "Not enough RF voltage: check RF settings" message clearly appears as the origin of the subsequent errors. In the case of a single RF system, I can easily add a printout of losses and voltage. In the case of several cavities with different frequencies, it would need an additional computation of the maximum voltage, which is not obvious. In that case the present message is "No solution found for Phis: check RF settings". I would rather replace it by the same message as in the single cavity case… |
Ah sorry, I read only the second error, do you really want to print out this much? |
python has a standard way of dealing with chained errors: I agree that this is very verbose. One could bypass this by catching exception1, rewriting a new combined error message and then raising exception2 But it may be discussed… |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine for me
In some circumstances, the energy loss computation with the
ELossMethod.TRACKING
method gives crazy results. This was the reason for the problems reported in #858.They PR replaces the tracking over the whole lattice with element-by-element tracking, which was up-to now used only as a fallback solution. This eliminates the reported problem and gives more generally a better agreement with the
ELossMethod.INTEGRAL
method.Because of some optimisations, this also reduces by ~45% the time taken by the computation.