O1 (WP1) – The theory of transport and machine learning architectures
Deliverable: A comprehensive turbulent transport model
Within this work package, we established the theoretical foundations for describing the dynamics of charged particles in fusion plasmas characterized by turbulence (Task 1.1), for the correct description of turbulent random fields (Task 1.2), and for the main machine-learning tools relevant to the purpose of this project (Task 1.3).
We consider a population of charged particles, with mass $m$ and charge $q$, confined in a tokamak configuration dominated by a strong magnetic field $\mathbf{B}$. The usual particle coordinates in phase space are $(\mathbf{x},\mathbf{v})$. When the magnetic field is sufficiently strong compared to other electromagnetic components, the motion can be viewed as a superposition of a smooth large-scale motion and a fast Larmor gyration. This scale separation is the basis of Lie perturbation theory [1], which provides a rigorous mathematical framework for charged-particle dynamics in magnetized plasmas.
In this approach, the true 6D phase space $(\mathbf{x},\mathbf{v})$ is replaced by the reduced gyrocentre coordinates $(\mathbf{X},v_{\parallel},\mu)$, which suppress the fast gyromotion through a perturbative expansion based on gyrokinetic ordering [2]. In this project we adopt the high-flow ordering [3], explicitly retaining the polarization drift [4].
The gyrocentre dynamics satisfy
$$ \frac{d\mathbf{X}}{dt} = v_{\parallel}\frac{\mathbf{B}^\star}{B_{\parallel}^\star} + \frac{\mathbf{E}^\star \times \mathbf{b}}{B_{\parallel}^\star} \qquad\text{(1)} $$
$$ \frac{dv_{\parallel}}{dt} = \frac{q}{m}\frac{\mathbf{E}^\star\cdot\mathbf{B}^\star}{B_{\parallel}^\star} \qquad\text{(2)} $$
$$ \frac{d\mu}{dt}=0 \qquad\text{(3)} $$
where $$\mathbf{E}^\star = -\nabla\Phi^\star - \frac{\partial \mathbf{A}^\star}{\partial t}, \qquad \mathbf{B}^\star = \nabla\times\mathbf{A}^\star,$$ and
$$ q\Phi^\star = \frac{m v_\parallel^2}{2} - \frac{m u^2}{2} + \mu B + q\phi_1^{\text{neo}} + q\phi_1^{\text{gc}} \qquad\text{(4)} $$
$$ \mathbf{A}^\star = \mathbf{A}_0 + \frac{m}{q}(v_{\parallel}\mathbf{b}+u+v_E) + \mathbf{A}_1^{\text{gc}} \qquad\text{(5)} $$
The zeroth-order magnetic potential $\mathbf{A}_0$ satisfies $\mathbf{B} = \nabla\times\mathbf{A}_0$. For axisymmetric equilibria, the field can be written as: $$ \mathbf{B} = F(\psi)\nabla\phi+\nabla\phi\times\nabla\psi, $$ where $\phi$ is the toroidal angle in cylindrical $(R,Z,\phi)$ or toroidal $(r,\theta,\phi)$ coordinates (COCOS = 2) [5].
The local safety factor $q_\theta(\psi,\theta)$, its flux-surface average $\bar{q}(\psi)$, and the generalized poloidal angle $\chi(\psi,\theta)$ are defined by:
$$ q_\theta(\psi,\theta) = \frac{\mathbf{B}\cdot\nabla\phi}{\mathbf{B}\cdot\nabla\theta} \qquad\text{(6)} $$
$$ \bar{q}(\psi) = \frac{1}{2\pi}\int_0^{2\pi} q_\theta(\psi,\theta)\,d\theta \qquad\text{(7)} $$
$$ \left.\frac{\partial\chi}{\partial\theta}\right|_{\psi} = \frac{q_\theta(\psi,\theta)}{\bar{q}(\psi)} \qquad\text{(8)} $$
Zeroth-order MHD equilibrium is toroidally invariant and constant on magnetic surfaces, so $n=n(\psi)$, $P=P(\psi)$, $T_i=T_i(\psi)$, $T_e=T_e(\psi)$.
A macroscopic radial electric field $E_0$ produces a toroidal rotation $$ \mathbf{u} = R^2\Omega_t(\psi)\,\nabla\phi, $$ where $\Omega_t(\psi)$ may have a gradient. The equations of motion are expressed in a frame rotating with $\mathbf{u}$ [3, 7]. Poloidal flows are neglected [6], but a neoclassical poloidal potential $\phi_1^{\text{neo}}(\psi,\theta)$ appears:
$$ \phi_1^{\text{neo}} = \frac{m\Omega_t(\psi)^2}{2|e|\,(1+T_i/T_e)} \left(R^2 - \langle R^2\rangle_\theta\right) \qquad\text{(9)} $$
The first-order gyrocentre potentials $\phi_1^{\text{gc}}$ and $\mathbf{A}_1^{\text{gc}}$ include turbulent fluctuations and small external perturbations (RMPs). Gyro-averaging gives:
$$ \tilde{\phi}_1^{\text{gc}}(k,t) = \tilde{\phi}_1(k,t)\, J_0(k_\perp \rho_L), $$ with $\rho_L=\sqrt{2m\mu}/(qB)$.
The drift-wave turbulence relevant for ions is dominated by ITG/TEM modes [8].
Circular geometry
In circular approximation, $$ \mathbf{B} = B_0 R_0\,\nabla\phi + \frac{r b_\theta(r)}{R}\,\nabla\theta \qquad\text{(10)} $$ $$ F(\psi)=B_0 R_0 \qquad\text{(11)} $$ $$ \psi(r)=B_0R_0\int_0^r b_\theta(r')dr' \qquad\text{(12)} $$ $$ b_\theta(r)=\frac{r\,\bar{q}(r)}{R_0^2-r^2} \qquad\text{(13)} $$ $$ \chi(r,\theta)=2\tan^{-1} \left[\frac{R_0-r}{R_0+r}\tan\left(\frac{\theta}{2}\right)\right] \qquad\text{(14)} $$
Solov’ev equilibria
With linear profiles: $$ \mu_0\frac{dP}{d\psi}=A, \qquad \frac{dF^2}{d\psi}=\frac{2 A R_0^2 \gamma}{1+\alpha^2} \qquad\text{(15)} $$ The poloidal flux is $$ \psi=\frac{A}{2(1+\alpha^2)} \left[R^2 - \gamma R_0^2 - Z^2 + \frac{\alpha^2}{4}(R^2-R_0^2)^2\right] \qquad\text{(16)} $$ Minor radius: $$ a=\frac{R_0}{2\sqrt{2-\gamma-\sqrt{\gamma}}} \qquad\text{(17)} $$ Elongation: $$ \kappa=\frac{\alpha}{\sqrt{1-\gamma/(2-\gamma)}} \qquad\text{(18)} $$ Current: $$ F(\psi)=B_0R_0\left[1+\frac{\psi}{2A\gamma B_0(1+\alpha^2)}\right] \qquad\text{(19)} $$
Experimentally reconstructed equilibria
Experimental magnetic equilibria (G-EQDSK format) provide $\psi(R,Z)$ and profiles $F(\psi)$, $\bar{q}(\psi)$ on numerical grids. They are generated by reconstruction tools such as CHEASE [9], EFIT [10], PLEQUE [11], NICE [12], and EQUINOX [13]. T3ST uses these equilibria when analyzing specific discharges.
Given the definitions of the magnetic equilibrium quantities $q_\theta(\psi,\theta)$, $\bar{q}(\psi)$, and $\chi(\psi,\theta)$ (Eqs. (6–8)), one can show that the Clebsch form of the magnetic field is valid:
$$ \mathbf{B} = \nabla(\phi - \bar{q}\,\chi)\times\nabla\psi. $$
For representing small-scale turbulent fluctuations, most gyrokinetic (GK) codes adopt field-aligned coordinates $(x,y,z)$ [14], which simplify the description of fluctuations elongated along magnetic field lines. These coordinates correspond to the radial, binormal, and parallel directions ($\mathbf{B}\propto\nabla y\times\nabla x\propto\partial \mathbf{r}/\partial z$):
$$ x = C_x f(\psi) \qquad\text{(20)} $$
$$ y = C_y\,( \phi - \bar{q}\,\chi ) \qquad\text{(21)} $$
$$ z = C_z\,\chi \qquad\text{(22)} $$
In practice, T3ST uses constant values $C_x=a$ (the tokamak minor radius), $C_y=r_0/\bar{q}(r_0)$ (with $r_0$ a reference radius), $C_z=1$, and defines $f(\psi)=\rho_t = \Phi_t(\psi)/\Phi_t(\psi_{\text{edge}})$, where $\rho_t\in[0,1]$ is the normalized effective radius. The toroidal magnetic flux is
$$ \Phi_t(\psi)=\int_{\text{axis}}^{\psi} \mathbf{B}\cdot\mathbf{e}_\phi\, dS(\psi'), $$
thus $\rho_t \approx r/a$ (in circular geometry).
Instead of computing turbulent fields self-consistently, T3ST models them statistically as an ensemble of random fields $\{\phi_1, A_1\}$ with prescribed statistical properties, consistent with experimental ITG/TEM observations. Several moderate assumptions are used:
-
Gaussianity — Fluctuations are assumed to follow a normal distribution $P[\phi_1]\sim\exp(-\phi_1^2/2\langle\phi_1^2\rangle)$. Small experimental deviations from Gaussianity have negligible impact on transport.
-
Homogeneity — Turbulence is taken as homogeneous. Thus the autocorrelation function $$ E(\mathbf{r},t;\mathbf{r}',t') = \langle \phi(\mathbf{r},t)\phi(\mathbf{r}',t')\rangle = E(\mathbf{r}-\mathbf{r}',\,t-t') $$ contains all statistical information and can be evaluated from the power spectrum $S(\mathbf{k},\omega)=\langle|\tilde{\phi}_1(\mathbf{k},\omega)|^2\rangle$.
-
Drift-type dispersion relation — ITG/TEM fluctuations originate from drift-wave instabilities described approximately even in the saturated state by a dispersion relation $\omega^\star(\mathbf{k})$. In the code: $$ \omega^\star(\mathbf{k}) = \frac{\mathbf{k}\cdot\mathbf{V}^\star}{1+\rho_s^2\,|\mathbf{k}_\perp|^2}, $$ where $\mathbf{V}^\star = -(\nabla p_s\times\mathbf{b})/(n_s q_s B)$ is the diamagnetic velocity of species $s$, and $\rho_s$ is its Larmor radius.
Based on these assumptions, T3ST constructs an ensemble of random fields $\phi_1(x,t)$ from white-noise fields in Fourier space $\eta(\mathbf{k},\omega)$ satisfying $$ \langle \eta(\mathbf{k},\omega)\,\eta(\mathbf{k}',\omega')\rangle = \delta(\mathbf{k}+\mathbf{k}')\,\delta(\omega+\omega'). $$ The Fourier components of the potential are
$$ \tilde{\phi}_1(\mathbf{k},\omega) = \sqrt{S(\mathbf{k},\omega)}\,\eta(\mathbf{k},\omega), $$
ensuring Gaussianity and correct correlations.
In toroidal geometry, the fields can be expressed through a double Fourier series:
$$ \phi(x,t)=\sum_{n,m}\phi_{nm}(r,t)\, e^{i(n\phi+m\theta)} \qquad\text{(23)} $$
which preserves natural periodicity. However, due to the anisotropic nature of turbulence (long correlation lengths along the field, short perpendicular), field-aligned representation is preferred. Thus T3ST evaluates $\phi_1$ in field-aligned coordinates, even though magnetic drifts are computed in cylindrical coordinates.
The random field is represented as:
$$ \phi_1(x,y,z,t) =\int dk\, d\omega\; \tilde{\phi}_1(\mathbf{k},\omega)\; e^{\,i(k_x x + k_y y + k_z z - [\omega^\star(\mathbf{k})+\omega] t)} \qquad\text{(24)} $$
For $k_\parallel\ll k_\perp$, the correspondence with toroidal mode numbers is approximately:
$$ k_y \approx \frac{n}{C_y},\qquad m = -\big[\bar{q}(x_0)\,n\big] + \Delta m,\qquad k_z = \frac{\Delta m + \{\bar{q}(x_0)n\}}{C_z}, \qquad\text{(25)} $$
where $[\cdot]$ and $\{\cdot\}$ denote the integer and fractional parts, and $n,\Delta m\in\mathbb{Z}$.
The spectrum $S(\mathbf{k},\omega)$ is modeled analytically to reproduce saturated drift-wave turbulence characteristics:
$$ S = A_\phi^2 \, \frac{\tau_c\,\lambda_x\lambda_y\lambda_z}{(2\pi)^{5/2}}\, \frac{ \exp\!\left[-(k_x^2\lambda_x^2 + k_z^2\lambda_z^2)/2\right] }{ 1+\tau_c^2\omega^2 }\, \Big[ e^{-\frac{(k_y-k_0)^2\lambda_y^2}{2}} \;-\; e^{-\frac{(k_y+k_0)^2\lambda_y^2}{2}} \Big] \qquad\text{(26)} $$
The parameters $\lambda_x,\lambda_y,\lambda_z$ are the correlation lengths in the field-aligned directions; $k_0$ selects the most unstable mode $$ k_{y,\text{max}} \approx \frac{k_0}{2} + \sqrt{\frac{k_0^2}{4} + \frac{2}{\lambda_y^2}}. $$ The correlation time $\tau_c$ measures deviations from the dispersion relation, and $A_\phi$ sets the turbulence amplitude. Typical parameters:
$$ \lambda_x \approx 5\rho_i,\quad k_0 \approx 0.1/\rho_i,\quad \lambda_y \approx 5\rho_i,\quad \lambda_z \approx 1,\quad \tau_c \approx R_0/v_{\text{th}},\quad |e|A_\phi \approx 1\%\,T_i. $$
Since $\lambda_z\approx 1$, we obtain $\lambda_\parallel\approx\bar{q}R_0$, consistent with experimental observations.
Drift-wave turbulence in tokamaks is generally a superposition of ITG and TEM modes, weighted by coefficients $A_i$ and $A_e$:
$$ \phi_1 = A_i\,\phi_1^{\text{ITG}} + A_e\,\phi_1^{\text{TEM}}, \qquad A_i + A_e = 1. $$
It is well known that magnetic curvature, shear, internal transport barriers, ELM activity, and blob structures can induce non-Gaussian behavior and spatial variations of turbulence. Thus the assumptions of Gaussianity and homogeneity are only approximate. Nevertheless, numerical results (Sec. 4) show that particle transport is predominantly local, with particles moving only a few Larmor radii from their initial surface. Therefore, although not globally exact, these assumptions remain valid locally for the purposes of the present analysis.
A possible extension recently implemented in the T3ST code is the ability to include inhomogeneities along the direction parallel to the magnetic field (“z”) through a simple prefactor:
$$ \phi_1 \rightarrow \phi_1 \, g(z) $$
$$ g(z) = e^{-\, z^2 / (2 \Lambda_z^2)} $$
where \( \Lambda_z \) is a measure of the parallel correlation and of the “ballooning” character specific to electrostatic turbulence.
Let an arbitrary function be \(F(\mathbf{X}) = y\), where \(\mathbf{X}\) is the “input” vector of size \(\mathbf{X}\in\mathbb{R}^{N}\), and \(y\) is the “output” which, in our case, is a scalar \(y\in\mathbb{R}\). Machine-learning models are designed to approximate complex relationships between input–output pairs, i.e. mappings \(\mathbf{X}\mapsto y\), especially when the analytical form of the function is unknown, difficult to derive, or impossible to reproduce explicitly.
In the context of this project, the objective is to predict the asymptotic diffusion and convection values as functions of the free parameters of the transport model. These free parameters can be grouped into three categories: parameters describing the plasma equilibrium profiles, parameters of the particle distribution under consideration, and turbulence parameters. In total, depending on the available information, the asymptotic diffusion may depend on approximately 20 independent variables, so that the input vector has dimension \(\mathbf{X}\in\mathbb{R}^{20}\).
The main obstacle to achieving accurate predictions comes from the high complexity of the multivariate function, driven by the large dimensionality of the input space. Moreover, this difficulty is amplified by the limited size of the training database, which cannot be expanded arbitrarily due to the computational cost of the numerical simulations.
In this setting, it is necessary to identify machine-learning methods—combined with sampling and preprocessing techniques—that provide good performance in high-dimensional spaces and adapt efficiently to small datasets. For such problems, the most suitable models are nonlinear regression methods, in particular feed-forward neural networks (NNs) [15], which are universal approximators and can capture complex nonlinear relationships in continuous high-dimensional functions. Complementarily, dimensionality reduction techniques such as PCA [16] can be used to extract relevant features and reduce the NN input space, improving both stability and predictive accuracy.
In essence, a neural network is a function with a specific structure that maps an input of dimension \(d_0\) to an output of dimension \(d_{n+1}\). The basic structure is composed of layers of three types: an input layer (\(L_0 \equiv L_{\text{in}}\)), an output layer (\(L_{n+1} \equiv L_{\text{out}}\)), and, between them, one or more “hidden” layers (\(L_i\), \(i=\overline{1,n}\)). The basic elements of each layer are neurons, and their number may vary from layer to layer (denoted by \(d_i\)).
For the problem analyzed in this project, the most appropriate neural-network model is a fully connected feed-forward neural network (FCNN) [15]. In such an architecture, each neuron in a layer is connected to all neurons in the next layer, and information propagates unidirectionally from input to output through one or more hidden layers. A generic FCNN architecture is illustrated schematically in Figure 1.
The inputs and outputs of an NN must be numerically quantifiable, so that each neuron represents a single numerical value. In the present study, the input is the set of \(\sim 20\) free parameters of the transport model, and the output is the scalar value of the asymptotic radial diffusion.
Equation (1.22) describes how the value of a generic neuron, denoted \(\alpha^{(i)}_j\), is computed. This quantity represents the value of the \(i\)-th neuron in layer \(L_j\):
where:
- \(w^{(i,k)}_j\) is the weight assigned to the value of the \(k\)-th neuron in the previous layer (\(L_{j-1}\));
- \(f\) is the activation function, which can take various forms; commonly used choices are sigmoid or the hyperbolic tangent (\(\tanh\)). One of its roles is to introduce nonlinearity into an otherwise linear combination of weights and neuron values (a weighted sum over the \(d_{j-1}\) neurons of layer \(L_{j-1}\));
- \(\beta^{(i)}_j\) is the bias associated with neuron \(i\) in layer \(L_j\), whose role is to shift the input range of the activation function.
In matrix notation, the compact form of Eq. (1.22) for the entire layer \(L_j\) is:
Here \(\mathbf{A}_j\) and \(\mathbf{A}_{j-1}\) are column vectors of sizes \(d_j\times 1\) and \(d_{j-1}\times 1\), containing the values of all neurons in layers \(L_j\) and \(L_{j-1}\), respectively; \(\mathbf{B}_j\) is a \(d_j\times 1\) column vector containing the biases of each neuron in layer \(L_j\); and \(\mathbf{W}_{j-1}\) is a \(d_j\times d_{j-1}\) matrix containing the weights corresponding to the connections between layers \(L_{j-1}\) and \(L_j\). Therefore, for the connection between layers \(L_{j-1}\) and \(L_j\) there are in total \(d_j(d_{j-1}+1)\) parameters.
Consequently, the total number of neural-network parameters is
where \(n\) is the total number of hidden layers.
The neural network is trained on an existing dataset in order to determine the optimal parameter values (weights and biases) such that the error between true values and predictions is minimized. The training process includes several steps:
- Initialization: before training, weights and biases are set to random values according to a chosen scheme. Identical initializations, or very large-magnitude values (for \(\tanh\)/sigmoid), can slow down or stall learning, keeping the network in poor local minima. A suitable initialization keeps activation inputs in regions with significant gradients; otherwise gradients tend to zero and learning becomes inefficient. If all weights start identically, they also evolve identically, preventing effective optimization.
- Loss function and training epochs: training proceeds over multiple epochs during which the dataset is split into batches that are successively fed to the network. An epoch ends after the full dataset has been processed, followed by backpropagation. At each epoch, weights and biases are adjusted by an optimization algorithm to reduce the loss function.
- Optimization: the standard method is Stochastic Gradient Descent (SGD) [17]: at each iteration a batch is selected, the loss gradient is computed, and the weights are updated in the direction opposite to the gradient. A widely used variant is ADAM [18], which dynamically adapts the learning rate. Its advantages include separate learning rates for each parameter, a momentum term enabling faster convergence, and bias corrections that improve gradient estimates.
O2 (WP2) – Developing and testing numerical codes
Deliverable: 1 code for test particle simulations, 2 codes for machine learning
-
Within this work package, we implemented new technical improvements to the code (T3ST) for test-particle dynamics in turbulent fields (Task 2.1), developed scripts for implementing machine-learning methods (Task 2.2), and tested these two computational components (Task 2.3).
- T2.1: Improvements to the test-particle numerical code
- extract_contour_zero — finds all $(R,Z)$ points where $\phi=0$;
- order_points_by_angle — sorts contour points by polar angle to form a closed ordered loop;
- interp_point_along_contour — interpolates a point at a chosen position along the ordered contour.
- T2.2: Machine learning tool development
- Dimensionality and strictly positive domain: input vector \(\mathbf{X}\in\mathbb{R}^N\), with \(N\in\overline{(1,25)}\); scalar output \(y\in\mathbb{R}\), with \(y>0\) for all \(\mathbf{X}\in\mathbb{R}^N\).
- Simple individual dependencies: based on previous results [20, 21, 22], we expect the individual dependencies \(f(X_i)\), \(i\in\overline{(1,N)}\), to be relatively simple: continuous, smooth, approximately monotonic, with at most one change in monotonicity over the test interval.
- Output distribution compatible with real data: using simulations from [20], obtained on a sample of approximately \(1.53\times10^5\) values, we imposed that the range and distribution of \(y\) be similar to those observed in real datasets. A comparison between the CDF of the final test function (Eq. 2.8) and the CDF of the data from [20] is shown in Figure 3.
- T2.3: Testing
During this stage of the project, the development of the T3ST code has been completed. T3ST [25] is a numerical FORTRAN code implementing the mathematical description of charged-particle dynamics in tokamak configurations, as presented earlier. Moreover, the code can include axisymmetric equilibrium magnetic fields at different levels of description (circular model, Solov’ev model, or equilibria reconstructed from experimental data). On top of this equilibrium field, Coulomb collisions and electrostatic turbulent fields are superimposed. The latter are modelled statistically using the principle of statistical representability, through random fields with predefined statistical characteristics.
Charged particles are dynamically followed in this electromagnetic environment using a numerical solver for the equations of motion, based on a 4th-order Runge–Kutta scheme. Once the particle trajectories are obtained, radial transport is estimated at the level of the convection and radial diffusion coefficients, computed in the usual way from the average position and dispersion of the trajectories:
$$ V_r(t\,|\,x)=\frac{d\langle X(t\,|\,x)\rangle}{dt}, \qquad D_r(t\,|\,x)=\frac12\frac{d}{dt}\left(\langle X(t\,|\,x)^2\rangle - \langle X(t\,|\,x)\rangle^2\right). $$
At the time of the funding proposal, the T3ST code (although unnamed at the time) was already about 90% complete and had been used in several theoretical investigations. As of this report, T3ST has undergone several improvements, detailed below.
Refinement of collision routines
Fokker–Planck operators for Coulomb collisions, $$ C[f,f_s] = -\partial_z\left(K_z f - D_{zz'}\,\partial_{z'} f\right), $$ have been previously derived in the literature for gyrokinetic coordinates [19].
Since T3ST follows particle trajectories $\{X(t), v_\parallel(t), \mu(t)\}$, we must describe collisions at this level. Collisions modify the gyroscopic dynamics, turning the deterministic ODE system into a set of stochastic differential equations (SDEs):
$$ d\mathbf{X} = \sqrt{2D_c\,(I-\mathbf{b}\otimes\mathbf{b})}\,d\mathbf{W}_X, $$
$$ dv_\parallel = v_\parallel\!\left[ -\nu + \left(\frac{2D_\parallel - D_\perp}{v^2} + \frac{\partial D_\parallel}{\partial v}\right) \right] dt + \Sigma_{v_\parallel,v_\parallel} dW_{v_\parallel} + \Sigma_{v_\parallel,\mu} dW_\mu, $$
$$ d\mu = \mu\!\left[ -2\nu + mE\!\left( v_\parallel \frac{\partial D_\parallel}{\partial v} + \frac{3(D_\parallel-D_\perp)(\mu B + 2E D_\perp)}{\mu B} \right) \right] dt + \Sigma_{\mu,v_\parallel} dW_{v_\parallel} + \Sigma_{\mu,\mu} dW_\mu, $$
where $dW_i$ are independent Wiener processes with zero mean.
Besides the full Coulomb operator, T3ST also implements a simplified Lorentz operator, useful especially for electron transport and providing a reasonable approximation for ions in coronal equilibrium with the background plasma. This formulation describes the evolution of the pitch angle $\lambda = v_\parallel/v$, where $v=\sqrt{v_\parallel^2 + v_\perp^2}$, and the kinetic energy $E_k$:
$$ \lambda(t+\Delta t) = \lambda(t) - \nu_d \lambda(t)\Delta t + \sigma\,(1-\lambda(t)^2)\nu_d\Delta t, \qquad (?) $$
$$ E_k(t+\Delta t) = E_k(t) - 2\nu_e\Delta t\, E_k(t) T \left(\frac{1}{T} - \frac{3}{2}\frac{E_k}{T} - \frac{d\ln\nu_e}{dE_k}\right) + 2\sigma\sqrt{\nu_e \Delta t\, E_k(t) T }. \qquad (?) $$
Here $\sigma=\pm1$ is a random sign chosen independently for each particle at each step. $T$ is the background plasma temperature, and $\nu_d$ and $\nu_e$ are the deflection and energy-transfer collision frequencies:
$$ \nu_d(v)= \frac{2\ln\Lambda\, n_i (Z_{\text{eff}} Z e^2)^2}{\pi\epsilon_0^2 m^2 v_{\text{th}}^3} \frac{\Phi(v)-\Psi(v)}{v^3}, \qquad (?) $$
$$ \nu_e(v)= \frac{\ln\Lambda\, n_i (Z_{\text{eff}} Z e^2)^2}{4\pi\epsilon_0^2 m^2 v_{\text{th}}^3} \frac{\Psi(v)}{v^3}. \qquad (28) $$
with $\ln\Lambda = 17$ the Coulomb logarithm, and the functions:
$$ \Phi(v) = \operatorname{erf}(v), \qquad (?) $$
$$ \Psi(v) = \frac{1}{2v^2}\big[\Phi(v) - v\,\Phi'(v)\big]. \qquad (?) $$
Equations (??) preserve both the isotropy of the pitch-angle distribution and the Maxwell–Boltzmann energy distribution: $$ P(\lambda, t+\Delta t) = P(\lambda). $$
Refinement of additional routines
Using real magnetic equilibria from preprocessed G-EQDSK files requires interpolation procedures to evaluate magnetic quantities along particle trajectories, which evolve in a Lagrangian manner, not on a fixed grid. Moreover, for initializing particle positions at $t=0$, most scenarios in T3ST require a uniform distribution of particles along a chosen magnetic flux surface. The previous implementation contained minor technical issues that introduced small spurious effects in the transport coefficients.
Within task T2.1, we identified, corrected, and improved the Fortran routine responsible for initializing particles on magnetic flux surfaces in experimentally reconstructed equilibria. The new routines are: psisurf_efit3, extract_contour_zero, order_points_by_angle, and interp_point_along_contour.
The routine psisurf_efit3 reconstructs magnetic flux surfaces from EFIT data and returns a representative point on each surface for a given parallel velocity $v_\parallel$. It reconstructs the poloidal flux $\psi(R,Z)$ and associated quantities $(F,\partial_R\psi,\partial_Z\psi)$ on a regular $(R,Z)$ grid, computes the magnetic field magnitude, and forms a modified scalar field:
$$ \phi(R,Z) = \psi - \psi_0 - K\,\frac{F}{|B|}\,V_p(k). $$
For each $v_\parallel$, the routine identifies the zero contour of $\phi(R,Z)$ — corresponding to the desired flux surface — using the auxiliary procedure extract_contour_zero, which locates sign changes of $\phi$ along cell edges and interpolates zero-crossing positions. A random point from this contour is selected as the particle position $(X(k), Y(k))$. If no valid contour is found, a fallback central value is used. The loop over all particles is parallelized with OpenMP.
Aggressive parallelization strategies
The most important improvement in T3ST in 2025 concerns program structure, leading to a roughly order-of-magnitude speed-up. This allows numerical simulations with satisfactory resolution (e.g., $N_p=10^6$, $N_c=200$, $N_t=1000$) on available hardware (~96 threads) in about one minute.
In previous versions, the most expensive computation was the evaluation of turbulent fields (and their derivatives), because it scaled as $\mathcal{O}(N_p N_c)$, where $N_p$ is the number of particles and $N_c$ the number of Fourier modes. By comparison, all other components scale as $\mathcal{O}(N_p)$. Thus, the earlier paradigm computed all quantities in series with vectorized operations, while only the turbulent components were parallelized.
Within WP2, we explored a complementary configuration: parallelizing all operations over the particles ($N_p$). Surprisingly, this approach led to a substantial performance improvement. A representative plot of computation time vs. particle number is shown in Figure 1 (log scale), where comparison between the old and new parallelization models reveals a speed-up of approximately a factor $\sim 11$.
In recent years, the Wolfram Mathematica platform [24] has integrated an extensive set of tools for the construction, training, and analysis of neural networks, collectively referred to as the Wolfram Language Neural Net Framework. This framework is complemented by a large collection of pre-trained models available through the Wolfram Neural Net Repository, as well as associated packages. These tools provide native support and advanced functionality for defining network architectures, representing neural models, training and deploying them, and selecting optimization procedures, loss functions, and regularization techniques—either predefined or user-customizable.
In the context of the objectives of Task T1.3, these capabilities are particularly well aligned with our requirements. They significantly reduce the time needed to develop the underlying software infrastructure and allow us to focus primarily on the physical problem of predicting turbulent transport. During the recent work period, we employed these libraries to develop and test a complete set of machine-learning tools adapted to data generated by numerical simulations performed with the T3ST code.
In order to evaluate different neural-network methods and training options prior to generating the actual database, we introduced an intermediate step in which several architectures, models, and training strategies were tested using a test function with dimensionality varying between 1 and 25 variables. This step is crucial because the generation of the real database is computationally expensive.
By contrast, using a test function—whose training dataset can be expanded arbitrarily—allows us to study sampling strategies, obtain an approximate estimate of the minimum required training-set size, compare different optimization and training methods, and explore the possibility of iterative neural-network training. This preliminary information provides practical guidance for generating the real database, avoiding oversizing and excessive computational costs.
Characteristics of the test function
When selecting the test function (defined as \(f(\mathbf{X}) = y\), where the pairs \(\mathbf{X} \rightarrow y\) form the dataset), we imposed the following criteria to preserve similarity with the behavior of the real asymptotic diffusion:
Consequently, under the conditions listed above, the final form of the test function is:
where \(i\in\overline{(1,N)}\) indexes the components of the input vector \(\mathbf{X}\); \(\alpha_i\in(0,1]\), \(\beta_i\in[0,5]\), \(\gamma_i\in[1.5,5.5]\) are scalar coefficients; and \(P_1^{(i)}(\mathbf{X})\), \(P_2^{(i)}(\mathbf{X})\) are random combinations of sums of terms of the form
The procedure defined by Eq. (2.8) generates sufficiently complex terms to reproduce variations similar to those observed in the real physical model, while maintaining relatively simple one-dimensional dependencies (continuous, smooth, and approximately monotonic), in agreement with observations from [20, 21, 22]. The sum of these terms yields a strictly positive output \(y>0\), with a distribution comparable to that of real simulations.
For the preliminary tests, the training dataset was sampled over the interval \([2.0,\,8.5]\), which approximately corresponds to the relevant ranges of the scaled parameters in the real model. Since the real data contain a small level of Gaussian noise (<10%), the same noise level was introduced into the test-function data to preserve representational fidelity.
Data normalization
To improve neural-network accuracy and accelerate training, both inputs and outputs are normalized before being fed into the network. This step is required when activation functions such as sigmoid or \(\tanh\) are used, as their ranges are strictly bounded around 0 and \(\pm1\).
Although standardization to zero mean and unit variance is commonly used, for the present dataset this procedure leaves a large fraction of output values outside the active region of the \(\tanh\) function. Therefore, scaling is performed to the interval \([-1,1]\) using the linear transformation:
where \(X\) denotes either the input components \(X_i\) or the output \(y\). This normalization ensures that the network operates in the nonlinear regime of the activation function and that outputs remain bounded within \(\pm1\).
Mitigation of overfitting
Overfitting occurs when a neural network learns the fine details and noise of the training data rather than extracting generalizable structures. As a result, the model effectively memorizes the training examples and loses predictive capability on unseen data.
Wolfram Mathematica [24] provides several efficient mechanisms to prevent overfitting, two of which
are particularly relevant here. The first involves the use of a validation dataset via the
ValidationSet option. After each training round, the network is evaluated on this dataset, and
Wolfram automatically selects the intermediate network state that minimizes the validation loss rather
than the training loss.
The second method is early stopping, activated through the TrainingStoppingCriterion option in
combination with ValidationSet. If the validation loss starts to increase—indicating the onset
of memorization—the training process is automatically halted. Together, these two mechanisms provide
robust control of overfitting by continuously monitoring validation performance and preventing excessive
model complexity.
Training an ensemble of neural networks
Due to the random initialization of weights and biases, the final trained configurations differ from one neural network to another. Although training should ideally converge toward a region close to the global minimum of the loss function, the optimization trajectories differ, and convergence to the global minimum cannot be guaranteed. As a result, individual networks produce slightly different predictions.
A solution to this issue is to train multiple networks and define the final prediction as the average of their individual predictions—an approach known as a neural-network ensemble [23]. The effectiveness of this method follows from the Central Limit Theorem: individual errors and biases tend to cancel out, and the ensemble average converges toward the true function value.
Code fragments used during the testing phase
Figure 4 shows a code fragment illustrating the generation of the test function, the training and
validation datasets, and their scaling. Figures 5a–b present code fragments in which two loss functions
are constructed using the NetGraph function.
Defining the difference between neural-network predictions and true values as \(\varepsilon = y - \hat{y}\), the first loss function is the Huber loss:
where \(\delta\) is a hyperparameter chosen based on the noise level in the training data. The second loss function is the Log-Cosh loss:
Finally, Figure 6 presents a code fragment illustrating the generation of network architectures and the training of the neural-network ensemble using the Huber loss function and overfitting-mitigation techniques.
The development of the T3ST code took place over several years and culminated in the present project, during which the last refinements and improvements to the numerical tool were made. Consequently, the code has gone through an extensive sequence of testing stages, targeting both specific implementations and large-scale results.
In this report we restrict ourselves to presenting three examples relevant to transport aspects. The first two refer to purely neoclassical dynamics (in the absence of turbulence) at the microscopic level, while the third test integrates almost all components of the code simultaneously.
We begin by checking whether the neoclassical trajectories (without turbulence) satisfy the minimal requirements regarding the correctness of their topology. For this purpose we analyse (Figure 2) two randomly chosen trajectories, which illustrate both the characteristic geometry of passing particles and that of “banana” orbits, both properly closed in the poloidal projection, in a circular configuration.
The second test targets the quantitative aspect of the trajectories. To this end, we generate a set of particles with a Maxwell–Boltzmann energy distribution, with pitch angles uniformly distributed in the interval \((0, 2\pi]\), and their initial positions placed on a magnetic surface corresponding to a circular equilibrium (thus at a fixed radius, but uniformly distributed in the toroidal and poloidal angles).
Using the circular model (see equation ??), it can be shown that a very good approximation of the radial velocity is provided by the analytical expression
In Figure 3 we present the distribution of radial velocities obtained in the analysed scenario, both from the analytical formula mentioned above and from the simulations carried out with the T3ST code. The two distributions are seen to coincide almost perfectly, which constitutes a solid validation of the way in which the guiding-centre drifts are calculated (at least in the non-turbulent regime).
The last and probably most important test is illustrated in Figure 4. The scenario considered is the following: hydrogen ions are distributed according to a Maxwell–Boltzmann distribution in energy and uniformly in pitch angle. The spatial distribution is chosen such that all particles possess approximately the same toroidal momentum, in direct connection with the new routine developed during stage T1.2:
This initial distribution is very close to a gyrokinetic equilibrium (as opposed to a distribution uniform on a magnetic surface). We therefore expect that particles distributed in this way will exhibit only a short transient phase, after which they will rapidly settle into a genuine equilibrium state, characterised by vanishing transport coefficients.
In this scenario, after reaching the quasi-equilibrium state, turbulence is initialised and the particle dynamics are then followed further. It can be shown—although the analysis is beyond the scope of this paper—that, under the given conditions, the quasilinear approximation of the diffusion (valid for short times immediately after the onset of turbulence) can be written as
The complexity of this test is also visible in the analytical formula inspired by quasilinear theory. It includes the turbulence intensity, the geometric effects associated with toroidicity, the spectrum of poloidal wavenumbers, as well as finite Larmor radius effects, which enter directly into the statistical average through the Bessel function \(J_0\).
In Figure 5 the results of this complex test are presented. As expected, in the absence of turbulence, the transient dynamics are short and the system rapidly converges towards a state without transport. This state is then “excited” by turbulence (around time \(t \approx 9\)), and the initial slope of the evolution is predicted with very high accuracy by the quasilinear result at short times.
Testing the machine-learning tools
We initiated the testing phase of the machine-learning tools described in Tasks T1.3 and T2.2 by evaluating the convergence speed of the two loss functions defined in Eqs. (2.10) and (2.11), in comparison with the standard mean squared error (MSE). For this purpose, we trained three identical neural networks, each with two hidden layers containing 50 and 30 neurons, respectively, using Xavier normal initialization and the ADAM optimization algorithm.
The training set consisted of \(10^5\) samples. Automatic stopping of the training process was implemented using the criterion that the relative variation of the validation error must remain below 1% for at least 15 consecutive epochs. Figure 9 shows the evolution of the three loss functions during training. In the legend, \(\varepsilon\) denotes the relative error between the predictions of the neural networks and the true values \(y\) in the validation set:
The results show that the Huber loss function leads to both faster convergence and more accurate predictions. Consequently, the Huber loss function is adopted for all subsequent tests.
Prediction error, test-function dimensionality, and ensemble model selection
We investigated the influence of the dimensionality of the test function and the size of the dataset on model performance. Eight test functions with dimensionalities between 2 and 24 variables were used, along with datasets ranging from \(10^2\) to \(10^6\) samples (five values). In total, 40 neural networks were trained using the same architecture: two hidden layers with 80 and 40 neurons.
All other training details were identical to those described in the previous subsection. The analysis begins with the evolution of the error \(\varepsilon\) (Eq. 2.15) as a function of the training-set size (Figures 10a–b). For all eight test functions, the error saturates at approximately \(10^5\) training samples, independently of the number of variables.
We also examined the possibility of overfitting. Figure 10b shows the ratio between validation error and training error as a function of dataset size. This ratio approaches unity for datasets larger than \(\sim 10^5\) samples, indicating the absence of overfitting and confirming that a database of order \(10^5\) is sufficient.
Finally, we compared these results with those obtained using a deeper architecture featuring four hidden layers and a total of 500 neurons. Sixty such networks were trained. Figures 10c–d show that, although the number of parameters increases from approximately 5,000 to about 54,500, the performance does not improve significantly: neither the prediction error, nor its dependence on dataset size, nor the training-to-validation error ratio exhibits meaningful gains.
Based on these results, we selected an ensemble composed of nine neural networks for subsequent tests, corresponding to combinations of 2, 3, and 4 hidden layers with 50, 80, and 120 neurons.
Recurrent training of the neural-network ensemble
We continued the testing phase by analyzing the feasibility of recurrent neural-network training, a technique designed to reduce the initial computational cost by starting from a small dataset. This approach is particularly advantageous when data originate from numerical simulations rather than from an analytical test function.
The method consists of using a neural-network ensemble to evaluate the variance of predictions on the validation set, selecting points with high variance or large errors. To determine which of the 20 input parameters vary significantly near each point, we compute the gradient of the prediction with respect to each parameter and retain only those variables associated with significant gradients. Based on this information, a new training set is generated and the ensemble is retrained.
We tested this approach using the ensemble defined in the previous subsection, starting from an initial dataset of \(10^3\) samples. After the initial training, two additional datasets of \(10^3\) samples each were generated: one using the adaptive procedure and a control dataset generated uniformly. The networks were retrained separately on these two datasets.
Performance was evaluated by comparing the predictions of the three ensembles on a uniformly sampled test set of \(10^5\) examples. Figure 11 shows the distributions of the percentage errors defined in Eq. (2.15), as well as their cumulative distribution functions.
The results demonstrate a clear improvement for the adaptively retrained model: approximately 94% of the errors are below 10%, compared to about 89% for the control model and roughly 64% for the initially trained ensemble.
We therefore conclude that adaptive retraining represents a viable strategy for reducing the total computational cost, even when accounting for the additional expense of retraining. This approach enables the use of a relatively small initial dataset, which can subsequently be expanded in an informed and efficient manner during the training process.
O3 (WP3) – The construction of the database: extensive simulations
Deliverable: Database, trained and tested machine learning tools
We used T3ST to run approximately distinct simulations with a Cyclone Base Case (CBC) magnetic equilibrium [28] and varying turbulence-model parameters. The database pairs each set of parameters with the resulting transport coefficients. After preprocessing the data, we used them to train a range of neural-network ensembles and identify suitable architectures.
We adapted the methods developed and tested in WP2 to the T3ST data. We retained the Huber loss and the order of magnitude of the database size established in the preliminary tests (T2.3, Figures 9 and 10). In WP3, training separate networks for the two transport coefficients gave no significant gain in predictive accuracy over training networks with two outputs. We therefore adopted the two-output architecture. We also extended the comparison of scaling methods. The results supported the use of ArcSinh/Std scaling for the outputs (T3.3, Figure 12).
The WP2 tests showed the benefits of adaptive sampling and training (T2.3, Figure 11). In those tests, we generated data locally by evaluating a test function. Applying the same method to T3ST would have required an iterative cycle of coordinating simulations across several servers, updating the database, retraining the ensemble, and selecting new sampling points from the spread and local sensitivity of its predictions. For WP3, the expected improvement did not justify this additional complexity. Adaptive sampling and dimensionality reduction by principal component analysis (PCA) remain directions for further work. Both would benefit from dedicated infrastructure to automate computation and data processing.
T3.1 Defining the database
Since the project proposal was submitted, the test-particle code has undergone substantial development, both within T2.1 and through research outside the project. Now called T3ST, the code includes new capabilities and an expanded set of input parameters. These fall into three groups.
- Plasma parameters associated with the MHD equilibrium. , , , , , , , , and denote, respectively, the magnetic field on axis, major radius, minor radius, safety factor, magnetic shear, plasma density, ion/electron temperature, radial density scale length, and toroidal plasma rotation velocity.
- Turbulence parameters. is the fraction of ion-temperature-gradient (ITG) modes in a mixed ITG–trapped-electron-mode (TEM) state. is the turbulence amplitude on the low-field side (LFS). The correlation lengths , , and describe the fluctuations along the field-aligned coordinates , , and . The decorrelation time is .
- Transported-species parameters. These are the mass number , charge number , and temperature , or, for a population specified by its energy and velocity orientation, the energy and pitch parameter .
The macroscopic plasma equilibrium constrains the turbulence, and the two are physically correlated. T3ST nevertheless treats their parameters as independent inputs. Gyrokinetic and experimental results informed the following choices for the database.
We adopted the CBC equilibrium [28], a widely used benchmark for comparisons between gyrokinetic codes. The geometry is circular, with , , , , and . In the absence of collisions, the plasma density does not affect transport in this model. We set and , giving equal electron and ion temperatures and no plasma rotation. The turbulence model used here does not depend on or . Since the study focuses on majority-ion transport, we restricted the database to a hydrogen plasma in which the transported ions have the background ion temperature.
Seven free parameters remain as inputs to the neural networks.
We divided each parameter range into 20 equal intervals, giving 21 values per parameter and grid points in total (Table 1). We sampled approximately input points uniformly at random from this seven-dimensional grid. At each point we ran one T3ST simulation with the following settings.
These quantities denote the simulation time, number of time steps, number of test particles, and number of Fourier modes used to represent the turbulence, respectively.
| Physical parameter | T3ST variable | Range | Grid spacing |
|---|---|---|---|
| Normalized density gradient | 0–10 | 0.5 | |
| Turbulence amplitude (LFS) | 0–4% | 0.2% | |
| ITG fraction of the turbulent field | 0–1 | 0.05 | |
| Correlation length along | 1–10 | ||
| Correlation length along | 1–10 | ||
| Correlation length along | 0.5–3 rad | 0.125 rad | |
| Turbulence correlation time | 0.5–7 |
T3.2 Running the simulations
When we constructed the database, the group's local computing infrastructure comprised four AMD EPYC servers, one purchased through this project. They had 16, 24, 24, and 48 physical cores, respectively, operating at 4.1 GHz. Other research activities shared the servers, so they were available to this project only part of the time.
With the settings in Eq. (3.3), a T3ST simulation took about 10 seconds of wall-clock time on average. Two factors made this possible. The chosen resolution of test particles gives a noise level of approximately 5–10%, and the parallel architecture was improved in T2.1. The total reported computational cost was approximately CPU hours.
Postprocessing and network training required additional resources. Postprocessing cost about three orders of magnitude less than the T3ST simulations. Training, validation, and exploration of the network function space required approximately additional CPU hours, as detailed below.
T3.3 Processing the database
Of approximately examples, we used for training, for validation, and for testing. Each example has seven inputs (Table 1) and two outputs , the mean velocity and the diffusion coefficient . We preprocessed the data before training.
For the inputs, we used Min/Max scaling as defined in Eq. (2.9). The seven variables are sampled uniformly on discrete grids. The transformation maps each input to the interval , appropriate for the tanh activation function.
For the outputs, we tested Min/Max, Median/IQR (3.4), and ArcSinh/Std (3.5) scaling.
Here Mdn is the sample median, and is the quantile below which a fraction of the observations falls.
Figure 12 shows the Huber loss during training for three networks of identical architecture. All three used Min/Max scaling for the inputs, and each used a different output scaling. To compare the results directly, we transformed the predictions back to the original scale at each evaluation and computed the Huber loss against the corresponding target values.
The Median/IQR and ArcSinh/Std curves lie close together. Both remain below the Min/Max curve and converge faster. On the strength of these results and additional tests with other architectures, we chose ArcSinh/Std output scaling for the ensemble.
T3.4 Training and testing the machine learning tools
Testing the neural-network ensemble
We trained 26 networks with different architectures. All used tanh activation. The number of hidden layers ranged from 2 to 6 and the number of neurons from 10 to 200, yielding approximately 80 to 8,000 free parameters (weights and biases). We trained all networks in Wolfram Mathematica 11.3. Following the preliminary tests, we used Huber loss, Xavier normal initialization, the Adam optimizer, and batches of 64 examples. Each network trained for 2,000 seconds, a fixed duration chosen from empirical observations of the time required for the training loss to level off.
We used the following quantities to evaluate performance, all calculated on scaled, dimensionless data.
- and are the Huber losses evaluated during training on the training and validation sets, respectively.
- denotes the lowest loss recorded during training on the indicated set.
- denotes the loss on that set at the end of training.
Figure 13a shows the minimum validation loss as a function of the number of hidden neurons, with one curve for each hidden-layer count. The minimum loss falls to approximately 0.067 at 80 neurons. Adding more neurons gives no systematic improvement, and there is no clear trend with the number of hidden layers.
Figure 13b shows the ratio of final to minimum validation loss against the number of hidden neurons. A ratio above one means that validation loss rose after reaching its minimum, a possible sign of overfitting. The ratio tends to increase for architectures with more free parameters, suggesting that these networks reach their minimum validation loss before training ends. Together with the plateau in Figure 13a, this gives no clear advantage to increasing the number of neurons or layers beyond the values investigated.
To retain the best-performing configuration and avoid overfitting, we selected the network state with the lowest validation loss. The final training epoch can have a lower training loss even when its validation loss is higher.
Figure 14a plots the minimum validation and training losses against the number of free parameters. Squares denote validation and circles denote training. Colors identify the number of hidden neurons. The minimum validation loss levels off at about 1,000 free parameters, while the training loss continues to decrease.
Figure 14b shows the percentage of training epochs each network needed to reach a validation loss within 5% of its minimum, denoted by . Two cases illustrate the dependence on the number of free parameters.
- Networks with 500 free parameters (yellow squares) reached the threshold after 20–30% of their epochs. The remaining 70–80% yielded at most a further 5% improvement in validation loss.
- Networks with 8,000 free parameters (purple squares) reached the threshold after only 1–2% of their epochs. Up to 99% of training thus yielded at most a further 5% reduction in validation loss.
As the number of free parameters increases, the networks approach their minimum validation loss in fewer epochs, indicating more efficient training by this measure.
Selecting the ensemble
For the following analyses, we constructed a separate database of one-dimensional parameter scans. We varied each of the seven parameters in Table 1 individually over its range (approximately 20 values per parameter), holding the other six at the midpoints of their respective ranges.
We then trained an ensemble similar to the one described above, excluding the network with two hidden layers and 10 neurons because its prediction errors were larger than those of the other 25 networks. On the one-dimensional scans, its mean Huber loss was about 0.29 for (3.2 times the ensemble average) and 0.16 for (twice the ensemble average). In the following analyses, the ensemble prediction is the arithmetic mean of the predictions of the remaining 25 networks.
Size of the training database
To assess the effect of training-set size, we trained the ensemble on sets of examples. Figure 15 expresses the Huber loss for each training-set size as a percentage of the loss for the smallest set, . We evaluated predictions on the same test examples separately for mean velocity (red) and diffusion (blue).
Increasing the training-set size by a factor of 18 reduced the mean-velocity error by about 9%, after which it tended to level off. The diffusion error fell by about 15% with no clear saturation. The difference in accuracy is partly due to the higher noise in the T3ST mean-velocity data. The two coefficients involve different correlations. Diffusion is associated with the autocorrelation of the turbulent radial drift, and convection with the cross-correlation between that drift and fluctuations in particle energy.
For jointly Gaussian random variables and with zero means and correlation coefficient , the relative standard deviation of the estimator of the mean product over independent particles is
This measure of relative statistical noise increases as the magnitude of the correlation coefficient decreases. At equal times, for diffusion, whereas for convection. This difference qualitatively explains the higher statistical noise in the mean velocity for the same number of test particles.
Testing ensemble predictions
We used the one-dimensional scans to evaluate how accurately the ensemble reproduces the individual parameter dependences of mean velocity and diffusion. Varying one parameter at a time allows a direct check of each predicted dependence. Figure 16 compares the individual networks, the ensemble mean, and the T3ST simulations for all seven scans. The ensemble was trained on the full training set of examples.
The ensemble mean generally lies close to the T3ST values. For most scans with low numerical noise, the individual predictions also show little spread. Even for noisier scans, such as the dependence on , the ensemble mean reproduces the trends in both diffusion and mean velocity despite the larger spread among networks.
Much of the intrinsic noise in T3ST comes from the finite number of test particles. The training simulations used particles each, whereas the one-dimensional scans used , a sixfold increase. Since statistical noise scales as , its amplitude in the scans is smaller by a factor of approximately 2.45. The agreement of the ensemble mean with the simulations, together with the small spread in many scans, suggests that the ensemble captures the underlying trends while attenuating numerical noise.
With six parameters held at their midpoints, ensemble errors on the one-dimensional scans are generally smaller than on the test set, which uniformly samples the seven-dimensional parameter space. Training-set size also has less influence on error in these scans than across the full test set.
Figure 17 shows mean velocity as a function of for ensembles trained on and . The bands show one standard deviation of the individual predictions around each ensemble mean. The two means are relatively close, but the ensemble trained on the smaller set has a substantially larger spread. For this scan, enlarging the training set chiefly reduces the spread of predictions, with a smaller effect on their mean. The mean follows the simulated values more closely than individual predictions, illustrating the benefit of using an ensemble.
The report identifies the project's Data & Surrogate Models page [29] as the access point for the training, validation, and test databases and the final neural-network ensemble.
O4 (WP4) – Predictions and physical mechanisms
Deliverable: Characterization of transport mechanisms
The final objective concerns the physical mechanisms behind turbulent transport in magnetized plasmas. We examine correlations between plasma parameters and transport coefficients, interpret the observed dependences using the physical model, and assess whether transport measurements can be used to infer turbulence properties.
T4.1 Correlations between transport and plasma parameters
For network training, we varied only parameters entering the turbulence model and kept the MHD equilibrium in the CBC configuration. In a separate set of T3ST simulations, as specified in T4.1 of the project proposal, we investigated how equilibrium parameters such as , , , and affect convection and diffusion [27]. We fixed the turbulence parameters at , , , , and , and varied one equilibrium parameter at a time (Figure 18).
The major radius influences radial transport through the aspect ratio . At fixed minor radius , radial transport reaches a plateau at large . At low aspect ratio the geometry approaches that of a spheromak, and both diffusion and outward convection decrease.
Varying the minor radius confirms this trend. As , diffusion decreases, and the convective velocity can change sign, becoming slightly negative.
The local safety factor has little effect on transport over . Only at very small , where the poloidal magnetic field dominates, does convection increase slightly while diffusion decreases.
As the magnetic shear decreases, outward convection weakens and can reverse. The asymptotic diffusion coefficient varies by about 20% and has a maximum absent from the convection profile. For a fixed turbulence spectrum, the shear dependence arises from Lagrangian velocity correlations. At equal times the correlation is independent of and satisfies
At short times, in the ballistic regime, the correlation expands as
The second-order term involves the double convective derivative, which contains the neoclassical drift velocity . To first order in ,
Shear therefore influences diffusion through the amplitude and geometry of the neoclassical drifts that advect the turbulent motion.
The diffusion coefficient decreases with increasing background field according to . At high field, (Bohm scaling). At low field, (Goldston scaling). This trend agrees with tokamak observations, although the model captures the dependence of turbulence on only partially self-consistently.
In the simulations, the perpendicular correlation lengths are . Consequently the turbulent velocity amplitude , the gyroaveraging factor , and the drift frequency are independent of . Diffusion scaling depends on the ratio of the flight time to the decorrelation time . In the CBC scenario, . In this nonlinear regime, is approximately proportional to , which explains the Bohm scaling. At lower fields, the correlation length increases and becomes comparable to or exceeds . The apparent Goldston scaling arises during the transition to the linear, ballistic regime, .
T4.3 Analytical approximations
We sought analytical approximations to the numerical dependences using nonlinear regression. We fitted rational functions and combinations of exponential functions to the T3ST data. Figure 18 brings together the results of T4.1 and T4.3 by comparing the simulated dependences with the analytical fits.
T4.2 Turbulence diagnostics
T4.2 investigated an inverse problem. Can a neural network infer turbulence properties from transport coefficients? Both the theoretical analysis and numerical attempts indicate that the present formulation cannot uniquely identify the turbulence parameters without additional constraints. In T3ST the transport coefficients depend on seven independent inputs.
Two outputs generally provide insufficient information to determine seven inputs uniquely. Different parameter combinations can yield the same transport coefficients. Inversion therefore requires additional observables or physical constraints on the parameters.
Even with as many observables as parameters, local identification by regular inversion would require a full-rank Jacobian. A singular or poorly conditioned Jacobian can lead to nonuniqueness or high sensitivity to data errors. Training a neural network cannot supply the information missing from the inverse problem.
T4.4 Additional results on the Lagrangian properties of transport
We also investigated approximate Lagrangian stationarity and the robustness of transport in the configurations tested. The analysis examines particle velocities and turbulent-field gradients, time symmetry, the representativeness of statistical ensembles, and sensitivity to initialization [26].
Lagrangian stationarity of test-particle velocities in turbulence
To investigate whether Lagrangian particle velocities in tokamak turbulence are statistically stationary, we examined the centered radial-velocity autocorrelation,
For a second-order stationary process, depends only on the time difference . Figure 19 shows the correlation for five starting times, , in T3ST simulations of a CBC-like case. The curves overlap almost completely, supporting approximate stationarity.
Statistics of field derivatives along trajectories
The statistics of the potential derivatives are another open question in Lagrangian turbulent dynamics. For a given magnetic field, these derivatives determine the turbulent drift through
Along the trajectories we computed the ensemble means and second moments , for . The means remain close to zero, and the second moments, normalized to their initial values, fluctuate by less than 2% (Figure 20). The poloidal-derivative distributions at the start and end of the simulation are nearly identical and close to Gaussian. These statistics are approximately stationary even though the Eulerian drift field is inhomogeneous and compressible. This observation alone does not establish ergodicity.
Time symmetry
Integrating trajectories forward and backward in time gives nearly symmetric diffusion and convection profiles, both with and without turbulence (Figure 21). The deviations are consistent with numerical fluctuations. The result supports approximate time symmetry of these observables without requiring microscopic reversibility.
Influence of initial conditions on transport
The standard T3ST initialization distributes particles uniformly over a flux tube with Maxwell–Boltzmann velocities. This prescription does not guarantee gyrokinetic equilibrium. To assess how the initial phase-space distribution affects transport, we compared the coefficients for seven alternative initializations.
- Individual constraints (Figure 22a). Fixed pitch parameter (brown), fixed energy (green), placement on the low-field side (blue), or turbulence switched on at after relaxation without turbulence (red).
- Combined constraints (Figure 22b). and (red), and low-field-side placement (blue), or and low-field-side placement (green).
Apart from short transients, the individual constraints have little effect on asymptotic diffusion. The largest deviation, about 5%, occurs for low-field-side initialization (Figure 22a). Switching on turbulence at or at produces nearly identical asymptotic coefficients, supporting use of the computationally cheaper standard initialization.
The combined constraints produce a spread of about 20% in the time profiles and asymptotic values (Figure 22b). Even when the initially occupied region of phase space is restricted, transport remains comparable to that obtained with the standard, broadly distributed population.
Conclusions
We extended and optimized T3ST, our test-particle code for turbulent transport in strongly magnetized plasmas. We revised the gyrocentre equations of motion and the statistical model of turbulence (T1.1–T1.2), extended the collision operators, and implemented particle initialization in experimentally reconstructed magnetic equilibria (T2.1). Redesigning the parallelization produced the largest computational gain, speeding up calculations by a factor of approximately 11 relative to the previous implementation.
We selected fully connected feed-forward neural networks to predict transport coefficients (T1.3). In Wolfram Mathematica, we implemented data preprocessing, network configuration, and routines for training and evaluating ensembles (T2.2).
Analytical and numerical tests verified both sets of tools (T2.3). T3ST reproduced neoclassical orbit topology and the analytical distribution of radial velocities. The initial evolution of radial diffusion after turbulence was switched on agreed well with the quasilinear estimate. Tests on synthetic functions guided our choice of Huber loss, quantified the effects of network architecture and training-set size, and informed an adaptive training strategy.
To construct the training database, we fixed the magnetic equilibrium to the Cyclone Base Case, a standard gyrokinetic benchmark. We varied seven transport-model parameters and randomly selected 105 configurations from a uniform seven-dimensional grid (T3.1, Table 1). For each configuration, we ran T3ST to obtain the asymptotic radial convection and diffusion coefficients, V and D (T3.2).
We used Min/Max scaling for the inputs and ArcSinh/Std scaling for the transport coefficients (T3.3, Figure 12). Of the 26 network architectures we trained and evaluated, we retained 25 in the final ensemble (T3.4, Figures 13–14). When each input was varied individually, ensemble means reproduced the simulated dependence of both coefficients despite statistical noise in the T3ST data (Figure 16). Increasing the training-set size reduced prediction errors and, in particular, the spread among individual networks (Figures 15 and 17).
In a separate set of T3ST simulations, we held the turbulence characteristics fixed and varied the magnetic equilibrium to determine how the asymptotic convection and diffusion coefficients depend on plasma geometry and magnetic parameters (T4.1). Rational and exponential functions fitted by nonlinear regression generally reproduced the simulated trends (T4.3, Figure 18).
We also examined the inverse problem of inferring turbulence parameters from transport measurements (T4.2). The two transport coefficients generally admit multiple combinations of the seven independent parameters. Identifying a unique solution would require additional physical constraints or independent observables.
Beyond the original project objectives, we investigated the Lagrangian statistics of turbulent transport (T4.4). Radial-velocity autocorrelations and the statistics of electrostatic-potential derivatives support approximate stationarity in the configurations studied (Figures 19–20). The transport observables also showed approximate time symmetry (Figure 21). Changing individual initial conditions had little effect on the asymptotic coefficients, although imposing several constraints together produced larger variations (Figure 22).
We used generative AI tools, particularly ChatGPT [30], to assist with programming, code optimization and debugging, scientific documentation, and editing the report. The research team critically evaluated and verified the outputs and takes full responsibility for the results and their scientific interpretation.
References
- Littlejohn R.G., J. Math. Phys. 23, 742 (1982).
- Brizard A.J., Hahm T.S., Rev. Mod. Phys. 79, 421 (2007).
- Brizard A.J., Phys. Plasmas 2, 459 (1995).
- Wang L., Hahm T.S., Phys. Plasmas 17, 082304 (2010).
- Sauter O., Medvedev S., Comput. Phys. Commun. 184, 293 (2013).
- Hinton F.L., Wong S.K., Phys. Fluids 28, 3082 (1985).
- Peeters A.G. et al., Phys. Plasmas 16, 042310 (2009).
- Merz F., Jenko F., Nucl. Fusion 50, 054005 (2010).
- Lütjens H. et al., Comput. Phys. Commun. 97, 219 (1996).
- Lao L. et al., Nucl. Fusion 25, 1611 (1985).
- Kripner L. et al., 46th EPS Conf. Plasma Phys., P4.1033 (2019)
- Faugeras B., Fusion Eng. Des. 160, 112020 (2020).
- Blum J. et al., J. Comput. Phys. 231, 960 (2012).
- Beer M.A. et al., Phys. Plasmas 2, 2687 (1995).
- Zou J. et al., Methods Mol. Biol. 458, 15 (2008).
- Lever J. et al., Nat. Methods 14, 641 (2017).
- Amari S., Neurocomputing 5, 185 (1993).
- Kingma D.P., Ba J., arXiv:1412.6980 (2014).
- Brizard A.J., Phys. Plasmas 11, 4429 (2004).
- Pomârjanschi L.M., Plasma Phys. Control. Fusion 66, 065007 (2024).
- Craciunescu T. et al., EUROfusion WPTE & WPSA Report (2022), unpublished, available on request.
- Pomârjanschi L.M., dissertation, University of Bucharest (2024), unpublished, available on request.
- Bishop C.M., Neural Networks for Pattern Recognition, OUP (1995), §9.6.
- Wolfram Research, Mathematica (2025).
- Palade D.I., Pomârjanschi L.M., Nucl. Fusion 65, 086007 (2025).
- Palade D.I., J. Plasma Phys. 92, E61 (2026).
- Palade D.I., Pomârjanschi L.M., Phys. Plasmas 33(2), 022306 (2026).
- Dimits A.M. et al., Phys. Plasmas 7, 969 (2000).
- Plasma Theory Group, INFLPR, Data & Surrogate Models, PN-IV-P2-2.1-TE-2023-1102 (2026).
- OpenAI, ChatGPT (2026).