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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PA
Collective Effects
mbtrack2
Commits
e219c264
Commit
e219c264
authored
Feb 19, 2021
by
Gamelin Alexis
Browse files
Options
Downloads
Patches
Plain Diff
Add the contribution of dispersion when bunch/beam is initialized
parent
797693e5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tracking/particles.py
+20
-12
20 additions, 12 deletions
tracking/particles.py
with
20 additions
and
12 deletions
tracking/particles.py
+
20
−
12
View file @
e219c264
...
@@ -252,9 +252,8 @@ class Bunch:
...
@@ -252,9 +252,8 @@ class Bunch:
def
init_gaussian
(
self
,
cov
=
None
,
mean
=
None
,
**
kwargs
):
def
init_gaussian
(
self
,
cov
=
None
,
mean
=
None
,
**
kwargs
):
"""
"""
Initialize bunch particles with 6D gaussian phase space.
Initialize bunch particles with 6D gaussian phase space.
Covariance matrix is taken from [1].
Covariance matrix is taken from [1] and dispersion is added following
the method explained in [2].
!!! -> disp & dispp not included yet.
Parameters
Parameters
----------
----------
...
@@ -267,6 +266,7 @@ class Bunch:
...
@@ -267,6 +266,7 @@ class Bunch:
----------
----------
[1] Wiedemann, H. (2015). Particle accelerator physics. 4th
[1] Wiedemann, H. (2015). Particle accelerator physics. 4th
edition. Springer, Eq.(8.38) of p223.
edition. Springer, Eq.(8.38) of p223.
[2] http://www.pp.rhul.ac.uk/bdsim/manual-develop/dev_beamgeneration.html
"""
"""
if
mean
is
None
:
if
mean
is
None
:
...
@@ -278,14 +278,22 @@ class Bunch:
...
@@ -278,14 +278,22 @@ class Bunch:
optics
=
kwargs
.
get
(
"
optics
"
,
self
.
ring
.
optics
)
optics
=
kwargs
.
get
(
"
optics
"
,
self
.
ring
.
optics
)
cov
=
np
.
zeros
((
6
,
6
))
cov
=
np
.
zeros
((
6
,
6
))
cov
[
0
,
0
]
=
self
.
ring
.
emit
[
0
]
*
optics
.
local_beta
[
0
]
cov
[
0
,
0
]
=
self
.
ring
.
emit
[
0
]
*
optics
.
local_beta
[
0
]
+
(
optics
.
local_dispersion
[
0
]
*
self
.
ring
.
sigma_delta
)
**
2
cov
[
1
,
1
]
=
self
.
ring
.
emit
[
0
]
*
optics
.
local_gamma
[
0
]
cov
[
1
,
1
]
=
self
.
ring
.
emit
[
0
]
*
optics
.
local_gamma
[
0
]
+
(
optics
.
local_dispersion
[
1
]
*
self
.
ring
.
sigma_delta
)
**
2
cov
[
0
,
1
]
=
-
1
*
self
.
ring
.
emit
[
0
]
*
optics
.
local_alpha
[
0
]
cov
[
0
,
1
]
=
-
1
*
self
.
ring
.
emit
[
0
]
*
optics
.
local_alpha
[
0
]
+
(
optics
.
local_dispersion
[
0
]
*
optics
.
local_dispersion
[
1
]
*
self
.
ring
.
sigma_delta
**
2
)
cov
[
1
,
0
]
=
-
1
*
self
.
ring
.
emit
[
0
]
*
optics
.
local_alpha
[
0
]
cov
[
1
,
0
]
=
-
1
*
self
.
ring
.
emit
[
0
]
*
optics
.
local_alpha
[
0
]
+
(
optics
.
local_dispersion
[
0
]
*
optics
.
local_dispersion
[
1
]
*
self
.
ring
.
sigma_delta
**
2
)
cov
[
2
,
2
]
=
self
.
ring
.
emit
[
1
]
*
optics
.
local_beta
[
1
]
cov
[
0
,
5
]
=
optics
.
local_dispersion
[
0
]
*
self
.
ring
.
sigma_delta
**
2
cov
[
3
,
3
]
=
self
.
ring
.
emit
[
1
]
*
optics
.
local_gamma
[
1
]
cov
[
5
,
0
]
=
optics
.
local_dispersion
[
0
]
*
self
.
ring
.
sigma_delta
**
2
cov
[
2
,
3
]
=
-
1
*
self
.
ring
.
emit
[
1
]
*
optics
.
local_alpha
[
1
]
cov
[
1
,
5
]
=
optics
.
local_dispersion
[
1
]
*
self
.
ring
.
sigma_delta
**
2
cov
[
3
,
2
]
=
-
1
*
self
.
ring
.
emit
[
1
]
*
optics
.
local_alpha
[
1
]
cov
[
5
,
1
]
=
optics
.
local_dispersion
[
1
]
*
self
.
ring
.
sigma_delta
**
2
cov
[
2
,
2
]
=
self
.
ring
.
emit
[
1
]
*
optics
.
local_beta
[
1
]
+
(
optics
.
local_dispersion
[
2
]
*
self
.
ring
.
sigma_delta
)
**
2
cov
[
3
,
3
]
=
self
.
ring
.
emit
[
1
]
*
optics
.
local_gamma
[
1
]
+
(
optics
.
local_dispersion
[
3
]
*
self
.
ring
.
sigma_delta
)
**
2
cov
[
2
,
3
]
=
-
1
*
self
.
ring
.
emit
[
1
]
*
optics
.
local_alpha
[
1
]
+
(
optics
.
local_dispersion
[
2
]
*
optics
.
local_dispersion
[
3
]
*
self
.
ring
.
sigma_delta
**
2
)
cov
[
3
,
2
]
=
-
1
*
self
.
ring
.
emit
[
1
]
*
optics
.
local_alpha
[
1
]
+
(
optics
.
local_dispersion
[
2
]
*
optics
.
local_dispersion
[
3
]
*
self
.
ring
.
sigma_delta
**
2
)
cov
[
2
,
5
]
=
optics
.
local_dispersion
[
2
]
*
self
.
ring
.
sigma_delta
**
2
cov
[
5
,
2
]
=
optics
.
local_dispersion
[
2
]
*
self
.
ring
.
sigma_delta
**
2
cov
[
3
,
5
]
=
optics
.
local_dispersion
[
3
]
*
self
.
ring
.
sigma_delta
**
2
cov
[
5
,
3
]
=
optics
.
local_dispersion
[
3
]
*
self
.
ring
.
sigma_delta
**
2
cov
[
4
,
4
]
=
sigma_0
**
2
cov
[
4
,
4
]
=
sigma_0
**
2
cov
[
5
,
5
]
=
sigma_delta
**
2
cov
[
5
,
5
]
=
sigma_delta
**
2
...
...
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