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.
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
Add particle species in Beam classes and update tracking methods #276
base: master
Are you sure you want to change the base?
Add particle species in Beam classes and update tracking methods #276
Changes from 50 commits
213e7af
cbcbd4c
b41181b
5f9c19d
89d1740
eb82c49
9565b73
d49781e
7cdb3f3
489ebb2
30cf6a5
a620f4e
741232f
1a2976d
a3570ff
691490b
ddcac5f
d137d58
10dd222
262433f
de73cbd
e98ef0b
768871b
5005675
12a3d89
d74fc78
09cd0d3
a352ea0
c5e1ab8
9275cd9
7e8d653
8ee1044
d54d63b
957b347
6491a32
6a63bb7
1537d7b
c582310
992fa11
981f825
00c65a6
5963602
15cc15c
3ace4b3
9f1adf3
1d82517
9b7fc4e
7bffd7e
4d170fe
d4cf841
ea6467c
77db2be
4dd0484
eb8acd1
31fc324
5845d4c
f668971
dd095a1
e37a26e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This seems counterintuitive. Is this effect caused by us measuring energy in eV such that we cannot just set
voltage = energy gain
for non-unit charge particles?This might especially lead to issues if we import lattices from external files. In that case the converter would have to know the intended particle species and adjust all voltages.
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.
@cr-xu what do you think?
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.
Yes, I thought that confusing too at the beginning.
I went with this convention exactly due to the compatibility with the converters. Because Bmad also defines the voltage as the effective voltage for the ref. particle
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.
So @cr-xu you think we are fine as we are and won't run into problems when simulating other species?
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.
I think it's in the end a design choice... I see this convention (effective voltage rather than the physical one) as consistent with other normalized field strengths like$k_1$ for quadrupoles etc.
We can also just use the physical voltage,and just document/comment that extra caution is needed if they want to have non-unit charged particles.
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.
I have no opinion on this. I just want to know if this is okay to merge 😄
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.
@Hespe Actually now the
voltage = total energy gain
for non-unit charged particles. Setting the voltage to physical voltage would mean thattotal energy gain = voltage * q
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.
Yes, that is what I meant. For non-unit charged particles, we would have to take the charge into account to calculate the energy gain.
I think your argument that the cavity is particle independent is what I would have thought before. Otherwise you would have to know the particle you are going to simulate the correctly configure the
Cavity
element.