public class CovarianceMatrix extends PhaseMatrix
A CovarianceMatrix
in homogeneous coordinates represents
all moments of a phase space distribution up to and include second order. This is
seen by taken the moment of the outer product of two phase vectors. We find
<zzT> = | <xx> <xx' <xy> <xy'> <xz> <xz'> <x> | | <x'x> <x'x'> <x'y> <x'y'> <x'z> <x'z'> <x'> | | <yx> <yx'> <yy> <yy'> <yz> <yz'> <y> | | <y'x> <y'x'> <y'y> <y'y'> <y'z> <y'z'> <y'> | | <zx> <zx'> <zy> <zy'> <zz> <zz'> <z> | | <z'x> <z'x'> <z'y> <z'y> <z'z> <z'z'> <z'> | | <x> <x> <y> <y> <z> <z> <1> |where x', y', z' represent the momentum coordinate in the x, y, and z directions, respectively.
Note that the covariance matrix is not necessarily centralized. Specifically, if the beam is off axis, then at least one of the moments <x>, <y>, <z> is non-zero and the corresponding second-order moments will be skewed. Likewise, if the beam has a coherent drift in some direction, then the moments <x'>, <y'>, <z'> will have at least one nonlinear value. There are methods in this class for returning centralized moments when such quantities are needed.
Note that the covariance matrix is not necessarily centralized. Specifically, if the beam is off axis, then at least one of the moments <x>, <y>, <z> is non-zero and the corresponding second-order moments will be skewed. Likewise, if the beam has a coherent drift in some direction, then the moments <xp>, <yp>, <zp> will have at least one nonlinear value. There are methods in this class for returning centralized moments when such quantities are needed.
PhaseMatrix.IND
IND_HOM, IND_X, IND_XP, IND_Y, IND_YP, IND_Z, IND_ZP, INT_SIZE
ATTR_DATA, matImpl
Constructor and Description |
---|
CovarianceMatrix()
Constructor for CovarianceMatrix.
|
CovarianceMatrix(PhaseMatrix matInit)
Constructor for CovarianceMatrix.
|
CovarianceMatrix(java.lang.String strTokens)
Constructor for CovarianceMatrix.
|
Modifier and Type | Method and Description |
---|---|
static CovarianceMatrix |
buildCovariance(Twiss3D envTwiss)
Create and return a
CovarianceMatrix built according to the
given set of Twiss parameters. |
static CovarianceMatrix |
buildCovariance(Twiss twissX,
Twiss twissY,
Twiss twissZ)
Create a PhaseMatrix that is the correlation matrix corresponding
to the given Twiss parameters.
|
static CovarianceMatrix |
buildCovariance(Twiss twissX,
Twiss twissY,
Twiss twissZ,
PhaseVector vecCen)
Create a CovarianceMatrix corresponding to the given Twiss parameters and
having the given mean values (centroid location).
|
CovarianceMatrix |
clone()
Creates and returns a deep copy of this matrix.
|
CovarianceMatrix |
computeCentralCovariance()
Compute and return the covariance matrix of the distribution.
|
double |
computeCentralCovXX()
Compute and return the covariance value of the xx phase space
coordinate monomial.
|
double |
computeCentralCovXY()
Compute and return the covariance value of the xy phase space
coordinate monomial.
|
double |
computeCentralCovXZ()
Compute and return the covariance value of the xz phase space
coordinate monomial.
|
double |
computeCentralCovYY()
Compute and return the covariance value of the yy phase space
coordinate monomial.
|
double |
computeCentralCovYZ()
Compute and return the covariance value of the yz phase space
coordinate monomial.
|
double |
computeCentralCovZZ()
Compute and return the covariance value of the zz phase space
coordinate monomial.
|
double[] |
computeRmsEmittances()
Return the x,y,z plane rms emittance of the beam Units: radian-meters
NOTE:
This method ignores any coupling between phase planes and any offsets of the
beam centroid from the beam axis.
|
R3x3 |
computeSpatialCovariance()
Compute and return the 3x3 symmetric matrix of all centralized spatial covariance
values.
|
Twiss[] |
computeTwiss()
Return the Twiss parameters for each plane that correspond to the current
correlation matrix.
|
void |
forceRmsEmittances(double[] arrEmitNew)
(Re)sets the rms emittances for the beam.
|
PhaseVector |
getMean()
Return the phase space coordinates of the centroid in homogeneous coordinates.
|
double |
getMeanX()
Return the mean value of the x phase variable.
|
double |
getMeanY()
Return the mean value of the y phase variable.
|
double |
getMeanZ()
Return the mean value of the z phase variable.
|
double |
getSigmaX()
Compute and return the standard deviation of the x phase variable
|
double |
getSigmaY()
Compute and return the standard deviation of the y phase variable
|
double |
getSigmaZ()
Compute and return the standard deviation of the z phase variable
|
static CovarianceMatrix |
newCenter(PhaseVector vecCen)
Create a "center matrix" corresponding the given mean values
(centroid location).
|
static CovarianceMatrix |
newIdentity()
Create an identity correlation matrix
|
protected PhaseMatrix |
newInstance()
Handles object creation required by the base class.
|
static CovarianceMatrix |
newZero()
Create a new instance of a zero phase matrix.
|
homogenize, identity, max, minus, minusEquals, norm1, norm2, normF, normInf, parse, plus, plusEquals, projectColumn, projectColumn, projectR4x4, projectR6x6, projectRow, projectRow, rotationProduct, setElem, spatialTranslation, translation, zero
assignIdentity, conjugateInv, conjugateTrans, det, getSize, inverse, isEquivalentTo, isSymmetric, setElem, solve, solveInPlace, times, times, times, timesEquals, timesEquals, transpose
assignMatrix, assignZero, conditionNumber, copy, equals, getArrayCopy, getColCnt, getElem, getElem, getMatrix, getRowCnt, hashCode, load, newInstance, print, save, setElem, setMatrix, setMatrix, setSubMatrix, toString, toStringMatrix, toStringMatrix, toStringMatrix
public CovarianceMatrix()
public CovarianceMatrix(PhaseMatrix matInit) throws java.lang.IllegalArgumentException
PhaseMatrix
argument.matInit
- symmetric PhaseMatrix
object to initial thisjava.lang.IllegalArgumentException
- initializing matrix is not symmetricpublic CovarianceMatrix(java.lang.String strTokens) throws java.lang.IllegalArgumentException, java.lang.NumberFormatException
strTokens
- initial values of matrix in Mathematica formatjava.lang.IllegalArgumentException
- wrong number of token string in argumentjava.lang.NumberFormatException
- malformatted number in argument stringPhaseMatrix.PhaseMatrix(String)
public static CovarianceMatrix newZero()
public static CovarianceMatrix newIdentity()
public static CovarianceMatrix newCenter(PhaseVector vecCen)
Create a "center matrix" corresponding the given mean values (centroid location). The returned matrix can be subtracted from a covariance matrix to produce a central covariance matrix.
vecCen
- mean value vector of the phase space coordinates, i.e., public static CovarianceMatrix buildCovariance(Twiss3D envTwiss)
CovarianceMatrix
built according to the
given set of Twiss parameters.envTwiss
- twiss parameter set describing RMS envelopebuildCovariance(Twiss, Twiss, Twiss)
public static CovarianceMatrix buildCovariance(Twiss twissX, Twiss twissY, Twiss twissZ)
Create a PhaseMatrix that is the correlation matrix corresponding to the given Twiss parameters. Note that the correlation matrix is for a centered beam (on axis). Thus, the correlation matrix is actually the covariance matrix.
The returned matrix is in homogeneous coordinates of the block
diagonal form
| Rxx 0 0 0 |
| 0 Ryy 0 0 |
| 0 0 Rzz 0 |
| 0 0 0 1 |
where Rii are 2x2 symmetric blocks corresponding to each phase
plane. Clearly the phase planes are uncoupled.
twissX
- twiss parameters of the x phase planetwissY
- twiss parameters of the y phase planetwissZ
- twiss parameters of the z phase planepublic static CovarianceMatrix buildCovariance(Twiss twissX, Twiss twissY, Twiss twissZ, PhaseVector vecCen)
Create a CovarianceMatrix corresponding to the given Twiss parameters and having the given mean values (centroid location).
twissX
- twiss parameters of the x phase planetwissY
- twiss parameters of the y phase planetwissZ
- twiss parameters of the z phase planevecCen
- mean value vector of the phase space coordinates, i.e., public CovarianceMatrix clone()
clone
in class PhaseMatrix
BaseMatrix.clone()
public void forceRmsEmittances(double[] arrEmitNew)
arrEmitNew
- three element vector of rms emittances for X,Y,Z planes, respectively
public double getMeanX()
public double getMeanY()
public double getMeanZ()
public PhaseVector getMean()
public double computeCentralCovXX()
public double computeCentralCovXY()
public double computeCentralCovYY()
public double computeCentralCovYZ()
public double computeCentralCovZZ()
public double computeCentralCovXZ()
public R3x3 computeSpatialCovariance()
public double getSigmaX()
public double getSigmaY()
public double getSigmaZ()
public CovarianceMatrix computeCentralCovariance()
public double[] computeRmsEmittances()
public Twiss[] computeTwiss()
protected PhaseMatrix newInstance()
newInstance
in class PhaseMatrix
M
PhaseMatrix.newInstance()