Class CalculationsOnParticles

java.lang.Object
xal.tools.beam.calc.CalculationEngine
xal.tools.beam.calc.CalculationsOnParticles
All Implemented Interfaces:
ISimulationResults, ISimulationResults.ISimLocResults<ParticleProbeState>

public class CalculationsOnParticles extends CalculationEngine implements ISimulationResults.ISimLocResults<ParticleProbeState>

Provides processing functions appropriate for single particle simulation data.

Additional class methods provide access to computed quantities used by the class for the above processing, such as the "periodic fixed orbit", "periodic betatron phase advance", and "period matched Twiss parameter". These parameters make not make sense here, as we make the very broad assumption that the particle is in a periodic system and the simulation data is taken about n periods, but they are available.

Since:
Nov 14, 2013
Version:
Sep 25, 2014
Author:
Christopher K. Allen
  • Constructor Details

    • CalculationsOnParticles

      public CalculationsOnParticles(Trajectory<ParticleProbeState> datSim)
      Constructor for CalculationsOnParticles. Creates a new CalculationsOnParticles object for process the simulation data contained in the given particle trajectory object.
      Parameters:
      datSim - simulation data for a particle
      Since:
      Nov 14, 2013
  • Method Details

    • getTrajectory

      public Trajectory<ParticleProbeState> getTrajectory()
      Returns the simulation trajectory from which all the machine properties are computed.
      Returns:
      simulation trajectory from which this object was initialized
      Since:
      Nov 7, 2013
    • getFullResponseMatrix

      public PhaseMatrix getFullResponseMatrix()
      Returns the full response matrix Φ providing the sensitivity of the final particle position z to the initial conditions z0.
      Returns:
      the response matrix Φ = ∂z/∂z0
      Since:
      Nov 7, 2013
    • periodBetatronPhaseAdvance

      public R3 periodBetatronPhaseAdvance()

      Returns the betatron phase advances from the simulation beginning to end (which are computed at instantiation). The results are value for trajectories near the simulation trajectory associated with this computation engine. The fact being from the use of the response matrix in the calculations.

      The returned value is the calculation CalculationEngine.calculatePhaseAdvPerCell(PhaseMatrix) of the super class, and thus assumes simulation trajectory is that for at least one period of a periodic structure.

      NOTES:

      · The betatron phase advances are given in the range [0,2&pi];.

      Returns:
      vector particle betatron phase advances (in radians)
      Since:
      Oct 30, 2013
    • periodFixedOrbitPt

      public PhaseVector periodFixedOrbitPt()

      Returns the phase space location of the fixed point at the simulation start (which is computed at instantiation) assuming the simulation is that for at least one period of a periodic accelerating or transport section. That is, we assume the beamline is periodic and the returned value is an invariant particle position under the action of the response matrix.

      The returned value z is the result of the calculation CalculationEngine.calculateFixedPoint(PhaseMatrix) given the full response matrix Φ at the simulation exit (see getFullResponseMatrix()). It is invariant under the action of Φ, that is, Φz = z.

      NOTES:

      · The entrance and exit of the beamline should have the same fixed point value.

      Returns:
      Since:
      Oct 30, 2013
    • periodMatchedTwiss

      public Twiss[] periodMatchedTwiss()

      Returns the matched Courant-Snyder parameters at the entrance of the simulation assuming the simulation is at least one period of a periodic structure. These are the "envelopes" taken from the "closed envelope" solution under the assume the linac is a periodic transport.

      Note that emittance ε is the parameter used to describe the extend of the actual beam (rather than the normalized size β), or "acceptance". Thus it cannot be computed here and NaN is returned instead.

      NOTES:

      · The entrance of the simulation is assumed to be the location of the first and last states of the solution trajectory.

      Returns:
      array of Twiss parameter sets (α, β, NaN)
      Since:
      Oct 30, 2013
    • computeCoordinatePosition

      public PhaseVector computeCoordinatePosition(ParticleProbeState state)
      Simply returns the location of the simulated particle at the location of the give state. No real computation necessary.
      Specified by:
      computeCoordinatePosition in interface ISimulationResults.ISimLocResults<ParticleProbeState>
      Parameters:
      state - simulation state where parameters are computed
      Returns:
      vector (x,x',y,y',z,z',1) of phase space coordinates
      Since:
      Nov 14, 2013
      See Also:
      • xal.tools.beam.calc.ISimEnvResults#computeCoordinatePosition(xal.model.probe.traj.ProbeState)
    • computeFixedOrbit

      public PhaseVector computeFixedOrbit(ParticleProbeState state)

      IMPORTANT NOTE

      This method has been modified so it returns exactly the same value as computeCoordinatePosition(ParticleProbeState). This modification is maintain compatibility with the previous use of computeFixedOrbit() presented by the trajectory classes for particles, beam envelopes, etc. They responded differently depending upon whether the structure producing the simulation data was from a ring or a linear transport/accelerator structure.

      Thus, ignore all commenting below!

      Consider first the point in phase space that is invariant under repeated application of the response matrix Φ for the entire beamline or ring. This is under the condition that we decompose Φ into its homogeneous and non-homogeneous components. A particle entering the linac at that location exits at the same location.

      To compute this linac fixed point, recall that the homogeneous response matrix Φ for the beamline (or full-turn matrix for a ring) has final row that represents the translation Δ of the particle under the action of Φ. The 6×6 sub-matrix of Φ represents the (linear) action of the bending magnetics and quadrupoles and corresponds to the matrix TR6×6 (here T is linear). Thus, we can write the linear operator Φ as the augmented system

           Φ = |T Δ |,   z ≡ |p| ,
               |0 1 |        |1|
       
      where p is the projection of z into the embedded phase space R6 (without homogeneous coordinate). coordinates).

      Putting this together we get

          Φz = Tp + Δ = p ,

      to which the solution is

          p = -(T - I)-1Δ

      assuming it exists. The question of solution existence falls upon the resolvent R ≡ (T - I)-1 of T. By inspection we can see that p is defined so long as the eigenvalues of T are located away from 1. In this case the returned value is the augmented vector (p 1)TR6 × {1}.

      When the set of eigenvectors does contain 1, we attempt to find the solution for the transverse phase space. That is, we take vector pR4 and TR4×4 where T = proj4×4 Φ. The solution value is then z = (p 0 0 1)T.

      Once we have the fixed point z0 for the linac we compute the trajectory of the fixed point at the location of the given probe state. To do so, we multiply z0 by the response matrix Φn for the given probe state. That is, we propagate the fixed point of the linac from the linac entrance to the location of the given phase state.

      Specified by:
      computeFixedOrbit in interface ISimulationResults.ISimLocResults<ParticleProbeState>
      Parameters:
      state - simulation state where parameters are computed
      Returns:
      The quantity Φnz0, the linac fixed point z0 propagated to the state location sn
      Since:
      Nov 14, 2013
      See Also:
      • xal.tools.beam.calc.ISimEnvResults#computeFixedOrbit(xal.model.probe.traj.ProbeState)
    • computeChromAberration

      public PhaseVector computeChromAberration(ParticleProbeState state)
      Computes the chromatic aberration for one pass of the particle around the ring starting at the given state location, or for a beamline the entrance of the line to this state position. The returned vector is the displacement from the closed orbit caused by a unit momentum offset (δp = 1). See the documentation in ISimLocResults#computeChromAberration(ProbeState) for a more detailed exposition.
      Specified by:
      computeChromAberration in interface ISimulationResults.ISimLocResults<ParticleProbeState>
      Parameters:
      state - simulation state where parameters are computed
      Returns:
      the vector Δ of dispersion coefficients
      Since:
      Nov 14, 2013
      See Also:
      • xal.tools.beam.calc.ISimLocResults#computeChromAberration(xal.model.probe.traj.ProbeState)