Class ThinElement

java.lang.Object
xal.model.elem.Element
xal.model.elem.ThinElement
All Implemented Interfaces:
IComponent, IElement
Direct Known Subclasses:
ChargeExchangeFoil, Collimator, IdealMagOctupole, IdealRfGap, IdealRfGap, IdealRfGapUpgraded, Marker, SpectrumMapRfGap, ThinElectromagnet, ThinLens, ThinMatrix, ThinRfFieldMap

public abstract class ThinElement extends Element
Classes derived from ThinElement are modeled as having no length. Thus, space charge effects are neglected here. The IElement interface method getLength() always returns zero. However, a ThinElement may have an "effective length" which is a parameter used to determine it's effect on the beam, that is, it is used to compute the transfer matrix.
Author:
Christopher Allen
  • Constructor Details

    • ThinElement

      protected ThinElement(String strType)
      Creates a new instance of ThinElement specifying the element type identifier.
      Parameters:
      strType - type identifier string of element
    • ThinElement

      protected ThinElement(String strType, String strId)
      Creates a new instance of ThinElement specifying with the element type identifier and the instance identifier.
      Parameters:
      strType - type string of element
      strId - string identifier of the element
  • Method Details

    • elapsedTime

      protected abstract double elapsedTime(IProbe probe)
      Returns the time taken for the probe to propagate through element.
      Parameters:
      probe - propagating probe
      Returns:
      elapsed time through element Units: seconds
    • energyGain

      protected abstract double energyGain(IProbe probe)
      Calculate the energy gain for this element on the supplied probe.
      Returns:
      this element's energy gain
    • transferMap

      protected abstract PhaseMap transferMap(IProbe probe) throws ModelException
      Compute the transfer matrix of this element.
      Returns:
      transfer map for this element
      Throws:
      ModelException
    • longitudinalPhaseAdvance

      protected double longitudinalPhaseAdvance(IProbe probe)

      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 interface IComponent
      Specified by:
      getLength in class Element
      Returns:
      a value of zero
    • elapsedTime

      public double elapsedTime(IProbe probe, double dblLen)
      Returns the time taken for the probe to drift through part of the element.
      Specified by:
      elapsedTime in interface IElement
      Specified by:
      elapsedTime in class Element
      Parameters:
      probe - propagating probe
      dblLen - length of subsection to propagate through meters
      Returns:
      the elapsed time through sectionUnits: seconds
    • energyGain

      public double energyGain(IProbe probe, double dblLen)
      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 interface IElement
      Specified by:
      energyGain in class Element
      Parameters:
      probe - Probe for which energy gain is to be computed
      dblLen - length of subsection to calculate energy gain
      Returns:
      the energy gain for this element on the particular probe
    • longitudinalPhaseAdvance

      public double longitudinalPhaseAdvance(IProbe probe, double dblLen)
      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 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:
      Nov 23, 2014
      See Also:
    • transferMap

      public PhaseMap transferMap(IProbe probe, double dblLen) throws ModelException
      Compute the transfer matrix for subsection of this element of length dblLen 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 interface IElement
      Specified by:
      transferMap in class Element
      Parameters:
      dblLen - length of subelement
      probe - 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

      protected PhaseMatrix applyErrors(PhaseMatrix matPhi, 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. 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 processed
      length - element length (used only for FM composed of many thing elements stacked)
      Returns:
      transfer matrix Φ after applying displacement
      See Also: