Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added the ability to specify an additional detuning angle in the beam loading element. When considering stability issues for active cavities, it can be desirable to apply a delta detuning angle from the optimum working point.
By specifying 'detune_angle' the feedback loop will feedback on the phase position of the optimum + detune_angle.
Below is a plot comparing the PyAT results with results based on the analytical formula (taken from MB2). There is some small disagreement, but the analytical formula contains a large amount of assumptions, whereas the numerical tracking of PyAT has fewer assumptions and also takes into account the bunch distribution
I also show here a plot showing that the detune_angle is implemented correctly, as the beam remains centered on 0 as a function of the detune_angle.