Updating xp, yp, p
Posted: 13 Aug 2014, 10:43
Hello all,
I am still learning the ropes of Elegant and just want to check if I am doing correctly the following:
Suppose that I have calculated the electric and magnetic field in the reference frame and want to find a change in momentum due to the Lorentz force.
First, I define delta t as:
set t [ expr "$L" / 299792458.0] ;
where L is the length of my drifting element.
Then change in momentum in SI units can be calculated as following (assuming that there is no B-field in the beam frame, so B-field in the rest frame can be expressed in terms of E). We will use sddsprocess for that.
#Calculating change in momentum:
"-def=col,dpx,Charge Particles / Ex * MeanGamma / MeanGamma / $t *"
"-def=col,dpy,Charge Particles / Ey * MeanGamma / MeanGamma / $t *"
"-def=col,dpz,Charge Particles / Ez * $t *"
Now I can convert change in momentum into Elegant units where the new xp will be (px+dpx)/pz. Let's assume for now that pz=p, so then I can write:
"-redef=col,xp,dpx 1.60218e-19 / 0.511e+6 / p / xp +"
and same for yp, and p.
I would like to check a few things.
1. Is the conversion from SI units correct?
2. Should I flip the sign for dpz since the tail and head of the bunch are flipped in Elegant?
Thanks.
I am still learning the ropes of Elegant and just want to check if I am doing correctly the following:
Suppose that I have calculated the electric and magnetic field in the reference frame and want to find a change in momentum due to the Lorentz force.
First, I define delta t as:
set t [ expr "$L" / 299792458.0] ;
where L is the length of my drifting element.
Then change in momentum in SI units can be calculated as following (assuming that there is no B-field in the beam frame, so B-field in the rest frame can be expressed in terms of E). We will use sddsprocess for that.
#Calculating change in momentum:
"-def=col,dpx,Charge Particles / Ex * MeanGamma / MeanGamma / $t *"
"-def=col,dpy,Charge Particles / Ey * MeanGamma / MeanGamma / $t *"
"-def=col,dpz,Charge Particles / Ez * $t *"
Now I can convert change in momentum into Elegant units where the new xp will be (px+dpx)/pz. Let's assume for now that pz=p, so then I can write:
"-redef=col,xp,dpx 1.60218e-19 / 0.511e+6 / p / xp +"
and same for yp, and p.
I would like to check a few things.
1. Is the conversion from SI units correct?
2. Should I flip the sign for dpz since the tail and head of the bunch are flipped in Elegant?
Thanks.