Class IdealRfCavity

java.lang.Object
xal.model.elem.ElementSeq
xal.model.elem.IdealRfCavity
All Implemented Interfaces:
Iterable<IComponent>, IRfCavity, IComponent, IComposite

public class IdealRfCavity extends ElementSeq implements IRfCavity

This class represents a general RF cavity being an composition of RF gaps and cavity drifts. The types and parameters of the internal elements define the operation (and configuration) of the cavity.

The propagation is done via the base class ElementSeq which just runs through the child elements propagating (or back propagating) in order. Thus, currently at least, this element is really just a container of elements.

Since:
Dec 3, 2014
Author:
Christopher K. Allen
  • Field Details

  • Constructor Details

    • IdealRfCavity

      public IdealRfCavity()
      Zero constructor for IdealRfCavity.
      Since:
      Dec 3, 2014
    • IdealRfCavity

      public IdealRfCavity(String strId)
      Constructor for IdealRfCavity with string identifier.
      Parameters:
      strId - string identifier for the RF cavity
      Since:
      Dec 3, 2014
    • IdealRfCavity

      public IdealRfCavity(String strId, int szReserve)
      Constructor for IdealRfCavity.
      Parameters:
      strId - string identifier for the RF cavity
      szReserve - number of initial element positions to allocate (marginally increases performance, maybe)
      Since:
      Dec 3, 2014
  • Method Details

    • setCavityModeConstant

      public void setCavityModeConstant(double dblModeConst)

      Set the operating mode constant λ for the RF cavity design. The constant is half of the mode number q. Specifically,

          λ = 0   (q=0) ⇒ 0 mode cavity structure (e.g. DTL)

          λ = 1/2 (q=1) ⇒ π/2 mode structure (bi-periodic structures, e.g., SideCC)

          λ = 1   (q=2) ⇒ π-mode cavity (e.g. CCL, super-conducting)

      Parameters:
      dblModeConst - the new mode constant λ for the cavity drift
    • getCavityModeConstant

      public double getCavityModeConstant()

      Get the operating mode constant λ for the RF cavity design. The constant is half of the mode number q. Specifically,

          λ = 0   (q=0) ⇒ 0 mode cavity structure (e.g. DTL)

          λ = 1/2 (q=1) ⇒ π/2 mode structure (bi-periodic structures, e.g., SideCC)

          λ = 1   (q=2) ⇒ π-mode cavity (e.g. CCL, super-conducting)

      Returns:
      the operating mode constant λ for the cavity drift
    • getCavFrequency

      public double getCavFrequency()
      Get the operating frequency of the RF cavity in Hertz.
      Specified by:
      getCavFrequency in interface IRfCavity
      Returns:
      the fundamental mode frequency f0 of the RF cavity
    • getCavAmp

      public double getCavAmp()
      Get the amplitude of the RF signal feeding the cavity. Specifically, the voltage of the RF at the cavity RF window.
      Specified by:
      getCavAmp in interface IRfCavity
      Returns:
      high-power signal level at the cavity (in Volts)
      Since:
      Dec 16, 2014 by Christopher K. Allen
    • getCavPhase

      public double getCavPhase()
      Get the RF phase of the cavity with respect to the propagating probe. Specifically, this is the RF phase seen by the probe as it first enters the cavity.
      Specified by:
      getCavPhase in interface IRfCavity
      Returns:
      RF phase of the cavity upon probe arrival (in radians)
      Since:
      Dec 16, 2014 by Christopher K. Allen
    • setCavFrequency

      public void setCavFrequency(double dblFreq)
      Set the operating frequency of the RF cavity in Hertz.
      Specified by:
      setCavFrequency in interface IRfCavity
      Parameters:
      dblFreq - fundamental RF frequency of the RF cavity (in Hertz)
    • setCavAmp

      public void setCavAmp(double dblAmp)
      Sets the amplitude of the RF signal feeding the cavity. Specifically, the voltage of the RF at the cavity RF window. This method updates the voltage for all gaps in the cavity.
      Specified by:
      setCavAmp in interface IRfCavity
      Parameters:
      dblAmp - high-power signal level at the cavity (in Volts)
      Since:
      Dec 16, 2014 by Christopher K. Allen
    • setCavPhase

      public void setCavPhase(double dblPhase)
      Sets the RF phase of the cavity with respect to the propagating probe. Specifically, this is the RF phase seen by the probe as it first enters the cavity. This method updates the phase for all gaps in the cavity.
      Specified by:
      setCavPhase in interface IRfCavity
      Parameters:
      dblPhase - RF phase of the cavity upon probe arrival (in radians)
      Since:
      Dec 16, 2014 by Christopher K. Allen
    • initializeFrom

      public void initializeFrom(LatticeElement latticeElement)
      Initializes the frequency and cavity mode constant from the given proxy element. The SMF node is taken from the proxy then queried directly. Eh, I don't like this.
      Specified by:
      initializeFrom in interface IComponent
      Overrides:
      initializeFrom in class ElementSeq
      Parameters:
      latticeElement - the SMF node to convert
      Since:
      Dec 5, 2014 @author Christopher K. Allen
      See Also:
    • propagate

      public void propagate(IProbe probe) throws ModelException

      Sets the probes longitudinal phase to the phase of this cavity upon entrance. Then we propagate the probe through the composite structure as usual by calling the base class propagate method.

      It is unnecessary to override the ElementSeq.propagate(IProbe, double) method since that method simply defers to the propagate(IProbe) method ignoring the position parameter.

      Specified by:
      propagate in interface IComponent
      Specified by:
      propagate in interface IComposite
      Overrides:
      propagate in class ElementSeq
      Parameters:
      probe - the state of the probe will be advance using the elements dynamics
      Throws:
      ModelException - an error occurred while advancing the probe state
      Since:
      Dec 16, 2014 by Christopher K. Allen
      See Also:
    • backPropagate

      public void backPropagate(IProbe probe) throws ModelException

      I am overriding this method even though a proper back propagation is impossible. We set the longitudinal phase of the probe to the phase of the cavity as it backs into the exit. The true phase should be the phase of the particle as it leaves the cavity when forward propagating, however, we have no way of knowing that phase a priori.

      It may be useful to use this setup during back propagations to explore various beam exit times and their effect.

      It is unnecessary to override the ElementSeq.backPropagate(IProbe, double) method since that method simply defers to the backPropagate(IProbe) method ignoring the position parameter.

      Specified by:
      backPropagate in interface IComponent
      Overrides:
      backPropagate in class ElementSeq
      Parameters:
      probe - the state of the probe will be advance using the elements dynamics
      Throws:
      ModelException - an error occurred while advancing the probe state
      Since:
      Dec 16, 2014 by Christopher K. Allen
      See Also:
    • computeSynchronousPhaseAndEnergyGain

      public void computeSynchronousPhaseAndEnergyGain()
      Description copied from interface: IRfCavity
      Compute the synchronous phase and the energy gain for a cavity gap.
      Specified by:
      computeSynchronousPhaseAndEnergyGain in interface IRfCavity
    • getSynchronousPhase

      public double getSynchronousPhase()
      Description copied from interface: IRfCavity
      Return the synchronous phase of a cavity gap, which must be previously calculated using computeSynchronousPhase.
      Specified by:
      getSynchronousPhase in interface IRfCavity
      Returns:
      synchronous phase [rad]
    • getEnergyGain

      public double getEnergyGain()
      Return the energy gain of a cavity gap previously calculated.
      Specified by:
      getEnergyGain in interface IRfCavity
      Returns: