Recent proceedings in radiation belt studies have proposed new requirements for numerical methods to solve the kinetic equations involved. In this article, we present a numerical solver that can solve the general form of the radiation belt Fokker–Planck equation and Boltzmann equation in arbitrarily provided coordinate systems and with user-specified boundary geometry, boundary conditions, and equation terms. The solver is based upon the mathematical theory of stochastic differential equations, whose computational accuracy and efficiency are greatly enhanced by specially designed adaptive algorithms and a variance reduction technique. The versatility and robustness of the solver are exhibited in four example problems. The solver applies to a wide spectrum of radiation belt modeling problems, including the ones featuring non-diffusive particle transport such as that arising from nonlinear wave–particle interactions.

In the space plasma environment, radiation belts refer to torus-shaped regions surrounding Earth and other magnetized planets that are filled with
highly energetic charged particles trapped in the planetary magnetic field. Since their discovery

In some circumstances, the dependence of phase space density on certain phases

Various numerical models have been built to solve a specific form of either Eq. (

The underlying mathematical theory of the solver is stochastic differential equation (SDE) theory. The SDE method had been utilized by

The kinetic equations given as Eqs. (

Let us consider the following partial differential problem composed of a Kolmogorov backward equation and a general set of initial and boundary
conditions:

The mathematical theory of SDEs establishes a relation between Eqs. (

A formal solution of the problem in Eqs. (

To formally solve the Fokker–Planck equation (Eq.

Initial and boundary conditions to Eq. (

Up to this point, we have transformed the Fokker–Planck equation (Eq.

User input items to the UBER code.

A set of the boundary-related items for each piece of boundary.

To summarize this section, the above mathematical theory allows us to fully define a PDE problem involving Eq. (

We give an outline of the algorithms used by the UBER code in this section, with an emphasis on the techniques that improve both its accuracy and
efficiency. Lower-level numerical techniques, such as the generation of pseudo-random variables, linear algebraic operations, and parallelized
computation, are based on the works presented in

Integration of the SDE (Eq.

Oblique reflection of the stochastic process on

Expectation of the functionals can be estimated, in principle, from an arithmetic mean of a number

In typical radiation belt problems, the functional values from various stochastic paths may differ by orders of magnitude, and hence their contributions
to the arithmetic mean also differ by orders of magnitude, whereas their computational efforts are of the same order. Therefore, straightforward
calculation of their arithmetic mean could result in extremely slow convergence with

Schematic illustration of process splittings in a

Figure

It still remains to find a method to project the functional value of a stochastic path when it is only partially realized. For this purpose, we insert
a break point at

Suppose that a partial path has been realized up to

The functional values

Four example problems are provided in this section. In the first problem, we solve a Fokker–Planck equation with two source terms, one proportional to the unknown function and the other independent of the unknown function, in both a spherical coordinate system and a Cartesian coordinate system. Effects of the process-splitting technique are analyzed in this example. In the second problem, an advection-dominated Fokker–Planck equation is considered. We further show that, even for a pure advection equation, the UBER code still gives the correct solutions, although it is not designed for such an equation and may not be the most efficient method. Code behavior with advection equations is further studied in the third problem in which the treatment of periodic boundary condition is also illustrated. In the last problem, we simulate the Earth's inner radiation belt by solving its Boltzmann equation involving realistic pitch-angle diffusion and CRAND source.

In this problem, we consider the diffusion and generation of neutrons in a spherical nuclear material at detonation, with an initially injected
Gaussian neutron distribution from a small source at the center and a neutron-reflecting coat that allows only one-half of the surface neutrons to
escape. In a spherical coordinate system, the equation, initial condition, and boundary conditions are

UBER solutions are obtained at four time stamps and are compared with those from a staggered-grid finite-difference method

To demonstrate UBER's ability in multiple dimensions with a complicated boundary geometry, the same problem is also solved in a three-dimensional
Cartesian coordinate system along a sphere radius. In this coordinate system, the diffusion coefficient becomes a 3

To analyze the effects of the process-splitting technique, we repeated the three-dimensional solutions at

To further reveal the behavior of the process-splitting technique, Fig.

Normalized wall clock time versus maximum offspring generations (

In practical UBER usage, solutions are achieved with a prescribed tolerance of relative error and an adaptive number of samples. Therefore, fast
convergence with the process-splitting technique could save a significant amount of computational effort even with its extra computational
burden. Table

In the second problem, we consider a Fokker–Planck equation for the pitch-angle distribution of a magnetized plasma

Equation (

In this problem, we study the UBER code behavior when solving the advection equation resulting from Eq. (

By the method of characteristics, Eq. (

The Euler scheme is well known to overshoot when integrating along a curve that consistently curls to one side, and this would cause error in UBER
solutions. To show this, we replace the drift frequency by

In the last problem, we demonstrate UBER's ability to solve a radiation belt Boltzmann equation by performing an inner radiation belt simulation
involving both the stably trapped (out of the drift loss cone) and the quasi-trapped (in the drift loss cone) electron populations. Inspired by

In Eq. (

The simulation is performed with an initially empty radiation belt as indicated by Eq. (

In conclusion, we have built a numerical solver for the general form of kinetic equations that appear in radiation belt studies. Based on the SDE method, the solver is coded to work in arbitrarily provided coordinate systems of up to three dimensions with user-specified boundary geometry, boundary conditions, and equation terms. We have also designed adaptive algorithms and a variance reduction technique for the SDE method, which enhanced its computational speed by 1 order of magnitude in our test. The example problems in this article demonstrated the solver's versatility and robustness in dealing with a range of problems that might each require a different solver in other methods. The solver, named UBER, has been programmed into a Fortran library that can be easily incorporated with other more complicated space physics models.

Left

The strengths of the SDE method lie in its abilities to solve problems that are difficult for other methods, but not in its speed. Even with the presented
improvements, the SDE method is in general nowhere near the finite-difference counterparts in terms of speed due to its Monte Carlo
nature. However, Monte Carlo methods are perfectly parallelized for no communication among parallel tasks; therefore, the UBER code gains handsome
speedup from parallel computation. Figure

Several other forms of radiation belt kinetic equations should also be solvable by the method presented in this article. In formulating the Boltzmann
equation (Eq.

Nonlinear evolution of phase space density occurs when the particle scatterings are not only small-scale but also large-scale, usually as a result of
trapping by intense plasma waves

We consider, for simplicity, a hypothetical radiation belt whose particle motion has two well-separated periods which define two pairs of action-angle
variables

For a collisionless plasma, evolution of

Equation (

Equation (

Taking account of collisions in the plasma would introduce to Eq. (

Neglecting the source and loss terms, the quasi-linear kinetic equations in the body of this paper could all be recovered from
Eqs. (

The UBER library is free and open-source. The current version of UBER is available from the GitHub repository at

LZ developed the UBER library, conducted the benchmark experiments, and wrote the paper. LC and AAC contributed to the conceptualization of the UBER library. PW, ZX, and XL provided ancillary code and data for the benchmark experiments.

The contact author has declared that neither they nor their co-authors have any competing interests.

Publisher's note: Copernicus Publications remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

The authors would like to express their gratitude to Michael Schulz for the very enlightening discussions on this work and to Zheng Xiang for exchanging code performance data. Liheng Zheng and Anthony A. Chan acknowledge NASA for financial support of this work.

This research has been supported by the National Aeronautics and Space Administration (grant nos. 80NSSC18K1224 and NNX15AI93G).

This paper was edited by Josef Koller and reviewed by three anonymous referees.