Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mbtrack2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PA
Collective Effects
mbtrack2
Commits
09a96856
Commit
09a96856
authored
3 years ago
by
Gamelin Alexis
Browse files
Options
Downloads
Patches
Plain Diff
Remove energy_change from Bunch
Not needed any more due the SynchrotronRadiation change.
parent
66874533
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tracking/particles.py
+0
-25
0 additions, 25 deletions
tracking/particles.py
tracking/rf.py
+1
-5
1 addition, 5 deletions
tracking/rf.py
with
1 addition
and
30 deletions
tracking/particles.py
+
0
−
25
View file @
09a96856
...
...
@@ -86,11 +86,6 @@ class Bunch:
coordinates.
emit : array of shape (3,)
Bunch emittance for each plane [1]. !!! -> Correct for long ?
energy_change : series of shape (alive,)
Store the particle relative energy change in the last turn. Only the
values for alive particles are returned. Used by the
SynchrotronRadiation class to compute radiation damping. To be changed
by Element objects which change the energy, for example RF cavities.
Methods
-------
...
...
@@ -128,8 +123,6 @@ class Bunch:
self
.
current
=
current
if
not
alive
:
self
.
alive
=
np
.
zeros
((
self
.
mp_number
,),
dtype
=
bool
)
self
.
_energy_change
=
np
.
zeros
((
self
.
mp_number
,),
dtype
=
float
)
def
__len__
(
self
):
"""
Return the number of alive particles
"""
...
...
@@ -243,24 +236,6 @@ class Bunch:
(
self
.
ring
.
optics
.
local_beta
*
np
.
mean
(
self
[
'
yp
'
]
**
2
))
return
np
.
array
((
Jx
,
Jy
))
@property
def
energy_change
(
self
):
"""
Store the particle relative energy change in the last turn. Used by
the SynchrotronRadiation class to compute radiation damping. To be
changed by Element objects which change the energy, for example RF
cavities.
"""
if
self
.
track_alive
is
True
:
return
self
.
_energy_change
[
self
.
alive
]
else
:
return
self
.
_energy_change
@energy_change.setter
def
energy_change
(
self
,
value
):
if
self
.
track_alive
is
True
:
self
.
_energy_change
[
self
.
alive
]
=
value
else
:
self
.
_energy_change
=
value
def
init_gaussian
(
self
,
cov
=
None
,
mean
=
None
,
**
kwargs
):
"""
Initialize bunch particles with 6D gaussian phase space.
...
...
This diff is collapsed.
Click to expand it.
tracking/rf.py
+
1
−
5
View file @
09a96856
...
...
@@ -44,12 +44,8 @@ class RFCavity(Element):
----------
bunch : Bunch or Beam object
"""
energy_change
=
self
.
Vc
/
self
.
ring
.
E0
*
np
.
cos
(
bunch
[
"
delta
"
]
+
=
self
.
Vc
/
self
.
ring
.
E0
*
np
.
cos
(
self
.
m
*
self
.
ring
.
omega1
*
bunch
[
"
tau
"
]
+
self
.
theta
)
bunch
[
"
delta
"
]
+=
energy_change
# energy_change is used by SynchrotronRadiation to compute radiation
# damping
bunch
.
energy_change
+=
energy_change
def
value
(
self
,
val
):
return
self
.
Vc
/
self
.
ring
.
E0
*
np
.
cos
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment