public class CalculationsOnBeams extends CalculationEngine implements ISimulationResults.ISimLocResults<EnvelopeProbeState>, ISimulationResults.ISimEnvResults<EnvelopeProbeState>
ISimEnvResults
interface. They are performed in the context
of a linear accelerator or transport system acting upon a beam bunch, the
simulation data being a trajectory of EnvelopeProbeStates
.ISimulationResults.ISimEnvResults<S>, ISimulationResults.ISimLocResults<S>
Constructor and Description |
---|
CalculationsOnBeams(Trajectory<EnvelopeProbeState> datSim)
Constructor for
|
Modifier and Type | Method and Description |
---|---|
R3 |
computeBetatronPhase(EnvelopeProbeState state)
Computes and returns the "betatron phase" of a beam particle within the simulated
envelope at the given state location.
|
PhaseVector |
computeChromAberration(EnvelopeProbeState state)
Computes the chromatic aberration for one pass around the ring starting at the given
state location, or from the entrance to state position for a linear
machine.
|
PhaseVector |
computeChromDispersion(EnvelopeProbeState state)
Convenience function for returning the chromatic dispersion coefficients
as defined by
D.C.
|
PhaseVector |
computeCoordinatePosition(EnvelopeProbeState state)
Returns the centroid location of the beam envelope.
|
PhaseVector |
computeFixedOrbit(EnvelopeProbeState state) |
PhaseMatrix |
computeTransferMatrix(java.lang.String elemFrom,
java.lang.String elemTo)
Returns the state response matrix calculated from the front face of
elemFrom to the back face of elemTo.
|
Twiss[] |
computeTwissParameters(EnvelopeProbeState state)
Returns the Courant-Snyder parameters of the beam envelope at the location of the
given probe state.
|
PhaseMatrix |
getFullResponseMatrix()
Returns the transfer map of the full machine lattice represented by the
associated simulation trajectory.
|
Trajectory<EnvelopeProbeState> |
getTrajectory()
Returns the simulation trajectory from which all the machine properties are
computed.
|
R3 |
periodBetatronPhaseAdvance()
Returns the betatron phase advances from the simulation beginning to end
(which are computed at instantiation).
|
PhaseVector |
periodFixedOrbitPt()
Returns the phase space location of the fixed orbit at the simulation start
(which is computed at instantiation) assuming the simulation is that for
at least one period of a periodic accelerating or transport section.
|
Twiss[] |
periodMatchedTwiss()
Returns the matched Courant-Snyder parameters at the entrance of the simulation
assuming the simulation is for at least one period of a periodic structure.
|
calculateAberration, calculateDispersion, calculateFixedPoint, calculateMatchedTwiss, calculatePhaseAdvance_old, calculatePhaseAdvance, calculatePhaseAdvPerCell, calculateTunePerCell, computeTwiss
public CalculationsOnBeams(Trajectory<EnvelopeProbeState> datSim)
trjSimul
- results for an EnvelopeProbe
simulationpublic Trajectory<EnvelopeProbeState> getTrajectory()
public PhaseMatrix getFullResponseMatrix()
public R3 periodBetatronPhaseAdvance()
Returns the betatron phase advances from the simulation beginning to end
(which are computed at instantiation). The returned value is the calculation
of the super class,
and thus assumes simulation trajectory is that for at least one period of
a periodic structure.
CalculationEngine.calculatePhaseAdvPerCell(PhaseMatrix)
public PhaseVector periodFixedOrbitPt()
Returns the phase space location of the fixed orbit at the simulation start
(which is computed at instantiation) assuming the simulation is that for
at least one period of a periodic accelerating or transport section.
The returned value z is the result of the
calculation
given the
full turn matrix Φ at the simulation exit (see CalculationEngine.calculateFixedPoint(PhaseMatrix)
getFullResponseMatrix()
).
It is invariant under
the action of Φ, that is, Φz = z.
public Twiss[] periodMatchedTwiss()
Returns the matched Courant-Snyder parameters at the entrance of the simulation assuming the simulation is for at least one period of a periodic structure. These are the "envelopes" taken from the "closed envelope" solution under the assume the linac is a periodic transport.
Note that emittance ε is the parameter used to describe the extend of
the actual beam (rather than the normalized size β), or "acceptance". Thus it
cannot be computed here and NaN
is returned instead.
public PhaseMatrix computeTransferMatrix(java.lang.String elemFrom, java.lang.String elemTo)
elemFrom
- String identifying starting lattice elementelemTo
- String identifying ending lattice elementEnvelopeTrajectory#computeTransferMatrix(String, String)
public PhaseVector computeCoordinatePosition(EnvelopeProbeState state)
CovarianceMatrix
state object. Since the state quantities
are expressed in homogeneous coordinates the final row and column of the
covariance matrix are interpreted as the centroid vector of the beam bunch.computeCoordinatePosition
in interface ISimulationResults.ISimLocResults<EnvelopeProbeState>
state
- simulation state where parameters are computedxal.tools.beam.calc.ISimEnvResults#computeCoordinatePosition(xal.model.probe.traj.ProbeState)
public PhaseVector computeFixedOrbit(EnvelopeProbeState state)
#computeCoordinatePosition(ParticleProbeState)
. This modification is
maintain compatibility with the previous use of computeFixedOrbit()
presented by the trajectory classes for particles, beam envelopes, etc. They
responded differently depending upon whether the structure producing the simulation
data was from a ring or a linear transport/accelerator structure.
Consider first the point in phase space that is invariant under repeated application of the response matrix Φ for the entire beamline or ring. This is under the condition that we decompose Φ into its homogeneous and non-homogeneous components. A particle entering the linac at that location exits at the same location.
To compute this linac fixed point, recall that the homogeneous response
matrix Φ for the beamline (or full-turn matrix for a ring)
has final row that represents the translation Δ of the particle
under the action of Φ. The 6×6 sub-matrix of Φ represents
the (linear) action of the bending magnetics and quadrupoles and corresponds to the
matrix T ∈ R6×6 (here T is linear).
Thus, we can write the linear operator Φ
as the augmented system
Φ = |T Δ |, z ≡ |p| , |0 1 | |1|where p is the projection of z into the embedded phase space R6 (without homogeneous coordinate). coordinates).
Putting this together we get
Φz = Tp + Δ = p ,
to which the solution is
p = -(T - I)-1Δ
assuming it exists. The question of solution existence falls upon the
resolvent R ≡ (T - I)-1 of T.
By inspection we can see that p is defined so long as the eigenvalues
of T are located away from 1.
In this case the returned value is the augmented vector
(p 1)T ∈ R6 × {1}.
When the set of eigenvectors does contain 1, we attempt to find the solution for the transverse phase space. That is, we take vector p ∈ R4 and T ∈ R4×4 where T = proj4×4 Φ. The solution value is then z = (p 0 0 1)T.
Once we have the fixed point z0 for the linac we compute the trajectory of the fixed point at the location of the given probe state. To do so, we multiply z0 by the response matrix Φn for the given probe state. That is, we propagate the fixed point of the linac from the linac entrance to the location of the given phase state.
computeFixedOrbit
in interface ISimulationResults.ISimLocResults<EnvelopeProbeState>
state
- simulation state where parameters are computedxal.tools.beam.calc.ISimEnvResults#computeFixedOrbit(xal.model.probe.traj.ProbeState)
public PhaseVector computeChromAberration(EnvelopeProbeState state)
ISimLocResults#computeChromAberration(ProbeState)
for a more detailed
exposition.computeChromAberration
in interface ISimulationResults.ISimLocResults<EnvelopeProbeState>
state
- simulation state where parameters are computedxal.tools.beam.calc.ISimLocResults#computeChromAberration(xal.model.probe.traj.ProbeState)
public Twiss[] computeTwissParameters(EnvelopeProbeState state)
EnvelopeProbe
the covariance matrix σ.
Only the 2×2 diagonal blocks of σ are used for
Courant-Snyder parameter calculations (for each phase plane), thus, any phase
plane coupling is lost.computeTwissParameters
in interface ISimulationResults.ISimEnvResults<EnvelopeProbeState>
state
- simulation state where Twiss parameters are computedxal.tools.beam.calc.ISimEnvResults#computeTwissParameters(xal.model.probe.traj.ProbeState)
public R3 computeBetatronPhase(EnvelopeProbeState state)
Computes and returns the "betatron phase" of a beam particle within the simulated envelope at the given state location. This quantity is the phase advance between the beginning of the simulation and the given state location. The calculation proceeds by computing the Courant-Snyder parameters α and β of the envelope at the entrance to the linac and at the given state location using the covariance matrix σ(s) of the simulation. The given state also contains the response matrix Φ(s) between the entrance to the linac and the current state location s. This matrix is used as the transfer matrix mapping particle phase coordinates between the linac entrance and the current state location.
The definition of phase advance ψ is given by
ψ(s) ≡ ∫s [1/β(t)]dt ,
where β(s) is the Courant-Snyder, envelope function, and the integral
is taken along the interval between the initial and final Courant-Snyder
parameters.
The basic relation used to compute ψ is the following:
ψ = sin-1 φ12/(β1β2)½ ,
where φ12 is the element of Φ in the upper right corner of each
2×2 diagonal block, β1 is the initial beta function value (provided)
and β2 is the final beta function value (provided).
computeBetatronPhase
in interface ISimulationResults.ISimEnvResults<EnvelopeProbeState>
state
- simulation state where parameters are computedxal.tools.beam.calc.ISimEnvResults#computeBetatronPhase(xal.model.probe.traj.ProbeState)
public PhaseVector computeChromDispersion(EnvelopeProbeState state)
Convenience function for returning the chromatic dispersion coefficients as defined by D.C. Carey in "The Optics of Charged Particle Beams".
Computes the chromatic aberration for one pass around the ring starting at the given state location, or from the entrance to state position for a linear machine. The returned vector is the displacement from the closed orbit caused by a unit momentum offset (δp = 1). See the documentation inISimLocResults#computeChromAberration(ProbeState)
for a more detailed
exposition.
computeChromDispersion
in interface ISimulationResults.ISimEnvResults<EnvelopeProbeState>
state
- we are calculating the dispersion at this state locationxal.tools.beam.calc.ISimEnvResults#computeChromDispersion(xal.model.probe.traj.ProbeState)