Skip to content
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

Energy loss relative tolerance #596

Merged
merged 2 commits into from
May 15, 2023
Merged

Energy loss relative tolerance #596

merged 2 commits into from
May 15, 2023

Conversation

swhite2401
Copy link
Contributor

The function get_timelag_fromU0 for lattice with very large U0 and multiple RF harmonics.
The reason is that for multiple harmonic a least square fit is use to compute the synchronous phase, the quantity to minimize is the difference between U0 and the accelerating voltage.
However using the absolute difference, the tolerance was becoming too tight for very large U0. This value is now normalized to U0. In addition, the tolerance was reduced to 1.0e-9 and set as an optional argument.

A small modification to envelope_parameters() is also propose to prevent attribute errors when voltage<U0. The function now simply returns a NaN.

@swhite2401 swhite2401 added Python For python AT code bug fix labels Apr 26, 2023
@swhite2401 swhite2401 merged commit 6abe7c8 into master May 15, 2023
@swhite2401 swhite2401 deleted the energy_loss_relative_tol branch May 15, 2023 15:11
@lfarv lfarv mentioned this pull request Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix Python For python AT code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants