Skip to content

Commit 9492c19

Browse files
author
dquartul
committed
v1.15.0, see README.md for details.
1 parent 555bdd3 commit 9492c19

File tree

8 files changed

+316
-77
lines changed

8 files changed

+316
-77
lines changed

README.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ copied verbatim in the file LICENCE.md.
44
In applying this licence, CERN does not waive the privileges and immunities
55
granted to it by virtue of its status as an Intergovernmental Organization or
66
submit itself to any jurisdiction.
7-
Project website: http://blond.web.cern.ch/
87

98
CODE NAME
109
=========
@@ -16,46 +15,59 @@ DESCRIPTION
1615
===========
1716

1817
CERN code for the simulation of
19-
longitudinal beam dynamics with collective effects.
18+
longitudinal beam dynamics in synchrotrons.
2019

2120

2221
LINKS
2322
=====
2423

2524
Repository:
26-
https://gitlab.cern.ch/dquartul/BLonD
25+
https://github.com/dquartul/BLonD
2726

2827
Documentation:
29-
http://blond-documentation.web.cern.ch/
30-
28+
http://dquartul.github.io/BLonD/
29+
3130
Project website:
3231
http://blond.web.cern.ch
3332

3433

35-
DEVELOPERS
36-
==========
34+
CURRENT DEVELOPERS
35+
==================
3736

37+
Simon Albright (simon.albright (at) cern.ch)
38+
Konstantinos Iliakis (konstantinos.iliakis (at) cern.ch)
3839
Alexandre Lasheen (alexandre.lasheen (at) cern.ch)
3940
Juan Esteban Muller (juan.fem (at) cern.ch)
4041
Danilo Quartullo (danilo.quartullo (at) cern.ch)
42+
Joel Repond (joel.repond (at) cern.ch)
4143
Helga Timko (Helga.Timko (at) cern.ch)
4244

45+
PREVIOUS DEVELOPERS
46+
===================
47+
48+
Theodoros Argyropoulos
49+
4350

4451
STRUCTURE
4552
==========
4653

4754
1) the folder __TEST_CASES contains several main files which
4855
show how to use the principal features of the code;
49-
2) the __doc folder contains the source files for the documentation;
56+
2) the __doc folder contains the source files for the documentation on-line;
5057
3) the various packages which constitute the code;
51-
4) the setup_cpp and setup_cython files needed to compile the C++ and Cython
52-
files present in the corresponding packages respectively; these files
53-
should be run once before launching any simulation.
54-
The compiler C/C++ GCC (at least version 4.8) is necessary.
58+
4) setup_cpp.py is needed to compile all the C++ files present in the project;
59+
this file should be run once before launching any simulation.
60+
The compiler C++ GCC (at least version 4.8) is necessary.
61+
5) WARNINGS.txt contains useful information related to code usage.
5562

5663

5764
VERSION CONTENTS
5865
================
66+
2016-06-23
67+
v1.14.5 - RF modulation file added in llrf folder
68+
- documentation on-line for PSB phase loop added
69+
- setup_cython.py removed because not used
70+
5971
2016-06-21
6072
v1.14.4 - PSB phase loop and rf noise fixed
6173

__doc/source/llrf.rst

Lines changed: 51 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -388,19 +388,56 @@ Machine-dependent Beam Phase Loop
388388

389389

390390
.. py:method:: PSB():
391-
392-
Calculates the RF frequency correction :math:`\Delta \omega_{\mathsf{PL}}`
393-
from the phase difference between beam and RF
394-
:math:`\Delta \varphi_{\mathsf{PL}}` for the PSB. The transfer function is
391+
392+
Phase loop:
393+
394+
The transfer function of the system is
395395

396-
.. math:: \Delta \omega_{\mathsf{PL}} = 2 \pi g
397-
\frac{a_0 \Delta \varphi_{\mathsf{PL}}^2
398-
+ a_1 \Delta \varphi_{\mathsf{PL}} + a_2 }
399-
{\Delta \varphi_{\mathsf{PL}}^2
400-
- b_1 \Delta \varphi_{\mathsf{PL}} - b_2} .
401-
402-
Input :math:`g` through ``gain`` and the array
403-
:math:`[a_0, a_1, a_2, b_1, b_2]` through ``coefficients``.
404-
405-
396+
.. math:: H(z) = g \frac{b_{0}+b_{1} z^{-1}}{1 +a_{1} z^{-1}}
397+
398+
where g is the gain and :math:`b_{0} = 0.99901903`, :math:`b_{1} = -0.99901003`,
399+
:math:`a_{1} = -0.99803799`.
400+
401+
Let :math:`\Delta \phi_{PL}` and :math:`\Delta \omega_{PL}` be the
402+
phase difference and the phase loop correction on the frequency
403+
respectively; since these two quantities are the input and output of our
404+
system, then from the transfer function we
405+
have in time domain (see https://en.wikipedia.org/wiki/Z-transform):
406+
407+
.. math:: \Delta \omega_{PL}^{n+1} = - a_{1} \Delta \omega_{PL}^{n} +
408+
g(b_{0} \Delta \phi_{PL}^{n+1} + b_{1} \Delta \phi_{PL}^{n})
409+
410+
In fact the phase and radial loops act every 10 :math:`\mu s` and as a
411+
consequence :math:`\Delta \phi_{PL}` is an average on all the values
412+
between two trigger times.
413+
414+
Radial loop:
415+
416+
We estimate
417+
the difference of the radii of the actual trajectory and the desired trajectory
418+
using one of the four known differential relations with :math:`\Delta B = 0`:
419+
420+
.. math:: \frac{\Delta R}{R} = \frac{\Delta \omega_{RF}}{\omega_{RF}}
421+
\frac{\gamma^2}{\gamma_{T}^2-\gamma^2}
422+
423+
In reality the error :math:`\Delta R` is filtered with a PI (Proportional-
424+
Integrator) corrector. This means that
425+
426+
.. math:: \Delta \omega_{RL}^{n+1} = K_{P} \left(\frac{\Delta R}{R}\right)^{n}
427+
+ K_{I} \int_0^n \! \frac{\Delta R}{R} (t) \, \mathrm{d}t.
428+
429+
Writing the same equation for :math:`\Delta \omega_{RL}^{n}` and
430+
subtracting side by side we have
431+
432+
.. math:: \Delta \omega_{RL}^{n+1} = \Delta \omega_{RL}^{n} +
433+
K_{P} \left[ \left(\frac{\Delta R}{R}\right)^{n} -
434+
\left(\frac{\Delta R}{R}\right)^{n-1} \right] + K_{I}^{'}
435+
\left(\frac{\Delta R}{R}\right)^{n}
436+
437+
here :math:`K_{I}^{'} = K_{I} 10 \mu s` and we approximated the integral
438+
with a simple product.
439+
440+
The total correction is then
441+
442+
.. math:: \Delta \omega_{RF}^{n+1} = \Delta \omega_{PL}^{n+1} + \Delta \omega_{RL}^{n+1}
406443

__doc/source/setup_cpp.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
setup_cpp module
2+
================
3+
4+
.. automodule:: setup_cpp
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:

__doc/source/toolbox.rst

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
toolbox package
2+
===============
3+
4+
Submodules
5+
----------
6+
7+
toolbox.action module
8+
---------------------
9+
10+
.. automodule:: toolbox.action
11+
:members:
12+
:undoc-members:
13+
:show-inheritance:
14+
15+
toolbox.diffusion module
16+
------------------------
17+
18+
.. automodule:: toolbox.diffusion
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:
22+
23+
toolbox.parameter_scaling module
24+
--------------------------------
25+
26+
.. automodule:: toolbox.parameter_scaling
27+
:members:
28+
:undoc-members:
29+
:show-inheritance:
30+
31+
toolbox.tomoscope module
32+
------------------------
33+
34+
.. automodule:: toolbox.tomoscope
35+
:members:
36+
:undoc-members:
37+
:show-inheritance:
38+
39+
40+
Module contents
41+
---------------
42+
43+
.. automodule:: toolbox
44+
:members:
45+
:undoc-members:
46+
:show-inheritance:

llrf/phase_loop.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -427,13 +427,7 @@ def LHC(self):
427427

428428
def PSB(self):
429429
'''
430-
Calculation of the PSB RF frequency correction from the phase difference
431-
between beam and RF (actual synchronous phase). The transfer function is
432-
433-
.. math::
434-
\\Delta \\omega_{RF} = g(t) \\frac{a_0 \\Delta\\Phi_{PL}^2 + a_1 \\Delta\\Phi_{PL} + a_2 }{b_0 \\Delta\\Phi_{PL}^2 + b_1 \\Delta\\Phi_{PL} + b_2}
435-
436-
Input g through gain and [a_0, a_1, a_2, b_0, b_1, b_2] through coefficients.
430+
Phase and radial loops for PSB. See documentation on-line for details.
437431
'''
438432

439433
# Average phase error while frequency is updated
@@ -450,8 +444,8 @@ def PSB(self):
450444
self.dphi_av = self.dphi_sum / (self.on_time[self.PL_counter]
451445
- self.on_time[self.PL_counter-1])
452446

453-
self.domega_PL = 0.998*self.domega_PL \
454-
- self.gain[counter]*(self.dphi_av - self.dphi_av_prev)
447+
self.domega_PL = 0.99803799*self.domega_PL \
448+
- self.gain[counter]*(0.99901903*self.dphi_av - 0.99901003*self.dphi_av_prev)
455449

456450
self.dphi_av_prev = self.dphi_av
457451
self.dphi_sum = 0.

0 commit comments

Comments
 (0)