Skip to content

Conversation

@austin-hoover
Copy link
Contributor

@austin-hoover austin-hoover commented Sep 5, 2025

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 Bunch with 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 the ${2, 2}$ distribution in Eq. (40). Now we track two particles, and again compute a nonlinear driving term from the tilted beam ellipse parameters.

Changes

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

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.
@azukov
Copy link
Member

azukov commented Sep 11, 2025

we will put into core but in some different namespace orbit.core.envelope

@austin-hoover
Copy link
Contributor Author

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 Bunch objects.

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 CovarianceMatrix object, assuming linear space charge forces: #51. That is ultimately the preferred approach for envelope tracking.

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 orbit.envelope module.

@austin-hoover austin-hoover marked this pull request as draft September 11, 2025 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants