Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Analysis Test Scripts: Check <z> and pt #232

Open
ax3l opened this issue Sep 1, 2022 · 1 comment
Open

Analysis Test Scripts: Check <z> and pt #232

ax3l opened this issue Sep 1, 2022 · 1 comment
Labels
component: tests examples, tests and benchmarks enhancement New feature or request

Comments

@ax3l
Copy link
Member

ax3l commented Sep 1, 2022

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.

cc @cemitch99 @n01r and me

@ax3l ax3l added the component: tests examples, tests and benchmarks label Sep 1, 2022
@ax3l ax3l added this to the Beta Release Version milestone Sep 1, 2022
@ax3l ax3l added the enhancement New feature or request label Sep 1, 2022
@cemitch99
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tests examples, tests and benchmarks enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants