At present three "sim_type"s are defined: Vector, TransferMatrix, and MomentMatrix.
Selects use of VectorState as the state type. Elements derive from LinearElementBase.
The vector VectorState::state defaults to all zeros.
The propagation step LinearElementBase::advance multiples the an Element's transfer matrix (LinearElementBase::transfer) with the vector VectorState::state.
Selects use of MatrixState as the state type. Elements derive from LinearElementBase.
The matrix MatrixState::state defaults to an identity matrix.
The propagation step LinearElementBase::advance multiples the an Element's transfer matrix (LinearElementBase::transfer) with the matrix MatrixState::state.
Selects use of MomentState as the state type. Elements derive from MomentElementBase
MomentState has several components. A single reference Particle MomentState::ref as well has several members which held as arrays over the number of charge states. MomentState::real hold a Particle for each charge state. MomentState::moment0 and MomentState::moment1 hold an array of vectors and matricies.
The members MomentState::moment0_env, MomentState::moment1_env, MomentState::moment0_rms are derived from MomentState::moment0 and MomentState::moment1 in MomentState::calc_rms().
A Particle holds several independent member: Particle::IonQ, Particle::IonZ, Particle::IonEs, Particle::IonEk, and Particle::phis. The remaining members are derived from IonEk and IonEs by Particle::recalc().
Each MomentElementBase holds an array of transfer matrices (MomentElementBase::transfer). One for each charge state.
The propagation step MomentElementBase::advance() multiples the an Element's transfer matrix (MomentElementBase::transfer) with the matrix MomentState::state, and also by the vector MomentState::moment0.
Specializations of advance() exist for the rf cavity and charge stripper elements:
MomentElementBase::transfer can be viewed as a linear approximation around the given reference and real Particle. As long as the approximation remains valid, the previously computed (cached) transfer matrix can be reused.
The method MomentElementBase::check_cache determines if the cached transfer matrices, and output Particles can be reused. It works by comparing MomentElementBase::last_ref_in and MomentElementBase::last_real_in with MomentState::ref and MomentState::real.
If check_cache() returns true, then ref and real are overwritten with MomentElementBase::last_ref_out and MomentElementBase::last_real_out. If not, then MomentElementBase::recompute_matrix() is called, then ref and real are copied into last_ref_out and last_real_out.
The members of MomentState are configured from a number of input Config parameters. Several "magic" parameters control initialization of either 0, 1, or many charge states depending on the presense of the parameters "IonChargeStates" and "cstate".
If neither is included, an empty Config will initialize a MomentState with zero charge states. Such a MomentState is only useful in conjunction with the source element type .
If only "IonChargeStates" is given, it must be an array of floating point values. This will initalize a number of charge states equal to the length of "IonChargeStates".
As a debugging/development aid, if the parameter 'cstate' is set to a value in the range [0, # of change states), the the simulation will only be initialized for a single selected change state.
This section lists all element types, and lists which "sim_type"s each is defined for.
The purpose of the "source" element is to overwrite the State.
Each instance holds an internal State. The advance() method simply assigns this internal State to the state being propagate()d.
The parameters accepted are the same as the associated State type.
A drift section.
Name | Default | Desc. |
---|---|---|
L | None | Length |
Supported by all "sim_type"s.
Equivalent to a zero length drift section. No parameters.
Supported by all "sim_type"s.
Sector bend magnet.
Name | Default | Desc. |
---|---|---|
L | None | Length |
phi | None | Bend angle |
phi1 | None | ??? angle |
phi2 | None | ??? angle |
K | 0.0 | Strength |
bg | None | Reference energy (beta*gamma) |
Supported by all "sim_type"s. Only MomentMatrix uses phi1, phi2, and bg.
Magnetic quadrupole.
Name | Default | Desc. |
---|---|---|
L | None | Length |
K | 0.0 | Strength. K>0 focusing in horizontal. K<0 focusing in vertical. |
B2 | None | Field. B2>0 focusing in horizontal. B2<0 focusing in vertical. |
Supported by all "sim_type"s. MomentMatrix uses B2, others use K.
Solenoid magnet.
Name | Default | Desc. |
---|---|---|
L | None | Length |
K | 0.0 | Strength. |
B | None | Field |
Supported by all "sim_type"s. MomentMatrix uses B, others use K.
Name | Default | Desc. |
---|---|---|
L | None | Length |
cavtype | None | Cavity type ID string |
Eng_Data_Dir | None | Directory containing data files |
f | None | Cavity frequency (Hz) |
phi | None | Synchrotron phase (rad) |
scl_fac | None | Electric field scale factor |
MpoleLevel | "2" | "0", "1", or "2" |
Placeholder. Equivalent to marker.
Placeholder. Equivalent to marker.
Element for which transfer matrix is directly specified.
Name | Default | Desc. |
---|---|---|
transfer | None | Flattened transfer matrix |
Supported by all "sim_type"s.