public class CsContinuationEstimator extends CourantSnyderEstimator
Computes the covariance matrix at a given location which is most likely to produce the provided data. That is, the covariance matrix is constructed at the given device location from the data provided. The method used is a continuation method where a curve of covariance matrices is constructed from a known solution value, the zero-current case, to the solution value for the given beam charge.
The iterates are computed using a continuation method as described in the paper "Implementation of a Beam Envelope State Observer." Specifically, let n be the number of independent phase planes we are considering (here it is 3). Then assume a smooth solution curve s(·) : R → R3n mapping bunch charge q to the solution σ ∈ R3n of independent beam moments at that charge. Moreover, we have σ* = s(q*) where q* is the bunch charge at the given profile data X.
In the analysis we have constructed a known function
G : R3n × R → R3n such that
G[s(q),q] = 0,
that is, G = 0 whenever s is the least-squares solution to the problem of reconstructing
the Courant-Snyder parameters for the given bunch charge q (and given data X).
The solution curve s(·) is constructed using continuity starting from a known value
s(0) = σ0, the zero-current solution. Given that the value of s
is known at q, the value of s at a small distance Δq from q is
s(q+Δq) = s(q)
+ [ds(q)/dq]Δq
+ O(Δq²) .
Essentially this method recursively computes ds(q)/dq and updates s(q)
according to the above.
The value ds(q)/dq is computed by consideration of the known function
G. We take the full derivative of the equation G = 0 w.r.t. to q
which yields
ds(q)/dq = [∂G(s,q)/∂s]-1
[∂G(s,q)/∂q] .
Once this value is computed the next value on the curve s(·)
is the vector s(q+Δq) = s(q) + [ds(q)/dq]Δq.
The partial derivatives are computed numerically
about the given values of s = matSig0 and q = dblBnchChg using
step lengths provided by the methods
and #setChargeDerivativeStepPercent(double)
.
#setMomentDerivativeStepPercent(double)
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 options for such generation here.
Modifier and Type | Field and Description |
---|---|
static boolean |
BOL_FIX_PT_SRCH
Whether or not to use an embedded fixed point search
|
static int |
CNT_CHRG_STEPS
Default number of space charge steps used in continuation
|
static double |
DBL_DEL_CURR_FRAC
Default fractional perturbation of the beam current used to compute the partial of the recursion function
|
static double |
DBL_DEL_MMT_FRAC
Default fractional perturbation of moment vector used to compute the partial of the recursion function
|
bolDebug, dblConvErr, dblResErr, fmtMatrix, genTransMat, matCurrF, matCurrSigma
Constructor and Description |
---|
CsContinuationEstimator(boolean bol2ndSrch,
int cntChgSteps,
double dblDelMmtFrac,
double dblDelCurFrac,
TransferMatrixGenerator genTransMat)
Creates a new instance of
ContinuationSolution . |
CsContinuationEstimator(TransferMatrixGenerator genTransMat)
Creates a new instance of
ContinuationSolution . |
Modifier and Type | Method and Description |
---|---|
CovarianceMatrix |
computeReconstruction(java.lang.String strRecDevId,
double dblBnchFreq,
double dblBmCurr,
java.util.ArrayList<Measurement> arrData)
Computes the covariance matrix at the given location which is most likely to produce the given
data.
|
void |
setBeamChargeSteps(int cntChgSteps)
Sets the number of steps Nq used to move from the zero current
solution σ0 to the finite current solution σ*
using the continuation method.
|
void |
setChargeDerivPerturb(double dblDelChgPct)
Sets the perturbation factor used to (numerically) compute the partial derivatives with
respect to the beam charge.
|
void |
setMomentDerivPerturb(double dblDelMmtPct)
Sets the perturbation used to compute (numerically) the partial derivatives with
respect to the initial beam moments.
|
void |
setSecondarySearchIterations(int cntMaxIters)
Directly sets the maximum number of iterations allowed for the secondary search algorithm.
|
void |
setUseSecondarySearch(boolean bolScndSrch)
Sets whether or not to use a second, internal search method within the continuation
solution method (i.e., method 2).
|
computeConvergenceError, computeObservationMatrix, computeObservationMatrix, computeReconFunction, computeReconSubFunction, computeResidualError, computeZeroCurrReconFunction, getReconConvergenceError, getReconResidualError, getReconstruction, isDebuggingOn, setDebug
public static final boolean BOL_FIX_PT_SRCH
public static final int CNT_CHRG_STEPS
public static final double DBL_DEL_MMT_FRAC
public static final double DBL_DEL_CURR_FRAC
public CsContinuationEstimator(TransferMatrixGenerator genTransMat)
ContinuationSolution
.genTransMat
- a pre-configured transfer matrix engine used internally.public CsContinuationEstimator(boolean bol2ndSrch, int cntChgSteps, double dblDelMmtFrac, double dblDelCurFrac, TransferMatrixGenerator genTransMat)
ContinuationSolution
.bol2ndSrch
- use the fixed point secondary search between beam charge stepscntCurSteps
- number of steps used to move (continuously) from zero charge to full chargedblDelMmtFrac
- the fractional perturbation in moment vector used to compute the partial of the recursion functiondblDelCurFrac
- the fractional perturbation of the beam current used to compute the recursion function partialgenTransMat
- a pre-configured transfer matrix engine used internally.public void setUseSecondarySearch(boolean bolScndSrch)
bolScndSrch
- use the secondary search if true
, no internal search if false
public void setSecondarySearchIterations(int cntMaxIters)
cntMaxIters
- maximum number of allowed secondary search iterationspublic void setBeamChargeSteps(int cntChgSteps)
Sets the number of steps Nq used to move from the zero current solution σ0 to the finite current solution σ* using the continuation method. Letting q* denote the beam charge at solution σ*, then the continuation method computes the solutions σn to the sub-problems with beam charge nΔq for each n = 0, 1, ..., Nq where Δq ≡ q*/Nq .
cntCurSteps
- number of steps used to approach the true beam charge solution from the
zero current solution using the continuation methodpublic void setChargeDerivPerturb(double dblDelChgPct)
Sets the perturbation factor used to (numerically) compute the partial derivatives with
respect to the beam charge. The value of beam current is increased this fractional amount
of the current value when computing
numerical derivatives. Specifically, if perturbation factor is denoted ε, then
the beam charge q is perturbed by an amount εq, that is, the perturbed
charged q' is given by
q' = q + εq
dblDelCurPct
- a value in (0,1) indicating the fraction of the current charge used as perturbationpublic void setMomentDerivPerturb(double dblDelMmtPct)
Sets the perturbation used to compute (numerically) the partial derivatives with
respect to the initial beam moments. The value of each moment is increased
this fractional amount of its current value when computing
numerical derivatives. Specifically, if this value is denoted ε
and σi is the ith element of moment
vector σ, then the perturbed moment vector σ' is given
by
σ' = σ + εσiei ,
where ei is the standard basis vector for moment σi.
dblDelMmtPct
- a value in (0,1) is the fraction of the current moment value used as the derivative steppublic CovarianceMatrix computeReconstruction(java.lang.String strRecDevId, double dblBnchFreq, double dblBmCurr, java.util.ArrayList<Measurement> arrData) throws ModelException
Computes the covariance matrix at the given location which is most likely to produce the given data. That is, the covariance matrix is constructed at the given device location from the data provided. The method used is a continuation method where a curve of covariance matrices is constructed from a known solution value, the zero-current case, to the solution value for the given beam charge.
The iterates are computed using a continuation method as described in the paper "Implementation of a Beam Envelope State Observer." Specifically, let n be the number of independent phase planes we are considering (here it is 3). Then assume a smooth solution curve s(·) : R → R3n mapping bunch charge q to the solution σ ∈ R3n of independent beam moments at that charge. Moreover, we have σ* = s(q*) where q* is the bunch charge at the given profile data X.
In the analysis we have constructed a known function
G : R3n × R → R3n such that
G[s(q),q] = 0,
that is, G = 0 whenever s is the least-squares solution to the problem of reconstructing
the Courant-Snyder parameters for the given bunch charge q (and given data X).
The solution curve s(·) is constructed using continuity starting from a known value
s(0) = σ0, the zero-current solution. Given that the value of s
is known at q, the value of s at a small distance Δq from q is
s(q+Δq) = s(q)
+ [ds(q)/dq]Δq
+ O(Δq²) .
Essentially this method recursively computes ds(q)/dq and updates s(q)
according to the above.
The value ds(q)/dq is computed by consideration of the known function
G. We take the full derivative of the equation G = 0 w.r.t. to q
which yields
ds(q)/dq = [∂G(s,q)/∂s]-1
[∂G(s,q)/∂q] .
Once this value is computed the next value on the curve s(·)
is the vector s(q+Δq) = s(q) + [ds(q)/dq]Δq.
The partial derivatives are computed numerically
about the given values of s = matSig0 and q = dblBnchChg using
step lengths provided by the methods
and #setChargeDerivativeStepPercent(double)
.
#setMomentDerivativeStepPercent(double)
computeReconstruction
in class CourantSnyderEstimator
strRecDevId
- ID of the device where the reconstruction is to be performeddblBnchFreq
- bunch arrival frequency for the given data (in Hz)dblBmCurr
- beam current (in Amperes)arrData
- the profile measurement data used for the reconstructionModelException
- error occurred during the transfer matrix computationsConvergenceException
- this is for the internal call to #computeReconstruction(String, double, CovarianceMatrix, ArrayList)