# Finding Motion of Charged Particle in Changing Magnetic Field (numerically)

1. Feb 3, 2010

### Emustrangler

I want to find the motion of an electron in a spatially varying magnetic field using finite element analysis, and have some way of estimating the error (especially in the path length). I imagine somewhere someone has written up an algorithim that does this, but I haven't had much luck googling. Anyone want to point me in the right direction?

2. Feb 3, 2010

### Bob S

I have done numerical integration along the electron path (actually I did protons) using the relation:

Bρ = (βγ/c) moc2 Tesla meters, or

ρ = (βγ/c) moc2/B meters

where B is the transverse magnetic field (in x and y), and ρ is the radius of curvature of particle path.

Bob S

3. Feb 3, 2010

### Born2bwire

I'm not sure how finite element analysis would be applied, at least not the forms of FEM that I have used. I would take a look into how molecular dynamics simulations are done as they have to deal with the motion of particles in spatially/time varying potentials. In essence, you have to use an integrator, like the Euler or Verlet method, to estimate the integrations of the accelerations and velocities over time to estimate the trajectories. In your case then, you would use the forces generated by the fields via the Lorentz force as your force input but everything else should be the same I believe. These methods are designed for the simulation of large numbers of particles so part of the design of the integrator is to be numerically efficient, if you are just concerned about a single electron then I wonder if they would be ways to use the low computational costs of the problem to increase the accuracy of the integrator. The easiest would be of course to decrease the time steps used but maybe a higher order integrator may be a better way.

4. Feb 3, 2010

### Bob S

In my case (see post #2), I stepped through about 10 meters, 1 mm at a time. I was tracking constant momentum particles, so β and γ were constant. I had a lookup table for the transverse dc spacially-varying magnetic fields Bx(z) and By(z) (actually a 4 x 4 transfer matrix) for every mm, and I tracked the particle's z coordinate and trajectory x, dx/dz, y, and dy/dz for each 1-mm step (x=0 and y=0 were the central orbit, and dx/dz and dy/dz were the divergences). The Lorentz v x B force was used at each step to update the four quantities above.

Bob S