An interpolation method to evaluate magnetic fields, given its unstructured and scattered magnetic data, is presented. The method is based on the reconstruction of the global magnetic field using a superposition of orthogonal functions. The coefficients of the expansion are obtained by minimizing a cost function defined as the L2 norm of the difference between the ground truth and the reconstructed magnetic field evaluated on the training data. The divergence-free condition is incorporated as a constraint in the cost function, allowing the method to achieve arbitrarily small errors in the magnetic field divergence. An exponential decay of the approximation error is observed and compared with the less favorable algebraic decay of local splines. Compared to local methods involving computationally expensive search algorithms, the proposed method exhibits a significant reduction of the computational complexity of the field evaluation, while maintaining a small error in the divergence even in the presence of magnetic islands and stochasticity. Applications to the computation of Poincaré sections using data obtained from numerical solutions of the magnetohydrodynamic equations in toroidal geometry are presented and compared with local methods currently in use.

1.
C. C.
Lalescu
,
B.
Teaca
, and
D.
Carati
, “
Influence of numerical schemes on statistical properties of computed charged particle trajectories in turbulent electromagnetic fields
,”
J. Comput. Phys.
241
,
546
557
(
2013
).
2.
C. C.
Lalescu
,
B.
Teaca
, and
D.
Carati
, “
Implementation of high order spline interpolations for tracking test particles in discretized fields
,”
J. Comput. Phys.
229
(
17
),
5862
5869
(
2010
).
3.
F.
Mackay
,
R.
Marchand
, and
K.
Kabin
, “
Divergence-free magnetic field interpolation and charged particle trajectory integration
,”
J. Geophys. Res.
111
(
A6
),
A06208
(
2006
).
4.
J.
Finn
and
L.
Chacon
, “
Volume preserving integrators for solenoidal fields on a grid
,”
Phys. Plasmas
12
(
5
),
054503
(
2005
).
5.
J. U.
Brackbill
and
D. C.
Barnes
, “
The effect of nonzero b on the numerical solution of the magnetohydrodynamic equations
,”
J. Comput. Phys.
35
(
3
),
426
430
(
1980
).
6.
B.
Ravu
,
M.
Rudman
,
G.
Metcalfe
,
D. R.
Lester
, and
D. V.
Khakhar
, “
Creating analytically divergence-free velocity fields from grid-based data
,”
J. Comput. Phys.
323
,
75
94
(
2016
).
7.
C. P.
McNally
, “
Divergence-free interpolation of vector fields from point values exact ·b=0 in numerical simulations
,”
Mon. Not. R. Astron. Soc.: Lett.
413
(
1
),
L76
L80
(
2011
).
8.
P.
Probert
, “
High-performance interpolation of stellarator magnetic fields
,”
IEEE Trans. Plasma Sci.
39
(
4
),
1051
1054
(
2011
).
9.
G. J.
Kramer
,
R. V.
Budny
,
A.
Bortolon
,
E. D.
Fredrickson
,
G. Y.
Fu
,
W. W.
Heidbrink
,
R.
Nazikian
,
E.
Valeo
, and
M. A.
Van Zeeland
, “
A description of the full-particle-orbit-following spiral code for simulating fast-ion experiments in tokamaks
,”
Plasma Phys. Controlled Fusion
55
,
0250013
(
2013
).
10.
D.
Pfefferlé
,
W. A.
Cooper
,
J. P.
Graves
, and
C.
Misev
, “
Venus-levis and its spline-Fourier interpolation of 3D toroidal magnetic field representation for guiding-centre and full-orbit simulations of charged energetic particles
,”
Comput. Phys. Commun.
185
(
12
),
3127
3140
(
2014
).
11.
R. W.
Garnett
and
G. R.
Burleson
, “
A simple three-dimensional magnetic field interpolation technique
,”
Nucl. Instrum. Methods Phys. Res. Sect. A
313
(
3
),
501
505
(
1992
).
12.
P. K.
Yeung
and
S. B.
Pope
, “
An algorithm for tracking fluid particles in numerical simulations of homogeneous turbulence
,”
J. Comput. Phys.
79
(
2
),
373
416
(
1988
).
13.
M. A. T.
Van Hinsberg
,
J.
ten Thije Boonkkamp
,
F.
Toschi
, and
H. J. H.
Clercx
, “
Optimal interpolation schemes for particle tracking in turbulence
,”
Phys. Rev. E
87
(
4
),
043307
(
2013
).
14.
B. K.
Tapley
,
H. I.
Andersson
,
E.
Celledoni
, and
B.
Owren
, “
Computational geometric methods for preferential clustering of particle suspensions
,”
J. Comput. Phys.
448
,
110725
(
2022
).
15.
M.
Abramowitz
,
I. A.
Stegun
, and
R. H.
Romer
, “Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables,”
Am. J. Phys.
56
,
958
(
1988
).
16.
Å.
Björck
,
Numerical Methods for Least Squares Problems
(
SIAM
,
1996
).
17.
D. J.
Higham
and
N. J.
Higham
,
MATLAB Guide
(
SIAM
,
2016
).
18.
S.
Reich
and
H.-K.
Xu
, “
An iterative approach to a constrained least squares problem
,”
Abstr. Appl. Anal.
2003
,
503
512
(
2003
).
19.
D. C.-L.
Fong
and
M.
Saunders
, “
LSMR: An iterative algorithm for sparse least-squares problems
,”
SIAM J. Sci. Comput.
33
(
5
),
2950
2971
(
2011
).
20.
D. R.
Powell
and
J. R.
Macdonald
, “
A rapidly convergent iterative method for the solution of the generalised nonlinear least squares problem
,”
Comput. J.
15
(
2
),
148
155
(
1972
).
21.
G. H.
Golub
and
C. F. V.
Loan
,
Matrix Computations
(
JHU Press
,
2013
).
22.
D.
Coppersmith
and
S.
Winograd
, “
Matrix multiplication via arithmetic progressions
,” in
Proceedings of the Nineteenth Annual ACM Symposium on Theory of Computing
(
ACM
,
1987
), pp.
1
6
.
23.
H.
Qian
, “
Counting the floating point operations (FLOPS)
,” MATLAB Central File Exchange Report No. 50608 (
2021
).
24.
L. F.
Shampine
and
M. W.
Reichelt
, “
The MATLAB ODE suite
,”
SIAM J. Sci. Comput.
18
(
1
),
1
22
(
1997
).
25.
J. P.
Boyd
,
Chebyshev and Fourier Spectral Methods
(
Springer
,
New York
,
1989
).
26.
S. C.
Jardin
,
N.
Ferraro
,
X.
Luo
,
J.
Chen
,
J.
Breslau
,
K. E.
Jansen
, and
M. S.
Shephard
, “
The M3D-C1 approach to simulating 3D 2-fluid magnetohydrodynamics in magnetic fusion experiments
,”
J. Phys.: Conf. Ser.
125
,
012044
(
2008
).
27.
C. R.
Sovinec
,
A. H.
Glasser
,
T. A.
Gianakon
,
D. C.
Barnes
,
R. A.
Nebel
,
S. E.
Kruger
,
D. D.
Schnack
,
S. J.
Plimpton
,
A.
Tarditi
,
M. S.
Chu
, and
NIMROD Team
, “
Nonlinear magnetohydrodynamics simulation using high-order finite elements
,”
J. Comput. Phys.
195
,
355
386
(
2004
).
28.
L. L.
Lao
,
J. R.
Ferron
,
R. J.
Groebner
,
W.
Howl
,
H. St.
John
,
E. J.
Strait
, and
T. S.
Taylor
, “
Equilibrium analysis of current profiles in tokamaks
,”
Nucl. Fusion
30
,
1035
(
1990
).
29.
B. C.
Lyons
and
S. C.
Jardin
, private communication (
2020
).
30.
B. C.
Lyons
,
C. C.
Kim
,
Y. Q.
Liu
,
N. M.
Ferraro
,
S. C.
Jardin
,
J.
McClenaghan
,
P. B.
Parks
, and
L. L.
Lao
, “
Axisymmetric benchmarks of impurity dynamics in extended- magnetohydrodynamic simulations
,”
Nucl. Fusion
61
,
064001
(
2019
).
31.
N. M.
Ferraro
, Private Communication (
2018
).
32.
A.
Pletzer
and
D.
McCune
, see https://w3.pppl.gov/ntcc/PSPLINE/ for “
NTTC PSPLINE Module
” (
2010
).
33.
B. S.
Cornille
,
M. T.
Beidler
,
S.
Munaretto
,
B. E.
Chapman
,
D.
Del-Castillo-Negrete
,
N. C.
Hurst
,
J. S.
Sarff
, and
C. R.
Sovinec
, “
Computational study of runaway electrons in MST tokamak discharges with applied resonant magnetic perturbation
,”
Phys. Plasmas
29
(
5
),
052510
(
2022
).
34.
S.
Munaretto
,
B. E.
Chapman
,
B. S.
Cornille
,
A. M.
DuBois
,
K. J.
McCollam
,
C. R.
Sovinec
,
A. F.
Almagri
, and
J. A.
Goetz
, “
Generatio and suppression of runaway electrons in MST tokamak plasmas
,”
Nucl. Fusion
60
,
046024
(
2020
).
You do not currently have access to this content.