-
Notifications
You must be signed in to change notification settings - Fork 16
Extension: Danilov distribution envelope solver #81
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
Extension: Danilov distribution envelope solver #81
Conversation
This commit adds DanilovEnvelopeSolver20 and DanilovEnvelopeSolver22 C++ classes
and Python wrappers. These classes track the envelope of the {2, 0} and {2, 2}
Danilov distribution using the first 1/2 particles in a Bunch object. The rest
of the particles are test particles tracked in the field of the uniform density
ellipse.
Has not been debugged
Initial attempt to add transfer matrix analysis and benchmark
There seems to be an error when setting the twiss parameters. The alpha_lx parameter has the wrong sign. This is causing matching iterations to diverge.
|
we will put into core but in some different namespace |
|
Clarification: this is solving a system of ODEs describing envelope of equilibrium distributions in linear focusing fields; it is not a space charge calculator that can be used for Jeff's approach uses the PyORBIT tracking directly to integrate the ODE. There is another approach that extracts linear focusing terms from the lattice and solves the ODE at the Python level. Actually this is implemented in PyORBIT for KV distribution here: https://github.com/PyORBIT-Collaboration/PyORBIT3/blob/main/py/orbit/matching/matching.py, but I don't know if this module is ever used. Jeff's approach can also be adapted to study particle-core modules without much trouble. Another approach is to directly track a However, ODE integration of exact envelope equations can also be used for envelope tracking, and it can be used for theoretical studies of beam dynamics. Thus, I think it makes sense to have these ODE solvers available under an |
Not compatible with Python 3.10
Compilation successful
And same for other solvers
Compiled and able to import from orbit.core.envelope
Background
This PR adds an extension to propagate the covariance matrix of a "Danilov" distribution. The distributions are described in Ref. [1]. They are labeled with the notation${N, M}$ , where N is the dimension of the space (1, 2, or 3) and $0 \le M \le N$ . This envelope solver considers the ${2, 0}$ and ${2, 2}$ distributions. The ${2, 0}$ is the familiar KV distribution, with no linear correlations between $x$ and $y$ . The ${2, 2}$ distribution is the limit of the KV distribution as one plane becomes "cold", i.e., as one of the emittances goes to zero, in an arbitrary x-y coupled coordinate system.
Implementation
The implementation was developed by Jeff Holmes (ORNL, retired). For the${2, 0}$ distribution (upright KV) the beam ellipse radii $a$ and $b$ in Eq. (33) are interpreted as the $x$ and $y$ coordinates of a fictitious particle. Space charge then acts as a nonlinear driving term in the equation of motion. This is implemented in PyORBIT by tracking a ${2, 2}$ distribution in Eq. (40). Now we track two particles, and again compute a nonlinear driving term from the tilted beam ellipse parameters.
Bunchwith a single particle. Although the external fields are nonlinear in PyORBIT, the method will work as long as they are approximately linear. A similar approach is taken with theChanges
/ext/danilov_envelope: https://github.com/austin-hoover/pyorbit/tree/danilov-envelope/ext/danilov_envelope/py/orbit/danilov_envelope: https://github.com/austin-hoover/pyorbit/tree/danilov-envelope/py/orbit/danilov_envelope. Perhaps there should be anextfolder for Python files?If this PR is not merged, it will still be useful to locate the extension on my fork.
References
[1] https://journals.aps.org/prab/pdf/10.1103/PhysRevSTAB.6.094202