# Magnetic cage and rope as the key for solar eruptions

Tahar Amari, Aurélien Canou, Jean-Jacques Aly, Francois Delyon, Frédéric Alauzet

► To cite this version:

Tahar Amari, Aurélien Canou, Jean-Jacques Aly, Francois Delyon, Frédéric Alauzet. Magnetic cage and rope as the key for solar eruptions. Nature, 2018, 554 (7691), pp.211 - 215. 10.1038/nature24671. cea-01872913

HAL Id: cea-01872913

https://cea.hal.science/cea-01872913v1

Submitted on 2 Oct 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Magnetic cage and rope as the key for solar eruptions

Tahar Amari<fnref n="1" />, Aurélien Canou², Jean-Jacques Aly<fnref n="3" />, Francois Delyon⁴ & Frédéric Alauzet⁵

Solar flares are spectacular coronal events that release large amounts of energy. They are classified as either eruptive or confined<fnref n="1" />,², depending on whether they are associated with a coronal mass ejection. Two types of model have been developed to identify the mechanism that triggers confined flares, although it has hitherto not been possible to decide between them because the magnetic field at the origin of the flares could not be determined with the required accuracy<fnref n="3" />⁻⁸. In the first type of model, the triggering is related to the topological complexity of the flaring structure, which implies the presence of magnetically singular surfaces⁹⁻¹¹. This picture is observationally supported by the fact that radiative emission occurs near these features in many flaring regions¹²⁻¹⁷. The second type of model attributes a key role to the formation of a twisted flux rope, which becomes unstable. Its plausibility is supported by simulations¹⁸⁻²², by interpretations of some observations²³,²⁴ and by laboratory experiments²⁵. Here we report modelling of a confined event that uses the measured photospheric magnetic field as input. We first use a static model to compute the slowly evolving magnetic state of the corona before the eruption, and then use a dynamical model to determine the evolution during the eruption itself. We find that a magnetic flux rope must be present throughout the entire event to match the field measurements. This rope evolves slowly before saturating and suddenly erupting. Its energy is insufficient to break through the overlying field, whose lines form a confining cage, but its twist is large enough to trigger a kink instability, leading to the confined flare, as previously suggested¹⁸,¹⁹. Topology is not the main cause of the flare, but it traces out the locations of the X-ray emission. We show that a weaker magnetic cage would have produced a more energetic eruption with a coronal mass ejection, associated with a predicted energy upper bound for a given region.

It is important to study the pre-eruptive magnetic structure of the active region before a solar eruption (which must be temporally and spatially isolated) with sufficient precision to capture detailed features such as the presence of a twisted flux rope (TFR). It is equally important to have an efficient magnetohydrodynamic model that is able to describe the eruptive phase and to identify the underlying triggering mechanism—for instance, the ideal magnetohydrodynamic instability of a TFR. The problem is notoriously difficult and previous attempts have not provided a clear answer to the basic questions<fnref n="3" />⁻⁸. We have been able, however, to develop such efficient tools, and we apply them here to a specific flare-producing active region of the Sun.

Our target is the National Oceanic and Atmospheric Region (NOAA) active region AR12192, which was visible at the surface of the Sun in October 2014. This region is interesting because it exhibited huge spots, making it the largest region observed during more than two solar cycles (it was as large as Jupiter) and also the most active one of the current solar cycle²⁶ (the 24th since 1755). However, it produced neither coronal mass ejections nor solar energetic particles, which seemed puzzling⁴⁻⁸. But it was the site of very intense X-class flares, which were

observed by the NASA Solar Dynamics Observatory (SDO) satellite and disturbed communication systems. Here we focus on the intense X3.1 flare that occurred at 21:10 UT (universal time) on 24 October 2014, a day the region was particularly active. One of the rationales for this choice is that the filtergram of the Helioseismic and Magnetic Imager (HMI) onboard SDO provided a series of high-precision measurements of the photospheric field around the time of the eruption. This prompted other groups also to model this flare, but the configurations they obtained fundamentally differ from the ones reported below. For instance, a reconstruction of the pre-eruptive magnetic structure⁸ shows only the presence of a weakly twisted tube overlying a strongly sheared arcade, while a fully data-driven picture<fnref n="3" /> (including both the pre-eruptive and eruptive phases) does not show the formation of any TFR. Therefore it is not surprising that both papers propose an interpretation of the X3.1 flare—based on a tether-cutting reconnection process—that is at odds with ours.

X-ray flux data from the Geostationary Operational Environmental Satellite (GOES) indicate that between 10:00 UT and 21:00 UT the only eruptive activity is a small C5-class flare occurring around 14:00 UT. This point was confirmed by checking with all wavelength data from the Atmospheric Imaging Assembly (AIA) instrument. To be sure to use data not affected by previous activity, however weak, we decided to restrict our attention to the quiet period running from 16:00 UT to 21:00 UT on 24 October. In a first step, during that time interval we made a series of static reconstructions of the environment of the active region at the global Sun scale. Our main tool is the code MESHMHD²⁷, which we fed with composite SDO/HMI data (Fig. 1) prepared as explained in Methods. MESHMHD is a very accurate numerical code that can be used to treat both static and dynamic problems and has the characteristic of being able to achieve high resolution only where it is needed—inside the active region²⁸ at small scales. Our static reconstruction neglects the effects of the plasma and gravity forces, a common approximation that is well justified in the low corona. The computed equilibrium state is to a high degree force-free and divergence-free, which is crucial for solving the present problem and allows an accurate computation of important quantities, such as the magnetic helicity (see Methods).

Our computation of a sequence of equilibria using this method shows (Fig. 2) that the active region configuration evolves slowly, revealing the progressive appearance of a TFR. The TFR is fully formed at 21:00 UT, where it reaches its maximum size (Figs 2 and 3). It is strongly confined inside an overlying magnetic cage, whose magnetic lines are not parallel to its axis (Fig. 3c) and which plays an important part in the evolution of the configuration, in agreement with recent observations²⁴. The magnetic twist of the TFR increases continuously (Extended Data Fig. 1). For the configuration obtained at 21:00 UT, that is, ten minutes before the major confined X3.1 flare, the twist has a value of about 2.5 turns (Extended Data Fig. 1). The structure of the electric current (and then of the force-free function $\alpha$)

<footnote n="1">¹CPHT, Ecole Polytechnique, CNRS, Université Paris-Saclay, Route de Saclay, 91128 Palaiseau, France. ²Centre de Physique Théorique, Ecole Polytechnique, F-91128 Palaiseau Cedex, France.</footnote>

<footnote n="3">³Université Paris Diderot, AIM, Sorbonne Paris Cité, CEA, CNRS, F-91191 Gif-sur-Yvette, France. ⁴LPTMC, UMR 7600 of CNRS, Université Pierre et Marie Curie, Paris, France. ⁵INRIA Saclay Ile-de-France, Projet Gamma 3, 1 rue Honoré d'Estienne d'Orves, 91126 Palaiseau, France.</footnote>
<figure><img src="image_2.png" /><figcaption>**Figure 1** | **Building magnetic input for the model.** SDO/HMI high-resolution photospheric magnetic maps are used to build up adapted resolution boundary conditions. $B_r$ denotes the radial component of the magnetic field. The composite map contains three different maps: a, the synoptic map of the Carrington Rotation 2156; b, the line-of-sight full-disk magnetogram in the Carrington heliographic coordinates (CHC); and c, the vector magnetogram patches from the Spaceweather Helioseismic and Magnetic Imager Active Region Patch (SHARP) of the Solar</figcaption></figure>

Dynamics Observatory data series in CHC. **d**, An iterative adapted scheme (on current and magnetic field) on a triangular mesh of the photosphere results in high-resolution boundary conditions only where necessary. The colouredOutline boxes in **a** indicate the positions of the patches provided by SDO, where the vector magnetic field has been measured; the dotted-outline region enlarged in **b** corresponds to the full-disk SDO/HMI magnetogram.

can also be determined thanks to our unstructured adapted mesh model. The current profile (Fig. 3d) appears to be complex. It contains both direct and return currents, with some of them flowing in

background twisted ropes of non-negligible twist (Extended Data Fig. 2). Like the twist, the total magnetic energy W increases during the evolution (Extended Data Fig. 1), reaching a value of 1.8 × 10³⁴ erg

<figure><img src="image_3.png" /><figcaption>**Figure 2** | Magnetic field evolution before the major flare. Selected field lines of the reconstructed magnetic configurations starting on 24 October 2014 at 16:00 UT are shown at different stages during the rising towards the</figcaption></figure>

major X3.1 flare: a, at 16:00 UT = H - 5 (five hours before the flare); b, at H - 3; c, at H - 2; and d, at hour H*, ten minutes before the flare.
<figure><img src="image_4.png" /><figcaption>**Figure 3** | TFR in the magnetic cage before the major confined eruption.
We show characteristic properties of the configuration at H* in Fig. 2d.
a, A TFR covering an active region the size of Jupiter has acquired a large twist (2.5 turns). b, Magnetic cage covering and maintaining the TFR.
c, Larger-scale view of the multilayer structure of the magnetic cage.</figcaption></figure>

Only two layers have been plotted. d, View of the electric current system associated with the TFR, revealed by the mesh adaptation scheme. The colour code is symmetric, with blue (red) for negative (positive) values and saturation fixed at (−0.36, 0.36) Mm⁻¹.

in the last computed configuration (a much smaller value was previ-
ously claimed⁸). If we restrict our attention to the sub-region contain-
ing the TFR, the stored magnetic energy is a factor of 1.09 above the
potential energy W<sub>pot</sub> of the whole region, but a factor of 1.24 above
the part of W<sub>pot</sub> that is contained in the sub-region.

Up to the time of the flare, the slowly evolving magnetic field with its embedded TFR stays well confined. This is in accordance with the fact that *W* stays below the energy *W*<sub>sop</sub> of the associated semi-open field<sup>29</sup> (Extended Data Fig. 1; a field is expected to suffer a fast expansion and to open when *W*/*W*<sub>sop</sub> approaches unity). For completeness, we have also computed the standard decay index *n* of the potential field associated with the pre-eruptive configuration. *n* is found (Extended Data Fig. 3) to remain definitely below the critical value *n*<sub>c</sub> ≈ 1.5 that is generally considered to characterize the onset of the torus instability (this instability is thought to trigger the loss of confinement of the TFR in ejective events<sup>19</sup>). This allows us to anticipate the confined character of the flare. We point out, however, that the applicability of the general argument is somewhat uncertain in the situation we encounter here. The quoted theoretical value of *n*<sub>c</sub> is computed by considering a configuration in which an idealized TFR stays in equilibrium in a background potential magnetic field, while the pre-eruptive configurations exhibit non-negligible electric currents flowing outside the TFR (Extended Data Fig. 2). Hence the background field appears to be force-free rather than current-free, which may be expected to lead to a modification of *n*<sub>c</sub>. A similar point was made in a previous study of the decay index *n* just before the X3.1 flare<sup>8</sup>.

To illustrate the importance of the background currents in the deter-
mination of the actual magnetic field *B*, we find it useful to compare
its decrease with that of an auxiliary force-free magnetic field *B*′ for
which the electric currents are fully confined inside a TFR that differs
as little as possible from the TFR of *B* (then *B*′ is current-free outside
its TFR; see Methods). The difference between the behaviours of both
force-free fields appears quite neatly (Extended Data Fig. 4), with *B* showing a much stronger value above the central part of the TFR. As
for the free energies, we find that *W* − *W*<sub>pot</sub> ≈ 19 × 10<sup>32</sup> erg for *B*, while
*W*′ − *W*<sub>pot</sub> ≈ 13 × 10<sup>32</sup> erg for *B*′. Then there is a huge reserve of about

6 × 10³² erg in the background, which would be sufficient by itself to power an X-class flare.

The quality of our reconstructions has been checked by computing
the evolution and the asymptotic convergence along the iterative scheme
of two standard diagnostics measuring, respectively, the extent to which
the field is force-free and divergence-free (Extended Data Fig. 5).
We have also compared the pre-eruptive configuration computed at
21:00 UT with various observational data (Extended Data Figs 6 and 7).

The second step of our method consists of testing the stability of the previously obtained pre-eruptive state. Our tool here is our numerical model METEOSOL³⁰, which is a magnetohydrodynamics code in Cartesian geometry, and we perform the computation in a numerical box that is large enough to allow for possible ejective processes²⁹. Each of the different states computed before 21:00 UT is taken as an initial state for the model, and is made to evolve by applying, in turn, during a short time, various boundary conditions²⁹ that mimic physical processes occurring at the Sun's surface: flux cancellation, converging motions and turbulent diffusion. We found that whatever the driving process, only the configuration of 21:00 UT leaves its equilibrium state, owing to the nonlinear development of a kink instability associated with the high value of the twist (see Methods). The TFR is most clearly seen changing its original shape into the helical one that is characteristic of the kink instability (Fig. 4). At the same time, it expands slightly, making it press against the cage above, which contains some non-negligible magnetic free energy associated with the presence of electric currents and shearing of the lines (this is the reserve of about 6 × 10³² erg mentioned above). This transformation of the configuration is favourable for triggering a reconnection process between the lines of the TFR and the lines forming the different layers of the cage. This leads to the conversion of some amount of magnetic energy that is tapped from both regions, and to the production of the observed flare.

No fast expansion and opening of the field are obtained in our sim-
ulations. The flare we compute is a confined one, and our results do
not exhibit any disagreement with the conclusion above based on the
decay index and the energy of the semi-open field. We also note that the
shearing of the cage, which is made of magnetic lines whose direction
<figure><img src="image_5.png" /><figcaption>**Figure 4** | Evolution and confined instability of the TFR. We show selected field lines of some configurations obtained during the evolution driven by small photospheric perturbations of the configuration of 24 October 2014 at 21:00 UT, taken as the initial condition. **a**, Initially</figcaption></figure>

perturbed state. **b**, Some time later, the TFR experiences a kink instability. **c**, The evolution completes later. **d**, The final state of the instability, in which reconnection leads to the formation of two pieces of the TFR.

varies with altitude (Fig. 3c), may play an important part in the torus stability of the TFR, in the same way that the shearing of a field supporting plasma against gravity may stabilize Rayleigh-Taylor modes. When the kink instability develops and the TFR deforms into a helical shape, the shearing ensures that in the cage above the TFR there are always magnetic lines having a non-negligible component orthogonal to the TFR; this is the component that is important for the confinement²⁵.

Our results show that the role of the cage, and thus of the environment, crucially affects the class of eruption—either confined or eruptive— that can be produced in an active region. Indeed, applying flux cance llation for a longer time and on a larger scale that includes the cage results in a decrease of the confinement that leads to a major disruption of the structure and to the ejection of the TFR, that is, a coronal mass ejection is produced as in our previous work²⁹ (Extended Data Fig. 9). Moreover, the maximum energy that could be stored in the configuration—which is the energy of the semi-open field—is found to be approached from below in the eruptive event (as previously found²⁹), whereas the energy is well below it in the confined one (Extended Data Fig. 1). Thus the free energy of the semi-open field appears to give an estimate of the energy that could be released from a region by the ‘most energetic’ possible eruption.

The result previously obtained in idealistic numerical simulations¹⁸⁻²⁰ is thus now shown to occur on the real Sun. We conclude that the cause of the confined eruption is the instability of the TFR, and not the topological structure of the configuration. It should be noted that our model shows an interesting correlation between the location of the predicted magnetic structure and the real Sun observations during the eruption (Extended Data Fig. 8).

**Online Content** Methods, along with any additional Extended Data display items and Source Data, are available in the online version of the paper; references unique to these sections appear only in the online paper.

Received 21 May; accepted 20 October 2017.

1. Schrijver, J. C. et al. Understanding space weather to shield society: a global road map for 2015–2025 commissioned by COSPAR and ILWS. *Adv. Space Res.* **55**, 2745–2807 (2015).

2. Schmieder, B., Aulanier, G. & Vrsnak, B. Flare-CME models: an observational perspective. *Sol. Phys.* **290**, 3457–3486 (2015).

3. Jiang, C. et al. How did a major confined flare occur in super solar active region 12192? *Astrophys. J.* **828**, 62 (2016).

4. Liu, R. et al. Structure, stability, and evolution of magnetic flux ropes from the perspective of magnetic twist. *Astrophys. J.* **818**, 148 (2016).

5. Yang, K., Guo, Y. & Ding, M. D. Quantifying the topology and evolution of a magnetic flux rope associated with multi-flare activities. *Astrophys. J.* **824**, 148 (2016).

6. Wang, H. et al. Witnessing magnetic twist with high-resolution observation from the 1.6-m new solar telescope. *Nat. Commun.* **6**, 7008 (2015).

7. Sun, X. et al. Why is the great solar active region 12192 flare-rich but CME-poor? *Astrophys. J.* **804**, L28 (2015).

8. Inoue, S., Hayashi, K. & Kusano, K. Structure and stability of magnetic fields in solar active region 12192 based on nonlinear force-free field modeling. *Astrophys. J.* **818**, 168 (2016).

9. Gorbachev, V. S., Kelner, S. R., Somov, B. V. & Shvarts, A. S. A new topological approach to the question of the trigger for solar flares. *Sov. Astron.* **32**, 308–314 (1988).

10. Démoulin, P. et al. Quasi-separatrix layers in solar flares. I. Method. *Astron. Astrophys.* **308**, 643–655 (1996).

11. Li, Y., Qiu, J., Longcope, D. W., Ding, M. D. & Yang, K. Observations of an X-shaped ribbon flare in the Sun and its three-dimensional magnetic reconnection. *Astrophys. J.* **823**, L13 (2016).

12. Mandrini, C. H. et al. Evidence of magnetic reconnection from H-alpha, soft X-ray and photospheric magnetic field observations. *Sol. Phys.* **174**, 229–240 (1997).

13. Bagalá, L. G., Mandrini, C. H., Rovira, M. G. & Démoulin, P. Magnetic reconnection: a common origin for flares and AR interconnecting arcs. *Astron. Astrophys.* **363**, 779–788 (2000).

14. Romano, P., Falco, M., Guglielmino, S. L. & Mirabito, M. Observation of a 3D magnetic null point. *Astrophys. J.* **837**, 173 (2017).

15. Mandrini, C. H., Schmieder, B., Démoulin, P., Guo, Y. & Cristiani, G. D. Topological analysis of emerging bipole clusters producing violent solar events. *Sol. Phys.* **289**, 2041–2071 (2014).

16. Dalmasse, K., Chandra, R., Schmieder, B. & Aulanier, G. Can we explain atypical solar flares? *Astron. Astrophys.* **574**, A37 (2015).

17. Jiang, C., Feng, X., Wu, S. T. & Hu, Q. Study of the three-dimensional coronal magnetic field of active region 11117 around the time of a confined flare using a data driven CESE-MHD model. *Astrophys. J.* **759**, 85 (2012).

18. Amari, T. & Luciani, J. F. Helicity redistribution during relaxation of astrophysical plasmas. *Phys. Rev. Lett.* **84**, 1196–1199 (2000).

19. Török, T. & Kliem, B. Confined and ejective eruptions of kink-unstable flux ropes. *Astrophys. J.* **630**, L97–L100 (2005).

20. Kliem, B., Titov, V. S. & Torök, T. Formation of current sheets and sigmoidal structure by the kink instability of a magnetic loop. *Astron. Astrophys.* **413**, L23–L26 (2004).
21. Pinto, R., Gordovsky, M., Browning, P. K. & Vilmer, N. Thermal and non-thermal emission from reconnecting twisted coronal loops. *Astron. Astrophys.* **585**, A159 (2016).

22. Hassanin, A. & Kliem, B. Helical kink instability in a confined eruption. *Astrophys. J.* **832**, 106 (2016).

23. Kumar, P., Yurchyshyn, V., Wang, H. & Cho, K. S. Formation and eruption of a small flux rope in the chromosphere observed by NST, IRIS and SDO. *Astrophys. J.* **809**, 83 (2015).

24. Chen, H. et al. Confined flare in solar active region 12192 from October 18 to 29. *Astrophys. J.* **808**, L24 (2015).

25. Myers, C. E. et al. A dynamic magnetic tension force as the cause of failed solar eruptions. *Nature* **528**, 526–529 (2015).

26. Lee, K.-S., Imada, S., Watanabe, K., Bamba, Y. & Brooks, D. H. IRIS, HINODE, SDO, and RHESSI observations of a white light flare produced directly by non-thermal electrons. *Astrophys. J.* **836**, 150 (2017).

27. Amari, T. et al. in ASP Conference Series (eds Pogorelov, N. V., Font, J. A., Audit, E. & Zank, G. P.) Vol. 459, 189 (Astronomical Society of the Pacific, 2012).

28. DeRosa, M. L. et al. The influence of spatial resolution on nonlinear force-free modeling. *Astrophys. J.* **811**, 107 (2015).

29. Amari, T., Canou, A. & Aly, J.-J. Characterizing and predicting the magnetic environment leading to solar eruptions. *Nature* **514**, 465–469 (2014).

30. Amari, T., Luciani, J. F. & Joly, P. A preconditioned semi implicit scheme for magnetohydrodynamics equations. *SIAM J. Sci. Comput.* **21**, 970–986 (1999).

**Acknowledgements** We were granted access to the High Performance Computing resources of the Centre Informatique National de l'Enseignement Supérieur (CINES) and of the Institut du Développement et de Ressources en Informatique (IDRIS) under allocation 2016-16050438 made by Grand Equipement National de Calcul Intensif (GENCI) and also to the mesocentre Phymat of the Centre National de la Recherche Scientifique/ École Polytechnique. We acknowledge support of the Centre National d'Etudes Spatiales (CNES) and of the Direction Générale de l'Armement (DGA). T.A. thanks R. Huart for discussions. The Solar Dynamics Observatory (SDO) data are courtesy of the National Aeronautics and Space Administration (NASA), and the SDO/HMI and AIA science teams.

**Author Contributions** T.A. and A.C. planned and performed the various calculations and analysis discussed with J.-J.A. T.A. and F.A. worked on the mesh adaptation strategy while F.D. worked with T.A. on MESHMHD. The manuscript was written by T.A. and J.-J.A. with feedback from A.C.

**Author Information** Reprints and permissions information is available at www.nature.com/reprints. The authors declare no competing financial interests. Readers are welcome to comment on the online version of the paper. Publisher's note: Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations. Correspondence and requests for materials should be addressed to T.A. (tahar.amari@polytechnique.edu).
## METHODS

**Input data.** The spherical magnetic data (Fig. 1) we use are composite, obtained from several patches of the vector magnetic field using the following technical procedure. To create the dataset, we use three different SDO/HMI products: the synoptic map of Carrington Rotation 2156 (a method of numbering the solar rotations as seen from Earth since 1853), the line-of-sight full-disk magnetogram in charged coupled device (CCD) coordinates, and the vector magnetograms from the SHARP data series in CCD coordinates. To avoid the imprecision of the data obtained near the solar limb, we use only the vector magnetograms of the regions nearest to the solar active region AR12192. These vector magnetograms are transformed to spherical coordinates³¹ and then embedded in the line-of-sight full-disk magnetogram at their respective locations in the CCD coordinates. The resulting data are then remapped from the CCD coordinates to the heliographic coordinates³², keeping only a spherical wedge 125° in longitude and 70° in latitude. Independently, the synoptic map is interpolated to a uniform latitude–longitude mesh. The polar field is fitted with a geometrical specification³³ to take care of the inaccuracy of the magnetic field measurements made near the solar poles. The final step is to embed this composite vector full-disk magnetogram into the synoptic map. To avoid discontinuities at the interfaces between the synoptic map and the full-disk map as well as between the fitted polar field and the unmodified synoptic field, the resulting radial component of the field, $B_r$, is subjected to a diffusion process. The non-uniform diffusion coefficient is taken to be larger around these interfaces than in the rest of the composite map, and it is set to zero in the full-disk area to keep $B_r$ unchanged therein. As is required in any case²⁸, a mesh adaptation algorithm is used to create high-resolution mesh in the region where it is needed. This is shown in Fig. 1d for the reconstruction of 21:00 UT. We thus finally obtained a large composite map containing a lot of information that needs to be handled correctly by the model to capture the physics involved.

**The pre-eruptive multi-scale environment model.** Our static calculations assume that the coronal magnetic field **B** is force-free, that is, we ignore the effects of the plasma and gravity forces. This is a common approximation (also used, for example, in ref. 8) that is well justified by the low value of the plasma beta ($\beta \approx 7 \times 10^{-4}$) in the lower solar corona³⁴, where the eruption is occurring. This approximation may be considered valid not only inside a single active region, but also in a larger part of the low corona, including several interconnected active regions.

In our (static) model, the photosphere is represented by a sphere S of radius 1 and the corona by the domain $\Omega$, which is contained between S and an outer sphere $S_2$ of radius $r=2.57$. $\Omega$ is assumed to be filled up with low-$\beta$, slightly resistive and viscous plasma embedded in the magnetic field **B**. **B** obeys the standard force-free equations⁷

$$ \nabla \times \mathbf{B} = \alpha \mathbf{B} \qquad (1) $$

$$ \nabla \cdot \mathbf{B} = 0 \qquad (2) $$

$$ \mathbf{B} \cdot \nabla \alpha = 0 \qquad (3) $$

where $\alpha = \alpha(r)$ is some scalar function that is constant along field lines according to equation (3). Beyond $S_2$, the physics should be dominated by the solar wind, which drives the magnetic field almost radially in the heliosphere. $S_2$ is then called the source surface.

Equations (1) to (3) are solved in $\Omega$ using an algorithm exploiting its mixed elliptic–hyperbolic structure. This algorithm has been well described in both Cartesian and spherical³⁵ geometry. It requires as boundary conditions the normal component $B_r$ of **B** on S, the vanishing on $S_2$ of the tangential component of **B**, which thus continuously matches the outer radial field, and an assignment of the value of $\alpha$ to each magnetic line connecting the parts $S^+$ and $S^-$ of S, where $B_r > 0$ and $B_r < 0$, respectively. Here, we set $\alpha$ to be equal on any line to a weighted combination of the values $\alpha_{\text{obs}}^+$ and $\alpha_{\text{obs}}^-$ given by the observations at its two footpoints on S, with the weights (summing to 1) reflecting our relative confidence in the precision of these data. The actual computation of **B** is done by imposing such a boundary condition at each hyperbolic step of the iterative scheme³⁶,³⁷.

To take advantage of the richness of these high-resolution data, our multi-scale method solves equations (1) to (3) numerically using a scheme defined on an unstructured tetrahedral mesh that can be adapted along the iterative algorithm lying at the heart of our MESHMHD numerical code. To begin with, we look for the best triangular mesh adapted to the data given on the photosphere. This is done by starting with a crude triangular mesh and using a fixed-point algorithm. Adaptation followed by data interpolation (for $\alpha$ and $B_r$) on the new mesh thus leads to an optimal mesh associated with the data, with high resolution where data information requires small triangles and lower resolution elsewhere. This complex procedure is needed to obtain the high-quality mesh shown in Fig. 1, which is then used to build an initial tetrahedral mesh inside $\Omega$. Our iterative algorithm²⁷ is next

started by using this initial mesh. After each iteration, quantities called sensors, such as the magnetic field **B** and $\alpha$, are used to adapt the mesh where small-scale structures form, such as electric current concentrations and the TFR (Fig. 2). This is continued using a fixed-point method³⁸ until the couple mesh/solution converges to a small interpolation error.

Using this model, we obtain an equilibrium with very good standard diagnostics. The evolution and asymptotic convergence along the iterative scheme³⁹ have been computed for two of these diagnostics (Extended Data Fig. 5): $(J, B)$ and $\langle |f_i| \rangle$. $(J, B)$ is the angle between the electric current density **J** and **B**, which measures the extent to which **B** is force-free, and the standard parameter $\langle |f_i| \rangle$ provides an estimate of the divergence of **B**. When convergence is obtained, $(J, B)$ is smaller than 2°, while $\langle |f_i| \rangle \approx 10^{-17}$. This means that the constraint $\nabla \cdot \mathbf{B} = 0$ is satisfied to a high degree of precision ($|\nabla \cdot \mathbf{B}|$ is at most equal to about $10^{-12} \text{ G} \text{Mm}^{-1}$). This last result is a direct consequence of the structure of our numerical algorithm, which rests on a discretization of the equations that makes the magnetic field exactly divergence-free. We work in the functional spaces for element representation that are divergence-free on each tetrahedron, which ensures that **B** is in the kernel of the divergence operator. **B** is computed as the curl of a vector potential **A**, with **B** and **A** defined on each tetrahedron, while the divergence operator is defined by duality.

To have such low values for these diagnostics is a necessary condition for the electric currents to organize themselves into a well formed TFR with high twist (Fig. 2) during the reconstruction process performed by our model, which increases the resolution of the mesh where the current and the magnetic field change over smaller scales. Moreover, comparisons with coronal and ribbon data provided by emission observations made by AIA (onboard the NASA/SDO mission) show interesting correlations (see Extended Data Figs 6 and 7).

**Auxiliary force-free field B'.** Electric currents flowing outside the TFR (denoted T) of the reconstructed force-free field **B** are far from being negligible in the active region we consider. This appears quite clearly in Extended Data Fig. 2, where we can see electric currents of both signs associated with the TFRs that fill the volume around or above T. But unfortunately their effects have not yet been taken into account in the theoretical force-free models that are generally used for establishing the stability criteria of a TFR. To quantify the importance of the electric currents, we introduced a new auxiliary force-free magnetic field, $B'$, constructed in such a way that all its electric currents are fully confined inside a TFR (denoted $T'$) that differs as little as possible from T.

Let us denote as $S^{+/−}$ the intersection of T with the part $S^{+/−}$ of positive/negative polarity of the solar surface. To compute $B'$, we first solve the same Grad–Rubin boundary value problem as for **B**, but with a change in the boundary conditions: on $S^+$, we require $\alpha$ to vanish outside $S^+$ instead of assuming the observed value. In this way, we obtain a field whose currents are concentrated in a tube having the same intersection with $S^+$ as T, but an intersection with $S^−$ different from $S^+$. Therefore, we set up an iterative procedure to transform that field into another field $B'$ that has a TFR $T'$ as close as possible to T. Each iterative step consists in solving a Grad–Rubin problem in which an appropriate value of $\alpha$ is imposed either on $S^+$ or $S^−$.

**Magnetohydrodynamic evolution.** Once several reconstructions have been made in the four hours before the eruption, we have several different equilibrium states that may be a priori expected to be stable, because otherwise the reconstruction scheme would not have converged. We therefore undertake a new step in which, with the help of a magnetohydrodynamic code, we determine how each of these equilibrium states evolves under the action of several processes that are known to occur on the solar photosphere: flux cancellation, flow convergence and turbulent diffusion. These processes are mimicked by properly chosen boundary conditions, and the effects of each of them are considered in turn. We do not perform a standard stability analysis⁸, in which one would study how an initial equilibrium state evolves either under the effects of some arbitrary superposed perturbations, or simply from the interpolation errors left when bringing data from one code to the other. Rather, we impose physically motivated nonlinear evolutions on our magnetic structure, which stay close to the actual evolution of the active region because the computations are run for only a short time.

The tool we use is our efficient magnetohydrodynamics code METEOSOL³⁰, which has already been extensively employed and has produced many results¹⁸,⁴⁰,⁴¹, in particular in theoretical studies of the effects on a given magnetic structure of the surface processes mentioned above. Since the big flare that occurred around 21:00 UT was not ejective, the calculations are performed on a high-resolution METEOSOL mesh set in a large Cartesian box (such a box has been proved by previous simulations of coronal mass ejections not to exert any spurious confining effect on the magnetic field, thus ensuring that the resulting eruption is physically confined and not artificially confined by the box). The mesh used by METEOSOL is a staggered Cartesian non-uniform one. The spatial discretization of the operators is defined in such a way that magnetic helicity
and topology are conserved in the weakly resistive limit and that the constraint $\nabla \cdot \mathbf{B} = 0$ is satisfied, to round off errors. METEOSOL uses an efficient time-advance semi-implicit scheme. Some modifications have been introduced since the original version of METEOSOL³⁰. In particular, the convective terms are treated by a third-order non-oscillatory upwind scheme. The model uses several different assumptions and options, among which a classical zero-$\beta$ approach, with an imposed profile of density that is either constant or decreasing with altitude. We have also tried an initial plasma hydrostatic equilibrium, assuming the adiabatic approximation in which the heating terms are neglected. This led to only minor changes in the results. For the viscosity and the resistivity, we choose values between $10^{-2}$ and $10^{-3}$ (in code units) and in the range $10^{-4}$ down to $10^{-5}$, respectively. The results were found to be independent of the values selected for these parameters.

Applying the method above, we find that the evolution of the pre-eruptive configuration of 21:00 UT is driven by any of the three surface mechanisms previously listed, which leads after a short time to the development of the kink instability of the TFR, which otherwise stays confined (Fig. 4). No instability is found to develop during a short period of time when the same procedure is applied to earlier static configurations, which we observed to evolve slightly and inconsequently.

A further result concerns the effect of applying flux cancellation for a longer time and on a larger scale including the magnetic cage. In that case, the resulting decrease in the confinement leads to a major disruption of the structure and to an ejection of the TFR, that is, a coronal mass ejection is produced as in our previous work²⁹ (Extended Data Fig. 9). This result provides one more illustration of the confining power of the cage and then of the effect of the environment on the nature of the event (a confined flare versus eruptive flare plus coronal mass ejection) that can be produced.

During the development of the instability of the 21:00 UT (hour H) pre-eruptive configuration, magnetic helicity is conserved, keeping a value of about $-300 \times 10^{42} \text{ Mx}^2$ (1 maxwell = 1 G cm$^2$; Fig. 4d). However, the configuration does not relax between the pre-eruptive and post-eruptive phases to a linear force-free field having the same helicity; that is, the Taylor conjecture⁴² is not valid here. Instead, nonlinearities are present in the predicted post-eruptive state, which is otherwise found to be close to the state obtained by applying

our static model to the HMI observations made on 25 October 2014 (Extended Data Fig. 10).

**Code availability.** We have decided not to make our code available. Several parts of the code we used are embedded in a complicated way, and are the private property of the authors' institutions. The reader, however, should be able to reproduce our results by using the information provided in Methods.

**Data availability.** The data files that support our analysis will be made available upon reasonable request.

31. Allen Gary, G. & Hagyard, M. J. Transformation of vector magnetograms and the problem associated with the effects of perspective and the azimuthal ambiguity. *Sol. Phys.* **126**, 21–36 (1990).

32. Thompson, W. T. Coordinate systems for solar image data. *Astron. Astrophys.* **449**, 791–803 (2006).

33. Titov, V. S., Mikic, Z., Török, T., Linker, J. A. & Panasenco, O. 2010 August 1–2 sympathetic eruptions. I. Magnetic topology of the source-surface background field. *Astrophys. J.* **759**, 70 (2012).

34. Priest, E. R. Magnetohydrodynamics of the Sun (Cambridge Univ. Press, 2014).

35. Amari, T., Aly, J.-J., Canou, A. & Mikic, Z. Reconstruction of the solar coronal magnetic field in spherical geometry. *Astron. Astrophys.* **553**, A43 (2013).

36. Amari, T. & Aly, J.-J. Observational constraints on well-posed reconstruction methods and the optimization-Grad-Rubin method. *Astron. Astrophys.* **522**, A52 (2010).

37. Wheatland, M. S. & Régnier, S. A Self-consistent nonlinear force-free solution for a solar active region magnetic field. *Astrophys. J.* **700**, L88–L91 (2009).

38. Alauzet, F., Frey, P. J., George, P. L. & Mohammadi, B. 3D transient fixed point mesh adaptation for time-dependent problems: application to CFD simulations. *J. Comput. Phys.* **222**, 592–623 (2007).

39. Guo, Y., Xia, C., Keppens, R. & Valori, G. Magneto-frictional modeling of coronal nonlinear force-free fields. I. Testing with analytic solutions. *Astrophys. J.* **828**, 82 (2016).

40. Amari, T., Luciani, J.-F., Aly, J.-J., Mikic, Z. & Linker, J. Coronal mass ejection: initiation, helicity and flux ropes. II. *Turbulent diffusion driven evolution*. *Astrophys. J.* **595**, 1231–1250 (2003).

41. Amari, T., Aly, J.-J., Luciani, J.-F., Mikic, Z. & Linker, J. Coronal mass ejection initiation by converging photospheric flows: toward a realistic model. *Astrophys. J.* **742**, L27 (2011).

42. Taylor, J. B. Relaxation of toroidal plasma and generation of reverse magnetic fields. *Phys. Rev. Lett.* **33**, 1139–1141 (1974).
Magnetic Energy and Twist

<figure><img src="image_6.png" /></figure>

**Extended Data Figure 1** | Evolution of magnetic energies and twist. Evolution during the four hours preceding the eruption of the actual magnetic field energy (blue), the potential field energy (black), and the semi-open field energy (purple), expressed in physical units. The evolution of the twist is also plotted (red).
<figure><img src="image_7.png" /><figcaption>**Extended Data Figure 2** | Electric current structure of the magnetic environment. Set of selected flux ropes, including the central highly twisted flux rope and some ropes having a non-negligible twist of more</figcaption></figure>

than 0.5. These ropes are located around and above the major TFR and reveal a complex non-potential environment. Those in blue (red) are associated with a negative (positive) value of $\alpha$.
<figure><img src="image_8.png" /></figure>

**Extended Data Figure 3** | Index of torus instability. **a**, Magnetogram at 21:00 UT with rectangles indicating the sample area in which the index *n* is computed. The yellow rectangle is located just below the TFR, while the black rectangle, used as a reference, is chosen outside it. **b**, Variation with altitude of the torus index computed above the sample areas shown in **a**

<figure><img src="image_9.png" /></figure>

(with the same colour coding) by using the horizontal component¹⁹ of the mean potential (current-free) magnetic field, ⟨*B*<sub>π,h</sub>⟩. The horizontal line indicates the critical value of the index often used for the torus instability, while the vertical one indicates the height of the TFR axis.
<figure><img src="image_10.png" /></figure>

**Extended Data Figure 4** | Role of volumetric current. Variation of the magnetic intensity mean value above the rectangles shown in Extended Data Fig. 3a for the current-free solution (red curve), the force-free solution *B*', computed by removing the photospheric electric current exterior to the base of the TFR (green curve), and the full force-free solution (*B*), computed by taking into account the total electric current

<figure><img src="image_11.png" /></figure>

(blue curve). The number ksi measures the degree of removal of those external currents, with ksi = 0 (ksi = 1) indicating total (no) removal. As in Extended Data Fig. 3, the vertical yellow line indicates the height of the TFR axis. a, The central rectangle; b, the reference rectangle outside the TFR area.
Convergence Diagnostics

<figure><img src="image_12.png" /><figcaption>**Extended Data Figure 5** | **Quality of the reconstruction method.** Evolution of the angle $\theta_i$ between the electric current vector and the magnetic field (a good measure of how force-free the solution is) during</figcaption></figure>

the iterations of the algorithm, as well as that of the diagnostic standard parameter $\langle |f_i| \rangle$, measuring the divergence of the solution. *i* is the iteration number.
<figure><img src="image_13.png" /></figure>

**Extended Data Figure 6** | Comparison with AIA data. **a**, Selected field lines and set of different isosurfaces of the force-free scalar function $\alpha$ (red for positive values and blue for negative values) for the reconstructed pre-eruptive magnetic configuration of 24 October 2014 at 21:00 UT.

<figure><img src="image_14.png" /></figure>

**b**, Corresponding composite image from the AIA-131 Å and AIA-171 Å wavelength data. **c**, Synthetic emissivity computed by using the magnetic field and the electric current density of the reconstructed pre-eruptive magnetic configuration of 24 October 2014 at 21:00 UT.

<figure><img src="image_15.png" /></figure>
<figure><img src="image_16.png" /><figcaption>**Extended Data Figure 7** | Comparison with AIA-1,600 Å wavelength. a, AIA emission at 1,600 Å. b, Plot of the vertically integrated dissipation $J^2$ (where J is the norm of the electric current density) above the regions with high values of the squashing factor$^{33}$, as for the reconstructed</figcaption></figure>

<figure><img src="image_17.png" /></figure>

pre-eruptive magnetic configuration of 24 October 2014 at 21:00 UT. This plot highlights the strong electric current regions, in which reconnection is expected to occur.
<figure><img src="image_18.png" /><figcaption>**Extended Data Figure 8** | Extreme-ultraviolet emission and magnetic structure. a, Selected field lines of the evolving magnetic configuration during the flare. b, AIA emission at 94 Å on 24 October 2014 at 22:00 UT. c, Synthetic emissivity computed by using the magnetic field and the electric current density of the evolving magnetic configuration during the flare.</figcaption></figure>
<figure><img src="image_19.png" /></figure>

**Extended Data Figure 9 | Major eruption and role of the magnetic environment.** Selected field lines of the configuration that evolved into a major coronal mass ejection from the pre-eruptive configuration of 24

October 2014 at 21:00 UT when flux cancellation was applied on a larger scale, including the magnetic cage, whose confinement effect has thus been weakened.
<figure><img src="image_20.png" /></figure>

<figure><img src="image_21.png" /><figcaption>**Extended Data Figure 10 | Post-eruptive state.** Comparison of the post-eruptive states obtained from the simulation after the full relaxation of the evolving unstable state (a) and using HMI vector magnetic data from 25 October 2014 (b).</figcaption></figure>