public class EnvTrackerAdapt extends EnvelopeTrackerBase
Tracking algorithm for EnvelopeProbe
's. The EnvelopeProbe
's
state, which is a CovarianceMatrix
object, is advanced using the linear
dynamics portion of any beamline element (IElement
exposing object) transfer
map. The linear portion is represented as a matrix, thus, the state advance is accomplished
with a transpose conjugation with this matrix.
The effects of space charge are also included in the dynamics calculations. Space charge effects are also represented with a matrix transpose conjugation, however, the matrix is computed using the values of the probe's correlation matrix. The result is a nonlinear effect. The space charge forces are computed using a linear fit to the fields generated by an ellipsoidal charge distribution with the same statistics described in the probe's correlation matrix. The linear fit is weighted by the beam distribution itself, so it is more accurate in regions of higher charged density. For a complete description see the reference below.
This algorithm uses a second-order accurate, adaptive step sizing algorithm where the step size is continually adjusted to maintain an given error tolerance in the residual.
EnvelopeTrackerBase.EmitGrowthModel, EnvelopeTrackerBase.PhasePlane
Modifier and Type | Field and Description |
---|---|
static int |
ACCUR_ERROR
Error condition in integration accuracy
|
static int |
ACCUR_ORDER1
1st order accurate integration algorithm
|
static int |
ACCUR_ORDER2
2nd order accurate integration algorithm
|
static int |
ACCUR_RANGE
Range of avaible integration accuracies
|
static int |
NORM_L1
l-1 norm
|
static int |
NORM_L2
l-2 norm
|
static int |
NORM_LINF
l-infinity norm
|
static java.lang.Class<EnvelopeProbe> |
s_clsProbeType
probe type recognized by this algorithm
|
static int |
s_intVersion
current algorithm version
|
static java.lang.String |
s_strTypeId
string type identifier for algorithm
|
ATTR_EMITGROWTH, ATTR_SCHEFF, ATTR_STEPSIZE, ATTR_USESPACECHARGE, LABEL_OPTIONS, TBL_LBL_ENVBASETRACKER
ATTRTAG_DEBUG, ATTRTAG_RFGAP_PHASE, ATTRTAG_TYPE, ATTRTAG_UPDATE, ATTRTAG_VER, NODETAG_ALG, NODETAG_TRACKER, TBL_PRIM_KEY_NAME, UPDATE_ALWAYS, UPDATE_CUSTOM, UPDATE_ENTRANCE, UPDATE_ENTRANCEANDEXIT, UPDATE_EXIT
Constructor and Description |
---|
EnvTrackerAdapt()
Creates a new, uninitialized instance of
EnvTrackerAdapt |
EnvTrackerAdapt(EnvTrackerAdapt sourceTracker)
Copy constructor for EnvTrackerAdapt
|
Modifier and Type | Method and Description |
---|---|
EnvTrackerAdapt |
copy()
Creates a deep copy of EnvTrackerAdapt
|
void |
doPropagation(IProbe ifcProbe,
IElement elem)
Propagates the probe through the element using a second-order accurate
adaptive step size algorithm for space charge calculations.
|
int |
getAccuracyOrder()
Get the current accuracy order of the space charge stepping
algorithm.
|
double |
getErrorTolerance()
Return the acceptable tolerance in the residual error between
a full step and two half steps.
|
double |
getInitStepSize()
Return the initial step size for this algorithm.
|
int |
getMatrixNorm()
Get the type of Lebesque norm used for matrices.
|
int |
getMaxIterations()
Return the maximum allowable number of steps to progate a probe through
an element.
|
double |
getMaxStepSize()
Return the maximum allowable step size.
|
double |
getMaxStepSizeDriftPmq()
Return the maximum allowable step size.
|
double |
getSlackTolerance()
Step size adjustment slack tolerance.
|
double |
getStepSize()
Return the current step size, that is, the step size currently
used in the propagation.
|
void |
initialize()
Initialize the algorithm object for propagation.
|
void |
load(DataAdaptor daptArchive)
Load the parameters of the algorithm from a data source exposing the
IArchive interface. |
void |
load(java.lang.String strPrimKeyVal,
EditContext ecTableData)
Load the parameters of this
IAlgorithm object from the
table data in the given EditContext . |
void |
save(DataAdaptor daptArchive)
Save the settings particular to this subclass of
Tracker . |
void |
setAccuracyOrder(int intOrder)
Set the integration accuracy order for the underlying
stepping algorithm.
|
void |
setErrorTolerance(double dblErr)
Set the acceptable error in the residual correlation matrix.
|
void |
setInitStepSize(double dblStepSize)
Set the initial step size for applying space charge
corrections.
|
void |
setMatrixNorm(int enmNorm)
Set the type of Lebesque norm used in the matrix calculations.
|
void |
setMaxIterations(int intMaxIter)
Sets the maximum allowable number of steps to progate a probe through
an element.
|
void |
setMaxStepSize(double dblMaxStep)
Set the maximum allowable step size.
|
void |
setMaxStepSizeDriftPmq(double dblMaxStepDriftPmq)
Set the maximum allowable step size.
|
void |
setSlackTolerance(double dblSlack)
Set the slack size in the adaptive step size determination.
|
void |
setStepSize(double dblStepSize)
Set the current step size for applying space charge
corrections.
|
protected void |
stepThinElement(EnvelopeProbe probe,
IElement ifcElem)
new stepThinElement by Sako, taken from EnvelopeTracker
Advances the probe state through a subsection of the element with the
specified length.
|
compEmitGrowthFunction, compLongFourierTransform, compScheffMatrix, compTransFourierTransform, correctLongSigmaPhaseSpread, correctSigmaPhaseSpread, correctTransFocusingPhaseSpread, correctTransSigmaPhaseSpread, effPhaseSpread, fourierLong1dGaussian, fourierLong1dUniform, fourierLong3dGaussian, fourierLong3dUniform, fourierLongTrace3d, fourierTrans1dGaussian, fourierTrans1dUniform, fourierTrans3dGaussian, fourierTrans3dUniform, fourierTransTrace3d, getEmitGrowthModel, getEmittanceGrowthFlag, getSpaceChargeFlag, modTransferMatrixForDisplError, modTransferMatrixForEmitGrowth, phaseSpread, setEmitGrowthModel, setEmittanceGrowth, setUseSpacecharge
advanceProbe, getDebugMode, getElemPosition, getProbeType, getProbeUpdatePolicy, getStartElementId, getStopElementId, getType, getVersion, isStopElementIncluded, newFromEditContext, newFromEditContext, newInstance, propagate, registerProbeType, retractProbe, setDebugMode, setElemPosition, setIncludeStopElement, setProbeUpdatePolicy, setRfGapPhaseCalculation, setStartElementId, setStopElementId, unsetStartElementId, unsetStopElementId, useRfGapPhaseCalculation, validElement, validProbe
public static final int NORM_LINF
public static final int NORM_L1
public static final int NORM_L2
public static final int ACCUR_ERROR
public static final int ACCUR_ORDER1
public static final int ACCUR_ORDER2
public static final int ACCUR_RANGE
public static final java.lang.String s_strTypeId
public static final int s_intVersion
public static final java.lang.Class<EnvelopeProbe> s_clsProbeType
public EnvTrackerAdapt()
EnvTrackerAdapt
public EnvTrackerAdapt(EnvTrackerAdapt sourceTracker)
sourceTracker
- Tracker that is being copiedpublic EnvTrackerAdapt copy()
public void initialize()
initialize
in interface IAlgorithm
initialize
in class Tracker
IAlgorithm.initialize()
public void setInitStepSize(double dblStepSize)
initialize()
method is called.dblStepSize
- initial step size in setInitStepSize(double)
,
initialize()
public void setStepSize(double dblStepSize)
setStepSize
in class EnvelopeTrackerBase
dblStepSize
- initial step size in public void setMaxStepSize(double dblMaxStep)
dblMaxStep
- maximum allowable step size in meterspublic void setMaxStepSizeDriftPmq(double dblMaxStepDriftPmq)
dblMaxStepDriftPmq
- maximum allowable step size in meterspublic void setMaxIterations(int intMaxIter)
intMaxIter
- maximum alllowable single-element step countpublic void setErrorTolerance(double dblErr)
dblErr
- acceptable residual errorpublic void setAccuracyOrder(int intOrder)
intOrder
- integration orderpublic void setSlackTolerance(double dblSlack)
dblSlack
- size of the slack region in meterspublic void setMatrixNorm(int enmNorm)
enmNorm
- enumeration constant of family EnvTrackerAdapt.NORM_*
public double getInitStepSize()
public double getStepSize()
getStepSize
in class EnvelopeTrackerBase
public int getMaxIterations()
public double getMaxStepSize()
public double getMaxStepSizeDriftPmq()
public int getAccuracyOrder()
setAccuracyOrder(int)
public double getErrorTolerance()
public double getSlackTolerance()
public int getMatrixNorm()
public void doPropagation(IProbe ifcProbe, IElement elem) throws ModelException
doPropagation
in class Tracker
ifcProbe
- probe to propagateelem
- element acting on probeModelException
- invalid probe type or error in advancing probeTracker.validProbe(IProbe)
public void load(java.lang.String strPrimKeyVal, EditContext ecTableData) throws DataFormatException
IAlgorithm
object from the
table data in the given EditContext
.
Here we load only the parameters specific to the base class. It is expected
that Subclasses should override this method to recover the data particular
to there own operation.load
in interface IContextAware
load
in class EnvelopeTrackerBase
strPrimKeyVal
- primary key value specifying the name of the data recordecTableData
- EditContext containing table dataDataFormatException
- bad data format - error in readingIContextAware.load(String, xal.tools.data.EditContext)
public void load(DataAdaptor daptArchive) throws DataFormatException
IArchive
interface.
The superclass load
method is called first, then the properties
particular to EnvTrackerAdapt are loaded.
load
in interface IArchive
load
in class EnvelopeTrackerBase
daptArchive
- data source containing algorithm configurationDataFormatException
- bad format in algorithm dataIArchive.load(xal.tools.data.DataAdaptor)
public void save(DataAdaptor daptArchive)
Tracker
.
The superclass save
method is called first, then the properties
particular to EnvTrackerAdapt are saved.
save
in interface IArchive
save
in class EnvelopeTrackerBase
daptArchive
- data sink exposing IArchive
interfaceIArchive.save(xal.tools.data.DataAdaptor)
protected void stepThinElement(EnvelopeProbe probe, IElement ifcElem) throws ModelException
ifcElem
- interface to the beam elementprobe
- interface to the probedblLen
- length of element subsection to advance throughModelException
- bad element transfer matrix/corrupt probe state