Skip to content

Implement envelope tracker#112

Draft
austin-hoover wants to merge 84 commits into
PyORBIT-Collaboration:mainfrom
austin-hoover:env-tracker
Draft

Implement envelope tracker#112
austin-hoover wants to merge 84 commits into
PyORBIT-Collaboration:mainfrom
austin-hoover:env-tracker

Conversation

@austin-hoover

@austin-hoover austin-hoover commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

This PR implements an envelope/centroid tracker. We track the covariance matrix $\mathbf{\Sigma} = \langle \mathbf{x} \mathbf{x}^T \rangle$ and centroid $\mathbf{\mu} = \langle \mathbf{x} \rangle$, where $\mathbf{x} = [x, x', y, y', z, \Delta E ]^T$ is the 6D phase space vector.

Evolution equations:

$$ \begin{align} \mathbf{x} &\rightarrow \mathbf{M} \mathbf{x} + \mathbf{u} , \\ \mathbf{\mu} &\rightarrow \mathbf{M} \mathbf{\mu} + \mathbf{u} , \\ \mathbf{\Sigma} &\rightarrow \mathbf{M} \mathbf{\Sigma} \mathbf{M}^T . \end{align} $$

We track the $7 \times 7$ matrix $\mathbf{S} = \langle \mathbf{y} \mathbf{y}^T \rangle$, where $\mathbf{y} = [x, x', y, y', z, dE, 1]^T$:

$$ \mathbf{S} = \langle \mathbf{y} \mathbf{y}^T \rangle = \begin{bmatrix} \langle \mathbf{x} \mathbf{x}^T \rangle & \langle \mathbf{x} \rangle \\ \langle \mathbf{x} \rangle^T & 1 \end{bmatrix} = \begin{bmatrix} \mathbf{\Sigma} + \mathbf{\mu}\mathbf{\mu}^T & \mathbf{\mu} \\ \mathbf{\mu}^T & 1 \end{bmatrix} . $$

Evolution equations for $\mathbf{y}$:

$$ \begin{align} \mathbf{y} &\rightarrow \mathbf{N} \mathbf{y} , \\ \mathbf{S} &\rightarrow \mathbf{N} \mathbf{S} \mathbf{N}^T , \end{align} $$

where $\mathbf{N}$ is defined as

$$ \mathbf{N} = \begin{bmatrix} \mathbf{M} & \mathbf{u} \\ \mathbf{0} & 1 \end{bmatrix} . $$

Accelerator nodes and child nodes are mapped to transfer matrices at the Python level. An error is raised if the node is not recognized. Space charge is handled by assuming a uniform charge density within an ellipsoid in the $x$-$y$-$z$ plane (for 3D space charge) or within an ellipse in the $x$-$y$ plane (for 2D space charge).

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.

1 participant