Class IdealPermMagQuad

All Implemented Interfaces:
IElectromagnet, IComponent, IElement

public class IdealPermMagQuad extends ThickElectromagnet
Represents an ideal permanent magnet quadrupole for a beam transport/accelerator system. These magnets have significant field profiles and, thus, must be stepped through
Author:
Hiroyuki Sako
  • Field Details

  • Constructor Details

    • IdealPermMagQuad

      public IdealPermMagQuad(String strId, int enmOrient, double dblFld, double dblLen)
      Creates a new instance of IdealMagQuad
      Parameters:
      strId - identifier for this IdealMagQuad object
      enmOrient - enumeration specifying the quadrupole orientation (ORIENT_HOR or ORIENT_VER)
      dblFld - field gradient strength (in Tesla/meter)
      dblLen - length of the quadrupole
    • IdealPermMagQuad

      public IdealPermMagQuad()
      JavaBean constructor - creates a new uninitialized instance of IdealMagQuad BE CAREFUL
  • Method Details

    • getBRhoScaling

      public double getBRhoScaling()
    • setBRhoScaling

      public void setBRhoScaling(double d)
    • getOrientProbe

      public double getOrientProbe()
    • setOrientProbe

      protected void setOrientProbe(int orient)
    • setFringeLeft

      public void setFringeLeft(int edge)
    • setFringeRight

      public void setFringeRight(int edge)
    • getFringeLeft

      public int getFringeLeft()
    • getFringeRight

      public int getFringeRight()
    • getFringeFactor

      public double getFringeFactor()
    • getK

      public double getK()
    • setRadIn

      public void setRadIn(double ri)
    • setRadOut

      public void setRadOut(double ro)
    • setSCenter

      public void setSCenter(double se)
    • setSLength

      public void setSLength(double sl)
    • setEffLength

      public void setEffLength(double el)
    • setFringeLenEntr

      public void setFringeLenEntr(double fl)
    • setFringeLenExit

      public void setFringeLenExit(double fl)
    • getRadIn

      public double getRadIn()
    • getRadOut

      public double getRadOut()
    • getSCenter

      public double getSCenter()
    • getSLength

      public double getSLength()
    • getEffLength

      public double getEffLength()
    • setFieldPathFlag

      public void setFieldPathFlag(double ba)
    • setNominalKineEnergy

      public void setNominalKineEnergy(double ba)
    • getFieldPathFlag

      public double getFieldPathFlag()
    • getNominalKineEnergy

      public double getNominalKineEnergy()
    • getK1

      public double getK1()
    • setK1

      public void setK1(double k1)
    • 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 ThickElement
      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)
      Return the energy ga in imparted to a particular probe. For an ideal quadrupole magnet this value is always zero.
      Specified by:
      energyGain in interface IElement
      Specified by:
      energyGain in class ThickElement
      Parameters:
      dblLen - dummy argument
      probe - dummy argument
      Returns:
      returns a zero value
    • transferMap

      public PhaseMap transferMap(IProbe probe, double dL, double k, int orientation)
      Compute the partial transfer map of an ideal permanent quadrupole for the particular probe. Computes transfer map for a section of quadrupole dblLen meters in length.
      Parameters:
      probe - supplies the charge, rest and kinetic energy parameters
      dL - compute transfer matrix for section of this length
      k - focal strength
      orientation -
      Returns:
      transfer map of ideal quadrupole for particular probe
    • kFringeFromOthers

      protected double kFringeFromOthers(IProbe probe, double dblLen)
    • calcK

      public double calcK(IProbe probe, double dblLen)
      Removed - Jan 2019 Natalia Milas private static PhaseMatrix applyAlignErrorStatic(PhaseMatrix matPhi, double delx, double dely, double delz) { if ((delx==0)&&(dely==0)&&(delz==0)) { return matPhi; } PhaseMatrix T = new PhaseMatrix(); //T = Translation Matrix by Chris Allen // |1 0 0 0 0 0 dx| // |0 1 0 0 0 0 0| // |0 0 1 0 0 0 dy| // |0 0 0 1 0 0 0| // |0 0 0 0 1 0 dz| // |0 0 0 0 0 1 0| // |0 0 0 0 0 0 1| // T(d)r = r+dr // where // r = |x | // |x'| // |y | // |y'| // |z | // |z'| // |1 | // dr = |dx | // |0 | // |dy | // |0 | // |dz | // |0 | // |0 | for (int i=0;i<7;i++) { T.setElem(i,i,1); } T.setElem(0,6,-delx); T.setElem(2,6,-dely); T.setElem(4,6,-delz); PhaseMatrix Phidx = T.inverse().times(matPhi).times(T); return Phidx; }
    • kFringe

      public double kFringe(IProbe probe, double dblLen)
    • getUseApproxLens

      public static boolean getUseApproxLens()
    • transferMap

      public 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 ThickElement
      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
      See Also:
    • print

      public void print(PrintWriter os)
      Dump current state and content to output stream.
      Overrides:
      print in class Element
      Parameters:
      os - output stream object