Accelerated Bayesian inference of plasma profiles with self-consistent MHD equilibria at W7-X via neural networks

High-β operations require a fast and robust inference of plasma parameters with a self-consistent magnetohydrodynamic (MHD) equilibrium. Precalculated MHD equilibria are usually employed at Wendelstein 7-X (W7-X) due to the high computational cost. To address this, we couple a physics-regularized artificial neural network (NN) model that approximates the ideal-MHD equilibrium with the Bayesian modeling framework Minerva. We show the fast and robust inference of plasma profiles (electron temperature and density) with a self-consistent MHD equilibrium approximated by the NN model. We investigate the robustness of the inference across diverse synthetic W7-X plasma scenarios. The inferred plasma parameters and their uncertainties are compatible with the parameters inferred using the variational moments equilibrium code (VMEC), and the inference time is reduced by more than two orders of magnitude. This work suggests that MHD self-consistent inferences of plasma parameters can be performed between shots.


Introduction
Bayesian inference is the statistical identification of model parameters that are consistent with given observed data using Bayes theorem.In a magnetic confinement experiment, the model parameters describe the plasma state, which often includes, but is not limited to the plasma profiles (e. g., temperature and density) and an ideal-magnetohydrodynamic (MHD) equilibrium.Diagnostics raw measurements provide the observed data.
In case of a high β (the ratio between the plasma kinetic to the magnetic pressure) scenario or a large internal plasma current, the equilibrium may differ from the vacuum equilibrium.To correctly infer the plasma state, a self-consistent, finite-beta ideal-MHD equilibrium is required.Wendelstein 7-X (W7-X) is an optimized stellarator that features a stiff equilibrium and a low bootstrap current [1,2] (the expected bootstrap current at high-β in the standard configuration is 80 kA [3]), therefore, equilibrium changes caused by the plasma internal current are predicted to be small with respects to an equivalent tokamak.Finite-beta effects, however, have been experimentally observed, and they can still modify the vacuum equilibrium [4].
Data-driven approaches have been proposed to reduce the computational cost of constructing stellarator equilibria.Function parametrization was used at W7-AS [14,21] and at W7-X [22][23][24].More recently, [25] proposed a physics-regularized artificial neural network (NN) to approximate the ideal-MHD solution operator in W7-X configurations.Adopting machine learning (ML) models to approximate experimental equilibria can drastically accelerate sample-intensive applications (e. g., Bayesian inference) that require the computation of a MHD equilibrium.
However, how does the adoption of MHD equilibria approximated by NN models affect the inferred plasma parameters?In this paper, we show the fast (O(10 2 s)) and robust inference of plasma profiles (electron temperature and density) based on the Thomson scattering (TS) [26,27] and single channel dispersion interferometer (DI) [28] diagnostics with a self-consistent MHD equilibrium.The self-consistent MHD equilibrium is approximated by the physics-regularized NN model proposed in [25].The NN model allows the efficient exploration of the full posterior distribution of plasma profiles with self-consistent MHD equilibria, yielding an estimation of the profile uncertainties.Specifically, we: • couple the physics-regularized NN model from [25] in the Bayesian framework Minerva (section 2); • investigate the robustness of the inferred plasma parameters across diverse W7-X synthetic plasma scenarios (sections 3.1 and 3.2); • compare the reconstructed experimental plasma parameters and their uncertainties (estimated with Markov chain Monte Carlo (MCMC)) with three different MHD equilibrium models (section 3.3): a fixed, finite-beta variational moments equilibrium code (VMEC) equilibrium; a self-consistent VMEC equilibrium; and a self-consistent NN equilibrium;

Bayesian Analysis
In a model-based simulation, a mechanistic model, the model parameters H, and observed data D characterize the phenomenon under study.In Bayesian analysis, the model parameters and observations are fully captured by their joint probability distribution: where the prior distribution P (H) describes the prior knowledge on the model parameters before taking any observations into account (e. g., plasma density should be positive), and the conditional distribution P (D|H) denotes the probability of the observed data D given the model parameters H (when seen as a function of H for given D, P (D|H) is it also known as the likelihood function).
A parametric distribution function (e. g., Gaussian) usually represents P (D|H).The likelihood function is a function that captures the physical model under consideration, and it is often referred to as the forward model.Experimentally derived uncertainties inform the distribution variance.
Bayesian inference updates the model parameters prior distribution to their posterior distribution given the observed data using Bayes formula: where the posterior distribution P (H|D) describes the probability of the model parameters given the observed data, and P (D) is the evidence, a normalization constant that describes the probability of the observed data given all possible values of the model parameters: The posterior distribution of the model parameters describes the degree of belief we have in the parameter values, which is based on prior knowledge and updated by the observed data.It encapsulates all the information and uncertainties we have on the model parameters.

Model Graph
The Bayesian modeling framework Minerva [20,52] is used in this work.In Minerva, a graph describes the relationship between model parameters and observed data, which are both represented as the graph's nodes.The graph's edges represent the probabilistic relationships between the modeled quantities.At W7-X, several diagnostics are already implemented in Minerva, making it the obvious choice to validate the accelerated inference of plasma profiles with the NN model.
Figure 1 shows a simplified picture of the Minerva graph used in this work.Blue denotes the model free parameters, and orange denotes the observed quantities.A MHD equilibrium maps the 1D electron temperature and density profiles to a 3D position of magnetic flux surfaces in space.The TS [26,27] and the single channel DI [28] diagnostics are used to constrain the plasma state: the TS provides information on the electron density and temperature, while the DI measures the line-integrated electron density along a single line of sight (LOS).

Prior distributions and forward models
Modified two power profiles parametrize the electron density and temperature: ) hn e,2 , (4) where ρ = Φ/Φ edge is the square root of the normalized toroidal flux.The additional (with respect the standard two power parametrization) parameters h Te,3 and h ne,3 allow modeling not-null temperatures and densities beyond the last closed flux surface (LCFS), which are usually observed at W7-X [29].Uniform distributions represent the prior on the plasma profile parameters (see section 7.1).
Flux surfaces ρ(x, y, z) computed from a free-boundary ideal-MHD equilibrium map the 1D profiles (e. g., n e (ρ)) to the 3D real space geometry (n e (x, y, z)).The set of W7-X coil currents fixed to their setpoint values, the net toroidal magnetic flux Φ edge represented by a uniform prior distribution, and the 1D pressure and toroidal current profiles parametrize the free-boundary ideal-MHD equilibrium.
In this work, we assume T i T e , Z eff 1, and n i n e = n.As a result, the pressure is simply given by p 2n e T e .The purpose of this paper is to investigate the use of NN equilibria in a Bayesian inference framework, rather than providing a highly accurate description of W7-X (e. g., by including a X-ray imaging crystal spectroscopy (XICS) to infer the ion temperature, or spectrometers to infer the plasma effective ion charge Z eff ).Therefore, the relaxation of these assumptions is not in the scope of this paper.
The NN model sees only the total pressure p and not T e or T i .As a result, for the scope of this work, it is not critical how the pressure profile is constructed.The assumptions only limit the set of experimental scenarios that can be used to test the inference procedure.Indeed, the experimental scenarios considered in section 3.3 feature T i T e within experimental uncertainties.However, in section 3.2, we use synthetic data to investigate the robustness of the inference procedure across diverse, randomly sampled (within the model parameter prior distributions) W7-X scenarios.
The toroidal current profile is parametrized as: where s = ρ 2 .However, given the lack of diagnostics to constrain its profile [24], the profile shape is fixed: h Itor,2 = h Itor,3 = h Itor,4 = 1.Moreover, given that I tor (s = 1) = h Itor,1 , h Itor,1 is held fixed to the net toroidal current as measured by the Rogowski coil [30].
This work considers two MHD equilibrium models: VMEC [31] and a physics-regularized NN [25].The NN model has been integrated into Minerva with the ONNX Runtime framework [32].In the proposed Minerva graph, the equilibrium model is employed only to provide the self-consistent flux surface mapping.In this regard, [25] reports that the NN model achieves an average flux surface error of 0.6 mm.The NN model was trained on a large set of W7-X magnetic configurations, including the reference W7-X configurations [33], pressure profiles with β up to 5 %, and toroidal current profiles with I tor up to 20 kA.W7-X experimental conditions in previous operational campaigns are well within the training data set [Rolf2019, 34].For further information on the model architecture, training, and evaluation, please refer to [25].
The TS observations constrain the electron density and temperature.The TS system's forward model maps n e (x, y, z) and T e (x, y, z) to the number of scattered photons on a set of volumes along the TS laser beam path.Polychromator filters are used to measure the scattered spectrum by selecting distinct spectral intervals.The time integral of the signal of each channel over the length of the scattered laser pulse corresponds to the number of the scattered photons [27].Thomson scattering scatters laser photons off of electrons, and the Doppler effect broadens the Thomson scattered spectra due to the thermal motions of the electrons.The electron temperature determines the width of the Thomson scattered spectrum, and electron density determines its amplitude.The predicted TS signal of the i-th channel is [27]: where the integration is over the scattered spectrum wavelength λ. g 0 is the absolute sensitivity of a reference channel, E laser is the laser pulse energy, r e is the electron radius, λ laser is the laser wavelength, g i (λ) is the absolute sensitivity of the i-th channel, θ is the scattering angle, and S(λ, θ, T e ) is the spectral density function.The gi (λ)  g0 factor represents the relative calibration of each channel, and the C TS is the global calibration factor.For a more detailed description of the TS system, please refer to [26,27].
The forward model of the DI system maps the 3D electron density to the line-integrated value along the DI LOS.The predicted DI signal is: where the integration path dl is along the DI LOS.For a more detailed description of the DI system, please refer to [28].
The misalignment of the laser system is a common issue that affects TS systems.In a TS system, observation optics with LOSs that cross the laser beam path capture the scattered light.A misaligned laser system can cause the laser beam path to be outside the nominal scattering volumes; in such a case, the inferred density will be lower than the actual plasma density.
At W7-X, the TS system is believed to be affected by a systematic shift of the laser beam [35,36].Laser misalignment is expected to be the dominant source of error in the electron density profiles, affecting both the overall scale and shape of the profile.
In this work, we introduce two additional parameters to account for laser misalignment errors: the global TS calibration factor C TS , and a systematic uncertainty σ laser that is added to the nominal TS uncertainty.C TS is a model free parameter, and it is constrained during inference by the line-integrated density of the DI (i.e., the TS is cross-calibrated during inference).The systematic uncertainty due to laser misalignment is held fixed, and the standard deviation of the i-th TS channel is modeled as: where σi TS is the nominal TS uncertainty.α and σ 0 are experimentally estimated (see section 7.2).Ongoing efforts at W7-X are in place to account for the TS laser misalignment.A comprehensive modeling and exhaustive analysis of this error is beyond the scope of this paper.

Inference
The inference procedure is divided in two stages.Firstly, in the so called maximum a posteriori (MAP) optimization, the model free parameters that maximizes the left-hand side of equation ( 2), i. e., the mode of the posterior distribution, are derived: The Hooke and Jeeves optimizer [37] drives the optimization.Secondly, the MCMC Metropolis-Hastings algorithm (MHA) [38,39] numerically approximates the full posterior distribution.The model parameter uncertainties can be derived from the MCMC samples.The inference is carried out on a single core of an Intel(R) Xeon(R) Gold 6136 CPU @ 3 GHz.
We are interested in generating samples from the posterior distribution of the model parameters because they allow propagating their uncertainties into any subsequent quantities.The computation of the samples is not straightforward: either a closed form of the posterior is derived (either analytically, possible only in very seldom cases, or by approximating it with a parametric form as it is done in variational inference), or a sampling algorithm, such as an MCMC method, is used.MCMC methods have desirable mathematical convergence properties, and they do not require assumptions on the parametric form of the posterior distribution.However, they do not scale well to problems where the computation of the likelihood is inefficient because they require several thousands of evaluations of the likelihood function.Replacing the VMEC code with the NN model results in orders of magnitude faster likelihood evaluations, therefore, it brings the Bayesian inference approach to a scale that was not possible before.

Results
This section investigates the inference of plasma profiles for both synthetic and experimental W7-X data: section 3.1 visualizes the simple reconstruction of two parameters on simulated diagnostic data; section 3.2 investigates the robustness of the inference procedure across diverse W7-X plasma scenarios; section 3.3 compares the reconstruction of plasma profiles and their uncertainties with three different MHD equilibrium models: a fixed, finite-beta VMEC equilibrium; a self-consistent VMEC equilibrium; and a self-consistent NN equilibrium.

2D inference on synthetic data
To introduce the inference procedure, and to visualize the free parameter values during inference, a simplified 2D inference on synthetic data is reported.Apart for the electron density scale factor h ne,0 and the total toroidal flux enclosed by the plasma Φ edge , all other model parameters are fixed.
In this section, diagnostic data are simulated with this Minerva graph rather than taken from the experiment.Observations are modeled using normal or truncated normal distributions.The predicted data from the forward model determine the distribution means, and the experimentally informed uncertainties determine the distribution standard deviations.The synthetic diagnostic data are then generated by setting the free parameter values to their target one (see paragraph below), running the forward model with VMEC as the equilibrium solver, setting the observation means to the predicted diagnostic data, and finally drawing samples from the observation distributions.We would like to make two important remarks: the generated synthetic data are obtained using an accurate equilibrium provided by VMEC, while the inference process uses equilibria obtained from the NN model; the synthetic data are sampled from distributions whose sigma is informed by experimental uncertainties, ensuring that they are not noise-free.
A W7-X plasma scenario resembling the post-pellet phase with an enhanced confinement [4] is considered (W7X20181016.037at t = 1.In this simplified 2D inference, the MAP optimization quickly converges to the true values (figure 2): after five iterations, the inferred values (black dots) are already close to the target ones (red star).The inference initial guess (black star) is sampled from the parameter prior distributions.The relative difference between the inferred and true values is less than 1 % (table 1).
Figure 2 also shows the contours of the full posterior distribution normalized to the posterior distribution of the MAP values in the (h ne,0 , Φ edge ) space: a dark color indicates that a region of parameter space is less likely than the MAP values, on the other hand, a light color indicates that a region of parameter space is equally likely as the MAP values.10 000 random samples are used to interpolate the posterior distribution.Figure 2 does also highlight the advantage of a fast MHD equilibrium model: sampling 10 000 parameter values, which requires computing 10 000 self-consistent MHD equilibria, took only about 20 min (in a serial fashion on a single core).Hence, it is now possible to quickly explore the entire posterior distribution.

Inference robustness on synthetic data
Is the NN model's approximation of the ideal-MHD equilibrium robust across diverse plasma scenarios?
The NN model was trained on a large set of W7-X equilibria for various vacuum magnetic configurations, plasma pressure and toroidal current profiles.In this section, we investigate if the inference procedure is robust across plasma scenarios (e. g., high-and low-β, flat or peaked pressure profiles).
Using synthetic data provides the advantage of being able to conveniently scan the parameter space in different trials: for each inference trial, the true state and the initial guess are sampled from the model parameter prior distributions.The plasma state is represented by the vector h = (h Te,0 , h Te,1 , h Te,2 , h ne,0 , h ne,1 , h ne,2 ) T , while h Te,3 = h ne,3 = 1 are fixed.Similarly to section 3.1, synthetic data are generated by injecting the true plasma state into the graph, and by setting the observed data to samples drawn from the observation distributions, using VMEC as equilibrium model.The free parameters are then initialized to their initial guesses, and the posterior distribution is maximized for 100 iterations.The NN model approximates the MHD equilibrium during inference.
The inference procedure is robust across plasma state and initial guess (figures 3a to 3f).Figures 3a to 3f show the trajectory of the free parameters (normalized to their true values) as a function of the MAP iterations.Because the free parameters are normalized to their true values, a final value of 1 (red dashed line) represents a successfully converged inference.The trajectory means (solid line) and 5 % − 95 % quantiles (dashed lines) are estimated with 25 independent inference trials.The profile scale factors (h ne,0 and h Te,0 ) are accurately inferred, whereas the distributions of the profile shape parameters show a non-finite spread in their estimated values.Yet, the inferred values are on average close to the target values.As a representative case, table 2 shows the true, initial, and inferred parameter values in case of the median trial (i.e., the trial that has the median average percentage inference error across all trials).

Inference of improved confinement scenarios at W7-X
In this section, we replace the synthetic diagnostic data with experimental data.We address two questions: how does the approximation of the equilibria by the NN model affect the inferred plasma parameters?What are the implications of a self-consistent MHD equilibrium for plasma parameter estimation?To address both questions, two plasma scenarios with T i T e at different β and magnetic configurations are considered: W7X20181016.37,t = 1.7 s: a β > 1 %, improved confinement scenario following pellet injections in the standard configuration [4].
In this section, we compare three different ideal-MHD equilibrium models: a reference, fixed, finitebeta VMEC equilibrium (see description below); a self-consistent VMEC equilibrium; and a self-consistent NN equilibrium.Comparing the two self-consistent equilibrium models allows the investigation of the approximations provided by the NN model, while comparing the fixed and self-consistent equilibrium models enables the analysis of the implications of a self-consistent equilibrium on the inferred plasma profiles.
The reference VMEC equilibrium is taken from the set of precalculated finite-beta equilibria commonly used at W7-X [16].The pressure profile is assumed to be p 0 (1 − s) a2 , where p 0 is the pressure scale, and a 2 determines the pressure peaking factor.Estimating a 2 from the experimental profiles, and assuming p 0 so that W kin matches the measured W dia value (with a plasma volume of V p = 30 m 3 ), the closest precalculated equilibrium in terms of Euclidean distance in the (p 0 , a 2 ) space is selected.The net toroidal current is less than 2 kA in these experiments and can be neglected.Φ edge is set to the toroidal flux enclosed by the LCFS of the vacuum field obtained from field line tracing.
In case of the self-consistent MHD equilibria, the equilibrium is not fixed, but evaluated consistently with the proposed density and temperature profiles.Nine free parameters represent the plasma state: four profile parameters each for n e and T e , and a global calibration factor for the TS (see section 2.2.1).Φ edge is held fixed.As in section 3.2, the toroidal current profile shape is fixed, but the net toroidal current is set to the value measured by the Rogowski coil.
To improve the inference's convergence, diagnostics raw data inform the initial guess: h ne,0 is set to be consistent with the line average integrated density from the DI (assuming a flat density profile and a LOS length of 1.1 m), and h Te,0 is chosen so that the plasma's kinetic energy matches the measured diamagnetic energy from the diamagnetic loop (assuming a plasma volume of V p = 30 m 3 , and a linear pressure profile in normalized toroidal flux).
For both considered experiments, the inferred profile parameters with the three MHD equilibrium models are compatible (tables 3 and 4): after 100 MAP iterations, the parameter values are within one standard deviation away from each other.The standard deviations are estimated using 30 000 MCMC samples, of which the first 10 000 are discarded, and only 1 in every 50 are kept to reduce the sample autocorrelation.
It is worth highlighting the time needed to perform each inference (100 MAP iterations on a single core, given here in case of the W7X20181016.37shot): using the self-consistent VMEC equilibrium took 1108 min and 45 s, using the fixed VMEC equilibrium took 9 min and 35 s, and using the NN model took only 3 min and 31 s.The inference time is reduced by more than two orders of magnitude.As depicted in tables 3 and 4, the three ideal-MHD models yield compatible plasma profiles.This is true not only in terms of MAP profiles, but also for their posterior distributions estimated with MCMC (figures 4a to 4d).
The inferred profiles are also consistent with a independently inferred electron temperatures and densities per TS volume (figures 4a to 4d).For the reference Minerva inference, the density and temperature values at each TS volume are independently reconstructed using the fixed, finite-beta VMEC equilibrium as MHD model, and the density is further scaled to match the line-integrated value from the DI.See [27,Section 5] for a description of the inference procedure.
Tables 5 and 6 show selected quantities of interest of the resulting equilibria.In case of the inference performed with the NN model, the mean and standard deviation (in brackets) of the MCMC samples are reported.The inferred MHD equilibria obtained using the self-consistent VMEC and NN models feature compatible properties (tables 5 and 6): the inferred values with the self-consistent NN model are within one standard deviation with respect to the values inferred with the self-consistent VMEC equilibrium.It is worth noting that, for the two experimental scenarios investigated, the assumed pressure profile in the precalculated fixed equilibrium (first column in the tables) differs from the inferred pressure profiles (second and third columns in the tables).

Conclusions
In this work, we found that employing the NN model from [25] as ideal-MHD equilibrium model in the Minerva Bayesian framework yields inferred plasma parameters compatible with the parameters obtained using VMEC.We have also investigated the robustness of the NN accelerated inference using synthetic data, and we observed that it is robust across diverse W7-X plasma scenarios.
The inference time can be reduced by more than two orders of magnitude when using the NN model.Moreover, given the fast computational time, plasma parameter posterior distributions can be approximated using MCMC samples with self-consistent ideal-MHD equilibria.
This work has two major limitations: no magnetic diagnostics (except for the Rogowski coil) are included in the Minerva graph, owing to the lack of accuracy of the NN model in faithfully computing the plasma current density I , which is required to predict the magnetic diagnostics observations (the plasma contribution to the magnetic field at a location outside the plasma volume depends on a volume integral of the plasma current density [41]); T i ∼ T e and Z eff 1 have been assumed, as a result, the approach can be tested only on a limited set of experimental conditions where these assumptions are close to being satisfied.To infer additional plasma parameters, more diagnostics can be included in the Minerva graph.A XICS can be used to constrain the ion temperature [42], and a spectrometer can be used to infer the effective charge Z eff [43].
Using NN ideal-MHD models, it is possible to quickly infer plasma parameters while taking into account finite-beta effects in the equilibrium.If diagnostic data are available, the MHD self-consistent inference of plasma parameters can theoretically be performed between shots, providing valuable insights for the conduction of operational campaigns.

Author Statement
The contributions to this paper are described using the CRediT taxonomy [44] Thomas Sunn Pedersen Funding acquisition, Supervision.

Acknowledgement
We are indebted to the communities behind the multiple open-source software packages on which this work depends: hydra [45], matplotlib [46], numpy [47], pymc3 [48], pytorch [49], pytorch lightning [50], scipy [51].Financial support by the European Social Fund (ID: ESF/14-BM-A55-0007/19) and the Ministry of Education, Science and Culture of Mecklenburg-Vorpommern, Germany via the project "NEISS" is gratefully acknowledged.This work has been carried out within the framework of the EUROfusion I the plasma current density depends up to the secon-order derivatives of the equilibrium solution, and the equilibrium solution provided by the NN model does not have smooth second-order radial derivatives [25] 7 Appendix

Modeling the uncertainty due to the TS laser misalignment
This section briefly introduces how the uncertainty due to the TS laser misalignment is modeled in the Minerva graph.To estimate the uncertainties due to the TS laser misalignment, we make use of the fact that the inferred electron density linearly depends on the TS observations (see equation ( 7)).In this work, we assume that only two factors affect electron density: a change in the macroscopic plasma state (e. g., pellet injection, neutral beam injection (NBI) heating) or a shift in the TS laser.To rule out the former, we consider time windows from multiple shots where all the other plasma parameters apart from the inferred electron density and temperature from the TS are constant.Previous Minerva reconstruction are used for this estimation.Table 8 lists the considered shots and time windows.Figure 5 shows an example of these shot, in which the inferred electron density of three TS volumes is plotted over time.Given that all the other plasma parameters are constant in this time window, we assume that even the actual electron density is constant as well, and that the variations in the inferred values are due to the TS laser shifts.Therefore, we assume the time average (over the whole time window) of the electron density to be the actual density, and we consider the standard variation (in time) of the inferred electron density as a proxy to model the uncertainty due to the TS misalignment.
How does the standard deviation depend on the inferred value? Figure 6 shows the relationship between the standard deviation and average electron density for all the evaluated shots.When considering only the volumes inside the LCFS (stars), a simple linear model reasonably describes the data: σ ne ∼ T N (αµ ne , σ σn e ), where T N stands for a truncated normal distribution.However, the volumes outside the LCFS (dots) do not seem to follow the same trend.The posterior distributions of α and σ σn e are numerically estimated with 50 000 MCMC samples.The mean of the posterior distribution yields α = 0.18.
Finally, we model the uncertainty of a generic TS volume due to TS laser misalignment using the linear relationship between the electron density and the TS observed data as follows: σ i laser = max(σ 0 , αD i TS ), (12) where σ 0 accounts for the standard deviation of the TS volumes outside the LCFS not well modeled by the linear relationship.σ 0 is usually set to a small value compared to the observed TS data: σ 0 2.5 100 max i (D i TS ).

Figure 2 :
Figure 2: Trajectory of the free parameters during inference.In this case, the free parameters are the electron density scale factor hn e,0 and the net toroidal flux enclosed by the plasma Φ edge .The reconstruction process starts from the black star, which represents the initial guess, and converges to the red star, which represents the true state.The dashed black line indicates the order of parameter values encountered during inference.The synthetic observations are generated using the Minerva graph and VMEC as equilibrium model, while the inference is performed using the NN as equilibrium model.The logarithm of the ratio of the sample posterior probability to the MAP posterior probability is also shown.The light dark dots represent 10 000 random samples used to interpolate the posterior distribution.

Figure 3 :
Figure 3: Convergence of the model parameters during inference for 25 independent trials.Each trial yields a randomly sampled set of true and initial guess values.Each figure shows the mean (solid line) and 5 % − 95 % quantiles (dashed lines) of the normalized (to their true value) free parameters as a function of the MAP optimization iterations.A red dashed line guides the eye to indicate the normalized target value (i.e., 1).See section 2.2.1 for the description of each parameter.

Figure 4 :
Figure 4: Comparison of the inferred electron density (figures 4a and 4c) and temperature (figures 4b and 4d) profiles with the following MHD models: a fixed, finite-beta precalculated VMEC equilibrium; a self-consistent VMEC equilibrium; and the self-consistent NN model described in section 2.2.1.The solid lines represent the mean profile across all MCMC samples (in case of the self-consistent VMEC equilibrium, the solid line is the MAP profile), and dashed lines represent the 5 % − 95 % quantiles.In addition, the values (as well as their standard deviation) of the electron density and temperature at each TS volume location, from a reference Minerva inference, are also shown (red stars).The shot id and time of each reconstructed slice are shown in each figure title.

Figure 5 :Figure 6 :
Figure 5: The inferred electron density for three TS volumes in stationary plasma conditions.In the selected time window, all other macroscopic plasma parameters are nearly constant.Volumes in the core (1005), midradius (1035), and plasma edge (1076) are depicted.Data from previous Minerva reconstructions are used.

Table 1 :
Reconstructed free parameter values for the 2D inference on synthetic data.See section 2.2.1 for the description of each parameter.

Table 2 :
Target, initial guess, and inferred parameter values for the median trial.See section 2.2.1 for the description of each parameter.

Table 3 :
Comparison of the inferred free parameters in case of the W7X20181016.37shot at t = 1.7 s with the three ideal-MHD models: a fixed, finite-beta precalculated VMEC equilibrium; a self-consistent VMEC equilibrium; and the NN model described in section 2.2.1.The free parameter values are obtained via a MAP optimization, and the standard deviation (in brackets) is estimated with MCMC.Because of the computational time required to run VMEC for each MCMC sample, the MCMC procedure has not been performed in case of the self-consistent VMEC equilibrium.

Table 4 :
Comparison of the inferred free parameters in case of the W7X20180808.5 shot at t = 20.0 s with the three ideal-MHD models.See table3for a description of each row.

Table 5 :
Comparison of selected quantities of the inferred equilibria of experimentW7X20181016.37 at t = 1.7 s with three MHD models: a fixed, finite-beta precalculated VMEC equilibrium; a self-consistent VMEC equilibrium; and the self-consistent NN model as described in section 2.2.1.In case of the inference performed with the self-consistent NN model, the mean and standard deviation (in brackets) of the MCMC samples are reported.In these experimental conditions, the measured diamagnetic energy is W dia = 1137.661kJ.

Table 6 :
Comparison of selected quantities of the inferred equilibria of ex-perimentW7X20180808.5 at t = 20.0 s with the three MHD models, analogous to table 5. W dia = 232.188kJ.

Table 7
lists the prior distribution of the model free parameters.

Table 7 :
The prior distributions of the model parameters.U (a, b) means a uniform distribution defined on (a, b).The bounds of uniform distribution of Φ edge are set by the distribution of the training data on which the NN model has been trained.

Table 8 :
The W7-X shots and time windows used to inform the modeling of the uncertainty due to the TS laser misalignment.The magnetic configuration and line integrated density (as measured by the DI) are also listed.