The RMF (Rotating Magnetic Field) code is designed to calculate the motion of a charged particle in a given electromagnetic field. It integrates Hamilton’s equations in cylindrical coordinates using an adaptive predictor-corrector double-precision variable-coefficient ordinary differential equation solver for speed and accuracy. RMF has multiple capabilities for the field. Particle motion is initialized by specifying the position and velocity vectors. The six-dimensional state vector and derived quantities are saved as functions of time. A post-processing graphics code, XDRAW, is used on the stored output to plot up to 12 windows of any two quantities using different colors to denote successive time intervals. Multiple cases of RMF may be run in parallel and perform data mining on the results. Recent features are a synthetic diagnostic for simulating the observations of charge-exchange-neutral energy distributions and RF grids to explore a Fermi acceleration parallel to static magnetic fields.

At the basic level, the motion of charged particles in plasmas must be understood by single-particle motion driven by the fields present at the particle at each instant. Particle-in-cell codes do this self-consistently, but are computationally expensive and time-consuming, evaluating the time evolution of billions of interacting particles. Test-particle codes, single-particle codes, are far quicker. They are highly accurate when the simulation time scale is far shorter than MHD or resistive time scales conditions often found in high temperature plasmas.

To aid the design of plasma diagnostics, analyze their results, and understand the physics of particle motion in complex fields, the Rotating Magnetic Field (RMF) code was written to calculate the trajectory of a charged particle in a specified electromagnetic field. The RMF code integrates Hamilton’s equations in cylindrical coordinates using the adaptive predictor-corrector Double-precision Variable-coefficient Ordinary Differential Equation (DVODE)1 solver module for speed and accuracy. RMF has multiple capabilities for the field: a Hill’s vortex model2 and a numerical Grad–Shafranov solution3,4 for a Field Reversed Configuration (FRC); a rotating magnetic field;5 mirror coils; wires along the z-direction; static electrostatic fields normal to flux surfaces; and oscillatory magnetic-field-perpendicular grids to explore Fermi-acceleration physics.

Analyses include the computation of time-evolving energy histograms, Poincaré puncture plots, fast Fourier transforms of the energy, and Lyapunov exponents.6 Recent features include a synthetic diagnostic for simulating the observations of charge exchange neutrals7 and an array of grids to enable the study of a new form of Fermi acceleration.8 

Particle motion is initialized by specifying the position (r, ϕ, z) and velocity using energy in eV and spherical angles about the z-direction. The six-dimensional state vector and many derived quantities are saved as functions of time. Time is measured in units of cyclotron periods for a selected magnetic field. A post-processing graphics code, XDRAW, is then used to plot up to 12 windows of any two quantities using different colors to denote successive time intervals. XDRAW provides extensive interactive features to zoom, digitize, compute slopes and ratios, and save postscript files. A single RMF simulation takes a few seconds. Multiple cases of RMF may be run in parallel and post-processing data mining run on the results.

The central feature of the RMF is numerical integration of Hamilton’s equations for the motion of a charged particle in a given electromagnetic field. The Hamiltonian is given in cylindrical coordinates by

(1)

where pi are the conjugate momenta, q and m are the charge and mass of the charged particle, A is the magnetic vector potential, and φ is the electrostatic potential. The corresponding equations of motion are given by

(2)
(3)

They constitute a sixth-order coupled system of nonlinear ordinary differential equations. These equations are integrated numerically with DVODE set to a specified tolerance, typically 10−12 in the Hper step. (A long simulation, τ ∼ 104, would have an accumulated error in H below 10−6.) The results are visualized with the XDRAW graphics code, which draws contour plots, including of the field, and plots of multiple curves of any two variables.

In the absence of a rotating magnetic field, the fields are independent of t and ϕ and the equations conserve the Hamiltonian H and conjugate angular momentum pϕ. We monitor H to verify that it is conserved to high accuracy. In the presence of a rotating magnetic field, these are no longer conserved separately, but there is a canonically transformed Hamiltonian K = Hωpϕ, which we monitor for high accuracy.

Elastic or inelastic collisions are an option in RMF for which the Hamiltonian is re-initialized after each collision. A simulation is terminated when a particle’s trajectory extends beyond a specified region or when the specified simulation's duration is exceeded.

In RMF, a Field-Reversed Configuration (FRC) is represented by the Hill vortex model whose flux function, ψ, inside the separatrix is

(4)

where rs is the separatrix radius at the midplane z = 0. An O-point (line) is at ro=rs/2, ±zs are the x-point locations, and κzs/rs is the elongation. This satisfies a Grad–Shafranov equation,

(5)

with ψ0=B0rs2/2 being the confined magnetic flux, B0 being the magnetic field at r = z = 0, maximum pressure p0=2B02(1+1/4κ2), and pressure profile p(ψ) = p0(4ψ/ψ0). The solution of Zakharov and Shafranov9 is used outside the separatrix to enforce non-negative pressure there. An alternative FRC representation may be implemented in RMF: the Grad–Shafranov equation numerically solved with specified boundary conditions.

The RMF FRC work thus far reported using Hill’s vortex model. Landsman et al.10 examined the stability and periodicity of the three charged-particle orbit classes11 in FRCs.12μ, the magnetic moment, herein defined as the perpendicular energy divided by the local magnetic field, was not conserved when particle orbits approached the X-points,13 a phenomenon studied earlier in mirror configurations14,15 and geophysical plasmas.16,17

Particles are accelerated by the induced electric field created the rotating magnetic field. Its vector potential is derived from vacuum conditions, ∇ × ∇ × A = 0. There are two types of parity,18 depending on the field’s symmetry about z = 0. In RMF, the odd parity’s vector potential is given by19 

(6)

while the even parity’s vector potential is given by

(7)

where Bo and Be are the odd and even magnetic amplitudes, I0 and I1 are modified Bessel functions, k = π/2zs, ξ = kr, ψ = ϕϕ0ωt, and ω is the frequency of the rotating magnetic field.

Studies of the effects of rotating magnetic fields on charged particles in FRCs revealed a number of phenomena:

  1. Ions were heated to energies near mi(ωrs)2/2 when 0.2 > ω/ωci < 2 and slightly lower when −0.2 > ω/ωci > −2 for Bo > 0.01B0 while electrons were heated to energies up to qπrs2ωBo for lower relative frequencies, ω/ωce ∼ |0.001|. There was a Bo/B0-dependent threshold for heating.20 

  2. Heated ions circulated around the FRC in betatron orbits nearly in synchronism with the RMFo.

  3. High energy ions and electrons circulated in opposite directions in betatron orbits, independent of the direction of the rotating magnetic field’s rotation.

RMF models the field as an ensemble of circular coils, each a filament of radius a carrying current I. A single coil, coaxial with the z axis and centered at z = 0, creates a dipole field with vector potential

(8)

with

(9)
(10)

and complete elliptic integrals

(11)

The elliptic integrals are represented by polynomials and logs of m.

By positioning two coaxial coils at z = ±zc (with centers on the z axis) and currents flowing in the same direction, a mirror configuration is formed.

The purpose of the mirror field configuration was to study the lack of μ conservation in it. An example is shown in Fig. 1.

FIG. 1.

Particle orbits in a mirror machine with a major axis in the z-direction, mirror coils at ±30 cm, and mirror ratio R = 7. Top: projection of ion orbit on r,z plane. Bottom: μ (normalized to its initial value) vs time. The particle leaves the mirror region when μ falls below 0.3.

FIG. 1.

Particle orbits in a mirror machine with a major axis in the z-direction, mirror coils at ±30 cm, and mirror ratio R = 7. Top: projection of ion orbit on r,z plane. Bottom: μ (normalized to its initial value) vs time. The particle leaves the mirror region when μ falls below 0.3.

Close modal

The particle was initially confined, as shown in Fig. 1 (top). However, after a few axial transits, μ fell to such a low value [Fig. 1 (bottom)] that the particle was lost through a mirror throat. Changes in μ occurred when the particle crossed the midplane. For most of the time, the ratio ρi/Rc was small, <1%, which, according to the common theory, should result in μ conservation. Nevertheless, μ was not conserved. Theoretical15,21,22 and RMF studies showed the importance of the field-parallel particle velocity.

Similar behavior, lack of μ conservation, was seen for ion motion in a dipole field configuration [see Fig. 2].

FIG. 2.

Ion trajectory in a dipole field. Top: projection of ion orbit on r,z plane. Bottom: normalized μ vs time.

FIG. 2.

Ion trajectory in a dipole field. Top: projection of ion orbit on r,z plane. Bottom: normalized μ vs time.

Close modal

Guiding center theory shows that near a straight current-carrying wire a drift will develop parallel to the wire. Changes in μ do not occur15,21,22 because a changing field curvature is required. That occurs in FRC and mirror devices but not for a single straight wire.

The vector potential of a single straight wire of length l is given by

(12)

where r is the distance from the wire. As Figs. 3 and 4 show, both high and low energy particles, those with ρ/rc ∼ 0.5 and 0.05, show μ conservation, supporting the aforementioned theories and strongly in contrast with the orbits in mirror machines, FRCs, and dipoles.

FIG. 3.

Trajectory of a low energy ion in field of straight current-carrying wire. Top: projection of trajectory on xy plane. Bottom: projection of motion on rz plane.

FIG. 3.

Trajectory of a low energy ion in field of straight current-carrying wire. Top: projection of trajectory on xy plane. Bottom: projection of motion on rz plane.

Close modal
FIG. 4.

Trajectory of a high energy ion in field of straight current-carrying wire. Top: projection of trajectory on xy plane. The cyclotron motion is clear. Bottom: projection of motion on rz plane. The drift motion is clear.

FIG. 4.

Trajectory of a high energy ion in field of straight current-carrying wire. Top: projection of trajectory on xy plane. The cyclotron motion is clear. Bottom: projection of motion on rz plane. The drift motion is clear.

Close modal

The structure and several applications of the RMF code were described and note was made of current uses of the RMF code as a synthetic diagnostic for charge exchange measurements of ion energy distributions in high-β plasmas and to simulate field-parallel Fermi acceleration in mirror devices. Field options in the code allow studies of particle trajectories in the fields of static FRCs, axisymmetric mirrors, dipoles, cusps, and current-carrying wires, with or without static electric fields having a variety of geometries. Time-varying options include rotating magnetic fields and B-parallel electric fields created by transparent grids in the plasma.

This work was performed under DOE [Contract No. DE-AC02-09CH11466].

The authors have no conflicts to disclose.

The code output used to generate the graphs in this study is available from the corresponding author upon reasonable request. The figures and numerical results in this paper are openly available at http://arks.princeton.edu/ark:/88435/dsp01x920g025r, Ref. 23.

1.
DVODE: ODE solver – Legacy Fortran77 code, available from Netlib.
2.
M. J.
Hill
, “On a spherical vortex,”
Philos. Trans. R. Soc., A
185
,
213
(
1894
).
3.
R. L.
Spencer
and
D. W.
Hewett
, “Free boundary field-reversed configuration (FRC) equilibria in a conducting cylinder,”
Phys. Fluids
25
,
1365
(
1982
).
4.
C. P. S.
Swanson
and
S. A.
Cohen
, “The effect of rigid electron rotation on the Grad–Shafranov equilibria of a class of FRC devices,”
Nucl. Fusion
61
,
086023
(
2021
).
5.
H. A.
Blevin
and
P. C.
Thonemann
, “Plasma confinement using an alternating magnetic field,”
Nucl. Fusion Suppl. Pt. I
55
(
1962
).
6.
K.
Ramasubramanian
and
M. S.
Sriram
, “Lyapunov spectra of Hamiltonian systems using reduced tangent dynamics,”
Phys. Rev. E
62
,
4850
(
2000
).
7.
A. H.
Glasser
and
S. A.
Cohen
, “Interpreting ion-energy distributions using charge exchange emitted from deeply kinetic field-reversed-configuration plasmas,”
Phys. Plasmas
29
(
5
),
052508
(
2022
).
8.
C. P. S.
Swanson
,
C. A.
Galea
, and
S. A.
Cohen
, “Electron heating in 2-D: Combining Fermi–Ulam acceleration and magnetic-moment non-adiabaticity in a mirror-configuration plasma,”
Phys. Plasmas
29
(
to be published
).
9.
L.
Zakharov
and
V.
Shafranov
, “Equilibrium of current-carrying plasmas in toroidal configurations,”
Rev. Plasma Phys.
11
,
206
(
1986
).
10.
A. S.
Landsman
,
S. A.
Cohen
, and
A. H.
Glasser
, “Regular and stochastic orbits of ions in a highly prolate field-reversed configuration,”
Phys. Plasmas
11
(
3
),
947
(
2004
).
11.
M. Y.
Wang
and
G. H.
Miley
, “Particle orbits in field-reversed mirrors,”
Nucl. Fusion
19
,
39
(
1979
).
12.
B. V.
Chirikov
, “Stability of the motion of a charged particle in a magnetic confinement system,”
Sov. J. Plasma Phys.
4
,
3
(
1978
).
13.
A. H.
Glasser
and
S. A.
Cohen
, “Ion and electron acceleration in the field-reversed configuration with an odd-parity rotating magnetic field,”
Phys. Plasmas
9
,
2093
(
2002
).
14.
L. R.
Henrich
. “Departure of particle orbits from the adiabatic approximation.” in
Proc. Conf. on Thermonuclear Reactions
(
United States Atomic Energy Comission
,
Gatlinburg, TN
,
1956)
.
15.
R. H.
Cohen
,
G.
Rowlands
, and
J. H.
Foote
, “Nonadiabaticity in mirror machines,”
Phys. Fluids
21
,
627
(
1978
).
16.
T. W.
Speiser
, “Particle trajectories in a model current sheet, based on the open model of the magnetosphere, with applications to auroral particles,”
J. Geophys. Res.
70
,
1717
, (
1965
).
17.
J.
Chen
, “Nonlinear dynamics of charged particles in the magnetotail,”
J. Geophys. Res.: Space Phys.
97
,
15011
, (
1992
).
18.
S. A.
Cohen
and
R. D.
Milroy
, “Maintaining the closed magnetic-field-line topology of a field-reversed configuration with the addition of static transverse magnetic fields,”
Phys. Plasmas
7
(
6
),
2539
2545
(
2000
).
19.
S. A.
Cohen
and
A. H.
Glasser
, “Ion heating in the field-reversed configuration by rotating magnetic fields near the ion-cyclotron resonance,”
Phys. Rev. Lett.
85
,
5114
(
2000
).
20.
A. S.
Landsman
,
S. A.
Cohen
, and
A. H.
Glasser
, “Onset and saturation of ion heating by odd-parity rotating magnetic fields in a field-reversed configuration,”
Phys. Rev. Lett.
96
,
015002
(
2006
).
21.
R. J.
Hastie
,
G. D.
Hobbs
, and
J. B.
Taylor
“Non-adiabatic behaviour of particles in inhomogeneous magnetic fields,” in
Plasma Physics and Controlled Nuclear Fusion Research, Proceedings of the Third International Conference on Plasma Physics and Controlled Nuclear Fusion Research
(IAEA,
Vienna
,
1969
), Vol. I.
22.
D. C.
Delcourt
,
R. F.
Martin
, Jr.
, and
F.
Alem
, “A simple model of magnetic moment scattering in a field reversal,”
Geophys. Res. Lett.
21
,
1543
, (
1994
).
23.
See
http://arks.princeton.edu/ark:/88435/dsp01x920g025r
for the graphs presented herein
.