# Charged particle movement in arbitrary electromagnetic field

1. Dec 11, 2013

### FlatronL1917

Hello there! This is my first post here, hopefully I am not posting in the wrong place.
Also, I am an engineer and have not used this stuff for years, so please be patient with me, I am pretty sure that my question is stupid :-)

I would like to develop a simulation code for charged particles moving in a electromagnetic field.
My thought is that, we may not always have the luxury to align the coordinate system to our magnetic field.
Assuming an arbitrary magnetic field vector B in every cell and ignoring the electric field for the moment, I tried solving the equations of motion to see if I can avoid discretization and got the following:

ux = c1x + (c2x+c3x)*cos(qB/m * t) + (c2x-c3x)*sin(qB/m * t)
uy = c1y + (c2y+c3y)*cos(qB/m * t) + (c2y-c3y)*sin(qB/m * t)
uz = c1z + (c2z+c3z)*cos(qB/m * t) + (c2z-c3z)*sin(qB/m * t)

It seems that the cij constants determine the direction of B. I only have the initial conditions for ux, uy, uz, obviously so I can not calculate them. Where do I go from this point? Is my solution wrong? Any help/pointer would be greatly appreciated.

2. Dec 11, 2013

### Simon Bridge

It looks like you plane on linear electric and magnetic fields, rather than "arbitrary" ones ... just with axis arbitrarily rotated.

In which case, all you need is the standard aligned equations and the rotation matrix.