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

getbrho wrong Energy parameter #6

Open
oscarxblanco opened this issue Oct 23, 2023 · 1 comment
Open

getbrho wrong Energy parameter #6

oscarxblanco opened this issue Oct 23, 2023 · 1 comment

Comments

@oscarxblanco
Copy link
Contributor

Dear all,

there is an issue with the expression to calculate brho in

brho = (10/2.99792458) * sqrt((Energy+E0).^2 - E0.^2);

The variable Energy refers to the total beam energy as it is obtained from the Energy parameter in AT, and used as such in AT expressions to calculate the energy loss per turn. See for example in atsummary line :

eloss=1.0e9*Cgamma/2/pi*smm.e0.^4*smm.integrals(2); % eV

https://github.com/atcollab/at/blob/66a7c92af28bed5900891b9c4fcbf6fae169e1a0/atmat/atphysics/ParameterSummaryFunctions/atsummary.m#L86

Therefore the expression should be :

 brho = (10/2.99792458) * sqrt((Energy).^2 - E0.^2)

It seems to me that the author of this line was expecting Energy to return something else. There is misleading warning commented on top claiming that the kinetic energy is used, however, this expression is still wrong even in that case as momentum and energy differ by a second order correction in a Taylor expansion of PC = E * sqrt(1 - (E0/E)^2), where here below the quotient E0/E expressed as x :

(%i1) taylor(sqrt(1-x^2),x,0,2);
                                     2
                                    x
(%o1)/T/                        1 - -- + . . .
                                    2

For a 3 GeV machine, the difference between Energy and momentum*speed_of_light for an electron is on the order of 10^-8, while, this expression introduces and error on the order of 10^-4, a non-negligible effect when considering precise magnetic fields.

Please, let me know if I have misunderstood something or if you find this to be an error as I think it is.
Best regards,
o

@lnadolski
Copy link

Without any approximation:

E^2 =p^2 c^2 + E0^2
(brho) = p/e = (pc)/(ec)
(brho) = 1/c *sqrt(E^2-E0^2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants