Class EnergyVector

All Implemented Interfaces:
Serializable, IArchive

public class EnergyVector extends BaseVector<EnergyVector>

Class encapsulating the synchronous phase coordinates. These are the longitudinal coordinates of acceleration, the phase φ of the synchronous particle w.r.t. to the cavity RF and the energy W of the synchronous particle.

The position φ of the synchronous particle is the origin of the local coordinate frame that follows a particle beam bunch. The motions of beam particles are then w.r.t. the position and energy of the synchronous particle, are are usually described using a PhaseVector object.

The synchronous phase coordinates are represented in homogeneous coordinates so that they may be acted on by class SyncMatrix objects. In this manner translations are position using matrix multiplication. For example, instantaneous energy gains and phase jumps, such as those found in a thin lens model, can be represented by matrix multiplication.

Currently this class has minimal functionality. Additional capabilities should be added as necessary.

Since:
Oct 12, 2015
Author:
Christopher K. Allen
See Also:
  • Constructor Details

    • EnergyVector

      public EnergyVector()
      Zero argument constructor for EnergyVector.
      Since:
      Oct 12, 2015, Christopher K. Allen
    • EnergyVector

      public EnergyVector(double phi, double w)
      Initializing constructor for EnergyVector. The initial phase φ and energy W are given as arguments in the constructor.
      Parameters:
      phi - initial phase φ (in radians)
      w - initial energy W (in electron-Volts)
      Since:
      Oct 13, 2015, Christopher K. Allen
    • EnergyVector

      public EnergyVector(EnergyVector vecParent)
      Cloning constructor for EnergyVector.
      Parameters:
      vecParent - vector to be cloned and whose clone is then returned
      Since:
      Oct 12, 2015, Christopher K. Allen
    • EnergyVector

      public EnergyVector(String strTokens) throws IllegalArgumentException, NumberFormatException
      Initializing constructor for EnergyVector. The initial values for the vector are contained in the given string. The string should contain comma-separated values with enclosing parenthesis, brackets, or curly braces. For more information see BaseVector(int,String).
      Parameters:
      strTokens - formatted character string containing initial values, e.g., "{ φ W, 1 }"
      Throws:
      IllegalArgumentException - wrong number of token strings (make sure "1" is last value"
      NumberFormatException - bad number format, unreadable
      Since:
      Oct 12, 2015, Christopher K. Allen
      See Also:
    • EnergyVector

      public EnergyVector(double[] arrVals) throws ArrayIndexOutOfBoundsException
      Initializing constructor for class EnergyVector. The initial values for the created class are given by the double array of the argument. The array must have length 3 and have the last value as 1.
      Parameters:
      arrVals - double array { φ W, 1 }
      Throws:
      ArrayIndexOutOfBoundsException - the argument must have the same dimensions as this vector
      Since:
      Oct 12, 2015, Christopher K. Allen
    • EnergyVector

      public EnergyVector(DataAdaptor daSource)
      Initializing constructor for class EnergyVector. Initial values are taken from the given data source with DataAdaptor interface.
      Parameters:
      daSource - data source containing initial values
      Since:
      Oct 12, 2015, Christopher K. Allen
  • Method Details

    • setPhase

      public void setPhase(double phi)
      Sets the synchronous phase component of the phase variables.
      Parameters:
      phi - synchronous phase w.r.t. to RF phase (radians)
      Since:
      Oct 12, 2015, Christopher K. Allen
    • setEnergy

      public void setEnergy(double w)
      Sets the kinetic energy component of the synchronous phase variables.
      Parameters:
      w - kinetic energy (electron-Volts)
      Since:
      Oct 12, 2015, Christopher K. Allen
    • getPhase

      public double getPhase()
      Return the synchronous phase component of the synchronous phase vectors.
      Returns:
      synchronous phase w.r.t. to the RF phase (radians)
      Since:
      Oct 12, 2015, Christopher K. Allen
    • getEnergy

      public double getEnergy()
      Returns the energy component of the synchronous phase coordinates.
      Returns:
      kinetic energy (electron-Volts)
      Since:
      Oct 12, 2015, Christopher K. Allen
    • clone

      public EnergyVector clone()
      Description copied from class: BaseVector
      Base classes must override the clone operation in order to make deep copies of the current object. This operation cannot be done without the exact type.
      Specified by:
      clone in class BaseVector<EnergyVector>
      Since:
      Oct 12, 2015, Christopher K. Allen
      See Also:
    • newInstance

      protected EnergyVector newInstance(int size)
      Description copied from class: BaseVector
      Creates a new, uninitialized instance of this vector type.
      Specified by:
      newInstance in class BaseVector<EnergyVector>
      Returns:
      uninitialized vector object of type V
      Since:
      Oct 12, 2015, Christopher K. Allen
      See Also:
      • xal.tools.math.BaseVector#newInstance()
    • newInstance

      protected EnergyVector newInstance(double[] arrVecInit)
      Description copied from class: BaseVector
      Creates a new instance of this vector type with the given Java array as the internal representation.
      Specified by:
      newInstance in class BaseVector<EnergyVector>
      Parameters:
      arrVecInit - new vector's guts
      Returns:
      new instance of this vector type with the internal representation
      Since:
      Jan 20, 2016, Christopher K. Allen
      See Also: