-
Notifications
You must be signed in to change notification settings - Fork 30
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
Update and centralize the C constants #691
Conversation
Hello @JeanLucPons , this is a nice re-organization. Concerning the constant, if it is wrong (@lfarv @lnadolski , any idea why??) it has to be corrected and the unit tests modified accordingly. |
I am rather skeptical about "adjusting" the physical constants… PyAT (in python) uses the correct value of Cγ, computed in So the correct value should of course be set, and the tests corrected accordingly. But the fact that the AT results will change must be clearly documented, it may raise complains… |
The physical constants were updated in Matlab in #437, and I remember it raised many questions. But they probably were never updated in C |
Thanks Laurent, I also prefer to update the physical constants to the good values and update the unit tests. |
The tests are modified using results from Matlab. No tolerance had to be modified (good point!). Please approve, to unlock the pending Matlab and python releases. |
Hello,
I centralized constants used in at in an include file atconstants.h
I'm facing an issue concerning the CGAMMA constant defined as below:
![image](https://private-user-images.githubusercontent.com/23553641/281299754-74713b11-88c7-452e-aba4-b25690d0b7d8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTk0Mjc4MjUsIm5iZiI6MTcxOTQyNzUyNSwicGF0aCI6Ii8yMzU1MzY0MS8yODEyOTk3NTQtNzQ3MTNiMTEtODhjNy00NTJlLWFiYTQtYjI1NjkwZDBiN2Q4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI2VDE4NDUyNVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWJiMDcxMzMxMmViNWIxNzBhYWRlN2FlYTBiY2JjYTI5ZjdkNGYyNjc1MTc2MDE2YmY2NGUwZDEzNmJjNGVjZDMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0._MSPI_LaVcoGatzIWKMIA5Fo4fz8TH3y9X5HN9eAw6A)
Physics of Electron Storage Ring, M. Sands (4.2)
In the atconstants header file, the result of the formula gives: 8.846273834e-05 and it AT the old define was 8.846056192e-05.
The new cgamma constant results in at_physics test failure:
The best match i can get (8.846092697e-05) is by using 2.8179e-15m for the classical e- radius and 511keV for the rest energy.
Should we modify the test_physics.py or rather adjusting the constants above ?
Note: The very small correction of symplectic integrator constants does not affect the result of the tests.
Thanks