Lorentz factor in source codes!

Moderators: cyao, michael_borland

Post Reply
csun
Posts: 6
Joined: 14 Apr 2010, 13:15

Lorentz factor in source codes!

Post by csun » 10 Jun 2010, 16:32

Hello Michael,

I try to look at the source codes, and find the calculation for relative velocity as follows in several places (such as, in code multipole.c and csbend.c ):
--------------------------------
beta0 = p/sqrt(sqr(p)+1);
-------------------------------
If I understand correctly, here, $beta0$ is the relative velocity (i.e., $v/c$), and $p$ is the Lorentz factor ( i.e., $gamma$) .
However, the correct calculation for beta0 should be
----------------------------------------
beta0 = sqrt(sqr(p)-1)/p ;
---------------------------------------
I know both formulas are very close at high energy. However, the different will be significant at low energy.
My question is why you use an approximate formula in the codes, is there a reason behind it? or I am wrong?

Thanks!
CSun

michael_borland
Posts: 1933
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Lorentz factor in source codes!

Post by michael_borland » 11 Jun 2010, 08:59

CSun,

The correct equation for the velocity is beta = beta*gamma/gamma = p/sqrt(p*p+1). This is what elegant uses.

Elegant uses p=beta*gamma internally, not gamma.

--Michael

Post Reply