gov.sns.xal.model.elem
Class IdealRfGap

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

public class IdealRfGap
extends ThinElement
implements IRfGap

Represents the action of an ideal RF gap. Gap is modeled as a thin element whose accelerating action is given by the Panofsky formula.

The gap provides acceleration to the propagation probe as well as longitudinal focusing and radial defocusing. These mechanisms are implemented according to that provided by an ideal gap where the effects can be described analytically.


Field Summary
static java.lang.String s_strParamETL
          Parameters for XAL MODEL LATTICE dtd
static java.lang.String s_strParamFreq
           
static java.lang.String s_strParamPhase
           
static java.lang.String s_strType
          the string type identifier for all IdealRfGap objects
 
Fields inherited from interface gov.sns.xal.model.IElement
LightSpeed, Permeability, Permittivity, UnitCharge
 
Constructor Summary
IdealRfGap()
          JavaBean constructor - creates a new unitialized instance of IdealRfGap BE CAREFUL
IdealRfGap(java.lang.String strId, double dblETL, double dblPhase, double dblFreq)
          Creates a new instance of IdealRfGap
 
Method Summary
 double compLongFocusing(IProbe probe)
          Get the longitudinal focusing constant for a particular probe.
 double compTransFocusing(IProbe probe)
          Get the transverse focusing constant for a particular probe.
 double elapsedTime(IProbe probe)
          Returns the time taken for the probe to propagate through element.
 double energyGain(IProbe probe)
          Compute the energy gain of the RF gap for a probe including the effects of calculating the phase advance.
 double getCellLength()
          return the cell length (m)
 double getE0()
          Get the on accelerating field (V/m)
 double getETL()
          Return the ETL product of the gap, where E is the longitudinal electric field, T is the transit time factor, and L is the gap length.
 double getFrequency()
          Get the operating frequency of the RF gap.
 double getPhase()
          Return the RF phase delay of the gap with respect to the synchonous particle.
 void initializeFrom(IModelDataSource source)
          Initializes this element from the supplied data source.
 boolean isFirstGap()
          return wheteher this gap is the initial gap of a cavity
 void print(java.io.PrintWriter os)
          Dump current state and content to output stream.
 void setE0(double E)
          Set the on accelerating field
 void setETL(double dblETL)
          Set the ETL product of the RF gap where E is the longitudinal electric field of the gap, T is the transit time factor of the gap, L is the length of the gap.
 void setFrequency(double dblFreq)
          Set the operating frequency of the RF gap.
 void setPhase(double dblPhase)
          Set the phase delay of the RF in gap with respect to the synchronous particle.
 double simpleEnergyGain(IProbe probe)
          Compute the energy gain of the RF gap for a probe assuming a fixed default phase at the gap center.
protected  PhaseMap transferMap(IProbe probe)
          Compute the tranfer map for an ideal RF gap.
 
Methods inherited from class gov.sns.xal.model.elem.ThinElement
elapsedTime, energyGain, getLength, transferMap
 
Methods inherited from class gov.sns.xal.model.elem.Element
compDriftingTime, getId, getType, getUID, 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
the string type identifier for all IdealRfGap objects

See Also:
Constant Field Values

s_strParamETL

public static final java.lang.String s_strParamETL
Parameters for XAL MODEL LATTICE dtd

See Also:
Constant Field Values

s_strParamPhase

public static final java.lang.String s_strParamPhase
See Also:
Constant Field Values

s_strParamFreq

public static final java.lang.String s_strParamFreq
See Also:
Constant Field Values
Constructor Detail

IdealRfGap

public IdealRfGap(java.lang.String strId,
                  double dblETL,
                  double dblPhase,
                  double dblFreq)
Creates a new instance of IdealRfGap

Parameters:
strId - instance identifier of element
dblETL - field/transit time/length factor for gap (in volts)
dblPhase - operating phase of gap (in radians)
dblFreq - operating RF frequency of gap (in Hertz)

IdealRfGap

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

Method Detail

getETL

public double getETL()
Return the ETL product of the gap, where E is the longitudinal electric field, T is the transit time factor, and L is the gap length.

Specified by:
getETL in interface IRfGap
Returns:
the ETL product of the gap (in volts).

getPhase

public double getPhase()
Return the RF phase delay of the gap with respect to the synchonous particle.

Specified by:
getPhase in interface IRfGap
Returns:
phase delay w.r.t. synchonous particle (in radians).

getFrequency

public double getFrequency()
Get the operating frequency of the RF gap.

Specified by:
getFrequency in interface IRfGap
Returns:
frequency of RF gap (in Hertz)

isFirstGap

public boolean isFirstGap()
return wheteher this gap is the initial gap of a cavity


setETL

public void setETL(double dblETL)
Set the ETL product of the RF gap where E is the longitudinal electric field of the gap, T is the transit time factor of the gap, L is the length of the gap.

The maximum energy gain from the gap is given by qETL where q is the charge (in coulombs) of the species particle.

Specified by:
setETL in interface IRfGap
Parameters:
dblETL - ETL product of gap (in volts).

setPhase

public void setPhase(double dblPhase)
Set the phase delay of the RF in gap with respect to the synchronous particle. The actual energy gain from the gap is given by qETLcos(dblPhi) where dbkPhi is the phase delay.

Specified by:
setPhase in interface IRfGap
Parameters:
dblPhase - phase delay of the RF w.r.t. synchonouse particle (in radians).

setFrequency

public void setFrequency(double dblFreq)
Set the operating frequency of the RF gap.

Specified by:
setFrequency in interface IRfGap
Parameters:
dblFreq - frequency of RF gap (in Hertz)

setE0

public void setE0(double E)
Set the on accelerating field

Specified by:
setE0 in interface IRfGap

getE0

public double getE0()
Get the on accelerating field (V/m)

Specified by:
getE0 in interface IRfGap

getCellLength

public double getCellLength()
return the cell length (m)


initializeFrom

public void initializeFrom(IModelDataSource source)
                    throws ModelException
Initializes this element from the supplied data source.

Specified by:
initializeFrom in interface IElement
Overrides:
initializeFrom in class Element
Parameters:
source - an instance of RfGapDataSource
Throws:
java.lang.IllegalArgumentException - if source not of expected type
ModelException - if error initializing from source

elapsedTime

public double elapsedTime(IProbe probe)
Returns the time taken for the probe to propagate through element.

Specified by:
elapsedTime in class ThinElement
Parameters:
probe - propagating probe
Returns:
value of zero

energyGain

public double energyGain(IProbe probe)
Compute the energy gain of the RF gap for a probe including the effects of calculating the phase advance.

Specified by:
energyGain in class ThinElement
Parameters:
probe - uses the particle species charge
Returns:
energy gain for this probe (in electron-volts)

transferMap

protected PhaseMap transferMap(IProbe probe)
                        throws ModelException
Compute the tranfer map for an ideal RF gap.

Specified by:
transferMap in class ThinElement
Parameters:
probe - compute tranfer map using paramters from this probe
Returns:
tranfer map for the probe
Throws:
ModelException - this should not occur

simpleEnergyGain

public double simpleEnergyGain(IProbe probe)
Compute the energy gain of the RF gap for a probe assuming a fixed default phase at the gap center.

Parameters:
probe - uses the particle species charge
Returns:
energy gain for this probe (in electron-volts)

compTransFocusing

public double compTransFocusing(IProbe probe)
Get the transverse focusing constant for a particular probe. The focusing constant is used in the construction of the transfer matrix for the RF gap. A gap provides longitudinal focusing and transverse defocusing as well as a gain in beam energy. This focusing constant describes the effect in the transverse direction, which is defocusing and, therefore, negative.

The value represents the thin lens focusing constant for an ideal RF gap (this is the inverse of the focal length). To compute the focusing action for the lens we must include beam energy, which is changing through the gap. We use the value of beta for which the beam has received half the total energy gain.

Parameters:
probe - beam energy and particle charge are taken from the probe
Returns:
(de)focusing constant (in radians/meter)

compLongFocusing

public double compLongFocusing(IProbe probe)
Get the longitudinal focusing constant for a particular probe. The focusing constant is used in the construction of the transfer matrix for the RF gap. A gap provides longitudinal focusing and transverse defocusing as well as a gain in beam energy. This focusing constant describes the effect in the longitudinal direction, which is focusing and, therefore, positive.

The value represents the thin lens focusing constant for an ideal RF gap (this is the inverse of the focal length). To compute the focusing action for the lens we must include beam energy, which is changing through the gap. We use the value of beta for which the beam has received half the total energy gain.

Parameters:
probe - beam energy and particle charge are taken from the probe
Returns:
(de)focusing constant (in radians/meter)

print

public void print(java.io.PrintWriter os)
Dump current state and content to output stream.

Overrides:
print in class Element
Parameters:
os - output stream object