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 tracking #393

Merged
merged 4 commits into from
Apr 6, 2022
Merged

Energy loss tracking #393

merged 4 commits into from
Apr 6, 2022

Conversation

swhite2401
Copy link
Contributor

I has been brought to my attention that in some instances particles do not make it through one turn if cavities are off.
In this case at.ELossMethod.TRACKING cannot be used.
it is presently the default in find_orbit() and is therefore a serious issue.

This PR solves this issue by calculating the energy/element in case the particle is lost in less than a turn. This algorithm can be refined by smart iterative splitting of the ring based on loss index.

This also raises the question whether TRACKING should be the default, especially in find_orbit() for which it is used only to determine the initial guess: I would personally suggest to use INTEGRAL but this can be discussed.

@lfarv what do you think? Any better ideas?

@swhite2401 swhite2401 added Python For python AT code bug fix labels Mar 30, 2022
@lfarv
Copy link
Contributor

lfarv commented Mar 31, 2022

@swhite2401 : the problem with the INTEGRAL method in find_orbit6 is that it will always take all the dipoles/wigglers into account, while you can call find_orbit6 without dipole radiation (non-radiating machine), or with only some of them (why?). The TRACKING method will consider exactly what the user selects. For orbit guess, TRACKING is safer because it always matches the conditions for which the orbit is searched.

One could condition the 'integral' contribution of each dipole with its passmethod, but it would break the possibility of computing the energy loss independently of the radiation state of the lattice… It's nice to have all the lattice parameters available whatever the radiation state.

So given your patch, I would leave the defaults as they are. For marginal cases like the one you are mentioning, the user can still change the method: that's why the choice is proposed. Maybe a clear error message if the tracking fails would be helpful.

@swhite2401
Copy link
Contributor Author

So, this one is ok for merging?

@lfarv
Copy link
Contributor

lfarv commented Apr 5, 2022

@swhite2401 : yes, ok for me.

@swhite2401 swhite2401 marked this pull request as ready for review April 6, 2022 06:19
@swhite2401
Copy link
Contributor Author

Ok I merge

@swhite2401 swhite2401 merged commit 04886a2 into master Apr 6, 2022
@swhite2401 swhite2401 deleted the energy_loss_tracking branch April 6, 2022 06:24
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