5.12 Integration of orbit and weight of markers

The evolution equation of orbit and weight can be generally written as

dv = H (r,v,E),
dt     1
(118)

dw-= H2 (r,v,E),
dt
(119)

where H1 and H2 are known function. Note that E, as well as r and v, depends on time t. However E is not specified as an evolution equation. Instead, E is determined by a field equation, namely Poisson’s equation.

The classical 4th Runge-Kutta time integrator requires four evaluations of the function appearing on the right-hand side of the equation of motion per time step. In PIC method, this corresponds to that the field equation needs to be solved for four times. For large-scale simulation (e.g. spatial three-dimension simulation), solving the field equation is usually time-consuming. Considering this, lower order Runge-Kutta (e.g. 2nd order), which requires fewer times of evaluation of functions (and thus fewer times of solving the field equation) may be preferred in practice.

We use the 2nd Runge-Kutta method to integrate orbit and weight of markers. In this method, r, v, and w are first integrated from tn to the half time-step tn+12 using (rn,vn,En) to evaluate the right-hand side of Eqs. (118) and (119). Then we solve the Poisson’s equation at tn+12 to obtain En+12 using the already obtained values of (rn+12,vn+12,wn+12). After En+12 is obtained, r, v, and w are integrated from tn to tn+1 by using the values at the half time-step, namely (rn+12,vn+12,wn+12,En+12). Forgetting to solve the field equation at tn+12 to get En+12 is one of the mistakes I made during writing the code. Forgetting to do this means that I am still using En, instead of En+12, in taking the full step from tn to tn+1, which amounts to the (inaccurate and thus may be unstable) Euler scheme.

[Besides, the leapfrog scheme (2nd order accuracy) is often adopted to integrate the equations of motion. This scheme is given by

v(i+1∕2) = v(i−1∕2) +a(i)dt,
(120)

 (i+1)   (i)   (i+1∕2)
x    = x   + v     dt
(121)

where ai = ai(xi) is the acceleration of the particle at the time step i. The leapfrog scheme given by Eqs. (121) and (120) can be equivalently written as[6]

x(i+1) = x (i) + v(i)dt+ 1a(i)dt2
                    2
(122)

 (i+1)   (i)  1  (i)   (i+1)
v     = v  + 2(a  + a    )dt,
(123)

The leapfrog scheme given by Eqs. (122) and (123) was implemented in my code, but was not tested seriously (I usually used the 2n Runge-Kutta method discussed above). Note  that, for electrostatic case, a(i+1) is independent of v(i+1) and depends only on x(i+1), which is already obtained by Eq. (122). Thus the scheme given by Eqs. (122) and (123) is still an explicit scheme.]