Class ThickElement

java.lang.Object
xal.model.elem.Element
xal.model.elem.ThickElement
All Implemented Interfaces:
IComponent, IElement
Direct Known Subclasses:
IdealDrift, IdealMagSextupole, RfqDummyModel, ThickElectromagnet, ThickElectrostatic, ThickMatrix, ThickRfFieldMap

public abstract class ThickElement extends Element

Base class for all modeling elements having a finite length. As such, space charge will affect probes propagation through these elements.

The transfer matrix that is stored in the parent element is actually the incremental transfer matrix of the full element. Thus, derived classes should implement the method subTransferMatrix() that returns the nSecs root of the full transfer matrix. Deriving beamline elements from this class allows space charge kicks to be applied at nSecs equally spaced locations throughout the element.

Author:
Christopher K. Allen
  • Constructor Details

    • ThickElement

      protected ThickElement(String strType)
      Default constructor to be used by automatic lattice generation. Creates a new parameter-uninitialized instance of ThickElement.
      Parameters:
      strType - the string type-identifier of the element type
    • ThickElement

      protected ThickElement(String strType, String strId)
      Default constructor to be used by automatic lattice generation. Creates a new instance of ThickElement specifying its type identifier and its instance identifier.
      Parameters:
      strType - the string type-identifier of the element type
      strId - the string identifier of the element instance
    • ThickElement

      protected ThickElement(String strType, String strId, double dblLen)
      Creates a new instance of ThickElement
      Parameters:
      strType - string type identifier for the element
      strId - string instance identifier for this element
      dblLen - total length of the element (in meters)
  • Method Details

    • initializeFrom

      public void initializeFrom(LatticeElement latticeElement)
      Conversion method to be provided by the user
      Specified by:
      initializeFrom in interface IComponent
      Overrides:
      initializeFrom in class Element
      Parameters:
      latticeElement - the SMF node to convert
    • setLength

      public void setLength(double dblLen)
      Set the length of the element.
      Parameters:
      dblLen - length of element (in meters)
    • getLength

      public double getLength()
      Return the total length of this element
      Specified by:
      getLength in interface IComponent
      Specified by:
      getLength in class Element
      Returns:
      total element length (in meters)
    • energyGain

      public abstract double energyGain(IProbe probe, double dblLen)
      Return the energy gain of the beamline element over a subsection of the specified length.
      Specified by:
      energyGain in interface IElement
      Specified by:
      energyGain in class Element
      Parameters:
      probe - probe for which energy gain is to be determined
      dblLen - subsection length to calculate energyGain for
      Returns:
      the value #subEnergyGain(probe)*#getCount()
    • transferMap

      public abstract PhaseMap transferMap(IProbe probe, double dblLen) throws ModelException
      Description copied from class: Element
      Compute the transfer matrix for subsection of this element of length dblLen for the specified given probe. That is, this method should return the incremental transfer matrix.
      Specified by:
      transferMap in interface IElement
      Specified by:
      transferMap in class Element
      Parameters:
      probe - probe containing parameters for the sub-sectional transfer matrix
      dblLen - length of sub-element
      Returns:
      transfer map for an element of length dblLen
      Throws:
      ModelException - unable to compute transfer map
      Since:
      Jan 22, 2015 by Christopher K. Allen
      See Also:
    • isFirstSubslice

      protected boolean isFirstSubslice(double position)
      Checks if this is the first subslice transfer matrix is requested for
      Parameters:
      position - position of the probe
      Returns:
      is this the first subslice
    • isLastSubslice

      protected boolean isLastSubslice(double position)
      Checks if this is the last subslice transfer matrix is requested for
      Parameters:
      position - position of the probe + subslice length
      Returns:
      is this the last sub-slice
    • applyErrors

      protected PhaseMatrix applyErrors(PhaseMatrix matPhi, IProbe probe, double length)

      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.

      Parameters:
      matPhi - transfer matrix Φ to be processed
      probe - instance of the probe
      length - total think element length
      Returns:
      transfer matrix Φ after applying displacement and rotation
      See Also:
    • elapsedTime

      public abstract double elapsedTime(IProbe probe, double dblLen)
      Description copied from class: Element
      Returns the time taken for the probe probe to propagate through a subsection of the element with length dblLen.
      Specified by:
      elapsedTime in interface IElement
      Specified by:
      elapsedTime in class Element
      Parameters:
      probe - determine energy gain for this probe
      dblLen - length of subsection to calculate energy gain for
      Returns:
      the elapsed time through sectionUnits: seconds
    • longitudinalPhaseAdvance

      public double longitudinalPhaseAdvance(IProbe probe, double dblLen)
      This is a kluge to make RF gaps work, since frequency is not defined for modeling elements outside RF cavities. For such elements we simply return 0 phase advance. For elements where frequency is defined, we compute the phase advance as the angular frequency times the elapsed time through the element (see elapsedTime(IProbe, double)).
      Specified by:
      longitudinalPhaseAdvance in interface IElement
      Specified by:
      longitudinalPhaseAdvance in class Element
      Parameters:
      probe - the probe propagating through this element
      dblLen - distance the probe propagates through the element
      Returns:
      longitudinal phase advance of the probe through given distance
      Since:
      Jan 22, 2015 by Christopher K. Allen
      See Also: