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

at.beam improvement #537

Merged
merged 2 commits into from
Dec 7, 2022
Merged

at.beam improvement #537

merged 2 commits into from
Dec 7, 2022

Conversation

lfarv
Copy link
Contributor

@lfarv lfarv commented Dec 6, 2022

at.beam again ! The present version processes either fully coupled 6x6 sigma matrices, or fully decoupled (3 2x2 independent matrices). But it misses two common cases:

  1. coupled h/v motion with zero bunch length and energy spread,
  2. zero vertical emittance, but H-δ coupling always appear in dispersive regions.

In both cases, 6x6 analysis fails and at.beam falls back the the uncoupled case, which is wrong.

In this PR, we try in order the following cases:

  1. 6x6 H-V-δ matrix
  2. 4x4 H-V matrix
  3. 4x4 H-δ matrix
  4. fully decoupled

(The coupled V-δ case where εx=0 is not handled but looks unrealistic).

The following figures show the improvement. We consider a simplified radiation source: equilibrium emittance in horizontal and longitudinal planes, zero vertical emittance. The Σ-matrix is built with at.sigma_matrix using the twiss_in keyword argument, looking at a dispersive region of the ring. With at.beam we generate a particle distribution (1000 particles), and we rebuild the Σ-matrix from the particle distribution (at.sigma_matrix with the beam keyword argument).

Figure 1: master branch

Figure_1

The original projection of the Σ-matrix on the x-δ plane shows the correlation. The particle distribution has the right σx and σδ but not the right correlation, so the rebuilt Σ-matrix is wrong.

Figure 2: this branch

Figure_2
Now the particle distribution has the right correlation, and the re-built Σ is very close to the initial one, even with only 1000 particles.

Note: the figures above make use of a at.plot.plot_sigma() function which appear in another pull request

@lfarv lfarv added the Python For python AT code label Dec 6, 2022
@lcarver
Copy link
Contributor

lcarver commented Dec 6, 2022

i am convinced by your plots

@lfarv lfarv merged commit 6c2494b into master Dec 7, 2022
@lfarv lfarv deleted the atbeam branch December 7, 2022 10:05
@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
Python For python AT code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants