gov.sns.xal.model.elem
Class ThickMatrix

java.lang.Object
  |
  +--gov.sns.xal.model.elem.Element
        |
        +--gov.sns.xal.model.elem.ThickElement
              |
              +--gov.sns.xal.model.elem.ThickMatrix
All Implemented Interfaces:
IComponent, IElement

public class ThickMatrix
extends ThickElement

User element representing a general beamline element. Arbitrary beamline elements are specified by providing the transfer matrix generator, elapsed time, and energy gain a priori. Note that for this element the transfer matrix, elapsed time, and energy gain are independent of any probe objects. Note also that the generator for the transfer matrix is specified, NOT the actual transfer matrix. Thus, this class should be used carefully. This element is derived from the ThickElement base so that space charge kicks may be applied throughout the element. Denoting the generator matrix as A, then the transfer matrix M(s) for a section of length s is given by M(s) = Exp(s*A) where Exp() is the matrix exponential function. NOTE: Currently the class implements the matrix exponential function only to second order. Therefore M(s) = I + s*A + 0.5(s*A)^2 + O(s^3)


Field Summary
static java.lang.String s_strType
          string type identifier for all ThickMatrix objects
 
Fields inherited from interface gov.sns.xal.model.IElement
LightSpeed, Permeability, Permittivity, UnitCharge
 
Constructor Summary
ThickMatrix()
          JavaBean constructor - creates a new unitialized instance of ThickMatrix BE CAREFUL
ThickMatrix(java.lang.String strId, double dblLen)
          Creates a new instance of ThickMatrix.
ThickMatrix(java.lang.String strId, double dblLen, PhaseMatrix matPhiSub)
          Creates a new instance of ThickMatrix.
ThickMatrix(java.lang.String strId, double dblLen, PhaseMatrix matPhiSub, double dblDelW)
          Creates a new instance of ThickMatrix
 
Method Summary
 double elapsedTime(IProbe probe, double dblLen)
          Returns the time taken for any probe to drift through part of the element.
 double energyGain(IProbe probe, double dblLen)
          Returns the energy gain imparted to any probe when going through part of the element.
 void setElapsedTime(double dblDelT)
          Set the total elapsed time for all probes to propagate the entire element.
 void setEnergyGain(double dblDelW)
          Set the total energy gain imparted to any probe propagating through entire element.
 void setTransferMapGenerator(PhaseMatrix matGen)
          Set the transfer map generator A for the element.
 PhaseMap transferMap(IProbe probe, double dblLen)
          Returns the transfer map produced by the generator matrix over the distance dblLen.
 
Methods inherited from class gov.sns.xal.model.elem.ThickElement
getLength, setLength
 
Methods inherited from class gov.sns.xal.model.elem.Element
compDriftingTime, getId, getType, getUID, initializeFrom, print, propagate, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

s_strType

public static final java.lang.String s_strType
string type identifier for all ThickMatrix objects

See Also:
Constant Field Values
Constructor Detail

ThickMatrix

public ThickMatrix(java.lang.String strId,
                   double dblLen,
                   PhaseMatrix matPhiSub,
                   double dblDelW)
Creates a new instance of ThickMatrix

Parameters:
strId - identifier of this ThickMatrix object
dblLen - length of the element (in meters)
matPhiSub - 7x7 transfer matrix for a subelement
dblDelW - energy gain imparted of this element (in electron-volts)

ThickMatrix

public ThickMatrix(java.lang.String strId,
                   double dblLen,
                   PhaseMatrix matPhiSub)
Creates a new instance of ThickMatrix. Energy gain for each subelement is initialized to zero.

Parameters:
strId - identifier of this ThickMatrix object
dblLen - length of the element (in meters)
matPhiSub - 7x7 transfer matrix for a subelement

ThickMatrix

public ThickMatrix(java.lang.String strId,
                   double dblLen)
Creates a new instance of ThickMatrix. The subelement energy gain is initialized to zero. The subelement transfer matrix is initialized to the 7x7 identity.

Parameters:
strId - identifier of this ThickMatrix object
dblLen - length of the element (in meters)

ThickMatrix

public ThickMatrix()
JavaBean constructor - creates a new unitialized instance of ThickMatrix BE CAREFUL

Method Detail

setElapsedTime

public void setElapsedTime(double dblDelT)
Set the total elapsed time for all probes to propagate the entire element.

Parameters:
dblDelT - elapsed time through element in seconds

setEnergyGain

public void setEnergyGain(double dblDelW)
Set the total energy gain imparted to any probe propagating through entire element.

Parameters:
dblDelW - energy gain imparted to all probes (in electron-volts)

setTransferMapGenerator

public void setTransferMapGenerator(PhaseMatrix matGen)
Set the transfer map generator A for the element. The transfer map M(s) over a distance s is then given by M(s) = Exp(s*A) where Exp() is the matrix exponential function. Thus, the map M generated by A is also a matrix.

Parameters:
matGen - transfer matrix generator (probe independent)

elapsedTime

public double elapsedTime(IProbe probe,
                          double dblLen)
Returns the time taken for any probe to drift through part of the element. The value dT(dblLen) returned by this method is given by dT(dblLen) = dblLen/getLength() * dblDelT where dblDelT is the value given to #setElapsedTime.

Specified by:
elapsedTime in interface IElement
Specified by:
elapsedTime in class Element
Parameters:
probe - dummy argument
dblLen - length of subsection to propagate through meters
Returns:
the elapsed time through sectionUnits: seconds

energyGain

public double energyGain(IProbe probe,
                         double dblLen)
Returns the energy gain imparted to any probe when going through part of the element. The value dW(dblLen) returned by this method is given by DW(dblLen) = dblLen/getLength() * dblDelW where dblDelW is the value given to #setEnergyGain.

Specified by:
energyGain in interface IElement
Specified by:
energyGain in class ThickElement
Parameters:
dblLen - dummy argument
probe - dummy argument
Returns:
energy gain for each subelement (in electron-volts)

transferMap

public PhaseMap transferMap(IProbe probe,
                            double dblLen)
                     throws ModelException
Returns the transfer map produced by the generator matrix over the distance dblLen. NOTE: Currently the transfer map returned is accurate only to order two. That is the matrix exponential function is approximated by its first three terms.

Specified by:
transferMap in interface IElement
Specified by:
transferMap in class ThickElement
Parameters:
dblLen - propagation length in meters
probe - dummy argument
Returns:
computed transfer map
Throws:
ModelException - this should not occur
See Also:
setTransferMapGenerator(gov.sns.tools.beam.PhaseMatrix)