Updating xp, yp, p

Moderators: cyao, michael_borland

Post Reply
headdoggy64
Posts: 36
Joined: 18 Jul 2014, 12:44

Updating xp, yp, p

Post by headdoggy64 » 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.

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

Re: Updating xp, yp, p

Post by michael_borland » 13 Aug 2014, 11:37

The quantity "p" in elegant is the momentum in SI units (call it "P") divided by m*c: p = P/(mc).

So you should use
"-redef=col,xp,dpx me_mks / c_mks / pz / xp +"
and similarly for yp.

--Michael

headdoggy64
Posts: 36
Joined: 18 Jul 2014, 12:44

Re: Updating xp, yp, p

Post by headdoggy64 » 13 Aug 2014, 12:52

Thanks for your reply!

But it looks like in my case I need to use the mass of the macroparticle, not the electron mass.
So something like this:

"dpx 1.60218e-19 * me_mks / c_mks / Particles * Charge / pz / xp +"

Thanks again.

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

Re: Updating xp, yp, p

Post by michael_borland » 13 Aug 2014, 12:54

Yes, if the Charge quantity pertains to the macro particle, then that would seem to make sense.

--Michael

Post Reply