On the potential of physics-informed neural networks to solve inverse problems in tokamaks

Magnetic confinement nuclear fusion holds great promise as a source of clean and sustainable energy for the future. However, achieving net energy from fusion reactors requires a more profound understanding of the underlying physics and the development of efficient control strategies. Plasma diagnostics are vital to these efforts, but accessing local information often involves solving very ill-posed inverse problems. Regrettably, many of the current approaches for solving these problems rely on simplifying assumptions, sometimes inaccurate or not completely verified, with consequent imprecise outcomes. In order to overcome these challenges, the present study suggests employing physics-informed neural networks (PINNs) to tackle inverse problems in tokamaks. PINNs represent a type of neural network that is versatile and can offer several benefits over traditional methods, such as their capability of handling incomplete physics equations, of coping with noisy data, and of operating mesh-independently. In this work, PINNs are applied to three typical inverse problems in tokamak physics: equilibrium reconstruction, interferometer inversion, and bolometer tomography. The reconstructions are compared with measurements from other diagnostics and correlated phenomena, and the results clearly show that PINNs can be easily applied to these types of problems, delivering accurate results. Furthermore, we discuss the potential of PINNs as a powerful tool for integrated data analysis. Overall, this study demonstrates the great potential of PINNs for solving inverse problems in magnetic confinement thermonuclear fusion and highlights the benefits of using advanced machine learning techniques for the interpretation of various plasma diagnostics.

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.

Introduction
Advanced diagnostic techniques in tokamak reactors are fundamental to understand the physics, validate models, develop new ones, and advance and implement control strategies for correct execution of the discharges [1][2][3].Unfortunately, most of plasma diagnostics do not give a direct access to local internal quantities, limiting the amount and the details of information about the plasma.Many diagnostics, such as magnetic coils, measure only variables external to the hightemperature plasma.Others return line-integrated information, such as the interferometers and bolometers, which provide the line-integrated density (LID) and the line-integrated emissivity respectively [4][5][6][7].
The lack of local internal measurements implies that the nuclear fusion scientific community had to develop strategies to reconstruct the local variables by using advanced inversion techniques.For example, in order to reconstruct and analyse the magnetic configuration of tokamak plasmas, magnetic equilibrium reconstruction routines have been developed by imposing the Grad-Shafranov equation (derived from onefluid steady state toroidally symmetric ideal magnetohydrodynamic (MHD) equations) constrained with the magnetic measurements (used as boundary conditions of the partial differential equations (PDEs) and internal measurements when available [8][9][10][11][12][13][14][15].Another typical inverse problem is bolometer tomography that, combining the measurements from two or more bolometer cameras, allow reconstructing the most probable emissivity field [16][17][18].
However, such inversion techniques are usually limited by various assumptions that are required to render the inversion algorithm stable, fast, and reliable.For example, most equilibrium reconstruction codes use the one-fluid approximation, assume that the resistivity is zero, that the plasma is in a steadystate toroidally symmetric regime, while bolometer tomography usually assumes that emissivity is toroidally symmetric (this assumption is required when cameras see the plasma in different toroidal positions).Unfortunately, these hypotheses are true as first approximations at best, while if one is interested in extracting more physically meaningful information, more detailed reconstruction should be performed [18][19][20][21][22].
This work aims at showing how physics-informed neural networks (PINNs) may be used to solve inverse problems in nuclear fusion science.PINNs constitute a new branch of artificial intelligence that offers the possibility of integrating data-driven methodology and physics equations in a very efficient way.The physics equations can also be incomplete, leaving to experimental data the task of providing information on the unknown parts.They have good generalisation capability also in the opposite situation, in which there is some consolidated physics knowledge, but the measurements are scarce (a case of great interest in the next generation of devices particularly the reactor DEMO).Moreover, they do not need a mesh and can be easily applied to complex problem thanks to domain decomposition [23,24].All these features imply that PINNs have been deployed to address a huge number of problems in various fields, such as fluid dynamics [25], physics [26], engineering [27], and medicine [28].The present manuscript, as a first attempt to use PINNs to solve inverse problems in tokamaks, investigates their use in three fundamental problems: equilibrium reconstruction, interferometer inversion, and bolometer tomography.It also illustrates the potential of the technology to perform integrated data analysis (IDA).
The paper is organised as follows.The next section introduces the PINNs, with particular attention to the aspects relevant to the solution of inverse problems in tokamaks.Section 3 shows the PINNs potential to derive the magnetic topology in both 2D and 3D geometry from external measurements.The PINNs capability of solving tomographic inversion problems is addressed in section 4 for Joint European Torus (JET) bolometric diagnostic.How to perform IDA with PINNs is the subject of section 5, exemplified by the case of reconstructing the density profile with the help of interferometry and Thomson scattering on JET.Summary, discussion and lines of future developments are covered in the last section of the paper.

PINNs
PINNs, or PINNs, are new types of deep neural networks devised to solve partial differential equations through deep learning.Most physical phenomena can be described by PDE (e.g.Navier-Stokes equations for fluid dynamics) that can be solved only by numerical methods (finite volumes, finite differences, and finite elements).These methods usually rely on some prior assumptions, linearisation, and they have to deal with meshing (domain discretization), which usually limit the numerical simulation accuracy and fidelity [29][30][31].
The idea behind PINNs is based on the fact that a sufficiently deep neural network with nonlinear activation functions is a universal function approximator.Therefore, one can train the neural network to predict the physical variables that minimise the error on the physics equations and the available data.Therefore, contrary to typical supervised machine learning, PINNs are trained to find a solution that satisfy both data and physics [23][24][25].
Such an approach results in the following main advantages [23,24]: 1. Contrary to numerical simulations, which need well defined boundary conditions, neural networks can deal with problems that have sparse and incomplete data.2. When the knowledge about the physics of the problem in incomplete, numerical simulations require an iterative procedure to model specific phenomena (e.g.turbulence in fluids) that can demand a lot of computational time (without any guarantee that the found solution is the best).
On the contrary, PINNs can deal with incomplete physics, allowing a 'self-tuning' of the model parameters.Of course, such an approach is possible only by over constraining the problem (for example with additional measurements, inequalities, etc).3. Soft constraints (i.e.some constraints that may be true, but not everywhere and not every time) can be easily implemented and they can be used to close problems with incomplete physics and data.4. The method is meshless, allowing for solutions with very high-spatial resolution. 5. PINNs are easily scalable to large problems thanks to domain decomposition.
To fix the ideas, from now on the discussion will be particularised for the applications discussed in the rest of the paper.In this work, a PINN mathematical model will be indicated as f (θ, X) where θ is the vector of the parameters and X is the input vector.The data from the measurements, from here on named boundary conditions, will be indicated with Y.The training process is based on minimising a loss function L that is calculated as the sum of the physics losses L p and the boundary condition losses L b .The physics losses term L p is meant to quantify how well a solution reproduces the input mathematical equations.The boundary condition losses term L b basically consists of the goodness of fit, quantifying how well a solution approximates the available data.The losses are usually weighted by the vector α that allows adjusting the relative importance of the models and the data.
For what concern notations, from now on the variables without any subscript refer to the predicted variables while the ones with the subscript 'b' refer to the boundary conditions (measurements or a priori known information).For example, y is the predicted variable while y b is the measured quantity.
Several problems are defined by many physics equations and many boundary conditions.Therefore, the loss function of a problem described by N p physics equations and N b boundary conditions can be written as: ( Boundary condition losses are specific to the problem: they could be local measurements, line-integrated information, indirect measurements, etc.In the next sections, the application of PINNs to problems with both local boundary conditions (such as magnetic coils) and line-integrated boundary conditions (bolometer and interferometers) are exemplified.
Regarding the physics losses, let us assume a general PDE equation (a convection-diffusion equation is considered as an example): where c, v, D, and R are the variables and parameters of the equation.The neural network is asked to predict the unknowns and evaluate the derivatives (through automatic differentiation [32,33]) in M points known as collocation points.Then, the physics loss is calculated as the mean square error (MSE) of the physics equation(s) in these points: Collocation points can be different at each iteration, allowing the neural network to generalise the solution in the entire domain with a good spatial resolution.In this work, collocation points have been generated using a Sobol sequence [34,35].Collocation points are strategically generated to encompass the entire geometry of the problem.In 2D geometries, a 2D Sobol sequence is employed to generate both the R and Z coordinates, whereas in 3D geometries, a 3D Sobol sequence is utilized to also generate the toroidal angle coordinate.
The boundary loss is calculated as the MSE of the residuals, the differences between the experimental points and the predictions: where y j indicates the experimental values and y b j the PINN predictions.
Since the paper reports only applications of PINNs to tokamak problems, all the following examples are described in a cylindrical reference frame with coordinates R, ϕ, Z.All the neural network architectures presented in this work are also based on a feed-forward structure alternating fully connected layers with activation functions.The choice of the hyperparameters is a delicate aspect, which needs to be addressed on a case-by-case basis.Various approaches and solutions are discussed in the following sections particularised for the individual applications.
The neural network training (schematically represented in figure 1) is computed for K e epochs.For each epoch, K i iterations are performed.At each iteration, a mini-batch, i.e. a subset of the entire collocation points, is taken and used to evaluate the loss function.Then the gradients of the loss function are computed, and the neural network parameters (θ) are updated using the Adaptive Moment Estimation algorithm [36].The total number of collocation points (M p,total ) is computed as (M p,total = K i M p,batch ), to ensure that each iteration has a number of collocation points equal to M p,batch and that each iteration is run with a different batch.On the contrary the collocation points are the same for each epoch.
The training process is stopped when the 'Stop Condition' is fulfilled, i.e. one of the following criteria is satisfied: 1.The loss function reached a target loss function (L target ).
When this criterion is reached, the neural network is trained for other 100 epochs and then the neural network which returned the best loss is saved.For Criterion 1, the loss target is chosen case by case, while for Criterion 2 K v has been chosen equal to 100.
Criterion 3 should never be reached, since it means that the target loss has not been achieved (criterion 1) but the PINN is still improving (criterion 2).For this reason, the maximum number of epochs has been set to a large value (10 6 ).
It has to be highlighted that the stop condition hyperparameters define the quality of the reconstruction and the computational time.
For what concern the learning rate, the typical time-based learning rate update is applied, where the learning rate LR at the ith iteration is LR = (LR 0 ) / (1 + Decay ×i).In all cases, LR 0 is set to 10 −2 and decay to 10 −4 .
It is also worth mentioning that some solutions adopted in the present work, such as MSE loss, Adam optimizer, learning rate decay are very common and consolidated but alternatives exist [26][27][28].

Equilibrium reconstruction
In tokamaks the accurate measurement and control of the magnetic configuration is essential to achieve the required performances [37].This aspect has become increasingly important in the last years, due to the continuous increase of the scenarios' sophistication and several new methodologies, also based on artificial intelligence, have been developed [38][39][40][41].From the hybrid scenario to various small or free edge localised modes (ELMs) regimes, fine tuning of the fields is indispensable for both the quality and the stability of the plasmas.Unfortunately, the reconstruction of the magnetic topology is a very ill-posed inversion problem.Indeed, the internal fields have to be reconstructed on the basis of external measurements, while internal measurements are few and often not routinely available.Given the nature of the problem and the quality and quantity of the diagnostics available, in principle there is even an infinite number of solutions compatible with the measurements.To converge on physically meaningful solutions, the inversion codes rely on the Grad-Shafranov equation [42,43], which assumes that the plasma is in a steady state ideal MHD equilibrium between magnetic and kinetic pressure.Even when these assumptions are well satisfied, the deployment of the inversion algorithms is not necessarily straightforward.Indeed, the development of reliable codes implementing the reconstructions of the fields on the basis of the Grad-Shafranov equation has proved delicate, with their maintenance and update particularly time consuming.Consequently, easy alternatives, based on completely different mathematical methods are potentially quite valuable.
The section is organised as follows.Section 3.1 describes the neural network architectures developed for the equilibrium reconstructions.Then, in section 3.2 the results obtained with the PINN in some analytical cases (both 2D and 3D) are shown.Section 3.3 is devoted to some tests performed with JET measurements, comparing the PINNs-predictions with the outputs of the standard equilibrium reconstruction codes used at JET.

Equilibrium equations and network architectures
In this work, the reconstruction of the magnetic configuration is performed by assuming the ideal steady-state MHD equations: where B is the magnetic field vector, J is the plasma density current vector and p is the plasma pressure.Therefore, the problem is described by seven scalar variables (B R , B ϕ , B z , J R , J ϕ , J z , p) and seven scalar physics losses (equation ( 4)).However, instead of predicting seven different variables and ask the neural network to minimise all the physics loss functions, a smarter solution can be developed introducing some 'physics Layers' in the neural network.In this section, three different neural network architectures are presented, developed for ad hoc problems and situations.2-top).The network is trained to predict the three components of the vector potential A (A R , A phi , A z ) and pressure.Then, the first physics layer calculates the magnetic field B from the equation: Note that this automatically implies that the divergence of the predicted magnetic field is equal to zero and therefore the first of the seven physics conditions is always fulfilled.Then, a second physics layer computes the plasma density current from the magnetic field by exploiting the Ampere's law: Then, the neural network is required to satisfy the force balance vector equation and the boundary conditions.This architecture could be used also for 3D equilibria, and it allows reducing the number of variables to predict from seven to four and the number of physics losses to minimise from seven to three.
The inputs to the neural network are the cylindrical coordinates of the points (R i , ϕ i , z i ).The hidden layers are composed of 9 layers with 20 neurons each, for a total of 3544 learnable parameters.The activation functions are the hyperbolic tangent for the hidden layers, the linear function for the output layer giving the potential vector and the softplus for the pressure (this allows imposing that the pressure is non-negative).

Steady state 2D MagnetoHydroDynamics neural network.
For axial symmetric equilibria, two other architectures have been developed.The first one, the S2MHDnet (figure 2-middle), trains the neural network to predict only the toroidal component of the potential vector, the toroidal magnetic field, and the pressure.In fact, since all the derivatives with respect to the toroidal angle are equal to zero, it is possible to write: Also in this case, the divergence of the magnetic field is automatically fulfilled.Then, the plasma density current is calculated with the physics informed layer as for the S3MHDnet and the unique physics loss function is the vector force balance equation.With this architecture, the neural network has to predict only three variables instead of seven.
The inputs to the neural network are the coordinates of the points (R i , z i ).The hidden layers are made up of 9 layers with 20 neurons each, for a total of 3483 parameters.The activation functions are the hyperbolic tangent for the hidden layers, the linear function for the output layer giving the potential vector and the toroidal magnetic field and the softplus for the pressure (this allows imposing that the pressure is non-negative).

Grad-Shafranov neural network.
The last neural network GradShafrNet (figure 2-bottom) is the one that aims at solving the Grad-Shafranov equation: Here, the neural network architecture is composed of two separate hidden layer sections.The first section aims at predicting the poloidal magnetic flux ψ and the external density current J ext .The prediction of the external currents is required only when these currents are not known a priori, that is the worst case, and it is the case analysed in this example.On the other hand, if the external currents are well known, they can be used in the boundary losses to constraint the equilibrium.Then, the second hidden layer section calculates the pressure and the variable f = RB ϕ from the poloidal flux.This architecture imposes that f and p are both a function of ψ, allowing for a better constrained equilibrium.
The input of the neural network is the coordinate of the point (R, z).The first hidden section has 9 layers with 20 neurons each while the second hidden section has 3 layers with 20 neurons each, for a total of 4364 parameters.The activation functions are the hyperbolic tangent for the hidden layers, the linear function for the output layer giving the magnetic flux, external current and f, while the softplus is used for the pressure (this allows imposing that the pressure is non-negative).

Test with analytical solutions
In this section, the MHD PINNs are tested with some analytical solutions of the ideal steady state MHD equilibria.The tests performed are: 1. Solov'ev' solution (2D, steady state)-(see appendix A for additional details).2. Solov'ev solution (3D, toroidal symmetry, steady state)-(see appendix A for additional details).3. Periodic Toroidal Solution-(see appendix B for additional details).

Solov'ev' 2D case.
The first analytical case is based on the Solov'ev' solution of the Grad-Shafranov equation (2D steady state ideal MHD).A detailed description is given in [44,45] and in appendix A. Data are generated with the following equations: where Ψ is the magnetic flux, a, b, c, p 0 and R 0 are free parameters.Varying these parameters produces different equilibrium solutions and consequently different magnetic, current and pressure fields.
With regard to the geometry, in cylindrical coordinates, the radius R ranges from 1.61 m to 4.01 m while the vertical coordinate Z covers the interval from −1.62 m to 1.58 m.The boundary conditions are magnetic and pressure point sensors positioned at the edge of the volume considered.A total of 100 points are used as boundary conditions.No internal constraints are imposed.
The neural network used is the S2MHDnet.The loss function is: where M ip is the number of collocation points for each iteration, i p is index relative to the i p th collocation point, M b is the number of boundary conditions, i b is index relative to the i b th boundary condition.The collocation points for each iteration are 10 3 , with a total of 10 5 (100 iterations per epoch).
C p is a normalisation coefficient that should be used to ensure that the pressure term is comparable with the magnetic one.In the following cases, C p has been set equal to 1.
Regarding the loss weights α p and α b , several tests have been performed varying the ratio (α b /α p ) and no significant differences in terms of accuracy have been detected.However, it has been clearly observed that for balanced weights (α b /α p ∼ 1) the neural network presents faster convergence.
Figure 3 shows the expected (top row) and predicted (bottom row) pressure and the R and Z components of the where M indicates the number of points (physics or boundary) and target value indicates the values to predict (from the physics equations or the measurements).

Solov'ev 3D case.
A second analytical test has been performed employing the S3MHDnet to reconstruct a 3D equilibrium.This reconstruction was based on the Solov'ev equation, with the condition that the fields at any toroidal angle match those described in the previous section.So, the magnetic flux (from which all other fields are calculated as described in appendix A) is: Thus, the actual solution is toroidally symmetric but this a priori information is not given to the PINN.
Again, in cylindrical coordinates, the radius R ranges from 1.61 m to 4.01 m while the vertical coordinates Z covers the interval from −1.62 m to 1.58 m.The angle ϕ spans the entire toroidal range from 0 to 2π.The boundary conditions are magnetic and pressure point sensors positioned at the edge of the geometry at eight different toroidal positions equally spaced.A total of 100 points are used as boundary conditions for each poloidal section, for a total of 800 measurements.No internal constraints are used.
The neural network used is the S3MHDnet.The loss function is: Considerations similar to those of the previous section apply to the loss weights α p and α b .For this analytical case, the α weights do not play a very important role, but balanced hyper-parameters ensure a faster and a slightly more accurate solution.
Figure 4 shows the three-dimensional pressure field from the analytical solution (same as in the previous section, replicated at each toroidal angle) and the one reconstructed by the S3MHDnet.The reconstructed fields reproduce the analytical ones quite well, as it is shown in table 2 for the poloidal flux, the R and Z magnetic field components and the pressure.In this case, the relative error is about 5-7%, a bit larger with respect to the previous 2D case, and it may be explained as follows.In the 2D case, considering the number of sensors (100) and the perimeter of the boundary (11.2 m) the linear boundary density is around 10 sensors m −1 .In the three-dimensional case, the boundary is a surface and the sensor surface density is ∼4 sensors m −2 .Therefore, the average distance between two subsequent sensors in the 2D case is about 0.1 m while in the 3D case is about 0.5 m, implying that the problem is less constrained than the 2D (in addition to the fact that the system of equations is more complex).This example, even if the PINN achieves a quite good accuracy, suggests that for accurate and reliable 3D MHD equilibria, the use of a multidiagnostic constrained reconstructions may be fundamental for complex topologies of the fields.Indeed, in this example the boundary values for the loss are derived from the analytical solution whereas in real life they will be provided by experimental measurements, each with its error bars and uncertainties.Depending on the relative accuracy of the diagnostics used, a different choice of the αs may become important.This   is also the reason why, for experimental cases, a Zscore like loss has been used (see next sections).

Toroidally asymmetric equilibrium.
In this subsection, a simple toroidal asymmetric solution is used to test the S3MHD capability of reconstructing asymmetric equilibria.The completed model is derived in appendix B. The magnetic field along Z and the pressure vary as: where b, n and p 0 are three free parameters.
In cylindrical coordinates, the plasma volume has a radius R ranging from 1 m to 3 m while the vertical coordinates Z covers the interval from −1 m to 1 m.The toroidal angle ϕ spans the entire torus from 0 to 2π.The boundary conditions are magnetic and pressure point sensors located at the edge of the volume at 16 different toroidal positions equally spaced.A total of 84 points are used as boundary conditions equally spaced for each poloidal section, for a total of 1344 measurements.No internal constraints are imposed.
The neural network implemented is the S3MHDnet.The loss function is the same of the previous case (equation (13)).
In the analysis, b and p 0 are fixed at b = 1 and p 0 = 20 × 10 5 , while n is the toroidal number and is varied from 1 to 4. Note that the pressure periodicity is twice the magnetic one, and therefore presents a toroidal number ranging from 2 to 8. Of course, given the limited toroidal resolution of the 16 boundary conditions, the reconstructions present a decreasing accuracy for higher toroidal numbers.It is an obvious fact that higher toroidal numbers need a higher toroidal resolution of the measurements (coils, etc) to be properly reconstructed.
Figure 5 shows the comparison between the expected and the predicted magnetic field component along Z and the pressure profile (maps are plotted for Z = 0) for different toroidal numbers (n = 1, 2 and 4).The performances are quantified in table 3. From the reported results, it can be observed that for small toroidal numbers (compared with the toroidal resolution of the boundaries, that is 16) the reconstruction error is almost zero.On the contrary, when the toroidal number increases (n = 4), performances slightly decrease (even if reconstruction error is comparable with the target loss).A case with n = 8 has  been tested and the performances dropped as it was expected (remember that for n = 8, the pressure periodicity is 16, the same of the boundary constraints in this example).

Test with JET measurements
The JET is the largest operating tokamak in the world, with geometrical major and minor radii of 2.96 m and 1 m respectively.Given the variety of experiments and scenarios run on JET, the accurate reconstruction of the magnetic topology is a very important issue.On the other hand, various factors, from the dimensions of the device to the harsh environment, complicate this task on JET [46].A suite of codes, called EFIT, was developed over the years to perform this task [47][48][49][50].In the following, the PINN technology is applied to the problem of the equilibrium reconstruction using the same diagnostics as EFIT.section 3.3.1 describes the topology of the problems, the diagnostics and the PINN architecture.The results are reported in the next section 3.3.2.

Geometry, diagnostics and PINN configuration.
Contrary to the previous analytical cases, where all the entire domain is occupied by the plasma, in this problem both plasma and wall regions should be correctly taken into account in the loss functions.The reason why it is crucial to consider the wall is that the magnetic coils (whose measurements are the boundary conditions) are located outside it.The major radius coordinate ranges from 1.5 m to 4.5 m while the vertical coordinate goes from −2.5 m to 2.5 m. Figure 6 shows the entire domain, in which magnetic field, current density field and pressure field are reconstructed.The plasma region is delimited by the walls (the black curve in the figure).
In this work, the same boundary conditions used by the equilibrium reconstruction algorithm deployed on JET (EFIT) [51] have been implemented.On JET, different methodologies have been developed to reconstruct the fields.In this work, the 'magnetic only' EFIT configuration is employed.Three different types of magnetic sensors are included: Pick-up coils (CP) (represented by blue circles in the figure), which measure the poloidal magnetic field along a specific direction (given by the coil angle θ CP ).The first boundary loss function is then calculated as the predicted magnetic field along the i CP th coil direction axis, B R ( , vs the measured one, B b i b,CP .Moreover, since the measurements are affected by uncertainties, σ b i b,CP , the MSE is normalised to the uncertainty variance: Flux loops (CF) (represented by the green squares in figure 5), large coils that cover the whole toroidal angle and measure the poloidal flux at the coil radius.The second boundary loss function is then calculated as the predicted poloidal flux, ψ , against the measured one, ψ b i b,CF , normalised by the measurement uncertainty, σ b i b,CF , Saddle coils (CS) (represented by the red lines in the figure, while the red dots indicate the start and the end of the saddle coil), large coils positioned at different angles to measure the flux in specific directions.In the steady state toroidal symmetric case, it can be demonstrated that the saddle coils measure the poloidal flux difference between the saddle coil coordinates, , in the poloidal section: Consequently, the loss function associated to the saddle coils is: A fourth boundary loss function regards the wall, which forces the plasma pressure to zero: where σ p,wall in this case is not the uncertainty but a normalisation factor (chosen to be equal to 10 Pa).
For what concern the physics losses, we have to distinguish the regions inside and outside the wall.Inside the wall, where there is plasma, the loss can be written as: While for the region outside the wall, the same approach presented in [52] has been adopted: Another 'soft' loss is used to force the neural network to minimise the external currents (external currents should be present only in specific regions of the wall where shaping coils are used).
where σ Jext has been set equal to 100 A. Some clarifications are needed concerning the external currents.In general, the geometries (coils) and intensities of the important external currents are well known.Therefore, any reconstruction of the equilibrium should model and constrain the external currents so that the best possible map of the fields can be obtained.
In this work, this part of the modelling has not been implemented, and the PINN is just asked to reconstruct an equivalent external current distribution that is coherent with both the boundary conditions and the physical equations.This just make the problem harder to solve and convergence to a good solution more challenging.The final loss is: For this experimental case, an ad hoc adaptive α has been implemented.Indeed, it has been noticed that requiring the neural network to minimise the pressure on the wall and the external current outside the wall from the beginning of the training causes several troubles in the training process.In particular, the network tends to be stuck in local minima for long times, rendering the convergence very long.So, an in-training update of α has been adopted with the following logic.If the loss for the boundary conditions (measurements) are large, α is small so that the PINN is free to adapt to the measurements.When the measurements are well replicated, α increases so that the PINN refines the field to minimise the pressure on the wall and the external currents.The α adaptive function is: Note that when the measurement error is comparable with the measurement uncertainty ) the α is equal to the weight of the other losses (α ∼ 1).

Results.
In this section, the comparison between the equilibrium reconstructed from EFIT and the two PINNs (S2MHDnet and GradShafrNet) is reported.The neural networks have been trained using 5 × 10 5 collocation points with 5 × 10 3 per iteration (100 iterations per epoch).The training algorithms and other parameters are described in section 2. The results are calculated for pulse 94 217 at the time t = 9 s.The discharge is an ITER Baseline scenario shot in deuterium.The steady-state flat top plasma current is 2.5 MA, the toroidal magnetic field is 2.4 T, the LID (channel 3) is 15.3 m −2 and the input power is 17 MW from NBI e 2.7 MW from ICRH.
First, figure 7 shows the comparison between the measured and the predicted values from the pick-up coils, saddle coils and flux loops.Measurements and predictions are in very good agreement.This fact demonstrates that the neural network is able to find a solution that fits both the physics equations and the boundary conditions.
The capability of the PINNs to reconstruct the equilibrium is evaluated by comparing the reconstructed poloidal flux with the output of EFIT. Figure 8 shows in blue the flux surfaces from EFIT while in red the surfaces from S2MHDnet (top) and GradShafrNet (bottom).The thicker line represents the Ψ = 1 Magnetic Surface.Looking at the images, one can note that the magnetic surfaces are almost overlapping.The largest difference is observed in the core, and this is to be expected for two reasons: 1.No internal constraints are included, and this limits the accuracy in the core region, since small errors tend to propagate toward the centre and be amplified.2. Since no internal constraints have been implemented, the core is strongly determined by the pressure profile.In the case of EFIT, it is assumed that the pressure is a low order polynomial function of the flux, while the neural network has much higher flexibility.
On the contrary, the last closed surfaces and the X-point are very similar, and the differences are probably due to the stop conditions of the two algorithms and how they weight the different loss functions.Table 4 quantifies the differences between EFIT and PINNs and it can be observed that the average difference is always below 5%.

Bolometer tomography
In tokamaks the measurement of the total emitted radiation is performed with detectors called bolometers [53].These sensors are located outside the plasma and therefore their output are line integrals of the emission along their corresponding lines of sight.To obtain the local emissivity therefore quite sophisticated tomographic algorithms are required [17].Again, given the emission patterns and the topology of the diagnostics, these inversion problems are mathematically very ill-posed.The convergence on physically acceptable solutions requires the implementation of regularization terms and nonnegativity conditions.The magnetic topology must also be known in advance, to allow implementing different smoothing of the solutions along and perpendicularly to the magnetic surfaces.Consequently, the devised tomographic algorithms are quite delicate to fine tune: they have problems providing reasonable estimates of the uncertainties in the reconstructions, are prone to produce artefacts and the computational times are typically significant.A numerically completely alternative approach is therefore useful in many respects [21,54,55].
This section is organised as follows.First the main features of JET bolometric diagnostics are described (section 4.1).Then the architecture of the PINNs and their loss functions are described in quite detail in section 4.2.The last subsection reports the results obtained for the most typical radiation patterns encountered on JET.

Geometry and diagnostic
The geometry considered for the bolometer tomography includes only the region inside the wall (the external emissivity is exactly zero and no information is required for the wall).JET is equipped with two main bolometer cameras that measure the line-integrated emissivity: the vertical camera (KB5V) and the horizontal camera (KB5H).Both KB5V and KB5H have 24 bolometer channels.The two cameras are in two different octants (KB5V is located on top of octant 3, while KB5H in the equatorial plane of octant 6).Therefore, tomographic inversions typically assume that the emissivity is toroidally symmetric.A schematic of the two cameras lines of sight is shown in figure 9.

Network architecture, losses, and training options
In the case of bolometer tomography, the neural network architecture is a standard feed-forward neural network with nine layers and 20 neurons each, two input coordinates (R, Z) and one output, the emissivity (ε).All the activation functions are hyperbolic tangent for the hidden layers and a softplus layer for the output (to ensure that the emissivity is non-negative).
In figure 10 a schematic view of the PINN architecture for the bolometer tomography is reported.
As usual the loss function is made up of two terms, one physics loss and one boundary loss.
The boundary loss function is calculated as the MSE between measured (g b ) and reconstructed (g) powers (projections) divided by the squared standard deviation (σ ch ) of each bolometer channel: Here, the measured power g b and the standard deviation σ are expressed in W (conversion from W m −2 to W have been done through the channel etendues).They are calculated as the averages and standard deviation of the measurements over an interval of ∓200 ms.The reconstructed power is calculated as: where N p is the total number of pixels, ∆V n is the volume of the pixel, and H ch,n is the projection matrix, which represent the probability that a photon in the pixel n is detect in the channel ch.Therefore, for the calculation of the reconstructed bolometer signals, a structured grid is used, with a spatial resolution of 0.04 m.
For what concerns the physics loss, a physics-based regularisation term is used by assuming that emissivity should be 'smooth'.In magnetized plasmas, especially in steadystate conditions, it is expected that the plasma variables vary smoothly, and the degree of smoothness is assumed to be different in the directions parallel and orthogonal to the gradient of the magnetic flux.More specifically, most plasma variable gradients are expected to be zero along the directions with the same poloidal magnetic flux, such that in several situations it is allowed to assume that iso-magnetic flux surfaces are isodensity and iso-temperature [37,56,57].
Therefore, in order to implement these physical constraints, two loss functions are added, one for the gradients along the iso-magnetic surfaces and one along the gradient of the magnetic flux.
Let us call Ψ (R, z) the normalized poloidal magnetic flux, such that Ψ is equal to zero on the magnetic axis and Ψ is equal to one at the plasma separatrix.We can calculate the gradient of the output variable ε along the magnetic surfaces ∇ ∥ ε and along the gradient of the magnetic flux ∇ ⊥ ε as: where p Ψ and n Ψ are the direction parallel and orthogonal to the magnetic flux gradient.Therefore, the physics loss function can be written as: where C ∥ and C ⊥ are two hyper-parameters that have two roles.First, they are used to render dimensionless the physics loss function, and second, they define how important the parallel term is with respect to the orthogonal one.Since the two hyper-parameters have to render dimensionless the derivative of the output ε, one can write the two factors as a reference output (reference emissivity) divided by a characteristic length: where R 0 is the geometrical major radius and a is the geometrical minor radius.It has to be noted that the parallel regularisation has a weight that is much larger than the orthogonal one (the ratio C ∥ /C ⊥ is 2π R 0 /a that is around 18.6 for JET, that means a loss weight ratio of around 345).This is in full harmony with the physical understanding of the problem since in tokamaks strong orthogonal gradients are common, while parallel gradients are usually less pronounced.The magnetic flux unit vectors (p Ψ and n Ψ ) are calculated from the equilibrium reconstructions (see section 3).Regarding the 'grid' (collocation points) where the physics loss is computed, the  Sobol sequence is used.The number of collocation points has been set equal to 10 5 with 10 3 for each iteration (100 iterations per epoch).
Then, the loss function is: For the bolometer tomography, it has been observed that α = 0.1 is a good choice.However, some adaptive α update is under investigation.

Results
In this section, results relative to JET bolometric tomography are reported.In the case of the plasma total emissivity, different patterns can be observed as function of the plasma characteristics and impurity content.In figure 11, the PINN emissivity reconstructions for four typical radiation patterns are shown, together with a comparison of the reconstructed projections with the measured line-integrals of the horizontal and vertical cameras.To provide an independent validation, the reconstructions of the most sophisticated tomographic technique deployed on JET, based on the maximum likelihood (ML) approach, are also reported [16][17][18][19].The ML method has been chosen not only for its accuracy but also because one of its main characteristics is the capability of providing a statistically sound estimate of the confidence interval for each pixel [21,22].As can be derived from the tomograms reported and the discussion in the following, the reconstructions obtained with the PINN are of more than satisfactory quality.The main differences are mostly due to the fact that ML does not weigh the measurements as a function of their uncertainties (but measurements uncertainties are used to estimate the reconstruction confidence interval).Besides the comparison with the ML reconstructions, we provide also a short description of each pulse with an explanation of the radiation pattern shown.
The first row of figure 11 shows the tomogram of pulse 96 950 at t = 8.15 s.The emissivity pattern is the crescent shape radiative blob observed in the outer midplane of several JET discharges and predicted by the combination of turbulent and neoclassical transport [58,59].A high-radiative region is also observed in the divertor.The reconstructed channels replicate well the measurements, with an average RMSE equal to 3.4 × 10 4 W m −2 , a relative error of 3.5% and a L b = 0.28.
The second row is an example of a typical radiative pattern concentrated in the divertor for pulse 94 458 at t = 11.05s.Also in this case, reconstructed and measured bolometric channels almost overlap, with an average error of 1.4 × 10 4 W m −2 , a relative error of 0.4% and a L b = 0.015.It has to be noted that the standard deviations of the measured channels are quite large for most of the channels looking at the divertor, because of the presence of ELMs, which are rapid and frequent events observed in H-mode plasmas that cause relevant radiative bursts.Ideally, to achieve a good emissivity reconstruction in these situations, one should narrow the time window during which the measurements are averaged.Unfortunately, since on JET the vertical and horizontal camera are placed in different toroidal positions of the tokamaks, when the time resolution is reduced, toroidal asymmetries due to ELMs become more important and therefore the reconstruction is prone to generate artefacts in the reconstructed emissivity.
The third row shows pulse #94869 at t = 9.9 s, where an anomalous core radiation pattern is observed.On JET, sometimes heavy impurities accumulate in the central region of the plasma, with a clear increase of the core radiation that usually leads to a hollowing of the electron temperature profile.This is exactly what it is observed in this pulse by the high-resolution Thomson scattering (HRTS), confirming that the reconstructed core radiation is not an artefact.The average reconstruction error is 3.5 × 10 4 W m −2 , a relative error of 2.25% and a L b = 0.17.
The last row reports the tomogram for pulse #99763 at t = 19 s.In this case, a multifaceted asymmetric radiation from the edge (MARFE) event is observed during the ramp down of the plasma current.MARFEs are anomalous toroidal symmetric radiative events that can lead to plasma disruptions.MARFEs develop from the divertor region and move up and down the inner wall on the high-field side [60][61][62][63].For this emission pattern, the reconstruction error is 3.5 × 10 3 W m −2 , the relative error is 8% and the L b is 0.038.Also in this example, the standard deviations of the measurements are quite large due to the high frequency variations of the emission (due to both the fast movements of the MARFE and the fact that the plasma is in the ramp-down phase of the plasma current).However, it is worth pointing out that in all the cases analysed the reconstructed projections are within the error bars of the bolometric measurements.

IDA: reconstructing the density profile
In tokamaks, the density is typically measured at high time resolution by interferometry, which provides lines integrals.Spatially resolved information is typically derived from Thomson scattering but at lower time resolution.After describing the main aspects of these diagnostics on JET (section 5.1), the main aspects of the PINN developed for the determination of the density profile are covered in section 5.2.
The results obtained using the measurements of the interferometer only are described in section 5.3, which illustrates the PINN potential to deal with sparse data.An example of the PINNs application to IDA, is the subject of section 5.4, in which interferometric, High Resolution and LIDAR Thomson scattering systems are combined to obtain a unique density profile.Moreover, for this second case, combining the measurements of three diagnostics, a special neural network architecture and training process have been implemented, which allow estimating not only the local density but also the uncertainties correlated with the reconstructions.

Diagnostics
The JET far-infrared interferometer/polarimeter is composed of eight lines of sight, four verticals and four laterals.A schematic view of the eight lines of sight is shown in figure 12 (left).The interferometer is based on a 200 mW dicyanonaphthalene (DCN) lasers operating at 195 µm [64].The interferometer measures the LID, defined as: where l is the length of the line of sight crossing the plasma and N e is the local electron density.
The local measurement of electron density can be achieved through the Thomson scattering effect [65].At JET, there are two reliable diagnostics that exploit this physical mechanism, shown in figure 12 (right): the (Core) lidar and the HRTS.The Lidar is a back-scattering Thomson scattering diagnostics that relies on the time-of-flight methodology to measure the density at distinct positions.The laser of the diagnostic has a repetition rate of 4 Hz and a spatial resolution around 12 cm [66].The HRTS is a 90 • Thomson scattering system.It can measure the temperature in 63 acquisition points (per time slice) with a repetition rate of 20 Hz.The spatial resolution ranges from 1.6 cm in the core to 1 cm in the pedestal region [67,68].

Network architecture, losses, and training options
Two different PINNs have been developed for the density reconstruction.
The first PINN, that will be named 'TOMOnet' is the same reported in figure 10 of section 4 and it also reported in figure 13.The only difference is that the output is the density (N e ) and not the emissivity (ε).The neural network architecture is a standard feed-forward neural network with nine layers and 20 neurons each, two input coordinates (R, Z) and one output, the density (N e ).All the activation functions are the hyperbolic tangent for the hidden layers and the softplus for the output layer (to ensure that the density is non-negative).
The second PINN, maximum-likelihood TOMOgraphy net (MLTOMOnet), has the same architecture of TOMOnet, with the only difference that the output layer now predicts a second variable that represents the electron density uncertainty (σ Ne ).For both PINNs, 2 × 10 5 collocations points have been deployed, 2 × 10 3 for each iteration (100 iterations per epoch).

Losses for TOMOnet.
The losses for TOMOnet, which is applied to the electron density reconstruction using only the interferometer channels, are very similar to the ones used for the emissivity reconstruction from bolometry.
The loss related to the measurements is calculated as the difference between the predicted LID and the measured one.The measurement from the interferometer (LID m,ch ) for each channel (ch) is given as the line integral of the electron density along the line of sight and therefore the unit measure is m −2 .The predicted line-integrated densities (LID p,ch ) are calculated from the local electron density (N e ) by computing the discrete line-integral along the line of sight of each interferometer channel: Where l ch is the line of sight of the chth channel, l ch,i is the ith position of the chth channel line of sight and ∆l is the step size used for the numerical integration.The measurement loss is calculated as the MSE divided by the square uncertainty of the measurement of each channel (σ 2 ch ): Moreover, for the case of the electron density reconstruction, another loss has been added to impose the electron density goes to zero near the wall: [N e (R wall,i , Z wall,i )] 2 (35) where, N e,0 is a reference density (calculated as the average density measured by the eight channels).Therefore, the measurement loss for the electron density reconstruction is calculated as: The physics loss is the same described in section 4, but particularised for the electron density mean and uncertainty: where: Then, the overall loss function is: 5.2.2.Losses for MLTOMOnet.In all the experimental previous cases (equilibrium, emissivity, and density reconstruction), the measurement uncertainties have been used to normalise the boundary loss and to have a statistical estimate of the discrepancies between measurements and predictions.These uncertainties can be evaluated in different ways.For example, they can be provided by the data sheets of the instruments, by experimental assessment of the noise or they can be calculated as the standard deviation of the statistical fluctuations in a suitable time window.However, while the uncertainty of the measurements can be calculated, the uncertainties of the predicted field are more difficult to quantify.In this section, an approach to estimate the uncertainties of the reconstructed variables using the MLTOMOnet is described.
Let us consider a time window [t 1 t 2 ] in which the reconstruction must be performed.In this time window, the interferometer has measured M t values of the LID LID b (where the number of points is given by ∆t = t 2 − t 1 multiplied by the sample rate of the interferometer).The objective consists of calculating the average electron density (N e ) profile that returns the LID in this time window.Assuming that the uncertainties are normally distributed, it is possible to write that the probability that the kth measured LID b ch,k from channel ch belongs to the reconstructed LID ch (N e ) with the uncertainty σ LID,ch (σ Ne ) is: Then, the probability of all measurements from all channels (likelihood) is: Identifying the profile that maximises the log-likelihood is equivalent to minimising the following loss: where: With similar considerations, one can find the ML loss also for the local electron density measurements (lidar and HRTS): The physics loss for density is the same of the previous case, however also a 'physics' (regularisation) loss is used for the predicted uncertainty: And then: In this case, an adaptive α update scheme has been developed to ensure that the PINN find a smooth solution that ensures a good reconstruction of measurements: (48)

Results: density profiles from interferometer only
The interferometer tomography is tested for the ITER Baseline scenario pulse 94 217 (the same used for the equilibrium reconstruction in section 3). Figure 14 shows the time evolution of the plasma current (top) and the LID along channel 3 (LID3, bottom plot).The red big points indicate the six time slices where the PINN reconstruction has been run (t = 6 s, 7 s, 8 s, 9 s, 10 s, 11 s).Each reconstruction has been performed by averaging the LID measurements in a time window of 100 ms and with the hyper-parameter α equal to 1.
The tomogram for each time slice is shown in figure 15.In each tomogram, in addition to the reconstructed density field (represented by the colour scale), some specific poloidal magnetic surfaces (dashed lines in red) and the last closed magnetic surface (solid line in red) are reported.In addition, the eight lines of sight of the interferometer are shown as black dashed lines.Figure 16 illustrates the comparison between the measured and reconstructed line-integrated densities.The plots clearly show that the eight lines of sight are reconstructed with a very high accuracy (the worst L LID obtained in these reconstructions is 4 × 10 −3 , which means that, on average, the discrepancy between the reconstructed and the measured LID is around 0.06 σ, where σ is the standard deviation of the measurements).
However, the comparison between reconstructed and measured LIDs is not the most reliable approach to evaluate the reconstruction of the electron density, since the LID measurements have been used as constraint.A better validation approach consists of comparing the reconstruction quantities with one independent diagnostic (i.e. a diagnostic that has not been used as constraint).Figure 17 reports a comparison of the HRTS measurements with the reconstructed electron densities (evaluated at the same position as the HRTS points).The agreement between reconstructed and measured electron densities is quite good.In the worst time slice (t = 10 s), the average error is 0.047 × 10 20 m −3 while the relative error is 15.4%.If the uncertainties of the HRTS are considered, the reconstructed electron density is always contained inside two standard deviations.Moreover, it is worth highlighting that, for this pulse, the LID calculated from the HRTS (a routine developed at JET, which assumes that magnetic surfaces are iso-densities) overestimates by a similar factor the (1.05/1.1) the interferometer LID, suggesting that the error is in the measurements and not in the inversion.
As a comment on these quantitative comparisons, it may be important to note that, despite the small number of lines of sight, the electron density reconstruction seems to resolve acceptably well the pedestal region (in this part, reconstructed and HRTS measured electron densities perfectly overlap).Moreover, off-normal" profiles, such as the hollow electron density profile (t = 8 s), are also well reconstructed.

Results with multi-diagnostics and ML
In this section, the electron density profile reconstructed by combining interferometer, HRTS and LIDAR is shown.Moreover, in this example the estimation of the uncertainty using the MLTOMOnet is presented.Figure 18 (top-left) shows the reconstructed electron density field, while figure 18 (top-right) reports the uncertainty field.The uncertainties are to be interpreted as the standard deviation of the PINN reconstructions (with which the confidence interval can be calculated as 1.96 the standard deviation).
Figure 18 (bottom-row) reports the comparisons between the measurements and the reconstructions of interferometer (left), HRTS (middle) and LIDAR (right).The PINN using the multi-diagnostic constraint allows reconstructing an electron density profile that correctly reproduces the interferometers, HRTS, and LIDAR.In this case, since HRTS and Lidar are used for constraining the tomography, they are not independent validation measurements.However, this is the most reliable reconstruction that can be achieved since it combines the measurements of all the available diagnostics and, thanks to the evaluation of the uncertainties, provides clear information about the reliability of the reconstructed field.
Given the fact that the computational times of the PINNs are high but not incompatible with intershot analysis in the next generation of devices, their potential to complement Bayesian statistical approaches to uncertainty estimation should be carefully investigated.Indeed, they are also easy to implement and, relying on physical equations and not on statistical priors, can present various advantages in many situations.

Discussion, conclusions and future developments
In this study, PINNs have been developed to address the challenging task of solving inverse problems in tokamak research.Specifically, PINNs have been applied to the problem of reconstructing the ideal MHD equilibria of thermonuclear plasmas in both 2D and 3D configurations, achieving accurate results.Furthermore, the approach has been extended to the analysis of two additional inverse problems: emissivity reconstruction from bolometer data and electron density reconstruction from interferometer measurements.Through the application of the proposed methodology, these important plasma parameters have been accurately reconstructed.
One crucial aspect of this line of research is the development of ad hoc neural network architectures with physics layers, which can improve the accuracy, reliability, and feasibility of the solutions to the inversion problems.This incorporation of physics into the neural network framework is a fundamental characteristic of the PINNs.
The PINN architecture for emissivity and electron density tomography, called TOMOnet, has proved its effectiveness in solving inverse problems with high accuracy, even when confronted with limited data availability, as demonstrated in the case of the interferometer measurements.This emphasises the robustness and versatility of the PINNs in handling real-world scenarios.
To further enhance the capabilities of TOMOnet, an upgraded version called MLTOMOnet has been developed, which not only reconstructs the variables of interest but also estimates their uncertainties by applying a ML methodology.This improvement is particularly valuable as it provides a comprehensive understanding of the reconstructed parameters, aiding in the decision-making and increasing confidence in the obtained results.
We subsequently implemented MLTOMOnet to solve a multi-diagnostic reconstruction problem, enabling the generation of a combined electron density field that satisfies all the imposed constraints.This achievement is pivotal for future applications of PINNs in the field of nuclear fusion, as it demonstrates their potential to tackle more complex problems and deliver holistic solutions.Given the ease and transparency of their implementation, PINNs have therefore to be considered a very serious complement to Bayesian statistics for uncertainty estimation and IDA.
It has to be emphasised that all the results reported in this paper can be improved by requiring the PINNs to converge on lower loss functions.Indeed, typically, the loss function target has been set to 10 −4 , which coincides with a relative error between 1% and 5%.More stringent requirements could be easily satisfied.
Computational times are quite high and may strongly vary as a function of the problem and PINN complexity.The most demanding PINN is the S3MHDnet, with an average computational time of 6 h.Equilibrium reconstruction computational times are reduced when S2MHDnet and GradShafrNet are used (average time is ∼2 h and ∼1 h 30 m respectively).TOMOnet and MLTOMOnet have computational times ranging from 20 min to 2 h depending on the case and neural network initialisation.These computational times cannot be shortened significantly without paying a significant price in terms of performance.Indeed the complexity of the PINNs presented are typically the minimum required to achieve the reported quality of the outputs.Consequently, there is no much to be gained by acting on the PINNs' architecture.However it has to be highlighted that all the results obtained in this work have been conducted by initialising the net from scratch without any prior information (random choice of the weights), which is the worst case.In real life applications, pre-trained neural networks aimed at solving similar problems can reach convergence in much sorter times.In any case, these computational times make impracticable the use of PINN for real-time purposes.These PINNs must be considered as very flexible and accurate reconstruction algorithms to be used for postpulse processing.
The results obtained in this work prove that PINNs are susceptible of several possible future developments of great interest in tokamak research: Multi-diagnostic integrated reconstruction.Most of equilibrium reconstruction codes work with a limited number of diagnostics.An interesting alternative may be the development of PINN architectures, losses and training methodologies that allow for a multi-diagnostic (both magnetic and kinetic) constrained equilibrium so that the accuracy of the final reconstructions is enhanced.Given the difficulty of developing, maintaining and improving traditional equilibrium codes, the PINN alternative seems quite attractive.Application to more complex 3D configurations, such as the stellarator or unstable configurations (e.g.magnetic islands), looks particularly promising.
Reconstruction in presence of incomplete physics.In many cases, some parameters are hard to evaluate or compute (e.g.transport coefficients).By combining physics and data driven approaches, it may be possible to reconstruct plasma parameters by training the PINN to estimate the missing pieces of information.
PINNs and numerical simulations.In recent years, machine learning aided numerical simulations have revolutionized the field of scientific research and engineering.By harnessing the power of advanced algorithms and vast amounts of data, machine learning techniques enable scientists to accurately predict and simulate complex phenomena that were once challenging or even impossible to model.These simulations provide valuable insights into the behaviour of physical systems, allowing to optimize designs, make informed decisions, and improve overall efficiency.PINNs may be integrated into numerical simulation codes to improve accuracy and speed of numerical simulations.
Real-time architectures.Standard PINNs architectures and methodologies have been developed so that the training process is problem specific: a new reconstruction requires a new training and therefore incompatible computational time for real-time applications.However, various investigations are currently underway to develop a novel architecture and methodology that strikes a balance between accuracy and speed.This pursuit aims to create trained PINNs that can be effectively deployed in real-time applications.By finding a suitable trade-off, the power of PINNs could be harnessed to swiftly deliver reliable results without compromising precision, opening up exciting possibilities for real-time simulators and decision-making processes.

Figure 1 .
Figure 1.A schematics of PINN training logic.

Figure 2 .
Figure 2. Neural network architectures developed for the plasma equilibrium reconstruction.

Figure 5 .
Figure 5.Comparison between expected and predicted magnetic field and pressure for the simple asymmetric toroidal solution with n = 1, 2 and 4. The plots on the left are a view of the torus from the top.In the plots of the right column, the red lines indicate the exact prediction, the perfect agreement between the PINN output and the analytic solution.

Figure 6 .
Figure 6.Geometry and magnetic coils positions used for JET equilibrium reconstruction using a PINN.

Figure 7 .
Figure 7. Measured magnetic fields and fluxes measured by the coils vs predicted values using GradShafrNet for pulse 94 217 at t = 9.0 s.

Figure 10 .
Figure 10.Network architecture for the bolometer tomography.

Figure 11 .
Figure 11.Each row shows the reconstructed emissivity using the maximum likelihood (left column), the PINN (central column) and the comparison between measured and PINN reconstructed line integrals (right column).The dashed red lines in the PINN reconstructions are some poloidal magnetic flux surfaces, while the continuum line is the last closed magnetic surface.

Figure 12 .
Figure 12.Left: Lines of sight of the JET Far Infrared interferometer/polarimeter.Right: Laser path of the HRTS (in red) and Lidar (green).

Figure 14 .
Figure 14.Plasma current (top) and core line-integrated density (LID3, bottom) for plasma discharge 94 217.The six red dots indicate the six time slices, at which the interferometer reconstructions have been performed.

Figure 15 .
Figure 15.Electron density reconstruction using PINN TOMOnet for six time slices (pulse 94 217).The dashed red lines are some poloidal magnetic fluxes, while the continuum line is the last closed magnetic surface.Black dashed lines indicate the eight lines of sight of the interferometer.

Figure 16 .
Figure 16.Measured vs reconstructed interferometer lines of sight for the six time slices.

Figure 17 .
Figure 17.Measured electron density by the HRTS (blue) and electron density reconstructed by the PINN in the same positions.

Table 1 .
Reconstruction performances of S2MHDnet PINN for the Solov'ev analytical equilibrium using a = 7/3 c, b = −0.091,c=0.158, R 0 = 2.96 and p 0 = 32 060.R 0 = 2.96 and p 0 = 32 060.Table1reports: the standard deviation of the analytical fields, the root mean squared error (RMSE) of the difference between the PINN reconstruction and the analytical solution, the relative prediction error, and the coefficient of determination R 2 .From the table, it is possible to notice that the average relative error is always below 5%, with R 2 larger than the 99%.Here and in the examples shown in the rest of the paper the relative error is defined as magnetic field for a case with a = 7/3 c, b = −0.091,c = 0.158,

Table 3 .
Reconstruction performances of S3MHDnet PINN for the asymmetric toroidal solution at different toroidal numbers n.

Table 4 .
Difference between the PINNs and EFIT reconstructions.The row ψ N is calculated as the RMSE of the normalise flux maps.Last Closed Magnetic Surface (LCMS) ∆R and ∆Z are calculated as the position difference between the separatrix location output of the two algorithms.