public class PhaseMap extends java.lang.Object implements IArchive
Represents a generalized map between homogeneous phase space coordinates. Note that it does not necessarily need to be symplectic.
Currently the action of the map, denoted φ, simply consists of a linear portion plus an offset. Second order effects are to be designed and implemented in the future.
The action of the linear map
φ0 : R6 × {1} → R6 × {1}
on a phase vector z ∈ R6 × {1} is given by
φ0(z) = Φ0 ⋅
(z - z0)
+ Δ0 ,
where Φ0 ∈ R7×7 is the linear part of the map
(a matrix representation), z0 is the evaluation point or center, and
Δ0 is the value or offset of
the mapping. Note that φ0 : z0 → φ0,
that is, z0 is the location of the linear expansion of the
map φ0 and Δ0 is the value there.
The above representation is in direct correlation with the Taylor expansion of
a continuous map F0 ∈ C(R6×{1}
→ R6×{1}).
Say we wish to expand F0 about the point z0 ∈ R6.
The Taylor expansion of F0 at the point z ∈ R6 is
given by
F0(z) = F(z0)
+ F0'(z0) ⋅ (z - z0)
+ O(||z - z0||2) ,
where F0'(z0) is the matrix of first partial derivatives of F evaluated at the
point z0 ∈ R6×{1}. By identifying z0,
Δ0,
and Φ0 with z0, F0(z0),
and F0'(z0), respectively, we
arrive at our Taylor map representation for this class as seen by definition of
φ0.
Hopefully, this interface should be general enough so that when a consensus is reached as to represent higher-order effects of the transfer map, the implementation can be supported here.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ATTR_DATA
attribute marker for data
|
static java.lang.String |
LBL_2ND
label for second-order map component
|
static java.lang.String |
LBL_CNTR
label for the domain center component of the map
|
static java.lang.String |
LBL_DSPL
label for zero-order map component (offset)
|
static java.lang.String |
LBL_LIN
label for first-order map component
|
static java.lang.String |
LBL_THREE
label for third-order map component
|
Constructor and Description |
---|
PhaseMap()
Creates a new instance of
PhaseMap . |
PhaseMap(PhaseMap mapParent)
Copy constructor for
PhaseMap . |
PhaseMap(PhaseMatrix matTrans)
Create a new instance of PhaseMap which behaves as a linear transform given
by the specified matrix.
|
PhaseMap(PhaseVector vecDispl)
Create a new instance of
PhaseMap which behaves as simple
translation in phase
space given by the specified displacement vector. |
PhaseMap(PhaseVector vecCntr,
PhaseVector vecDspl,
PhaseMatrix matLin)
Initializing constructor for
PhaseMap class. |
Modifier and Type | Method and Description |
---|---|
PhaseVector |
apply(PhaseVector vecIn)
Apply this map to the given phase vector.
|
PhaseMap |
compose(PhaseMap mapRight)
Non-destructive map composition - binary composition of two PhaseMaps.
|
void |
composeEquals(PhaseMap mapRight)
In-place map composition, binary composition of two
PhaseMap
objects where this map
This map φ2 is replaced by
φ2 ← φ2 ⋅ φ1 where φ1 the argument map. |
PhaseMap |
copy()
Make a deep copy of this phase map.
|
PhaseVector |
getDomainCenter()
Returns the map center in its domain.
|
PhaseMatrix |
getFirstOrder()
Get the linear portion of the map, this is the quantity
Φ0 in the class documentation.
|
PhaseVector |
getRangeDisplace()
Get the map offset in the range, the vector
Δ0 in the class documentation.
|
static PhaseMap |
identity()
Create an identity phase map
|
PhaseMap |
inverse()
Compute and return the inverse map φ-1 of this map φ.
|
void |
load(DataAdaptor daptArchive)
Restore the value of the this
PhaseMatrix from the
contents of a data archive. |
void |
save(DataAdaptor daptArchive)
Save the value of this
PhaseMatrix to a data sink
represented by the DataAdaptor interface. |
void |
setDomainCenter(PhaseVector vecDomCntr)
Set the map's domain center, or z0 in the
notation of the class documentation.
|
void |
setFrom(PhaseMap map)
Set this map to copy the specified map.
|
void |
setLinearPart(PhaseMatrix matPhi)
Set the linear part of the map, this is the matrix
Φ0 in the notation of the class documentation.
|
void |
setRangeDisplace(PhaseVector vecRngDspl)
Set the map's offset in the range, this is the quantity
Δ0 in the class documentation.
|
public static final java.lang.String LBL_CNTR
public static final java.lang.String LBL_DSPL
public static final java.lang.String LBL_LIN
public static final java.lang.String LBL_2ND
public static final java.lang.String LBL_THREE
public static final java.lang.String ATTR_DATA
public PhaseMap()
PhaseMap
. Creates
the identity map centered at 0 ∈ R6×{1}.public PhaseMap(PhaseVector vecDispl)
PhaseMap
which behaves as simple
translation in phase
space given by the specified displacement vector.vecDispl
- displacement in the range of the phase map, or Δ0public PhaseMap(PhaseMatrix matTrans)
matTrans
- linear portion of the phase map, specifically Φ0public PhaseMap(PhaseVector vecCntr, PhaseVector vecDspl, PhaseMatrix matLin)
PhaseMap
class. Sets the
map center z0, the map offset Δ0,
and the map linear part Φ0 to the given quantities,
respectively.vecCntr
- point in map domain unaffected by map actionvecDspl
- the image of the map centermatLin
- linear part of the map around the map center pointpublic PhaseMap(PhaseMap mapParent)
PhaseMap
. Creates a new,
deep copy of the given PhaseMap
object.mapParent
- parent map to clonepublic static PhaseMap identity()
public PhaseMap copy()
public void setFrom(PhaseMap map)
map
- the map from which to copy this map's settings.public void setDomainCenter(PhaseVector vecDomCntr)
vecDomCntr
- the point z0 in phase space about which the
map is expandedpublic void setRangeDisplace(PhaseVector vecRngDspl)
vecRngDspl
- the displacement
Δ0 ∈ Rng{φ0} of the mappublic void setLinearPart(PhaseMatrix matPhi)
matPhi
- linear portion Φ0 of phase map φ0public void save(DataAdaptor daptArchive)
PhaseMatrix
to a data sink
represented by the DataAdaptor
interface.save
in interface IArchive
daptArchive
- interface to data sinkIArchive.save(xal.tools.data.DataAdaptor)
public void load(DataAdaptor daptArchive) throws DataFormatException, java.lang.IllegalArgumentException
PhaseMatrix
from the
contents of a data archive.load
in interface IArchive
daptArchive
- interface to data sourceDataFormatException
- malformed datajava.lang.IllegalArgumentException
- wrong number of string tokensIArchive.load(xal.tools.data.DataAdaptor)
public PhaseVector getDomainCenter()
public PhaseVector getRangeDisplace()
public PhaseMatrix getFirstOrder()
public PhaseMap inverse()
Compute and return the inverse map φ-1 of this map φ. By inverse map we mean that the composition φ-1 ⋅ φ is the identity map id : z → z on R6×{1}.
Consider linear maps φ defined according to the class documentation
φ(z) = Φ ⋅
(z - z0)
+ Δ0 ,
where Φ ∈ R7×7 is the linear part of the map
(a matrix representation), z0 is the evaluation point or center, and
Δ0 is the value or offset of the mapping. Then the inverse
map φ-1 : R6×{1} → R6×{1}
is given by
φ-1(y) = Φ0-1
⋅ (y - Δ0)
+ z0 ,
which can be derived by solving the equation φ(z) = y for
y.
public PhaseMap compose(PhaseMap mapRight)
Non-destructive map composition - binary composition of two PhaseMaps. Let
φ1 denote the given map and φ2 denote
this
map; that is, φ2 ≡ φthis.
Referring to the class documentation
, the composition
φ ≡ φ2 ⋅ φ1 is determined
by its action on an element z ∈ R6×{1}
PhaseMap
φ(z) = φ2 ⋅ φ1(z) ,
= φ2
[ Φ1⋅(z - z1)
+ Δ1 - z2] ,
= Φ2⋅Φ1
(z - z1)
+ Φ2 ⋅ (Δ1 - z2)
+ Δ2
where Φ1 and Φ2 are the linear parts (matrices)
of maps φ1 and φ2, respectively,
Δ1 and Δ2 are the (range) offsets
of maps φ1 and φ2, respectively, and
z1 and z2 are the (domain) centers of maps
φ1 and φ2, respectively.
Thus, the center z3, displacement Δ3, and
linear part Φ3 of the new composite map
φ3 ≡ φ2 ⋅ φ1
are respectively given by
z3 = z1 ,
Δ3 = Φ2 ⋅
(Δ1 - z2)
+ Δ2 ,
Φ3 = Φ2 ⋅ Φ1 ,
The above equations are the formulas for the returned map.
mapRight
- right argument φ1 to map compositionpublic void composeEquals(PhaseMap mapRight)
PhaseMap
objects where this map
This map φ2 is replaced by
compose(PhaseMap)
for details of the
computation.mapRight
- right argument φ0 of map compositionpublic PhaseVector apply(PhaseVector vecIn)
vecIn
- phase vector z