public class CsFixedPtEstimator extends CourantSnyderEstimator
Computes the twiss parameters from wire scanner data.
Computes the covariance matrix σ of second moments at the given device location
for the given beam current using the given RMS envelope data. The algorithm is started
by using the zero-current value covariance matrix as the initialize guess
(see
). The zero-current
covariance matrix is passed to the method
#computeCovarianceZeroCurrent(String, ArrayList)
.
#computeCovarianceFiniteCurrent(String, double, CovarianceMatrix, ArrayList)
A
object must be supplied
for the construction of one of these objects. This is done because of
the variety of options that exist when creating the transfer matrix
generator. It is safer to require pre-construction of the matrix
generator rather than offer all the opions for such generation here.
TransferMatrixGenerator
TransferMatrixGenerator
object must be supplied
for the construction of one of these objects. This is done because of
the variety of options that exist when creating the transfer matrix
generator. It is safer to require pre-construction of the matrix
generator rather than offer all the opions for such generation here.
Modifier and Type | Class and Description |
---|---|
static interface |
CsFixedPtEstimator.IProgressListener
Interface defining the methods to implement for a class that wishes to
monitor the progress of solution computation.
|
Modifier and Type | Field and Description |
---|---|
static double |
DBL_ALPHA
Default value of the fixed point iteration tuning parameter
|
static double |
DBL_MAX_ERR
Maximum residual error in solution
|
static int |
INT_MAX_ITER
Maximum number of solution iterations
|
bolDebug, dblConvErr, dblResErr, fmtMatrix, genTransMat, matCurrF, matCurrSigma
Constructor and Description |
---|
CsFixedPtEstimator(int cntMaxIter,
double dblMaxError,
double dblAlpha,
TransferMatrixGenerator genTransMat)
Creates a new
TwissObserver object using the given maximum iteration count,
maximum convergence error, and the given transfer matrix generator. |
CsFixedPtEstimator(TransferMatrixGenerator genTransMatrix)
Creates a new
TwissObserver object which uses the given transfer matrix
generator. |
Modifier and Type | Method and Description |
---|---|
void |
addProgressListener(CsFixedPtEstimator.IProgressListener lsnProg)
Adds the current
IProgressListener exposing object
to the list of objects receiving solution progress updates. |
CovarianceMatrix |
computeReconstruction(java.lang.String strRecDevId,
double dblBnchFreq,
double dblBmCurr,
java.util.ArrayList<Measurement> arrData)
Computes the covariance matrix σ of second moments at the given device location
for the given beam current using the given RMS envelope data.
|
CovarianceMatrix |
computeReconstruction(java.lang.String strRecDevId,
double dblBnchFreq,
double dblBmCurr,
CovarianceMatrix matSigInit,
java.util.ArrayList<Measurement> arrData)
Computes the covariance matrix σ of second moments at the given device location
for the given beam current for the given RMS envelope data.
|
int |
getSolnIterations()
Returns the number of fixed point iterations needed to compute the last computed
solution.
|
void |
setMaxError(double dblMaxError)
Directly set the iteration tolerance for the algorithm.
|
void |
setMaxIterations(int cntMaxIter)
Directly sets the maximum number of iterations allowed for the space charge algorithm.
|
void |
setSearchTuningValue(double dblAlpha)
The numerical tuning parameter α in the interval [0,1] which sets the normalized
step size taken between the current solution iterate and the next
solution iterate in Method 1.
|
computeConvergenceError, computeObservationMatrix, computeObservationMatrix, computeReconFunction, computeReconSubFunction, computeResidualError, computeZeroCurrReconFunction, getReconConvergenceError, getReconResidualError, getReconstruction, isDebuggingOn, setDebug
public static final int INT_MAX_ITER
public static final double DBL_MAX_ERR
public static final double DBL_ALPHA
public CsFixedPtEstimator(TransferMatrixGenerator genTransMatrix)
TwissObserver
object which uses the given transfer matrix
generator. The new object can only be used for the zero space charge case.genTransMatrix
- public CsFixedPtEstimator(int cntMaxIter, double dblMaxError, double dblAlpha, TransferMatrixGenerator genTransMat)
TwissObserver
object using the given maximum iteration count,
maximum convergence error, and the given transfer matrix generator. This constructor must
be used if Twiss parameters are to be computed in the presence of space charge
(see #computeCovarianceFiniteCurrent(String, double, ArrayList)
).cntMaxIter
- maximum number of allowed search iterationsdblMaxError
- maximum L2 convergence error in the solutiondblAlpha
- the default value of the fixed point iteration tuning parametergenTransMat
- a pre-configured transfer matrix engine used internally.public void setMaxIterations(int cntMaxIter)
cntMaxIter
- maximum number of allowed algorithm iterationspublic void setMaxError(double dblMaxError)
dblMaxError
- the maximum error tolerance for the algorithmpublic void setSearchTuningValue(double dblAlpha)
dblAlpha
- stability/convergence parameter λ ∈ [0,1]public int getSolnIterations()
public void addProgressListener(CsFixedPtEstimator.IProgressListener lsnProg)
IProgressListener
exposing object
to the list of objects receiving solution progress updates.lsnProg
- object to receive solution progress updatespublic CovarianceMatrix computeReconstruction(java.lang.String strRecDevId, double dblBnchFreq, double dblBmCurr, java.util.ArrayList<Measurement> arrData) throws ModelException, ConvergenceException
Computes the covariance matrix σ of second moments at the given device location
for the given beam current using the given RMS envelope data. The algorithm is started
by using the zero-current value covariance matrix as the initialize guess
(see
). The zero-current
covariance matrix is passed to the method
#computeCovarianceZeroCurrent(String, ArrayList)
.
#computeCovarianceFiniteCurrent(String, double, CovarianceMatrix, ArrayList)
computeReconstruction
in class CourantSnyderEstimator
strRecDevId
- ID of the device where the reconstruction is to be performeddblBnchFreq
- bunch arrival frequency (in Hz)dblBmCurr
- beam current (in Hz)arrData
- the profile measurement data used for the reconstructionModelException
- error occurred during the transfer matrix computationsConvergenceException
- failed to meet error tolerance after maximum number of iterationspublic CovarianceMatrix computeReconstruction(java.lang.String strRecDevId, double dblBnchFreq, double dblBmCurr, CovarianceMatrix matSigInit, java.util.ArrayList<Measurement> arrData) throws ModelException, ConvergenceException
Computes the covariance matrix σ of second moments at the given device location for the given beam current for the given RMS envelope data. The covariance matrix is computed iteratively using the given covariance matrix matSigInit as the initial guess. Thus, the closer matSigInit is to the solution (using the Frobenius norm) the faster the algorithm converges.
strRecDevId
- ID of the device where the reconstruction is to be performeddblBnchFreq
- bunch arrival frequency (in Hz), typically a sub-harmonic of machine frequencydblBmCurr
- beam current (in Amperes)matSigInit
- the initial covariance matrix (guess) used to start the algorithmarrData
- the profile measurement data used for the reconstructionModelException
- error occurred during the transfer matrix computationsConvergenceException
- failed to meet error tolerance after maximum number of iterations