Plasma profile reconstruction supported by kinetic modeling

Combining the analysis of multiple diagnostics and well-chosen prior information in the framework of Bayesian probability theory, the Integrated Data Analysis code (IDA Fischer et al 2010 Fusion Sci. Technol. 58 675–84) can provide density and temperature radial profiles of fusion plasmas. These IDA-fitted measurements are then used for further analysis, such as discharge simulations and other experimental data analysis. Since IDA considers measurement data, which is frequently fragmentary, with statistical and systematic uncertainties, which are often difficult to quantify, from a heterogeneous set of diagnostics, the fitted profiles and their gradients may be in contradiction to well-established expectations from transport theory. Using the modeling suite ASTRA coupled with the quasi-linear transport solver TGLF, we have created a loop in which simulated profiles and their uncertainties are fed back into IDA as an additional prior, thus providing constraints about the physically reasonable parameter space. We apply this physics-motivated prior to several different plasma scenarios and find improved heat flux match, while still matching the experimental data. This work feeds into a broader effort to make IDA more robust against measurement uncertainties or lack of measurements by combining multiple transport solvers with different levels of complexity and computing costs in a multi-fidelity approach.


Introduction
The validation of fusion plasma codes and analysis of discharges requires reliable experimental measurements.
Original Content from this work may be used under the terms of the Creative Commons Attribution 4.0 licence.Any further distribution of this work must maintain attribution to the author(s) and the title of the work, journal citation and DOI.
Unfortunately, there is not a single diagnostic capable of covering the entire plasma and parameter space.This means that any profile-producing analysis has to combine diagnostics and their often sophisticated, parameter-entangling forward models, as well as smoothing/interpolating procedures to acquire proper fits.
At the ASDEX Upgrade tokamak, the Integrated Data Analysis [1] framework (IDA) is routinely used to provide electron density n e and temperature T e profiles.It produces profiles for every millisecond of a discharge and most often relies on the Thomson Scattering (TS) diagnostic, deuterium cyanide laser interferometry (DCN), and the Lithium-ion beam emission spectroscopy (LIB) [2] to provide the measurements for density profiles.The TS is additionally used for electron temperature measurements along with the electron cyclotron emission (ECE) [3] radiometer. Figure 1 shows the measuring positions of the diagnostics for an L-mode discharge with the dotted lines showing different flux surfaces.We shall use ρ tor = √ Φ−Φ0 Φsep−Φ0 as a radial coordinate with Φ being the toroidal magnetic flux, Φ sep being the flux at the last closed flux surface (separatrix) and Φ 0 being the flux at the magnetic axis.As transport along magnetic field lines is much faster than perpendicular to them, we can assume constant temperature and density for a flux surface, although for ions this assumption might be violated in some situations.
Figure 1 clarifies the difficulty of combining the diagnostics.The LIB measures the plasma edge, the DCN measures the line-integrated density for five lines of sight, and TS is available for several different ρ tor but has a much lower sampling rate of 20 Hz.The ECE channels have a much higher sampling rate (1 MHz) but measure at non-equidistant and predefined cyclotron frequencies.Depending on the available frequencies (radiometer mixers) and the magnetic field, a temperature measurement 'hole' might occur as seen in figure 2 between ρ tor = 0.45 − 0.7 and no measurements in the close vicinity of the magnetic axis.IDA overcomes these challenges by combining the diagnostics with several well-chosen priors and employing Bayesian probability theory.Bayes theorem applied to the density would state that the probability of a n e profile given some data d is: P (n e |d) = P (d|n e ) P (n e ) /P (d) . ( The factor P(n e ) is the prior and does not contain measured information.As the user is usually only interested in the most probable profile, IDA uses a series of priors together with a maximization algorithm to find the maximum a Posteriori (MAP) and can thus ignore the normalizing evidence term P(d).For IDA, the prior can be chosen from a combination of constraints on monotonicity, curvature, and values on the edge.The monotonicity prior favors profiles decreasing with ρ tor using a predefined value defining the strength of this soft constraint.The curvature prior constrains the smoothness of the plasma profiles with radially varying strength parameters at the core and edge.Other priors exist, such as a set of reasonable temperature intervals at certain scrape-of-layer radii, e.g. the temperature is expected to be < 120 eV at the separatrix with an upper standard deviation of 40 eV.This use of priors sets IDA apart from other profile fitting tools such as Augped [4] where e.g. the fitting of a mtanh-function already assumes a specific shape.IDA acknowledges the existence of priors and how it affects the fits for the final result.
Using the four standard diagnostics (ECE, TS, LIB, DCN), the Bayesian probability for the joint evaluation of n e and T e is proportional to with e.g.p(d ECE |T e , n e ) either being a Gaussian or an outlier robust Student's t-distribution.There is no limit to the number of other diagnostics and priors that can be added, such as the reflectometer or helium-ion beam (HEB).
In practice, the logarithm of equation ( 2) is maximized, which is equivalent to the sum of the log likelihoods and log priors of the respective probabilities.For instance, in the case of the ECE diagnostic, the Gaussian log likelihood is proportional to ∝ ((T e − d ECE )/σ ECE ) 2 and the logarithm of the Student's t-distribution ∝ (a 0 + 0.5) × ln(2a 0 + ((T e − d ECE )/σ ECE ) 2 ) with d ECE being an ECE measurement, the data uncertainty given by the standard deviation σ ECE and a 0 determining how large the tails of the Student's t-distribution are.
It is important to note that the measured value d ECE (like for all signals) is based on a forward model [5], which describes the physics of the measurement and the calibration process [6].
The resulting IDA profiles are fitted from ρ pol = [0 − 1.25] described by an exponential of a cubic spline.The exponential of the spline has the feature of producing differentiable and positive profiles.
The magnetic equilibrium reconstruction needed for mapping the diagnostics to a common coordinate system, diagnostics or the forward models, might suffer from systematic uncertainties, depending on the discharge.The uncertainties of a routinely provided equilibrium based on magnetic measurements only (CLISTE [7]) can be reduced using a kinetic equilibrium coupled with current-diffusion modeling (IDE [8]).Various multi-fidelity forward models might be chosen for different scenarios, as low-fidelity black-body radiation for the ECE can be sophisticated with a high-fidelity radiation transport model (ECRad [5]) for non-local EC emission.Diagnostics might be misaligned, individual channels might be switched off due to unambiguous failures, or hyperparameters have to be introduced and estimated quantifying calibration uncertainties.All these measures can improve the resulting profiles and their uncertainties and support the consistency between the diagnostics, but residual inconsistencies or uncertainties might remain.For example, temporal calibration changes of the ECE or charge exchange recombination spectroscopy (CXRS) data which, for practical reasons, cannot be measured routinely.Additionally, even when the profile uncertainty includes the transport physics correctly, an improved best estimate of the profiles regularized by transport physics constraints is beneficial for applications in further studies.
Figure 2 shows three IDA electron temperature and density profiles of discharge #36974 at 3.404 s along with the experimental data used for the profiles.The significant scattering of the temperature data is due to the ECE measurements sampling fast enough to capture mode activity which periodically flattens the profile.One can see the relative scarcity of the TS measurements (red crosses) in the n e graph compared to the highly sampled ECE measurements in the T e figure.The discharge lacked LIB measurements, thus less n e data at the edge is available than usual.Not depicted are the line-integrated density measurements from the DCN, as they cover a range of radii.The lower panel of the figure shows the log gradients, which are the main drivers of turbulent transport.The T e log gradient stands out as it has large spatial fluctuations, especially in the regions of no ECE measurements.The T e spatial fluctuation is mainly driven by the edge channels of the ECE mixers which are notoriously difficult to calibrate.Below, we shall see that these spatial fluctuations are not consistent with the expectation of heat transport.
Figure 2 also shows an IDA profile without a curvature prior for both n e and T e .While the density profile stays roughly the same, the electron temperature profile has significantly stronger radially oscillating gradients in the areas with no ECE data.The gradient in the inner core is unrealistic as it leads to a core temperature of more than 11 keV.The third profile shows an IDA profile with a strongly weighted curvature prior.For this case, the fit looks very good as the profile is almost a straight line in the ECE gap.However, in general, such a strongly weighted prior has the habit of overruling diagnostic measurements and is not generally applicable.
The uncertainty of the IDA MAP profile is determined by adjusting the profile locally until the likelihood residuals have increased by 1 [9].This method provides users with an approximation of the information density inherent in the measured data.It is important to note that for this estimate the priors are not considered.We have thus selected to only plot the profile's MAP.MCMC sampling of the distribution is recommended for obtaining uncertainties for kinetic modeling.
While IDA profiles match the experimental measurements, they do not necessarily agree with our theoretical understanding of fusion plasmas.A simple test is to study the power balance in steady-state using transport and heating codes.As deposited heat must either radiate or travel radially outward, we expect the heat flux, which is given by turbulent and neoclassical transport, at every point to match the sum of power in the inner radius, At a given radius ρ, we have various power densities: ECRH heating represented as P ECRH , the electron component of neutral beam heating denoted as P e,NBI , ohmic heating labeled as P Ohm , power lost to radiation as P RAD , and power transferred to ions by collisions as P e,i .The turbulent equipartition term is not included in the simulation as it is usually negligible.In figure 3, we show the electron heat flux predicted by TGLF [10] and NCLASS [11] with the IDA profiles and volumeintegrated heating of the L-mode discharge #36974.The discharge was explicitly designed to study turbulence with wellstudied reference discharges [12] and heated through a single ECRH source deposited at ρ tor ≈ 0.2.In this case, the electron heat flux should be a straight line outside of the heat disposition with a slight slope due to collision and radiation terms.However, we can see a spike in transport where the logarithmic gradients were the largest.This mismatch in volumeintegrated heating and heat flux is only slightly improved by the strong curvature prior.It is our goal to improve the match for a wide variety of discharges by replacing the curvature prior with values from kinetic modeling simulations.
For this paper, we have introduced a kinetic model as a prior to the IDA framework, which puts a soft constraint on the profile gradients.This provides profiles that fit the experimental data within their uncertainties and are consistent with our physical understanding.In the next section, we will introduce ASTRA, which is the workhorse of our kinetic model, along with its implementation into the IDA framework.Afterward, we shall see successful applications to both L-mode section 3 The deposited power travels outward and would be a straight line if radiation and interaction terms were negligible.As we are in steady-state, we would expect the heat flux calculated by TGLF using the standard IDA profiles shown in figure 2 to match the heat input.However for both IDA profiles shown here, the gradient in the ECE gap would result in a much larger turbulent transport than expected.For radii outside of the boundary condition we do not run TGLF, explained in more detail below.and H-mode discharges section 4. We shall conclude with two examples of discharges where the kinetic model is known to struggle and how the simulations can still be used as prior information, sections 5.1 and 5.2.

Kinetic model introduction
In a proof of principle work, we have used profiles calculated by the kinetic modeling (KM) code ASTRA8 which is an updated version of [13].As ASTRA8 is a framework that can be run in numerous ways, we shall from here on refer to it as ASTRA-TGLF to indicate ASTRA8 being coupled with the TGLF turbulence solver.The kinetic modeling output is then given as a physics prior to IDA, thus making the overall prior: To more easily differentiate between different IDA priors we shall call IDA using the kinetic model prior IDA+KM.The new KM prior can be interpreted as a 'synthetic' diagnostic augmenting the measuring diagnostics.In the Bayesian framework, there is only a combination of information and its quantified uncertainties, independent of the sources.
Since the absolute values of the profiles estimated by ASTRA-TGLF might be less reliable than the profile gradients due to their uncertain initialization at the boundary, instead of p(n e , T e |KM) a better choice is to use p(∇n e /n e , ∇T e /T e |KM) as explained in more detail below.
The coupling of the IDA estimation process and the ASTRA evaluation is as follows.During the optimization process for finding the best fitting profiles, IDA will produce intermediate profiles T e,IDA , n e,IDA and feed them to ASTRA, which will simulate the profiles n e,KM and T e,KM .IDA will then compare n e,KM and T e,KM to its profiles by an additional prior term e.g. .We discuss the uncertainty σ KM in section 2.2.Ideally, this would be done self-consistently at every step of the IDA convergence loop, however as ASTRATGLF, combined with its subroutines, is computationally too expensive and the resulting profiles do not drastically change with a slightly changed input, we have decided to run ASTRA-TGLF and update the prior only after significant changes in the profiles, which typically is only at the beginning of the IDA fitting process.
The main ASTRA-TGLF bottleneck is the turbulence calculation by the TGLF subroutine, which neural-network turbulence solvers can replace in the future.These solvers are pre-trained on their respective models and use artificial intelligence (AI) to estimate the turbulent flux instead of solving expensive equations.Thus, neural network solvers such as QLK-NN [14,15] or TGLF-NN [16], are orders of magnitude faster and, once they are thoroughly validated, will speed ASTRA-TGLF up enough to increase the number of ASTRA-TGLF evaluations within the IDA optimization.

ASTRA
After producing inputs of a steady-state time window with TRVIEW [17], the equilibrium solver SPIDER [18] is run.The input profiles for n e , T e are IDA profiles without the kinetic model while the ion temperature T i is from IDI [9] or charge exchange data (CMZ and CEZ).The combination of ion temperature shotfiles in TRVIEW, makes a self-consistent uncertainty estimation difficult.Thus we have also decided to remove error bars for the ion temperature.The profiles are calculated by letting T e , n e and T i evolve while keeping the plasma current and safety factor profile (given by the IDE shotfile) constant.The profiles are viewed as converged when both the integrated particle and heat sources are equal to their respective fluxes at each point, which is usually the case after around 80 time steps.We shall use Γ for the particle, Q e for the electron heat and Q I for the ion heat flux in accordance with the ASTRA handbook [19].Our ASTRA-TGLF simulations contain 91 equidistant points in ρ tor , with TGLF being calculated at 64 locations within the boundary.We run in 25 ms timesteps with the subroutines being run each step.Overall the simulation takes about 80 min of wall-clock time, of which TGLF uses around 70 min.
The heat and particle fluxes are expressed in terms of heat conductivities and particle diffusivity and convection.
The terms are determined by the quasi-linear turbulence code TGLF with the saturation rule SAT2 and neoclassical transport code NCLASS.The source terms for energy and particles from neutral-beam injection (NBI) heating are calculated by RABBIT [20] and electron cyclotron resonant heating (ECRH) by Torbeam [21].As we are not modeling sawteeth [22] and find that our ASTRA-TGLF model underpredicts the heat flux close to the magnetic axis, we rely on additional diffusion terms where the safety factor q < 1 and ρ tor < 0.2 as not to have too high temperatures in the core.
In the context of this work, the primary impurity within the ASTRA-TGLF framework is Carbon, and its concentration is determined based on the value of Z eff , defined as follows: where Z main = 1 represents the charge of deuterium.Z eff is provided by Bremstrahlung measurements of CXRS data [23].
It's worth noting that Carbon has a slightly lower dilution effect on the plasma compared to Boron, which is typically assumed to be the primary impurity in real-world experiments.This smaller dilution effect brings the simulation closer to resembling a plasma with high-Z impurities, which is a more accurate representation.Nonetheless, the similarities between Carbon and Boron are substantial enough that they do not adversely affect the outcomes of the turbulence simulations.
The inclusion of ion dilution to ASTRA-TGLF has an ion turbulence stabilizing effect [24].We have also added the radiation from the experimentally measured tungsten concentration (which usually of the order of 10 −5 ) in order to match the simulated radiation with the experimentally measured value.Like most quasi-linear turbulence codes, TGLF struggles to correctly calculate the fluxes in the pedestal region in Hmode discharges [25,26].Thus, a boundary condition is used in which the simulation values are equal to the experimental input.The boundary is usually at ρ tor = 0.9, but we have seen that moving it even more inward can be beneficial if the simulation struggles to capture the density.While there are advances in being able to simulate the entire radius, e.g.[26] has shown that it is possible to simulate the pedestal region using MHD stability codes in H-mode and [25] has been able to simulate L-mode discharges that go to the separatrix, we have opted for the more traditional route.This saves computing time and it is unlikely that simulating the edge will add much information as the edge of the plasma is usually well covered with diagnostics (edge TS, LIB and HEB).
In figure 4 we can see the simulation of the L-mode discharge #36974 at 3.404 s.The simulated profile matches the input temperature T e,IDA well until the inner core at ρ tor ⩽ 0.25, where the lack of simulated sawteeth leads to too large temperatures (as there are no measurements at the very center it is hard to know by how much the simulation is off).As expected, the T e gradient has been smoothed at mid-radius, leading to a slightly higher temperature at ρ tor ≈ 0.6.Still, it matches the experimental profile again where ECE measurements were available.One can see a strong flattening in the gradient slightly inside the q = 1 surface due to the additional diffusion.The shape of the density profile also largely matches the input profile.
The displayed shot relies on 20 ms NBI blips (short bursts) every 300 ms for T i,exp and v tor data.We generally assume that these blips do not heat the plasma and have set P NBI = 0.
The assumption is supported by the simulated ion temperature matching the input and the measured T e not changing during the blip.While the simulation here looks solid, below we shall see that T i,sim for slightly varied input often is too low, which could point to the need of using the time-averaged power from the blips.The simulation of T i does not go into the IDA reconstruction, but unrealistic values would point toward the simulation being flawed.

Uncertainty quantification
To give a probability for the KM profiles, we need to have an estimate of the uncertainty of the simulation.Unfortunately, all routines used in our kinetic model are deterministic and do not provide a margin of error.For this work, we have predefined an uncertainty for the log gradient, based on input uncertainty propagation results of selected L-and H-mode discharges, as a proof of concept.In the future, we propose approximating the error by input error propagation as was done in [27][28][29].These two concepts we shall introduce below.
The comparison of simulated profiles in IDA can be made either by absolute values or by the log gradients of the profiles.As the log gradient of the profiles is a major driver of turbulent transport, and we want to have the new profiles match turbulent predictions, it makes sense to compare them with the added advantage that the log gradients are more robust against errors in the simulation input as we shall demonstrate below.We shall thus only discuss uncertainties of the gradients.

Input uncertainty propagation.
In turbulent fusion plasmas, the temperature gradient is often 'stiff', meaning that it will only increase slightly with stronger heating.This stiffness means that if the absolute value of the profile in the ASTRA-TGLF input at the boundary condition is chosen as too small or large, this error will propagate through the entire simulated plasma.While the log gradient is the main driver of turbulent transport, values such as the ion-electron temperature ratio and the normalized collisionality ∝ n/T 2 also affect Simple input error propagation with eight different ASTRA-TGLF input parameters for #36974 at 3.404 s.Te, T i , ne, Er, the safety factor q, P NBI and P ECRH were simultaneously randomly varied.The IDA profiles were made with the standard curvature prior.In the first row one can see that the output is very dependent on its input counterpart value at the boundary condition.This means that any input error introduced at the boundary condition will largely determine the profile towards the core.The simulated log gradient in contrast orange is seemingly independent of the boundary value.The input log gradient is a single value, as any scaling factor cancels itself out.
the transport and impact the critical gradient at which turbulence starts [30].In past studies TGLF transport was also found to depend on the safety factor q [22,31].
To reproduce the uncertainty due to the input values we have repeatedly run the kinetic model with varied input in a Monte Carlo approach (figure 5).
We chose five input profiles (T e , T i , n e , and q) as well as the radial electric field E r , NBI heating power P NBI and ERCH heating power P ECRH , and Z eff and scaled each with a different random number drawn for 64 different runs.For 16 runs an initial equilibrium could not be computed for the varied input.The scaled variable was drawn from a normal distribution with µ = 1 and σ = 0.15.
Figure 5 shows the mean value of the simulations at each ρ tor as well as the standard deviation (shaded area), maximum and minimum value (dotted lines).In the first row, one can see that the absolute simulated values are mainly dependent on their input counterpart.This can be seen especially well for the density, where if one tracks the maximum and minimum simulated values to the boundary condition, they clearly stem from their input counterparts.
The log gradients in the second row show a less obvious dependence on the inputs.The log gradient of the input is just a singular line as the scaling cancels itself out ∇Te Te = ∇(factor×Te) factor×Te .
Taking sawteeth and other problems of the kinetic model [32] into account the T e uncertainty for ρ tor ⩽ 0.2 is unrealistically small.The small uncertainty in the core shows the limits of an oversimplified input error propagation scheme.In the future, we would like to quantify these errors using polynomial chaos expansion [33] or the VVUQ [34] library as in [28].

Predefined uncertainty.
We know there are several strong limitations of the model used [35,36], which creates the need to take systematic uncertainties into account.Furthermore, in [32] the global electromagnetic GENE simulations found an oscillating gradient for ρ tor < 0.3 which behaved kinetic ballooning-like and is not found when doing local GENE simulations.As TGLF is a local code, it would also be unable to find these oscillations if further work confirms them as physical.These strong oscillations further motivate using a large uncertainty to make sure that IDA+KM does not negatively impact the profiles compared to IDA in these cases.
Until a more strenuous simulation uncertainty is derived, we use an assumed uncertainty that is a percentage of the examined quantity.Equation (6) shows the uncertainty percentage, which varies for different regions of the plasma.The uncertainty values in this article are derived from the standard deviation of the results of propagating uncertainties in the input data for both L-and H-mode discharges.The results in this paper are not dependent on these exact uncertainty values, the profiles shown were also redone with half and double σ KM with temperature and density profiles being almost impossible to tell apart.A higher uncertainty value was implemented close to the boundary condition (as the simulated gradient can have a large discontinuity at the boundary condition), and in the very center (as sawteeth are not being simulated).Since the log gradient can be ≈ 0 and the resulting predefined error would be very small, we have decided on a minimum uncertainty of σ KM,min = 0.075 for both log gradient quantities As density simulations are notoriously difficult to get right, an option exists to compare simulated profiles indirectly with DCN measurements.The difference of the line averaged density from the core to the separatrix at the midplane of the simulated and initial profile is used to add an additional error.Future work will have the ASTRA-TGLF line averaged density follow the line of sight of the DCN to more closely compare the simulated density to the DCN data.As shown in [25] the disconnect between observed experimental temperature profiles and ASTRA-TGLF simulations in these purely ECRH heated plasmas can be reduced by not evolving the density profile.

Results for L-mode discharges
L-mode discharges cannot reach reactor-relevant performances.However, they are the plasma of choice to study turbulence [37] and thus an excellent place to start and test if the IDA+KM profiles lead to profiles more in line with our theoretical understanding.For the comparison, we have turned off the usual curvature prior for the IDA+KM profiles.
When combining IDA with the log gradient from the kinetic model, we find that the resulting profiles generally lead to better matching fluxes.The Q e profiles are much less peaked, with the heat flux only sharply rising close to the boundary condition or in the innermost core.Q e now almost matches the electron heating power in the mid-radius region, which has the smallest simulation uncertainty, as shown in figure 6.In this region, the root-mean-squared error between Q e and electron heating has decreased by almost a factor of 4. As the T i profile is an extremely relevant part of calculating the fluxes, we show Γ, Q e and Q i calculated by NCLASS and TGLF for two different sets of kinetic profiles.Once using the ASTRA-TGLF input T i,exp and once using the simulated ion temperature T i,sim respectively.We have seen that the importance of T i varies between types of turbulence.In this L-mode case without NBI heating Q e match is improved independent of the used ion temperature.The Q i match, as was the case for all analyzed plasmas, was only improved when using the simulated T i profile.This enhanced ion heat flux match is a possible motivation for implementing a kinetic modeling prior for IDI in the future, especially if 'only' beam blips are available.We have seen that for the experimental T i the Q i match is worse when ion temperature gradient drivers dominate turbulence as the ion temperature gradient is the most crucial variable (see also section 4).In the right panels, one can see that the particle flux mostly matches the expected value of zero (no particles are added by the NBI blips and the neutrals are ionized before the boundary condition).Such a good match is not achieved for most of the examined cases, with the particle flux match often being especially bad in the core.In general, the difficulties in simulating the density input and flux have led to Γ not being a validation metric in [12,27,38].
While the heat fluxes are our metric of choice in determining the profile's agreement with transport physics, we do not want the KM to dominate the measured data.In figure 7, we can see the residuals of the T e measurements compared to the profiles.For L-mode discharge we find no systematic worsening of the data fit.The largest residual remains a stray ECE channel close to the separatrix, which is properly mitigated by the outlier-robust Student's t-distribution.The ECE channels closest to the gap have a slight offset, but these channels in general, are harder to calibrate correctly as they are the edge channels of independent ECE systems [39].To further strengthen our belief that the match has not worsened, we have also plotted the TS temperature measurements in the ECE gap, which are not worsened by the new prior even though the offset is more visible.
Comparing the standard IDA and IDA+KM profiles in figure 8 we find that actual values of n e and T e almost do not change in the areas where there is experimental data.However, their log gradients became significantly smoother.The highest deviation in T e is in the aforementioned ECE gap 0.45 ⩽ ρ tor ⩽ 0.7.For IDA+KM, we expected T e to rise as in figure 2 as the curvature prior was turned off, but the kinetic model is enough to prevent this even with its large core uncertainties.The density has largely remained unchanged, with only the very core being slightly elevated.
We have used this discharge to test the kinetic model prior for other IDA fitting procedures.IDA can also be used with a Markov Chain Monte-Carlo (MCMC) optimizer, which is slower to converge but gives more realistic profile uncertainties which are the standard deviation of the drawn profile samples [9].The MCMC IDA+KM also has a smoothed T e with a reduced standard deviation of the drawn profile samples compared to the standard IDA-MCMC.Furthermore, we tested the effect of reducing the simulation uncertainty or having diagnostics missing.Unsurprisingly, this usually leads to a better flux match.Once again, we stress the importance Figure 6.Heat flux and particle fluxes of the standard IDA and IDA with KM prior for #36974 at 3.404 s.For both experimental and simulated ion temperature profiles, the electron heat flux match is improved.The ion heat flux matches well in the core as the log gradients of the experimental and simulated Ti are roughly the same.At ρtor ≈ 0.75 the experimental gradient is too large and the turbulence is largely ITG driven leading to the spike in Q i .The particle flux match is in general difficult to model for a snapshot when the particle source and flux are so small.The match for Γ is relatively good compared to other L-mode discharges.We have plotted the experimental heat flux for both IDA profiles to show that these stay relatively constant with the different profiles as input.Comparison of the Te residuals for the different IDA profiles of discharge #36974 at 3.404 s.The ECE residual is slightly larger for the IDA with KM prior, but no systematic or strong deviation stands out.For completeness, we have plotted the Thomson scattering as well, which one can see most clearly as lonely measurement points in the ECE gap.We see an offset compared to the original IDA for the Thomson data, as Te is larger figure 8, but it is not necessarily a worse fit of the data. of double-checking the diagnostic residuals to make sure the simulation uncertainty was not underestimated.
Recently multiple non-linear GENE simulations were validated against a combination of turbulence measurements [27,40] for various radii.The GENE simulations used fine-tuned IDA profiles in which spline points and positions, diagnostic shifts and outlying diagnostic channels were removed to achieve the best possible fit.In GENE, profile gradients were varied for these papers to match electron and ion heat fluxes obtained by TRANSP calculations.We applied IDA+KM to all these discharges and obtained improved flux matches in all cases compared to the standard IDA.In figure 9, we can see the relative error between a selected GENE simulation and IDA(+KM) and ASTRA-TGLF gradients.For the plot, the GENE simulation with the best-combined heat flux match for ions and electrons was chosen, for which the GENE gradients were still inside the calculated error bars.In most cases, the IDA+KM gradient is closer to the predicted GENE simulation than the standard IDA.Thus, using IDA+KM as an initial input for GENE could save significant computational resources and allow the GENE simulators to vary more parameters in the search for the optimal fit.For the sole Hydrogen discharge #36770 IDA+KM T e gradient is slightly worse, which could be an outlier or point to more work needed to model hydrogen discharges correctly.
As shown in e.g.[27,40] measurements of the electron temperature fluctuations using CECE and Doppler backscattering measurements of electron density fluctuations can be used to validate turbulence codes.As this project progresses, TGLF simulations using different IDA profiles as input could be compared to these measurements as a further metric in determining a profile's agreement to transport physics.
In these L-mode discharges, IDA+KM could have been used to find a converged GENE gradient more efficiently.However, the actual GENE validation should still be done against the standard IDA, as it is vital to keep theory and experimental measurements separate during validation at least until the simulation's uncertainty has been quantified more reliably.While these IDA+KM profiles will be helpful for many different applications at ASDEX Upgrade, they will be clearly marked to avoid accidental use in transport validation investigations.

Results for H-mode #33616
This section will focus on the H-mode discharge #33616 at 5.451 s, which had 5.0 MW of NBI and 1.16 MW of ECR heating.H-mode discharges have a transport barrier at the edge leading to higher T e and n e values along the cores plasma, but the same turbulence physics applies to the core as to Lmode plasmas.Due to their high performance, H-mode discharges are the desired state for the tokamak ITER [41] and thus very relevant to future tokamak modeling.TGLF cannot simulate the fluxes at the pedestal, so the user must be careful in setting the ASTRA-TGLF boundary condition.For this proof of concept work, we have decided to keep the boundary at ρ tor = 0.9, which could in the future, be decreased to a smaller value as in [26].
The discharge #33616 has the advantage over the L-mode discharge #36974 in the previous chapter in that NBI heating is constantly available (5 MW from two beams), giving us continuous charge exchange data and thus more reliable T i and toroidal rotation measurements.
Figure 10 shows the simulation of the discharge.Due to the H-mode pedestal #33616 reaches higher n e values already for ρ tor > 0.9 than #36974 had in the core.The electron temperature pedestal is not as noticeable with a height of about 1 keV.The core T e,sim is lower than T e,exp as the gradient inside of ρ tor < 0.3 is smaller.However, we consider the fit to be good as the experimental core values vary from 3.2 to 4.8 keV within the sawtooth cycles.
The density is over-predicted in the core and slightly outside the values obtained before a sawtooth crash.However, the simulation's error bars are within the experimental values.T i matches the experimental data better than in the non-NBI case, with T i and the gradient matching each other for ρ tor ⩾ 0.2.While the core temperature is larger, it is also in line with data obtained during a sawtooth crash.
Once more, ASTRA-TGLF predicts smoother T e log gradients than the input had.
In figure 11 we compare IDA+KM to IDA for #33616 at 5.45 s.IDA+KM again did not significantly change the absolute values of T e but has a much smoother log gradient.The discharge has more spread-out ECE measurements than the L-mode discharge, so ASTRA-TGLF can never dominate in a region.The choice to use log gradients for the comparison of experimental and simulated profiles is, again, confirmed, as the IDA+KM profile still matches the data in the core even though it simulated considerably lower temperatures.The density and its log gradient are almost unchanged compared to the standard prior.Heating power and heat flux of IDA and IDA+KM for both experimental and simulated T i of #33616.As the H-mode discharge has more ion heating through NBI, the discharge is dominated by ITG turbulence.IDA+KM leads to a better matching of the expected flux only when using T i,sim as input.
The Q e flux in figure 12 matches the expected heating power values calculated by Torbeam and Rabbit in the region with the lowest uncertainty when using the T i,sim .Interestingly both IDA and IDA+KM profiles match the initial rise at ρ tor ≈ 0.15 with the following spike being much smaller for IDA+KM.This early matching is attributed to the existence of ECE data in the core.As the discharge has significant ion temperature gradient-driven turbulence, using the experimental T i,exp does not lead to an improvement.This high dependence on the ion temperature gradient motivates a possible inclusion of a kinetic modeling prior into IDI.
As mentioned in section 3, the particle flux in the core is off due to the slow convergence of the ASTRA-TGLF particle flux.The particle flux displayed in figure 12 matches the flux with simulated T i values well, meaning that the match to the expected particle flux could only be improved upon by running the simulation for much longer.This simulation still had a mismatch between input and flux even after running the simulation ten times longer and was not continued for practical reasons.

Non-standard discharges
While ASTRA-TGLF has made large steps in validation, some discharges are still difficult to model due to missing physics.This section shows two examples where the ASTRA-TGLF fails to capture the physics properly, but IDA+KM does not disastrously impact the fit to the measured data.

Advanced scenarios
While ASTRA combined with a quasi-linear turbulence model is often good at catching the physics of a regular discharge, it is known to fail for advanced scenarios involving internal transport barriers [32,35,36].These discharges achieve higher temperatures in the core by turbulence suppression.It is still an active field of study on how the suppression is achieved with a combination of strong E × B shear, fast ions, or fishbone modes being likely candidates.
However, in the cases cited above, the ion temperature peaks and while ASTRA-TGLF could not properly capture T i , the electron temperature was well matched.
To test the potential 'negative' impact of the kinetic model prior we have also applied IDA+KM on discharge #36053 at 3.4 s, which had 10 MW of NBI and 4.25 MW of ECR heating, which led to the electron temperature being peaked in the core.In figure 13, the ASTRA-TGLF simulation smoothed the gradient for ρ tor ⩾ 0.6 where ECE data is missing.The difference between simulation and experimental data in the innermost core does not seem to have negatively impacted IDA+KM due to the high core uncertainty assigned to the kinetic model.
ASTRA and TGLF are constantly being improved upon and hopefully, in the future, a better understanding of the physics of the internal transport barrier will make it possible to reduce uncertainty in these discharges without negatively impacting the IDA+KM fit.A side note is the pseudo radial displacement of the ECE data due to relativistic shine through by the highfield side, explained in more detail in [5].The assumption of a single temperature on a flux surface is still correct and IDA was able to properly fit the data through its forward models.

Neoclassical tearing modes
Due to the plasma current's gradient or perturbations in the Bootstrap current, it is possible for magnetic field lines to tear and produce magnetic islands [22].These (neoclassical) tearing modes flatten temperature and density profiles at the radius of the island as the magnetic field lines now have a radial component.Discharge #38926 has a large 2/1 mode that locks over time and visibly flattens electron and ion temperature data at around ρ tor = 0.6.
Figure 14 in orange shows the IDA+KM model where we assign a Gaussian distribution to the kinetic model as in the cases above.The gradient of the T e profile does not go to zero and thus does not capture the physics of the discharge involved.The temperature profile ignores the ECE measurements close to the NTM and T e is consequently overestimated for ρ tor = [0.2− 0.6].The profile's mismatch to the measurements can also be seen in figure 15, with the residuals systematically being smaller than zero.
A simple method to avoid this sort of mismatch is using a Student's t-distribution.The Student's t-distribution is less susceptible to outliers compared to a Gaussian and is also plotted in figure 14 using ν = 1, which is equivalent to a Cauchy distribution.The large tails are enough for the IDA with KM profile to match the initial IDA profile at the position of the tearing mode while still smoothing the profile at around ρ tor = 0.8.Using a Cauchy distribution in the previous L-and H-mode cases leads to a negligibly reduced match in Heat flux.The 'safe' option would be to use the Student's t-distribution as a default.Discharge #38926 at 3.0 s with IDA, IDA+KM profiles.ASTRA-TGLF cannot predict the tearing mode at around ρtor ≈ 0.6, and thus the kinetic model cannot be trusted.When using a Gaussian distribution for the prior the resulting profile is not matching the data.A Student's t-distribution fixes this problem, with the temperature profile being almost indistinguishable from the standard IDA.The gradient is also similar with a small smoothing at ρtor ≈ 0.8.

Conclusions
Turbulence is a crucial limitation in raising the core temperature and density profiles.The plasma community relies on profiles that match the experimental data while being consistent with our expectation of turbulence-driving log gradients.
In this work, we used Bayesian probability theory to augment the integrated data analysis framework (IDA) with the theoretical knowledge from ASTRA-TGLF simulations.This combination has been tested by comparing heat and particle fluxes for L-and H-mode plasma test cases.The electron heat flux match improved by more than a factor of 3 at mid-radius where the predetermined uncertainty was 10%, when using simulated ion temperature.The ion heat flux is not as strongly dependent on the chosen electron profile prior.The particle flux match shows promising signs, especially for discharge with higher flux but still has room for improvement.To ensure that the kinetic model does not dominate over the measurements, we have compared the residuals of the different diagnostics, which have remained stable in typical scenarios.To further rule out the kinetic model having a negative effect on the profile, we can use a Student's t-distribution whose long tails mitigates outliers.
As a possible use for these profiles, we have compared the IDA+KM model with predictions from the non-linear turbulence code GENE and have seen the gradients being closer than the standard IDA's (figure 9).As GENE is very computationally expensive, finding a good starting point for fluxmatching simulations is crucial and opens up the possibility of varying additional parameters in validation studies.This paper shows a proof of concept work with several tasks still outstanding.For one, we have seen that if ITG turbulence dominates, the ion temperature also has to be changed to see improvements in the flux matching.The uncertainties used to define the likelihood of the ASTRA-TGLF prior are still assumed ad hoc.Current work is focused on quantifying the uncertainty of the ASTRA-TGLF suite using input error propagation.This can then be expanded by adding systematic uncertainty of TGLF through comparison with other quasi-linear codes such as QuaLiKiz [42] and high fidelity turbulence codes such GENE and CGYRO.

Figure 1 .
Figure 1.Poloidal view of a typical AUG plasma equilibrium.The black contour lines are the flux surfaces, with the solid line being the last closed flux surface.The positions of the four standard diagnostics used for IDA are shown with different lines.

Figure 2 .
Figure2.IDA profiles and their log gradients of the #36974 discharge at 3.404 s.Red crosses are the Thomson Scattering measurements and green dots the more frequent ECE data.Not plotted are the line-averaged density measurements of the DCN interferometer and (for this discharge) the non-functional lithium beam.Each IDA profile is fitted on the same data but with varying uncertainty of the curvature prior.While the shape of the density does not change much with the choice of prior, due to the good diagnostic coverage, one can see that the Te-gradients are especially fluctuating at ρtor ≈ 0.6 where data is scarce.

Figure 3 .
Figure 3.Comparison of heat input and flux for the L-mode discharge.The dashed line shows the electron volume integrated heating, which jumps up through the ECRH deposited at ρtor ≈ 0.2.The deposited power travels outward and would be a straight line if radiation and interaction terms were negligible.As we are in steady-state, we would expect the heat flux calculated by TGLF using the standard IDA profiles shown in figure2to match the heat input.However for both IDA profiles shown here, the gradient in the ECE gap would result in a much larger turbulent transport than expected.For radii outside of the boundary condition we do not run TGLF, explained in more detail below.

Figure 4 .
Figure 4.ASTRA-TGLF simulation for the L-mode discharge #36974 at 3.404 s.The simulated profiles in orange largely match the input profiles in blue.Inputs are taken from integrated data suites IDA, IDI and IDE.The electron profiles shown were made with the standard curvature prior.The simulated profiles are kept constant outside the boundary condition (black-shaded area).The first row shows the absolute values with the log gradients plotted below.We present the simulated gradient uncertainties in an orange shade.The q = 1 surface is shown as a faint dotted line, inside of which we have additional diffusion coefficients.

Figure 5 .
Figure5.Simple input error propagation with eight different ASTRA-TGLF input parameters for #36974 at 3.404 s.Te, T i , ne, Er, the safety factor q, P NBI and P ECRH were simultaneously randomly varied.The IDA profiles were made with the standard curvature prior.In the first row one can see that the output is very dependent on its input counterpart value at the boundary condition.This means that any input error introduced at the boundary condition will largely determine the profile towards the core.The simulated log gradient in contrast orange is seemingly independent of the boundary value.The input log gradient is a single value, as any scaling factor cancels itself out.

Figure 7 .
Figure 7.Comparison of the Te residuals for the different IDA profiles of discharge #36974 at 3.404 s.The ECE residual is slightly larger for the IDA with KM prior, but no systematic or strong deviation stands out.For completeness, we have plotted the Thomson scattering as well, which one can see most clearly as lonely measurement points in the ECE gap.We see an offset compared to the original IDA for the Thomson data, as Te is larger figure8, but it is not necessarily a worse fit of the data.

Figure 8 .
Figure 8.Comparison of IDA profiles with and without the kinetic model for discharge #36974 at 3.404 s.The profiles are largely the same where ECE data was present, with the density remaining practically unchanged except for the innermost core.The smoothness of the log gradient for IDA+KM stands out.

Figure 9 .
Figure 9.Comparison of IDA, IDA+KM, and ASTRA-TGLF log gradients to GENE simulations for several radii and discharges.The dotted line represents the GENE simulation's gradient, which best matched the heat flux while still within the experimental error bars.In most cases, the IDA+KM gradients are closer to the GENE simulation, with the exception being the sole examined Hydrogen discharge #36770.Using IDA+KM as a starting point could save valuable computing time when conducting high-fidelity turbulence validation.

Figure 10 .
Figure 10.ASTRA-TGLF simulation of the H-mode discharge #33616 at 5.451 s.The simulation matches the input profiles well, with both Te and T i gradients being smoothed.The electron profiles shown are with no curvature prior.

Figure 11 .
Figure 11.IDA and IDA+KM profiles of #33616 at 5.451 s.The absolute values of both profiles have hardly changed with the IDA+KM Te gradient being a lot smoother than for the original IDA.

Figure 12 .
Figure 12.Heating power and heat flux of IDA and IDA+KM for both experimental and simulated T i of #33616.As the H-mode discharge has more ion heating through NBI, the discharge is dominated by ITG turbulence.IDA+KM leads to a better matching of the expected flux only when using T i,sim as input.

Figure 13 .
Figure 13.Discharge #36053 at 3.4 s with IDA, IDA+KM and the ASTRA-TGLF simulation.ASTRA-TGLF is not able to capture the profile peaking at around ρtor < 0.2, but due to the high uncertainty, it does not negatively affect the IDA-KM profile.The ECE pseudo radial displacement is properly captured by the ECrad forward model.The 'bump' at around ρtor = 0.9 comes from the input of ASTRA-TGLF and IDA [KM prior] not having a curvature prior.

Figure 14 .
Figure14.Discharge #38926 at 3.0 s with IDA, IDA+KM profiles.ASTRA-TGLF cannot predict the tearing mode at around ρtor ≈ 0.6, and thus the kinetic model cannot be trusted.When using a Gaussian distribution for the prior the resulting profile is not matching the data.A Student's t-distribution fixes this problem, with the temperature profile being almost indistinguishable from the standard IDA.The gradient is also similar with a small smoothing at ρtor ≈ 0.8.

Figure 15 .
Figure 15.ECE residuals of the profiles shown in figure 14.The large error of the Gaussian IDA+KM profile is visible radially inward of the NTM (ρtor ⩽ 0.6).