Class EnergyVector
- All Implemented Interfaces:
Serializable
,IArchive
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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enumeration for the element position indices for homogeneous phase space objects. -
Field Summary
Fields inherited from class xal.tools.math.BaseVector
ATTR_DATA
-
Constructor Summary
ConstructorsConstructorDescriptionZero argument constructor forEnergyVector
.EnergyVector
(double[] arrVals) Initializing constructor for classEnergyVector
.EnergyVector
(double phi, double w) Initializing constructor forEnergyVector
.EnergyVector
(String strTokens) Initializing constructor forEnergyVector
.EnergyVector
(EnergyVector vecParent) Cloning constructor forEnergyVector
.EnergyVector
(DataAdaptor daSource) Initializing constructor for classEnergyVector
. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Base classes must override the clone operation in order to make deep copies of the current object.double
Returns the energy component of the synchronous phase coordinates.double
getPhase()
Return the synchronous phase component of the synchronous phase vectors.protected EnergyVector
newInstance
(double[] arrVecInit) Creates a new instance of this vector type with the given Java array as the internal representation.protected EnergyVector
newInstance
(int size) Creates a new, uninitialized instance of this vector type.void
setEnergy
(double w) Sets the kinetic energy component of the synchronous phase variables.void
setPhase
(double phi) Sets the synchronous phase component of the phase variables.Methods inherited from class xal.tools.math.BaseVector
assignUnity, assignZero, copyVector, embedIn, equals, getArrayCopy, getElem, getElem, getSize, getVector, hashCode, innerProd, isEquivalentTo, leftMultiply, load, minus, minusEquals, negate, negateEquals, newInstance, norm1, norm2, normInf, plus, plusEquals, print, print, println, projectOnto, rightMultiply, save, setElem, setElem, setVector, setVector, setVector, times, timesEquals, toString
-
Constructor Details
-
EnergyVector
public EnergyVector()Zero argument constructor forEnergyVector
.- Since:
- Oct 12, 2015, Christopher K. Allen
-
EnergyVector
public EnergyVector(double phi, double w) Initializing constructor forEnergyVector
. 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
Cloning constructor forEnergyVector
.- Parameters:
vecParent
- vector to be cloned and whose clone is then returned- Since:
- Oct 12, 2015, Christopher K. Allen
-
EnergyVector
Initializing constructor forEnergyVector
. 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
Initializing constructor for classEnergyVector
. 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
Initializing constructor for classEnergyVector
. Initial values are taken from the given data source withDataAdaptor
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
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 classBaseVector<EnergyVector>
- Since:
- Oct 12, 2015, Christopher K. Allen
- See Also:
-
newInstance
Description copied from class:BaseVector
Creates a new, uninitialized instance of this vector type.- Specified by:
newInstance
in classBaseVector<EnergyVector>
- Returns:
- uninitialized vector object of type
V
- Since:
- Oct 12, 2015, Christopher K. Allen
- See Also:
-
xal.tools.math.BaseVector#newInstance()
-
newInstance
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 classBaseVector<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:
-