-
Notifications
You must be signed in to change notification settings - Fork 29
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
PyAT: improved timelag solver #451
Conversation
I tested 2 cases. Single and multi harmonic. For both cases when the returned timelag is set on the cavities using
then the equilibrium position for ct was on the order of 1e-5. On closer inspection, I realised that I am not able to trigger the warning seen on line 163 of energy_loss.py. I put a 4th harmonic cavity with very high voltage (6.5e6/1.5) which gives multiple possible phis but it doesn't seem to catch the warning. |
Could you send a figure of the wave form you got for this one? the initial points for the 2 solutions are at +/-lambda/4 around TimeLag so it is possible that if a solution is far off these initial values it is not found |
It's ok now. If I keep the harmonic TimeLag=0 then it triggers the warning. For TimeLag=0.1 (what you see in the figure) then it doesn't. So the warning can be triggered. but I guess the question now is why it doesn't find the second solution on the left of the main one? |
Right, can you send me your lattice? |
There was a logic issues settings the boundaries and initial guesses, this is fixed. In addition the range is now divided in 8 initial guesses over the full wake length on the main RF, instead of just 2 before. This should mitigate the issue with solutions not found |
Please put the modifications of |
As request I have created #453 to propose the |
For the computation, I trust @lcarver and you. But:
|
Exactly for that reason: we have to be consistent in the default we use and stick to the decision made in other places. |
I have no opinion on that. I always use |
So no reason to change anything, let's keep the expression type decide, and in this particular case it's mixed. I was just curious about the reason for the change ! So it's ok for me. |
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.
ok
Ok I merge then |
In
get_timelag_from_U0
the numerical synchronous phase solver was failing in some cases in the presence of multiple rf systems, such as higher order cavities.This PR proposes a simpler more robust version.