Implement envelope tracker#112
Draft
austin-hoover wants to merge 84 commits into
Draft
Conversation
This will be used to set the correct particle mass and energy.
This method applies the linear transformation S -> M S M^T.
… into env-tracker
Replace these with identity matrix
Drift then kick (node has a length param)
Comparison is |a - b| <= atol + rtol * |b|
Keep only quads, drifts, bends
That should happen by tracking syncparticle through node
Drift length needs to be calculated for the part of the node, not the whole node
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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$ :
Evolution equations for$\mathbf{y}$ :
where$\mathbf{N}$ is defined as
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).