Class ThinElement
- All Implemented Interfaces:
IComponent
,IElement
- Direct Known Subclasses:
ChargeExchangeFoil
,Collimator
,IdealMagOctupole
,IdealRfGap
,IdealRfGap
,IdealRfGapUpgraded
,Marker
,SpectrumMapRfGap
,ThinElectromagnet
,ThinLens
,ThinMatrix
,ThinRfFieldMap
- Author:
- Christopher Allen
-
Field Summary
Fields inherited from class xal.model.elem.Element
dblNodeLen, dblNodePos
Fields inherited from interface xal.model.IElement
LIGHT_SPEED, PERMEABILITY, PERMITTIVITY, UNIT_CHARGE
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
ThinElement
(String strType) Creates a new instance of ThinElement specifying the element type identifier.protected
ThinElement
(String strType, String strId) Creates a new instance of ThinElement specifying with the element type identifier and the instance identifier. -
Method Summary
Modifier and TypeMethodDescriptionprotected PhaseMatrix
applyErrors
(PhaseMatrix matPhi, double length) Add Rotation and Displacement Error to Transfer Matrixprotected abstract double
elapsedTime
(IProbe probe) Returns the time taken for the probe to propagate through element.double
elapsedTime
(IProbe probe, double dblLen) Returns the time taken for the probe to drift through part of the element.protected abstract double
energyGain
(IProbe probe) Calculate the energy gain for this element on the supplied probe.double
energyGain
(IProbe probe, double dblLen) Calculate the energy gain for this element.double
Return the length of this elementprotected double
longitudinalPhaseAdvance
(IProbe probe) Again, this is a kluge.double
longitudinalPhaseAdvance
(IProbe probe, double dblLen) Calculate the longitudinal phase advance through this element ignoring the length parameter (or lack thereof).protected abstract PhaseMap
transferMap
(IProbe probe) Compute the transfer matrix of this element.transferMap
(IProbe probe, double dblLen) Compute the transfer matrix for subsection of this element of lengthdblLen
for the specified given probe.Methods inherited from class xal.model.elem.Element
addCloseElements, backPropagate, backPropagate, compDriftingTime, compProbeLocation, getAlignX, getAlignY, getAlignZ, getCloseElements, getHardwareNodeId, getId, getLatticePosition, getNodeLen, getNodePos, getParent, getPhiX, getPhiY, getPhiZ, getPosition, getType, getUID, initializeFrom, print, propagate, propagate, setAlign, setAlignX, setAlignY, setAlignZ, setHardwareNodeId, setId, setParent, setPhiX, setPhiY, setPhiZ, setPosition, toString
-
Constructor Details
-
ThinElement
Creates a new instance of ThinElement specifying the element type identifier.- Parameters:
strType
- type identifier string of element
-
ThinElement
Creates a new instance of ThinElement specifying with the element type identifier and the instance identifier.- Parameters:
strType
- type string of elementstrId
- string identifier of the element
-
-
Method Details
-
elapsedTime
Returns the time taken for the probe to propagate through element.- Parameters:
probe
- propagating probe- Returns:
- elapsed time through element Units: seconds
-
energyGain
Calculate the energy gain for this element on the supplied probe.- Returns:
- this element's energy gain
-
transferMap
Compute the transfer matrix of this element.- Returns:
- transfer map for this element
- Throws:
ModelException
-
longitudinalPhaseAdvance
Again, this is a kluge. We return zero since the notion of frequency is not defined for every element (perhaps if this element is the child of an RF cavity). For those elements that do create a phase advance they need to override this method.
There is some legitimacy in returning zero since a thin element generally has no phase advance. That is, there is no propagation therefore no elapsed time and no phase advance. Only if there is energy gain must there be a corresponding conjugate phase advance.
- Parameters:
probe
- probe experiencing a phase advance through this element- Returns:
- the change in phase while going through the element
- Since:
- Nov 23, 2014
-
getLength
public double getLength()Return the length of this element- Specified by:
getLength
in interfaceIComponent
- Specified by:
getLength
in classElement
- Returns:
- a value of zero
-
elapsedTime
Returns the time taken for the probe to drift through part of the element.- Specified by:
elapsedTime
in interfaceIElement
- Specified by:
elapsedTime
in classElement
- Parameters:
probe
- propagating probedblLen
- length of subsection to propagate through meters- Returns:
- the elapsed time through sectionUnits: seconds
-
energyGain
Calculate the energy gain for this element. Because this is a thin element with no length, the length parameter is ignored.- Specified by:
energyGain
in interfaceIElement
- Specified by:
energyGain
in classElement
- Parameters:
probe
- Probe for which energy gain is to be computeddblLen
- length of subsection to calculate energy gain- Returns:
- the energy gain for this element on the particular probe
-
longitudinalPhaseAdvance
Calculate the longitudinal phase advance through this element ignoring the length parameter (or lack thereof). We simply return 0 assume the zero length of this element allows no phase advance. Of course there are thin elements which do create a finite phase advance (e.g., an RF gap), those element must override this method.- Specified by:
longitudinalPhaseAdvance
in interfaceIElement
- Specified by:
longitudinalPhaseAdvance
in classElement
- Parameters:
probe
- the probe propagating through this elementdblLen
- distance the probe propagates through the element- Returns:
- longitudinal phase advance of the probe through given distance
- Since:
- Nov 23, 2014
- See Also:
-
transferMap
Compute the transfer matrix for subsection of this element of lengthdblLen
for the specified given probe. Because this is a thin element (with no length), the length parameter is ignored in computing the transfer matrix.- Specified by:
transferMap
in interfaceIElement
- Specified by:
transferMap
in classElement
- Parameters:
dblLen
- length of subelementprobe
- probe containing parameters for the subsectional transfer matrix- Returns:
- transfer map for an element of length dblLen
- Throws:
ModelException
- unable to compute transfer map- See Also:
-
#transferMap()
-
applyErrors
Add Rotation and Displacement Error to Transfer Matrix
Method to add the effects of a spatial rotation and displacement to the beamline element represented by the given transfer matrix. Method is optimized to add transformation only to the first and last sub-slice of the element. Besides reducing number of matrix multiplications, there is also less numerical error.
- Parameters:
matPhi
- transfer matrix Φ to be processedlength
- element length (used only for FM composed of many thing elements stacked)- Returns:
- transfer matrix Φ after applying displacement
- See Also:
-