You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should check if our beam particles actually moved, instead of only checking 2nd moments.
We often check stationary and periodic solutions. If we only check the 2nd moments, we will not notice if particles did not move at all. For instance, in the development of #214 we accidentally did a zero-element simulation which passed all tests and only failed during plotting.
Thus, we should check:
the expected phase change on pt (and/or pz) of the reference particle
the expected average position of the particle beam.
Verifying the evolution of the reference particle is a good check. However, in many cases (all the straight magnetic elements), all components of the momentum (including pt) will be unchanged. In the IOTA ring example, (x,y,z,px,py,pz,pt) are all periodic. If we want to exclude the trivial solution, I suggest looking at the reference particle quantities arc length s and the time t, which will always change (unless the lattice has only zero-length elements).
Because the beam particles are defined relative to the reference particle, the expected average position of the particle beam usually does not change more than a small amount (resulting from noise associated with the statistics due to the finite number of particles).
In order to verify that the beam particles have moved, one simple solution is to check that the initial and final values of the second moments are not identical to all digits (as they should not be), but that they agree within the specified tolerance. Another possibility is to check explicitly that the first particle in the distribution has moved to a different position.
We should check if our beam particles actually moved, instead of only checking 2nd moments.
We often check stationary and periodic solutions. If we only check the 2nd moments, we will not notice if particles did not move at all. For instance, in the development of #214 we accidentally did a zero-element simulation which passed all tests and only failed during plotting.
Thus, we should check:
pt
(and/orpz
) of the reference particlecc @cemitch99 @n01r and me
The text was updated successfully, but these errors were encountered: