Closed lfarv closed 1 year ago
Anybody willing to do something about that ? Or shall I do it ?
I think @lcarver said he would do it, but most likely not for matlab...
Fine. Apart from naming, better being done before the function gets widely used, all my other suggestions are neither critical nor urgent, just ideas!
For Matlab, same: not urgent, I might do it some time later…
Sorry, I was off yesterday. I will do it for your first 2 points. But yes, I will not do the MATLAB! Although I am not sure of the following point:
"one could even accept a Σ-matrix, which can replace alpha, beta, emit, sigma_dp.`"
This is not clear to me.
This is not clear to me.
The Σ-matrix (beam matrix as returned by ohmienvelope
, for instance) contains all the optics and emittance information. So, with Σ and tunes, you can get the M66 matrix and the emittances. Adding the damping times, you have everything.
Here, since the longitudinal motion is treated apart, I think we should use a 4D twiss_in
input, generate a 4x4 transfer map and add the 44, 45, 54 and 55 terms as you do it now.
So to start from the R matrix in twiss_in
, the easiest is first to build Σ = ε1.R1 + ε2.R2, then use a_matrix
to get the A matrix, use the tunes to generate the rotation matrix S and finally build M44 = A.S.A-1
If starting directly from Σ, a_matrix
will also return the needed emittances.
fixed in #655
The recent
simple_ring
function has some arguments in common with the existingsigma_matrix
function. However, their names are slightly different. Apart from the mnemonic inconvenience, this prevents from using the same dictionary as input for both functions (I encountered the problem when trying to compare the "design" Σ-matrix with the output of tracking a population throughsimple_ring
: I need both functions).So I would like to rename the
simple_ring
arguments coherently with those ofsigma_matrix
:beta_x
->betax
alpha_x
->alphax
emit_x
->emitx
sigma_dp
->espread
For the last one, strictly speaking, it's indeed a momentum spread (not energy), so we could envisage adding an alias insigma_matrix
(mspread
or even keepingsigma_dp
). But I would not like to alias all the arguments…Next:
simple_ring
could accept the same input assigma_matrix
:twiss_in
, usingR
if present (this can define a coupled lattice), oralpha
andbeta
(for uncoupled lattices),alphax
, … as nowalpha*
,beta*
,emit*
,sigma_dp*
.Third: we miss the Matlab simple ring:
atsimplering
Otherwise, simple_ring worked nicely in all my tests!