Class AxialFieldSpectrum

java.lang.Object
xal.tools.beam.em.AxialFieldSpectrum

public class AxialFieldSpectrum extends Object

Class that representing the spatial spectral properties of a time-harmonic, axial electric field. The most important properties from a beam physics standpoint are the transit time factors. These are the components of the Fourier transform of the axial field, and their resulting Hilbert transforms. The Hilbert transform of a transit time factor turns out to be the transit time factor of axial field times the signum function. The spectral pre- and post-envelopes are formed from a transit time factor and its Hilbert transform. These pre- and post-envelopes are the primary entities for computing the pre- and post-gap energy gain and phase jump, respectively.

Partial Field Model

This class attempts to maintain backward compatibility between the RF acceleration model produced by Los Alamos and CERN. There the Tq and S transit time factors are zero. Although usually labeled S, the "sine" transit time factor is actually its quadrature conjugate Sq. That model also requires an "offset" Δz which is the distance between the coordinate origin and the field center (the point of symmetry). The assumptions are that the field is symmetric about the axial location Δz, if not this information is lost.

In the partial field model the provided spectra, T, Sq, and their derivatives, are assumed to be functions of normalized particle velocity β ≜ v/c, where v is particle velocity and c is the speed of light. Thus, the functions T(β), dT(β)/dk, Sq(β), and dSq(β)/dk are provided to the partial field model constructor.

Note the important difference that in the full-field model the arguments of the spectra quantities are the particle wave number k. That is, the constructor for the full-field model takes spectral functions T(k), dT(k)/dk, Sq(k), and dSq(k)/dk, along with all the other spectral quantities.

Full Field Model

The current full-field model includes all four transit time factors and their derivatives. Thus, all the field information is kept, no offsets are necessary, and there is information enough to compute the post gap energy gain and phase jump. (In the above model the post gap quantities are assumed to be equal to the pre-gap quantities.) When function objects are provided for all four transit time factors this class assumes that the new model is being used. When only T and S are provided the class assumes that the old model is being used. Further assumptions are

· The sine transit time factor S is actually the conjugate Sq (see below)
· The offset Δz must also be provided

The class then makes the appropriate conversions from the quantities (T,T',S,S'z) to (T,T',Tq,T'q,S,S',Sq,S'q). Of course the later set is incomplete.

Axial Electric Fields

Let the longitudinal electric field along the beam axis z be denoted Ez(z). Let the total voltage gain long the field be denoted V0, that is,

    V0 ≜ ∫Ez(z) dz .

Note then that the total available energy gain ΔW0 for a particle falling through the field Ez(z) is qV0. The value V0 is used to create the normalized electric field ez(z) given by

    ez(z) ≜ (1/V0)Ez(z) .

All spectral quantities in this class are with respect to this normalized field.

Next, let sgn(z) denote the signum function, that is,

     sgn(z) ≜ -1    z  < 0
              +1    z  > 0
 
Finally, define the quadrature field Eq(z) as

    Eq(z) ≜ sgn(z) Ez(z) .

Of course the quantities here will be with respect to the normalized quadrature field eq(z) defined as
     ez(z) ≜ (1/V0)Eq(z) ,
           = sgn(z)ez(z) .
 

Transit Time Factors

There are four (4) transit time factors. These transit time factors are described as follows:

· T(k) - The Fourier cosine transform of axial field Ez(z)
    T(k) ≜ (1/V0)∫Ez(z) cos kz dz

· S(k) - The Fourier sine transform of axial field Ez(z)
    S(k) ≜ (1/V0)∫Ez(z) sin kz dz

· Tq(k) - The Fourier cosine transform of the axial field sgn(z)Ez(z)
    Tq(k) ≜ (1/V0)∫sgn(z)Ez(z) cos kz dz

· Sq(k) - The Fourier sine transform of axial field sgn(z)Ez(z)
    Sq(k) ≜ (1/V0)∫ sgn(z)Ez(z) sin kz dz

where k is the synchronous particle wave number. Sometimes the arguments to the transit time factors is the synchronous particle velocity β. This includes that for the derivative functions as well (see below). One needs to check the method documentation for the argument type.

The derivatives of the transit time factors are also available. These are the derivatives with respect to wave number k and will be denoted T'(k), S'(k), T'q(k), and S'q(k).

Hilbert Transform

The transit time factors are related to each other via the Hilbert transform ℋ. Specifically,

    Tq(k) = -ℋ[S(k)] ,
    Sq(k) = +ℋ[T(k)] .

This is a transitive relation which follows from the anti-selfadjointness of the Hilbert transform, thus,

    T(k) = -ℋ[Sq(k)] ,
    S(k) = +ℋ[Tq(k)] .

The Hilbert transform also relates the field spectra, as shown below.

Field Spectra

Denote by ℰz(k) and ℰq(k) the Fourier transforms of the axial field ez(z) and its conjugate eq(z), respectively. That is, the field spectra are

    ℰz(k) ≜ ℱ[ez](k) ,
    ℰq(k) ≜ ℱ[eq](k) ,

where ℱ[·] is the Fourier transform operator. The Fourier transforms of the fields have the decomposition

    ℰz(k) = T(k) - iS(k) ,
    ℰq(k) = Tq(k) - iSq(k) ,

where i is the imaginary unit. The spectra are then related by the Hilbert transforms

    ℋ[ℰz(k)] = iℰq(k) ,
    ℋ[ℰq(k)] = iℰz(k) ,

Thus, we see ℰz(k) and ℰq(k) are conjugates of each other.

Pre- and Post-Envelope Spectra

The pre- and post-envelope spectra can be formed from the field spectra. First, denote by ℰ-(k) and ℰ+(k) the pre- and post-envelope spectra, respectively. They are defined

    ℰ-(k) ≜ (1/2)[ ℰz(k) + iℋ[ℰz(k] ] = (1/2)[ ℰz(k) - ℰq(k) ],
    ℰ+(k) ≜ (1/2)[ ℰz(k) + iℋ[ℰz(k] ] = (1/2)[ ℰz(k) + ℰq(k) ] ,

Let φ be the synchronous particle phase at the gap center. Then the quantities e-iφ-(k) and e-iφ+(k) contain the pre- and post-gap energy gain ΔW-, ΔW+ and phase jump Δφ-, Δφ+, respectively. For example, the real part of e-iφ-(k) tracks the pre-gap energy gain while the imaginary part tracks the phase jump. We have

    ΔW-(φ,k) = qV0 Re ℰ-(k)e-iφ ,
    Δφ-(φ,k) = d/dk Im Ki-(k)e-iφ ,

where q is the unit charge and Ki is the quantity

    Kik0(qV0/mc2)(1/βi3γi3) .

The subscript i indicates initial, pre-gap values. The post-gap quantities have analogous expressions

    ΔW+(k,φ) = (q/2) Re e-iφ-(k) ,
    Δφ+(k,φ) = (Kf/2) Im d/dk e-iφ-(k) ,

The subscript f indicates final, post-gap quantities. Methods to compute these values are provided.

Since:
Sep 23, 2015
Version:
Sep 23, 2015
Author:
Christopher K. Allen
  • Constructor Summary

    Constructors
    Constructor
    Description
    AxialFieldSpectrum(double dblFreq, double dblOffset, IRealFunction fncTz0, IRealFunction fncDTz0, IRealFunction fncSq0, IRealFunction fncDSq0)
    Constructor for creating a partial field model object using a central field offset.
    Constructor for creating the full field model using the sine and cosine transform and their conjugates.
  • Method Summary

    Modifier and Type
    Method
    Description
    cnjSpectrum(double k)
    Computes and returns the complex spectral of the conjugate spatial field at the given wave number k.
    dkCnjSpectrum(double k)
    Computes and returns the derivative, with respect to the wave number k, of the quadrature field spectrum at the given wave number k.
    dkFldSpectrum(double k)
    Computes and returns the derivative, with respect to the wave number k, of the field spectrum at the given wave number k.
    Compute and return the derivative of the spectral post-envelope ℰ+(k), that is d+(k)/dk.
    dkPreEnvSpectrum(double k)
    Compute and return the derivative of the spectral pre-envelope ℰ-(k), that is d-(k)/dk.
    double
    dkSq(double k)
    Returns the derivative dS(k)/dk of the conjugate sine transit-time factor w.r.t. the particle wave number k.
    double
    dkSz(double k)
    Returns the derivative of the sine transit-time factor dSz/dk with respect to the particle wave number k .
    double
    dkTq(double k)
    Returns the derivative dT(k)/dk of the conjugate cosine transit-time factor w.r.t. the particle wave number k.
    double
    dkTz(double k)
    Returns the derivative of the cosine transit time factor Tz w.r.t. the wave number k.
    fldSpectrum(double k)
    Computes and returns the complex spectra of this spatial field at the given wave number k.
    Returns the offset between the axis origin and the center of the field, however that is defined.
    double
    Returns the time-harmonic frequency of this electric field.
    boolean
    Returns true when this object has been initialized to use the partial field model.
    postEnvSpectrum(double k)
    Compute and return the spectral post-envelope ℰ+(k).
    preEnvSpectrum(double k)
    Compute and return the spectral pre-envelope ℰ-(k).
    double
    sq(double k)
    Returns the conjugate sine transit-time factor Sq, proportional to the Fourier sine transform of the field sgn(z)Ez(z).
    double
    sz(double k)
    Returns the sine transit-time factor Sz, proportional to the Fourier sine transform of the axial field, for the given wave number.
    double
    tq(double k)
    Returns the conjugate cosine transit-time factor Tq, proportional to the Fourier cosine transform of the field sgn(z)Ez(z).
    double
    tz(double k)
    Returns the cosine transit time factor Tz, proportional to the Fourier cosine transform, for the given wave number.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AxialFieldSpectrum

      public AxialFieldSpectrum(double dblFreq, double dblOffset, IRealFunction fncTz0, IRealFunction fncDTz0, IRealFunction fncSq0, IRealFunction fncDSq0)

      Constructor for creating a partial field model object using a central field offset.

      In this case the given field spectra are assumed to be functions of normalized particle velocity β. Thus, the RF frequency is needed to convert from wave number k to normalized velocity β in order to evaluate the functions.

      Parameters:
      dblFreq - frequency of the time-harmonic electric field (Hz)
      dblOffset - offset between axial origin and central field position (meters)
      fncTz0 - central cosine transform (transit time factor)
      fncDTz0 - derivative of the central cosine transform w.r.t. k
      fncSq0 - conjugate central sine transform (transit time factor)
      fncDSq0 - derivative of the conjugate central sine transform w.r.t. k
      Since:
      Sep 23, 2015 by Christopher K. Allen
    • AxialFieldSpectrum

      public AxialFieldSpectrum(IRealFunction fncTz, IRealFunction fncDTz, IRealFunction fncSz, IRealFunction fncDSz, IRealFunction fncTq, IRealFunction fncDTq, IRealFunction fncSq, IRealFunction fncDSq)

      Constructor for creating the full field model using the sine and cosine transform and their conjugates. The pre- and post-envelope spectra are build from these objects and used to compute acceleration parameters.

      Note that frequency f is not needed here since the given arguments are assumed to be functions of k. RF frequency is only needed to convert from wave number k to normalized velocity β in the case of spectral functions that are functions of β (e.g., T(β), S(β), etc.).

      Parameters:
      fncTz - field cosine transform (transit time factor)
      fncDTz - derivative of the cosine transform w.r.t. k
      fncSq - field conjugate sine transform (transit time factor)
      fncDSq - derivative of the sine transform w.r.t. k
      fncTq - field conjugate cosine transform (transit time factor)
      fncDTq - derivative of the conjugate cosine transform w.r.t. k
      fncSz - field sine transform (transit time factor)
      fncDSz - derivative of the field sine transform w.r.t. k
      Since:
      Sep 28, 2015 by Christopher K. Allen
  • Method Details

    • isPartialFieldModel

      public boolean isPartialFieldModel()
      Returns true when this object has been initialized to use the partial field model.
      Returns:
      Since:
      Sep 28, 2015 by Christopher K. Allen
    • getFrequency

      public double getFrequency()
      Returns the time-harmonic frequency of this electric field.
      Returns:
      the RF frequency of the electric field (Hz)
      Since:
      Sep 28, 2015 by Christopher K. Allen
    • getFieldOffset

      public Double getFieldOffset()

      Returns the offset between the axis origin and the center of the field, however that is defined. That is, it could be defined as the point of maximum field, or the center of mass, etc.

      If the full field model is being used then this parameter is not defined and a null value will be returned.

      Returns:
      offset between field center and axis origin in partial field model (meters), or null if the full field model is being used
      Since:
      Sep 28, 2015 by Christopher K. Allen
    • fldSpectrum

      public Complex fldSpectrum(double k)

      Computes and returns the complex spectra of this spatial field at the given wave number k. The value returned has the formula

          ℰz(k) = Tz(k
      ) - i Sz(k)

      where ℰz is the returned spectral value, Tz is the cosine transit-time factor, and Sz is the sine transit-time factor.

      NOTES:

      · We assume that the electric field is normalized by its total potential drop V0 ≜ ∫Ez(z)dz so that the resulting total potential of the field is 1.

      Parameters:
      k - particle wave number (in radians/meter)
      Returns:
      the Fourier spectrum ℰ(k) of the field at the given wave number k
      Since:
      Sep 30, 2015, Christopher K. Allen
    • dkFldSpectrum

      public Complex dkFldSpectrum(double k)

      Computes and returns the derivative, with respect to the wave number k, of the field spectrum at the given wave number k. The value returned has the formula

          ℰz'(k) = T'z(k) - i Sz'(k)

      where ℰz' is the returned spectral derivative, Tz' is the cosine transit-time factor derivative, and Sz' is the sine transit-time factor derivative of the field.

      NOTES:

      · We assume that the electric field is normalized by its total potential drop V0 ≜ ∫Ez(z)dz so that the resulting total potential of the field is 1.

      Parameters:
      k - particle wave number (in radians/meter)
      Returns:
      Fourier spectrum derivative ℰ'(k), w.r.t. k, of the field at the given wave number k (meters/radian)
      Since:
      Sep 30, 2015, Christopher K. Allen
    • cnjSpectrum

      public Complex cnjSpectrum(double k)

      Computes and returns the complex spectral of the conjugate spatial field at the given wave number k. The value returned has the formula

          ℰq(k) = Tq(k) - i Sq(k)

      where ℰq is the returned spectral value, Tq is the cosine transit-time factor of the quadrature field, and Sq is the sine transit-time factor of the quadrature field.

      NOTES:

      · We assume that the electric field is normalized by its total potential drop V0 ≜ ∫Ez(z)dz so that the resulting total potential of the field is 1.

      Parameters:
      k - particle wave number (in radians/meter)
      Returns:
      the Fourier spectrum ℰq(k) of the quadrature field at the given wave number k (unitless)
      Since:
      Sep 30, 2015, Christopher K. Allen
    • dkCnjSpectrum

      public Complex dkCnjSpectrum(double k)

      Computes and returns the derivative, with respect to the wave number k, of the quadrature field spectrum at the given wave number k. The value returned has the formula

          ℰq'(k) = Tq'(k) - i Sq'(k)

      where ℰq' is the returned spectral derivative, Tq' is the cosine transit-time factor derivative of the quadrature field, and Sq is the sine transit-time factor derivative of the quadrature field.

      NOTES:

      · We assume that the electric field is normalized by its total potential drop V0 ≜ ∫Ez(z)dz so that the resulting total potential of the field is 1.

      Parameters:
      k - particle wave number (in radians/meter)
      Returns:
      Fourier spectrum derivative ℰq'(k) w.r.t. k of the quadrature field at the given wave number k (meters/radian)
      Since:
      Sep 30, 2015, Christopher K. Allen
    • preEnvSpectrum

      public Complex preEnvSpectrum(double k)

      Compute and return the spectral pre-envelope ℰ-(k). The spectral pre- and post-envelopes turn out to be equal to odd and even combinations, respectively, of the field spectra. Specifically, the pre- and post-envelopes ℰ-(k) and ℰ+(k) are given by

          ℰ-(k) = (1/2)[ ℰz(k) - ℰq(k) ] ,
          ℰ+(k) = (1/2)[ ℰz(k) + ℰq(k) ] ,

      where ℰz(k) is the Fourier spectrum of the axial field and ℰq(k) is the spectrum of the quadrature field (the conjugate Fourier transform).

      NOTES:

      · We assume that the electric field is normalized by its total potential drop V0 ≜ ∫Ez(z)dz so that the resulting total potential of the field is 1.

      Parameters:
      k - the particle wave number (radians/meter)
      Returns:
      the pre-envelope ℰ-(k) at the given wave number (unitless)
      Since:
      Sep 30, 2015, Christopher K. Allen
    • dkPreEnvSpectrum

      public Complex dkPreEnvSpectrum(double k)

      Compute and return the derivative of the spectral pre-envelope ℰ-(k), that is d-(k)/dk. For a description of the pre-envelope see preEnvSpectrum(double) or the class documentation.

      NOTES:

      · We assume that the electric field is normalized by its total potential drop V0 ≜ ∫Ez(z)dz so that the resulting total potential of the field is 1.

      Parameters:
      k - the particle wave number (radians/meter)
      Returns:
      derivative of the pre-envelope spectrum d-(k)/dk at the given wave number (in meters/radian)
      Since:
      Oct 1, 2015, Christopher K. Allen
      See Also:
    • postEnvSpectrum

      public Complex postEnvSpectrum(double k)

      Compute and return the spectral post-envelope ℰ+(k). The spectral pre- and post-envelopes turn out to be equal to odd and even combinations, respectively, of the field spectra. Specifically, the pre- and post-envelopes ℰ-(k) and ℰ+(k) are given by

          ℰ-(k) = (1/2)[ ℰz(k) - ℰq(k) ] ,
          ℰ+(k) = (1/2)[ ℰz(k) + ℰq(k) ] ,

      where ℰz(k) is the Fourier spectrum of the axial field and ℰq(k) is the spectrum of the quadrature field (the conjugate Fourier transform).

      NOTES:

      · We assume that the electric field is normalized by its total potential drop V0 ≜ ∫Ez(z)dz so that the resulting total potential of the field is 1.

      Parameters:
      k - the particle wave number (radians/meter)
      Returns:
      the post-envelope ℰ+(k) at the given wave number (unitless)
      Since:
      Sep 30, 2015, Christopher K. Allen
    • dkPostEnvSpectrum

      public Complex dkPostEnvSpectrum(double k)

      Compute and return the derivative of the spectral post-envelope ℰ+(k), that is d+(k)/dk. For a description of the post-envelope see postEnvSpectrum(double) or the class documentation.

      NOTES:

      · We assume that the electric field is normalized by its total potential drop V0 ≜ ∫Ez(z)dz so that the resulting total potential of the field is 1.

      Parameters:
      k - the particle wave number (radians/meter)
      Returns:
      derivative of the post-envelope spectrum d-(k)/dk at the given wave number (in meters/radian)
      Since:
      Oct 1, 2015, Christopher K. Allen
      See Also:
    • tz

      public double tz(double k)
      Returns the cosine transit time factor Tz, proportional to the Fourier cosine transform, for the given wave number.
      Parameters:
      k - particle wave number with respect to the RF frequency (radians/meter)
      Returns:
      the value of T(k) (unitless)
      Since:
      Sep 28, 2015 by Christopher K. Allen
    • dkTz

      public double dkTz(double k)
      Returns the derivative of the cosine transit time factor Tz w.r.t. the wave number k.
      Parameters:
      k - particle wave number with respect to the RF frequency (radians/meter)
      Returns:
      the value of dTz(k)/dk (meters/rad)
      Since:
      Sep 28, 2015 by Christopher K. Allen
    • sz

      public double sz(double k)
      Returns the sine transit-time factor Sz, proportional to the Fourier sine transform of the axial field, for the given wave number.
      Parameters:
      k - particle wave number with respect to the RF frequency (radians/meter)
      Returns:
      the value of Sz(k) (unitless)
      Since:
      Sep 28, 2015 by Christopher K. Allen
    • dkSz

      public double dkSz(double k)
      Returns the derivative of the sine transit-time factor dSz/dk with respect to the particle wave number k .
      Parameters:
      k - particle wave number with respect to the RF frequency (radians/meter)
      Returns:
      the value of dSz(k)/dk (meters/radian)
      Since:
      Sep 28, 2015 by Christopher K. Allen
    • tq

      public double tq(double k)
      Returns the conjugate cosine transit-time factor Tq, proportional to the Fourier cosine transform of the field sgn(z)Ez(z).
      Parameters:
      k - the particle wave number w.r.t. the RF frequency (radians/meter)
      Returns:
      the conjugate cosine transit-time factor Tq(k) (unitless)
      Since:
      Sep 29, 2015 by Christopher K. Allen
    • dkTq

      public double dkTq(double k)
      Returns the derivative dT(k)/dk of the conjugate cosine transit-time factor w.r.t. the particle wave number k.
      Parameters:
      k - the particle wave number w.r.t. the RF frequency (radians/meter)
      Returns:
      the value of dTq(k)/dk (meters/rad)
      Since:
      Sep 29, 2015, Christopher K. Allen
    • sq

      public double sq(double k)
      Returns the conjugate sine transit-time factor Sq, proportional to the Fourier sine transform of the field sgn(z)Ez(z).
      Parameters:
      k - the particle wave number w.r.t. the RF frequency (radians/meter)
      Returns:
      the conjugate cosine transit-time factor Sq(k) (unitless)
      Since:
      Sep 29, 2015 by Christopher K. Allen
    • dkSq

      public double dkSq(double k)
      Returns the derivative dS(k)/dk of the conjugate sine transit-time factor w.r.t. the particle wave number k.
      Parameters:
      k - the particle wave number w.r.t. the RF frequency (radians/meter)
      Returns:
      the value of dSq(k)/dk (meters/rad)
      Since:
      Sep 29, 2015, Christopher K. Allen