PINN-based NLFFF Extrapolation
- The paper introduces a PINN framework for NLFFF extrapolation that leverages automatic differentiation to enforce force-free and solenoidal conditions in a continuous 3D magnetic field model.
- It employs a vector-potential formulation and adaptable loss functions that integrate observational magnetogram data with potential boundary conditions to achieve accurate coronal reconstructions.
- The method demonstrates practical benefits including memory efficiency and validated performance metrics over large domains, effectively modeling complex solar structures like filaments and flux ropes.
PINN-based NLFFF extrapolation is a class of coronal magnetic-field reconstruction methods in which a physics-informed neural network is trained to represent a three-dimensional nonlinear force-free field (NLFFF) above the solar photosphere while satisfying the force-free and solenoidal constraints that define low- coronal equilibria. In the standard NLFFF approximation, the Lorentz force vanishes, , with in normalized units or in classical notation, so that with spatially varying , and must also hold. Within this framework, PINNs provide a mesh-free continuous representation of the coronal field, enforce PDE residuals by automatic differentiation, and incorporate boundary or observational constraints such as vector magnetograms, potential side and top boundaries, and, in hybrid formulations, coronal loop geometry (Purkhart et al., 25 Aug 2025, Aschwanden, 2012).
1. Governing equations and the PINN formulation of the NLFFF problem
The mathematical core of NLFFF extrapolation is the coupled constraint
or, equivalently, together with . These relations encode the assumption that in the low-0 corona magnetic pressure greatly exceeds gas pressure, so the current density is everywhere parallel to the magnetic field. This is the same PDE structure that underlies classical NLFFF extrapolation, analytic approximations, and PINN-based formulations (Aschwanden, 2012, Purkhart et al., 25 Aug 2025).
In a direct PINN formulation, the neural representation 1 is constrained by force-free, divergence-free, and data terms. A generic loss written in the source material is
2
with
3
plus boundary and loop losses. The boundary term can use photospheric vector data,
4
and the loop term can use the misalignment angle
5
This directly generalizes earlier forward-fitting logic in which misalignment angles between modeled field directions and triangulated coronal loops are minimized (Aschwanden, 2012).
A specific vector-potential PINN realization is the NF2-based method used for the pre-eruptive reconstruction of a 500 Mm filament. There the network outputs
6
so that 7 is satisfied at the level of the continuous representation through the identity 8. In that formulation there is no explicit divergence loss term in the training, and the only PDE constraint enforced explicitly is the force-free residual
9
The normalization by 0 makes the Lorentz-force residual roughly scale-invariant with field strength, preventing strong-field regions from dominating the loss and allowing weak-field areas to contribute sensibly (Purkhart et al., 25 Aug 2025).
2. Analytical antecedents and parametric hybrids
A central antecedent for PINN-based NLFFF extrapolation is the analytic approximation developed by Aschwanden for fast forward-fitting. That construction begins with a potential-field parameterization using “buried magnetic charges” 1 below the photosphere. For a single unipolar charge,
2
and a general potential field is the linear superposition
3
Because 4 for each charge and divergence is linear, this basis is exactly divergence-free (Aschwanden, 2012).
The non-potential extension “sphericalizes” the exact uniformly twisted cylindrical flux-tube solution. Using 5 and 6, with axial symmetry and small 7, the approximate elementary NLFFF becomes
8
9
0
This solution recovers the potential field when 1, reproduces cylindrical twist geometry near the twist axis, and satisfies 2 and 3 to second order in 4 or equivalently 5. Each elementary NLFFF component is parameterized by five scalars,
6
with
7
so the overall non-potential approximation is a superposition 8 with 9 free parameters (Aschwanden, 2012).
This analytic family is directly relevant to PINNs because it can serve as a structured basis, a synthetic benchmark generator, a regularizer, or an initialization. The source material states several conceptual bridges explicitly: a network can predict the parameters 0 rather than an arbitrary field; the analytic formulas can generate synthetic magnetograms, loop sets, 1, and 2; and a PINN can learn either within this parametric family or around it as a corrective layer 3. Conceptually, the PINN generalizes forward-fitting: Aschwanden’s model is a specific parametric family inside the space of possible NLFFF solutions, whereas the neural representation is a high-dimensional function approximator with PDE or physics constraints imposed through the loss (Aschwanden, 2012).
The analytic approximation is also computationally important. For given parameters, a 3D cube of 4 or loop integrations can be computed in 51 second on typical hardware for grids of order 6, with reported figures of merit
7
and CPU times 8 s depending on complexity. This speed makes forward-fitting feasible and, by implication, makes the analytic family attractive as a prior or warm start for PINN optimization (Aschwanden, 2012).
3. Network architectures, collocation, and boundary treatment
The NF2 implementation described in the filament study is a fully-connected feed-forward network approximating 9. The inputs are 3D Cartesian coordinates 0 in the extrapolation box, and the outputs are 1, 2, and 3, later converted to 4 via curl. The network is mesh-free in the sense that no grid is stored; the learned function provides a continuous representation of 5, and thus of 6, throughout the domain. The paper itself does not enumerate all network hyperparameters, but, following Jarolim (2023, 2024), the NF2 PINN is described as using 8–10 dense layers of width 7 neurons, typically about 10 layers with 128–256 neurons, together with smooth activations suitable for automatic differentiation (Purkhart et al., 25 Aug 2025).
Automatic differentiation supplies the spatial derivatives needed for the field and the residuals. First derivatives of 8 form 9, while second derivatives are used inside 0 when evaluating the force-free loss. These derivatives are computed at randomly sampled collocation points. In the cited large-volume extrapolation, each iteration samples 8192 points from the lower boundary and lateral or top boundaries, and 16384 points randomly inside the volume. The points are re-sampled every iteration over 200000 iterations, which the paper identifies as conceptually similar to stochastic collocation in the PINN literature (Purkhart et al., 25 Aug 2025).
The boundary treatment is central. On the lower boundary, the method uses an HMI 720 s vector magnetogram in CEA coordinates, yielding 1, 2, and 3. On the lateral and upper boundaries, it uses a precomputed potential field 4. The photospheric boundary mismatch is
5
followed by uncertainty-aware clipping,
6
and
7
The side and top boundary term is
8
The total loss is
9
with 0, 1, and 2 decaying from 1000 to 1 over the first 50000 iterations. This schedule gives strong initial emphasis to fitting the observed photospheric boundary and then gradually re-balances toward satisfying the force-free constraint in the interior (Purkhart et al., 25 Aug 2025).
The large-domain application used an extrapolation box of approximately 3 Mm. The trained PINN was later sampled onto Cartesian grids at 0.72 Mm per pixel for the main analyses and 1.44 Mm per pixel for the sensitivity ensemble. The study emphasizes memory efficiency: neural-network weights require about 60× less storage than an equivalent 3D grid of 4 at 0.72 Mm resolution. This continuous representation is reported to encode a highly twisted magnetic flux rope and large-scale topology in a single network, without grid refinement or multi-block grids (Purkhart et al., 25 Aug 2025).
4. Representational choices and PINN-compatible physics models
PINN-based NLFFF extrapolation now encompasses several distinct representational strategies, each corresponding to a different way of encoding force-freeness, solenoidality, and data consistency.
| Formulation | Field representation | Physics enforcement |
|---|---|---|
| Analytic forward-fitting | Superposition of twisted buried-charge elements | Divergence-free and approximately force-free to second order by construction |
| Vector-potential PINN | Network outputs 5, with 6 | Solenoidal by identity; force-free enforced by 7 and boundary losses |
| Viscous-relaxation formulation | 8 and optionally 9 in a steady relaxation system | Induction plus viscous momentum balance; NLFFF reached as relaxed state |
The vector-potential architecture removes one of the major difficulties of NLFFF extrapolation by guaranteeing 0 analytically in the continuous model. By contrast, direct 1-output PINNs generally require an explicit divergence penalty. This distinction is particularly relevant when the solution is evaluated on a grid: the filament study reports that only a small residual 2 appears after sampling 3 on a finite grid, and finds 4 for the final model (Purkhart et al., 25 Aug 2025).
A second formulation, developed in a non-PINN context but explicitly mapped onto PINN design, is fully implicit viscous relaxation. There the target field satisfies
5
with 6, but the route to equilibrium uses
7
and
8
The source material presents this as a natural PDE system to encode in a PINN, either by treating 9 as an auxiliary output and penalizing both residuals or by eliminating 0 and directly penalizing 1 together with suitable regularization. The same source argues that this Newtonian viscous closure is preferable to a magneto-frictional closure in configurations containing null points, current sheets, or topological changes, because the latter can constrain fluid motion too strongly and can severely violate magnetic flux conservation and topology in some configurations (Liu et al., 17 Sep 2025).
These alternatives imply different inductive biases. Analytic forward-fitting is low-dimensional and strongly structured. Vector-potential PINNs are high-dimensional but architecturally solenoidal. Viscous-relaxation PINNs incorporate a dynamical route to equilibrium rather than only the final algebraic condition 2. This suggests a design space rather than a single canonical method: PINN-based NLFFF extrapolation can be purely neural, purely parametric, or hybridized through analytic baselines, PDE regularization, or correction fields (Aschwanden, 2012, Liu et al., 17 Sep 2025).
5. Validation, benchmarks, and representative scientific applications
The principal observational demonstration in the source material is the reconstruction of a large inverse S-shaped filament partially located in AR 13229 on 2023 February 24. Using a PINN-based NLFFF extrapolation applied to a pre-eruption HMI vector magnetogram, the study reconstructs a large-scale magnetic flux rope of about 500 Mm in length, consistent with the filament. Field lines seeded from the eastern footpoint form a compact, low-lying core with apex height 3 Mm and a local minimum of 4 Mm between the main flare ribbons, while field lines seeded inside the inverse J-shaped flare ribbon hook wrap around this core and form a wider envelope extending westward. The model yields total magnetic helicity 5 Mx6, free energy 7 erg, and a current-weighted angle between 8 and 9 of about 00, with 01. It also resolves an extended eastern footprint in a weak-field environment with mean unsigned photospheric 02 of about 5 G, connecting the reconstructed flux rope and strapping fields to flare-ribbon and coronal-dimming morphology (Purkhart et al., 25 Aug 2025).
That application is methodologically significant because it uses a very large Cartesian domain, includes weak-field regions at the active-region periphery, and interprets connectivity in terms of stationary flux-rope dimming and strapping-flux dimming. The extrapolated configuration explains why the eastern leg erupted more freely while the western leg remained partially confined: the eastern leg is associated with an extended footprint across weak-field plage and strapping fields anchored in weak photospheric flux on both sides of the PIL, whereas the western leg is more compact and is overarched by stronger fields more tightly anchored in the active-region core. The paper presents this as evidence that PINN-based NLFFF extrapolation can effectively model large-scale filaments extending into weak-field regions (Purkhart et al., 25 Aug 2025).
Quality assessment in PINN-based NLFFF extrapolation is not restricted to morphological agreement. The cited sources collect a set of standard metrics that are also used in non-PINN NLFFF validation. Energy-based diagnostics include
03
04
For non-solenoidal fields, the difference between 05 and 06 measures contamination of free-energy estimates by divergence. The corresponding metrics
07
should be small for a trustworthy extrapolation. Force-free and divergence norms include
08
and
09
These metrics are emphasized as central diagnostics for assessing whether an NLFFF reconstruction is physically valid, including in a PINN setting (Rudenko et al., 2020).
Benchmarking against reference solutions supplies additional targets. The fully implicit viscous-relaxation code is validated on the Low–Lou solution, the Titov–Démoulin flux rope model, and a strongly sheared arcade with a current sheet. For the Low–Lou test, reported central-volume metrics are 10, 11, 12, 13, 14, 15, and 16. For the High-HFT Titov–Démoulin case, 17, 18, 19, HFT apex error 20, flux-rope-axis apex error 21, and energy error 22. For the sheared arcade with current sheet, central-region metrics include 23, 24, 25, 26, 27, 28, and 29. These are not PINN results, but the source explicitly identifies the benchmarks and metrics as directly reusable for validating a PINN-based NLFFF solver (Liu et al., 17 Sep 2025).
6. Limitations, controversies, and methodological directions
A persistent issue in all NLFFF extrapolation, including PINN-based variants, is the incompatibility between a force-free coronal model and a generally non-force-free photospheric boundary. The optimization study on AR 11158 emphasizes that the photospheric field contains a significant force component, that gas pressure is non-negligible near the measurement layer, and that an exact solution of 30 with fully specified bottom vector field and potential side boundaries may not exist. The paper argues that optimization in the full space of possibly non-solenoidal fields therefore converges naturally to a field with finite divergence and finite Lorentz force. In that context, enforcing exact NLFFF everywhere may be overconstraining, and some residual force near the photosphere may be physically realistic rather than purely numerical error (Rudenko et al., 2020).
This point connects directly to the treatment of boundary data. Traditional optimization-class NLFFF codes often rely on preprocessing of vector magnetograms to reduce net forces and torques, whereas the cited PINN filament study does not apply explicit NLFFF preprocessing. Instead it uses uncertainty-aware clipping in the photospheric boundary loss: if 31, that pixel is effectively not penalized. The study presents this as one of the key differences from traditional NLFFF, because the network intrinsically “preprocesses” the boundary by balancing data fidelity and physics constraints through loss weights and error maps rather than through an external deterministic step (Purkhart et al., 25 Aug 2025).
Sensitivity to hyperparameters remains substantial. Appendix A of the filament study examines an ensemble of 16 extrapolations with 32 from 0.05 to 0.80. For low 33 of 0.05–0.10, the magnetic-flux-rope current channel becomes fragmented and 34 is large, about 35–36. For moderate 37 greater than 0.20, the magnetic-flux-rope current channel becomes smoother and more continuous, and 38 decreases systematically with 39 up to 0.6. The authors choose 40 as a compromise because it gives good force-free metrics, a coherent and continuous magnetic flux rope, and avoids unphysical connectivity in the southern dimming region seen for some higher 41. They further state that the qualitative interpretation—the existence of a magnetic flux rope, flux-rope-connected dimming, and strapping-field dimming—is robust across the ensemble (Purkhart et al., 25 Aug 2025).
Geometric assumptions also matter. The filament study acknowledges that a Cartesian grid becomes less adequate at large longitudes, citing that full spherical geometry becomes important beyond about 42 from disk center, although the filament of interest remains within that range. This limitation motivates one of the explicitly stated future directions: spherical PINN NLFFF. Other stated directions are multi-height boundary data, extension to photosphere plus chromosphere, data-driven or time-dependent PINNs using sequences of magnetograms, additional constraints from EUV loops, domain decomposition or multi-network PINNs for active-region core versus quiet Sun versus coronal holes, and more systematic studies of architecture depth, width, activation choices, collocation strategies, and optimization schedules (Purkhart et al., 25 Aug 2025).
The same sources also suggest two broader methodological lessons. First, divergence control is foundational for credible energy estimates: vector-potential architectures remove the need for an explicit 43 in the continuous model, while postprocessing analyses show how non-solenoidal contamination can strongly distort free-energy calculations if left unchecked. Second, topology-preserving representations are essential in strongly non-potential regimes: the viscous-relaxation study stresses the importance of reconstructing nulls, HFTs, bald patches, and current sheets, and notes that magnetic fields that may directly trigger solar eruptions can require handling discontinuities and sharp current concentrations. This suggests that PINN-based NLFFF extrapolation is best understood not as a single architecture, but as an evolving family of solenoidal, force-constrained, data-assimilative models spanning analytic priors, vector-potential neural fields, and PINN-compatible relaxation systems (Rudenko et al., 2020, Liu et al., 17 Sep 2025).