I'm interesting in numerically simulating (with my own code, not an off-the-shelf package) the motion of a single electrically charged particle in a magnetic field. The field will vary in time and space but probably not fast compared to the cyclotron frequency or the Larmor radius.

There are many well known methods for integrating equations of motion for particles in fields. But the force due to the magnetic field has some special properties such as not changing the kinetic energy of the particle. Are there some numerical procedures that are better adapted to this special case eg. that will give a more accurate simulation and better conserve adiabatic invariants (when they should be conserved)?

  • $\begingroup$ Hi sigfpe, and welcome to Scicomp! Do you have a specific set of equations that you're working with? If so, could you include them in your question or perhaps a link to the equations? $\endgroup$
    – Paul
    Feb 26, 2013 at 4:38

2 Answers 2


I believe what you are looking for is a sympletic method; see:


They are designed to conserve energy exactly; however by trading up for accuracy one area, your simulation will have greater errors in other quantities (i.e. position as a function of time) compared to your usual Runge-Kutta methods.

  • $\begingroup$ Looking it some of the references to that wikipedia page I see that this is exactly what I'm after. $\endgroup$
    – sigfpe
    Feb 26, 2013 at 15:28
  • $\begingroup$ @jeffdk I got curious about what said "have greater errors in position as a function of time". Could you point me to an example? $\endgroup$
    – Hui Zhang
    Apr 11, 2013 at 17:24

Further research eventually yielded the Boris method. For a constant B field it produces stable circular orbits.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.