# Are the mass and charge important for the path of a charged particle in an electric potential?

I recently suspected a bug in a subroutine which traces the path of an electron in an electrostatic potential. (I had written that subroutine myself some time ago...) It had separate code-branches for the relativistic and the non-relativistic case. The non-relativistic case used neither the mass, nor the charge of the electron, nor any derived quantity like their ratio.

First I thought that this must be related to the bug, but then I found that the real problem was just an accidentally duplicated line. But how is it possible that the path of an electron in the electrostatic potential doesn't depend on its mass or charge?
The code tracks the position of the electron (in [um]), its direction (normalized), and its energy (in [eV]). The potential field can be queried at specified points, and returns an analytic gradient (in [V/um]) and the potential itself (in [V]).

Edit As suggested in the comments, giving the actual equations solved by the code could be helpful: $\frac{dx}{ds}=\frac{D}{||D||}$, $\frac{dD}{ds}=\nabla\phi \frac{||D||}{2E}$, $E=E_0+\phi(x)-\phi(x_0)$. This should come close to what the code does by forcing the direction $D$ to stay normalized and updating the energy $E$ based on the potential $\phi$. For $E_0=\phi_0$, the differential equation for $\frac{D}{||D||}$ becomes $2\frac{d\frac{D}{||D||}}{ds}=\nabla\ln\phi-\langle\frac{D}{||D||},\nabla\ln\phi\rangle\frac{D}{||D||}$.

• Then, probably there is more than one bug in your program. The charge is important for calculating the force, qE, where E is the field, and the mass, for obtaining the acceleration a = Fe/m. – Sofia Dec 12 '14 at 1:06
• @Sofia There are probably countless more bugs in my program (and maybe even in this subroutine), but probably at places where I don't expect them. And my testing is probably also not very systematic, but at least it should be relatively independent of the actual code. The acceleration is useless for me, because I'm not really interested in the speed or time evolution of the electron, I only need the path in space (i.e. its shape). – Thomas Klimpel Dec 12 '14 at 1:47
• Do you want to tell me the formulas you got for the trajectory? Maybe I can help. But this can be only much later. In my country it's 5 o'clock in the morning, and I want to catch some sleep hours before everybody is awaken. – Sofia Dec 12 '14 at 3:11
• sorry not to answer this earlier - the path does not depend on charge or mass, but the time of flight does depend on mass and charge – tom Dec 12 '14 at 11:36