Lorentz factor in source codes!
Posted: 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
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