1 Introduction

The magnetic activity of the Sun has a high impact on Earth. As illustrated in Fig. 1, large coronal eruptions like flares and coronal mass ejections can influence the Earth’s magnetosphere where they trigger magnetic storms and cause aurorae. These coronal eruptions have also harmful effects like disturbances in communication systems, damages on satellites, power cutoffs, and unshielded astronauts are in danger of life-threatening radiation.Footnote 1 The origin of these eruptive phenomena in the solar corona is related to the coronal magnetic field as magnetic forces dominate over other forces (like pressure gradient and gravity) in the corona. The magnetic field, created by the solar dynamo, couples the solar interior with the Sun’s surface and atmosphere. Reliable high accuracy magnetic field measurements are only available in the photosphere. These measurements, called vector magnetograms, provide the magnetic field vector in the photosphere.

Fig. 1
figure 1

Image courtesy of SOHO (ESA and NASA)

Magnetic forces play a key role in solar storms that can impact Earth’s magnetic shield (magnetosphere) and create colorful aurora.

To get insights regarding the structure of the coronal magnetic field we have to compute 3D magnetic field models, which use the measured photospheric magnetic field as the boundary condition. This procedure is often called “extrapolation of the coronal magnetic field from the photosphere”. In the solar corona the thermal conductivity is much higher parallel than perpendicular to the field so that field lines may become visible by the emission at appropriate temperatures. This makes in some sense magnetic field lines visible and allows us to test coronal magnetic field models. In such tests 2D projection of the computed 3D magnetic field lines are compared with plasma loops seen in coronal images. This mainly qualitative comparison cannot guarantee that the computed coronal magnetic field model and derived quantities, such as the magnetic energy, are accurate. Coronal magnetic field lines which are in reasonable agreement with coronal images are, however, more likely to reproduce the true nature of the coronal magnetic field.

To model the coronal magnetic field \({\mathbf {B}}\) we have to introduce some assumptions. It is therefore necessary to get some a priori insights regarding the physics of the solar corona. An important quantity is the plasma \(\beta \) value, a dimensionless number which is defined as the ratio between the plasma pressure p and the magnetic pressure,

$$\begin{aligned} \beta =2 \mu _0 \frac{p}{B^2}. \end{aligned}$$
(1)

Figure 2 from Gary (2001) shows how the plasma \(\beta \) value changes with height in the solar atmosphere. As one can see a region with \(\beta \ll 1\) is sandwiched between the photosphere and the upper corona, where \(\beta \) is about unity or larger. In regions with \(\beta \ll 1\) the magnetic pressure dominates over the plasma pressure (and as well over other non-magnetic forces like gravity and the kinematic plasma flow pressure). Here we can neglect in the lowest order all non-magnetic forces and assume that the Lorentz force vanishes. This approach is called the force-free field approximation and for static configurations it is defined as:

$$\begin{aligned} {\mathbf {j}}\times {\mathbf {B}}= \mathbf {0}, \end{aligned}$$
(2)
$$\begin{aligned} {\mathbf {j}}= \frac{1}{\mu _0}\nabla \times {\mathbf {B}} \quad {\text {is}}\;{\text {the}}\;{\text {electric}}\;{\text {current}}\;{\text {density}} , \end{aligned}$$
(3)
$$\begin{aligned} \nabla \cdot {\mathbf {B}}= 0 , \end{aligned}$$
(4)

or by inserting Eq. (3) into (2):

$$\begin{aligned} (\nabla \times {\mathbf {B}}) \times {\mathbf {B}}= \mathbf {0}, \end{aligned}$$
(5)
$$\begin{aligned} \nabla \cdot {\mathbf {B}}= 0 . \end{aligned}$$
(6)

Equation (5) can be fulfilled either by:

$$\begin{aligned} \nabla \times {\mathbf {B}}=0 \; \quad {\text {current-free}}\;{\text {or}}\;{\text {potential}}\; {\text {magnetic}}\;{\text {fields}} \end{aligned}$$
(7)

or by

$$\begin{aligned} {\mathbf {B}} \parallel \nabla \times {\mathbf {B}} \; \quad {\text {force-free}}\;{\text {fields}}. \end{aligned}$$
(8)

Current free (potential) fields are the simplest assumption for the coronal magnetic field. The line-of-sight (LOS) photospheric magnetic field which is routinely measured with magnetographs are used as boundary conditions to solve the Laplace equation for the scalar potential \(\phi \),

$$\begin{aligned} \varDelta \phi =0, \end{aligned}$$
(9)

where the Laplacian operator \(\varDelta \) is the divergence of the gradient of the scalar field and

$$\begin{aligned} {\mathbf {B}} = -\nabla \phi . \end{aligned}$$
(10)

When one deals with magnetic fields of a global scale, one usually assumes the so-called “source surface” (at about 2.5 solar radii where all field lines become radial): see, e.g., Schatten et al. (1969) for details on the potential-field source-surface (PFSS) model. Figure 3 shows such a potential-field source-surface model for May 2001 from Wiegelmann and Solanki (2004).

Fig. 2
figure 2

Image reproduced with permission from Fig. 3 of Gary (2001), copyright by Springer

Plasma \(\beta \) model over active regions. The shaded area corresponds to magnetic fields originating from a sunspot region with 2500 G and a plage region with 150 G. The left and right boundaries of the shaded area are related to umbra and plage magnetic field models, respectively. Atmospheric regions magnetically connected to high magnetic field strength areas in the photosphere naturally have a lower plasma \(\beta \).

Fig. 3
figure 3

Image reproduced with permission from Wiegelmann and Solanki (2004), copyright by ESA

Global potential field reconstruction.

Potential fields are popular due to their mathematical simplicity and provide a first coarse view of the magnetic structure in the solar corona. They cannot, however, be used to model the magnetic field in active regions precisely, because they do not contain free magnetic energy to drive eruptions. Further, the transverse photospheric magnetic field computed from the potential-field assumption usually does not agree with measurements and the resulting potential field lines do deviate from coronal loop observations. For example, a comparison of global potential fields with images from the Transition Region And Coronal Explorer (TRACE) done by Schrijver et al. (2005) and with stereoscopically-reconstructed loops by Sandman et al. (2009) showed large deviations between potential magnetic field lines and coronal loops.

The \({\mathbf {B}} \parallel \nabla \times {\mathbf {B}}\) condition can be rewritten as

$$\begin{aligned} \nabla \times {\mathbf {B}}= \alpha {\mathbf {B}} , \end{aligned}$$
(11)
$$\begin{aligned} {\mathbf {B}} \cdot \nabla \alpha= 0, \end{aligned}$$
(12)

where \(\alpha \) is called the force-free parameter or force-free function. From the horizontal photospheric magnetic field components \((B_{x0}, \, B_{y0})\) we can compute the vertical electric current density

$$\begin{aligned} \mu _0 j_{z0}=\frac{\partial B_{y0}}{\partial x}-\frac{\partial B_{x0}}{\partial y} \end{aligned}$$
(13)

and the corresponding distribution of the force-free function \(\alpha (x,y)\) in the photosphere

$$\begin{aligned} \alpha (x,y)=\mu _0 \frac{j_{z0}}{B_{z0}} . \end{aligned}$$
(14)

Condition (12) has been derived by taking the divergence of Eq. (11) and using the solenoidal condition (4). Mathematically, Eqs. (11) and (12) are equivalent to Eqs. (2)–(4). Parameter \(\alpha \) can be a function of position, but Eq. (12) requires that \(\alpha \) be constant along a field line. If \(\alpha \) is constant everywhere in the volume under consideration, the field is called a linear force-free field (LFFF), otherwise it is a nonlinear force-free field (NLFFF). Equations (11) and (12) constitute partial differential equations of mixed elliptic and hyperbolic type. They can be solved as a well-posed boundary value problem by prescribing the vertical magnetic field and for one polarity the distribution of \(\alpha \) at the boundaries. As shown by Bineau (1972) these boundary conditions ensure the existence and unique NLFFF solutions at least for small values of \(\alpha \) and weak nonlinearities. Boulmezaoud and Amari (2000) proved the existence of solutions for a simply and multiply connected domain. As pointed out by Aly and Amari (2007) these boundary conditions disregard part of the observed photospheric vector field: In one polarity only the curl of the horizontal field [Eq. (13)] is used as the boundary condition, and the horizontal field of the other polarity is not used at all. For a general introduction to complex boundary value problems with elliptic and hyperbolic equations we refer to Kaiser (2000).

Please note that high plasma \(\beta \) configurations are not necessarily a contradiction to the force-free condition (see Neukirch 2005, for details). If the plasma pressure is constant or the pressure gradient is compensated by the gravity force \((\nabla p = -\rho \nabla \varPsi \), where \(\rho \) is the mass density and \(\varPsi \) the gravity potential of the Sun) a high-\(\beta \) configuration can still be consistent with a vanishing Lorentz force of the magnetic field. In this sense a low plasma \(\beta \) value is a sufficient, but not a necessary criterion for the force-free assumption. In the generic case, however, high plasma \(\beta \) configurations will not be force-free and the approach of the force-free field is limited to the upper chromosphere and the corona (up to about \(2.5\,R_{\odot }\)).

2 Linear force-free fields

Linear force-free fields are characterized by

$$\begin{aligned} \nabla \times {\mathbf {B}}= \alpha {\mathbf {B}}, \end{aligned}$$
(15)
$$\begin{aligned} \nabla \cdot {\mathbf {B}}= 0, \end{aligned}$$
(16)

where the force-free parameter \(\alpha \) is constant. Taking the curl of Eq. (15) and using the solenoidal condition (16) we derive a vector Helmholtz equation:

$$\begin{aligned} \varDelta {\mathbf {B}} + \alpha ^2 {\mathbf {B}} =0 \end{aligned}$$
(17)

which can be solved by a separation of variables, a Green’s function method (Chiu and Hilton 1977) or a Fourier method (Alissandrakis 1981). These methods can also be used to compute a potential field by choosing \(\alpha =0\).

For computing the solar magnetic field in the corona with the linear force-free model one needs only measurements of the LOS photospheric magnetic field. The force-free parameter \(\alpha \) is a priori unknown and we will discuss later how \(\alpha \) can be approximated from observations. Seehafer (1978) derived solutions of the linear force-free equations (assuming local Cartesian geometry with (xy) in the photosphere and z is the height from the Sun’s surface) in the form:

$$\begin{aligned} B_x &= \sum _{m,n=1}^{\infty } \frac{C_{mn}}{\lambda _{mn}} \exp \left( -r_{mn} z \right) \cdot \left[ \alpha \frac{\pi n}{L_y} \sin \left( \frac{\pi m x}{L_x}\right) \cos \left( \frac{\pi n y}{L_y}\right) \right. \nonumber \\&\quad\left. -r_{mn} \frac{\pi m}{L_x} \cos \left( \frac{\pi m x}{L_x}\right) \sin \left( \frac{\pi n y}{L_y}\right) \right] , \end{aligned}$$
(18)
$$\begin{aligned} B_y &= -\sum _{m,n=1}^{\infty } \frac{C_{mn}}{\lambda _{mn}} \exp \left( -r_{mn} z \right) \cdot \left[ \alpha \frac{\pi m}{L_x} \cos \left( \frac{\pi m x}{L_x}\right) \sin \left( \frac{\pi n y}{L_y}\right) \right. \nonumber \\&\quad\left. +r_{mn} \frac{\pi n}{L_y} \sin \left( \frac{\pi m x}{L_x}\right) \cos \left( \frac{\pi n y}{L_y}\right) \right] , \end{aligned}$$
(19)
$$\begin{aligned} B_z= \sum _{m,n=1}^{\infty } C_{mn} \exp \left( -r_{mn} z \right) \cdot \sin \left( \frac{\pi m x}{L_x}\right) \sin \left( \frac{\pi n y}{L_y}\right) , \end{aligned}$$
(20)

with \(\lambda _{mn}= \pi ^2 (m^2/L_x^2+ n^2/L_y^2 )\) and \(r_{mn}=\sqrt{\lambda _{mn}-\alpha ^2}\).

As the boundary condition, the method uses the distribution of \(B_z(x,y)\) on the photosphere \(z=0\). The coefficients \(C_{mn}\) can be obtained by comparing Eq. (20) for \(z=0\) with the magnetogram data. In practice, Seehafer’s (1978) method is used for calculating the linear force-free field (or potential field for \(\alpha =0\)) for a given magnetogram, and a given value of \(\alpha \) as follows. The observed magnetogram which covers a rectangular region extending from 0 to \(L_x\) in x and 0 to \(L_y\) in y is artificially extended onto a rectangular region covering \(-L_x\) to \(L_x\) and \(-L_y\) to \(L_y\) by taking an antisymmetric mirror image of the original magnetogram in the extended region, i.e.,

$$\begin{aligned} B_z(-x,y) &= -B_z(x,y), \\ B_z(x,-y) &= -B_z(x,y), \\ B_z(-x,-y) &= B_z(x,y) \quad (0<x<L_x, 0<y<L_y). \end{aligned}$$

This makes the total magnetic flux in the whole extended region to be zero. (Alternatively one may pad the extended region with zeros, although in this case the total magnetic flux may be non-zero.) The coefficients \(C_{mn}\) are derived from this enlarged magnetogram with the help of a Fast Fourier Transform. In order for \(r_{mn}\) to be real and positive so that solutions (18)–(20) do not diverge at infinity, \(\alpha ^2\) should not exceed the maximum value for given \(L_x\) and \(L_y\),

$$\begin{aligned} \alpha ^2_{\mathrm{max}}= \pi ^2\left( \frac{1}{L_x^2} +\frac{1}{L_y^2}\right) . \end{aligned}$$

Usually, \(\alpha \) is normalized by the harmonic mean L of \(L_x\) and \(L_y\) defined by

$$\begin{aligned} \frac{1}{L^2}=\frac{1}{2}\left( \frac{1}{L_x^2}+\frac{1}{L_y^2}\right) . \end{aligned}$$

For \(L_x=L_y\) we have \(L=L_x=L_y\). With this normalization the values of \(\alpha \) fall into the range \(-\sqrt{2} \pi< \alpha < \sqrt{2} \pi. \)

2.1 How to obtain the force-free parameter α

Linear force-free fields require the LOS magnetic field in the photosphere as input and contain a free parameter \(\alpha \). One possibility to approximate \(\alpha \) is to compute an averaged value of \(\alpha \) from the measured horizontal photospheric magnetic fields as done, e.g., in Pevtsov et al. (1994), Wheatland (1999), Leka and Skumanich (1999) and Hagino and Sakurai (2004), where Hagino and Sakurai (2004) calculated an averaged value \(\alpha =\sum {\mu _0 J_z \; {\text {sign}}(B_z)}/ \sum {|B_z|}\). The vertical electric current in the photosphere is computed from the horizontal photospheric field as \(J_z=\frac{1}{\mu _0}\left( \frac{\partial B_y}{\partial x}-\frac{\partial B_x}{\partial y}\right) \). Such approaches derive best fits of a linear force-free parameter \(\alpha \) with the measured horizontal photospheric magnetic field.

Alternative methods use coronal observations to find the optimal value of \(\alpha \). This approach usually means that one computes several magnetic field configurations with varying values of \(\alpha \) in the allowed range and to compute the corresponding magnetic field lines. The field lines are then projected onto coronal plasma images. A method developed by Carcedo et al. (2003) is shown in Fig. 4. In this approach the shape of a number of field lines with different values of \(\alpha \), which connect the foot point areas (marked as start and target in Fig. 4e) are compared with a coronal image. For a convenient quantitative comparison the original image shown in Fig. 4a is converted to a coordinate system using the distances along and perpendicular to the field line, as shown in Fig. 4b. For a certain number of N points along this uncurled loop the perpendicular intensity profile of the emitting plasma is fitted by a Gaussian profile in Fig. 4c and the deviation between field line and loops are measured in Fig. 4d. Finally, the optimal linear force-free value of \(\alpha \) is obtained by minimizing this deviation with respect to \(\alpha \), as seen in Fig. 4f.

Fig. 4
figure 4

Image reproduced with permission from Figs. 3, 4, and 5 of Carcedo et al. (2003), copyright by Springer

How to obtain the optimal linear force-free parameter \(\alpha \) from coronal observations.

The method of Carcedo et al. (2003) has been developed mainly with the aim of computing the optimal \(\alpha \) for an individual coronal loop and involves several human steps, e.g., identifying an individual loop and its footpoint areas and it is required that the full loop, including both footpoints, is visible. This makes it somewhat difficult to apply the method to images with a large number of loops and when only parts of the loops are visible. For EUV loops it is also often not possible to identify both footpoints. These shortcomings can be overcome by using feature recognition techniques, e.g., as developed in Aschwanden et al. (2008a) and Inhester et al. (2008) to extract one-dimensional curve-like structures (loops) automatically out of coronal plasma images. These identified loops can then be directly compared with the projections of the magnetic field lines, e.g., by computing the area spanned between the loop and the field line as defined in Wiegelmann et al. (2006b). This method has become popular in particular after the launch of the two STEREO spacecraft in October 2006 (Kaiser et al. 2008). The projections of the 3D linear force-free magnetic field lines can be compared with images from two vantage points as done for example in Feng et al. (2007b, 2007a). This automatic method applied to a number of loops in one active region revealed, however, a severe shortcoming of linear force-free field models. The optimal linear force-free parameter \(\alpha \) varied for different field lines, which is a contradiction to the assumption of a linear model. A similar result was obtained by Wiegelmann and Neukirch (2002) who tried to fit the loops stereoscopically reconstructed by Aschwanden et al. (1999). On the other hand, Marsch et al. (2004) found in their example that one value of \(\alpha \) was sufficient to fit several coronal loops. Therefore, the fitting procedure tells us also whether an active region can be described consistently by a linear force-free field model: Only if the scatter in the optimal \(\alpha \) values among field lines is small, one has a consistent linear force-free field model which fits coronal structures. In the generic case that \(\alpha \) changes significantly between field lines, one cannot obtain a self-consistent force-free field by a superposition of linear force-free fields, because the resulting configurations are not force-free. As pointed out by Malanushenko et al. (2009) it is possible, however, to estimate quantities like twist and loop heights with an error of around 15% and 5%, respectively. The price one has to pay is using a model that is not self-consistent.

2.2 Comparison of photospheric and coronal values of α

One important question is also whether the best-fit value of \(\alpha \) derived from photospheric vector magnetograms and the optimal value of \(\alpha \) for fitting coronal structures are consistent which each other. Burnette et al. (2004) compared several best-fit methods for \(\alpha \) deduced from vector magnetograms in the photosphere with values fitting best coronal structures for 34 flaring active regions. They found that for ARs where coronal structures can be well modelled by a single \(\alpha \), its value is consistent which computations from the photosphere. They found a Spearman correlation of 0.71. There are outliers, however, where the photospheric and coronal \(\alpha \) differ by an order of magnitude.

A third possibility to compute \(\alpha \) from photospheric data has been developed by Valori et al. (2015). From a time-series of magnetograms the authors computed the horizontal photospheric flow and the related helicity flux through the photosphere. Within this approach knowledge of the horizontal photospheric magnetic fields is not necessary. Within the linear-force-free assumption the magnetic helicity and \(\alpha \) are linearly related [see Eq. (2) in Valori et al. 2015, for details] and consequently the authors derived \(\alpha \) from the helicity injection, by assuming a zero helicity at the beginning of the time-series. During the time series two images from TRACE were used to find a best coronal value of \(\alpha \). It was found that the values obtained from photospheric observation were a factor of 22 and 2 higher than the coronal ones. The authors pointed out two reasons for the large difference: (1) The poor quality of one TRACE image allowed only the identification of some external and likely potential-field loops and (2) the active region was at this particular time probably in the strongly non-linear state and therefore not well modelled by a linear force-free model.

2.3 Chromospheric \(\alpha \)

As the photosphere is not necessarily consistent with the force-free condition, but the solar atmosphere becomes force-free (or at least closer to force-free) in the chromosphere and corona, it is also interesting to compare a best-fit linear \(\alpha \) deduced from photospheric, chromospheric and coronal structures as done in Gosain et al. (2014) for two sunspots. One example for active region AR11084 is shown in Fig. 5. The top panels show images observed with the Atmospheric Imaging Assembly (AIA) on the Solar Dynamics Observatory (see Lemen et al. 2012). The left panel shows the chromosphere observed in 304 Å and the right panel the corona observed in 171 Å). Identified structures (chromospheric whorls and coronal loops) are marked with plus signs. The mean distance of these structures deduced from the images and magnetic field lines from linear force-free models (with different values of \(\alpha \)) is shown in the bottom panels. The minimum distance is at \(\alpha \approx 0.4\) in the chromosphere (left) and at \(\alpha \approx 0.23\) (right) in the corona. The center panels show the best fitting linear force-free field lines. The finding that the best-fit \(\alpha \) value is different in the chromosphere and corona means that the entire configuration cannot be modelled consistently within the linear force-free approximation, because it requires a globally constant \(\alpha \). Interestingly the authors found that \(\alpha \) computed from the photospheric vector magnetogram agrees very well with the chromospheric one. For another active region AR11092 investigated in the same paper, the photospheric \(\alpha \) agreed well with the coronal one. For active region AR11092 the chromospheric structures could not been modelled with a single \(\alpha \)-value, but three different values had to be chosen for different chromospheric structures. Similar to the case of active region AR11084 the best-fit chromospheric values are significantly higher compared to the coronal ones. While computing the best-fit \(\alpha \) in different layers of the solar atmosphere helps to define quantitatively the amount of twist in these structures, it is also clear from these studies that the linear force-free approach cannot be used for a consistent modelling of these layers.

Fig. 5
figure 5

Image reproduced with permission from Fig. 2 of Gosain et al. (2014), copyright by AAS

The top panels show chromospheric (left) and coronal images (right) from AIA, respectively. Center panels: best fit LFFF-models. Bottom panels: searching for optimal value of parameter \(\alpha \) (see text).

2.4 Using neural networks

Benson et al. (2019) used a neural network approach to determine \(\alpha \) for linear force-free fields from coronal images. For testing the method the authors created pseudo coronal loop images from a linear force-free model for several multi-dipolar configurations, including an active region observed with SDO. The neural networks have been trained with 70% of the images for each dataset and it was concluded that the method was very effective. It was pointed out, however, that using real coronal images instead of the pseudo images (created from a known magnetic field model) is a challenging task, because training the network is difficult and would require detailed knowledge of physical processes in the solar corona. While the application of neural networks seems to be prosperous and the first results are encouraging, such approaches are still in their infancy.

3 Analytic or semi-analytic approaches to nonlinear force-free fields

Solving the nonlinear force-free equations in full 3-D is extremely difficult. Configurations with one or two invariant coordinate(s) are more suitable for an analytic or semi-analytic treatment. Solutions in the form of an infinitely long cylinder with axial symmetry are the simplest cases, and two best known examples are Lundquist’s (1950) solution in terms of Bessel functions (\(\alpha = \hbox {constant}\)), and a solution used by Gold and Hoyle (1960) in their flare model (\(\alpha \ne \) constant, all field lines have the same pitch in the direction of the axis). Low (1973) considered a 1D Cartesian (slab) geometry and analyzed slow time evolution of the force-free field with resistive diffusion.

In Cartesian 2D geometry with one ignorable coordinate in the horizontal (depth) direction, one ends up with a second-order partial differential equation, called the Grad–Shafranov equation in plasma physics. The force-free Grad–Shafranov equation is a special case of the Grad–Shafranov equation for magneto-static equilibria (see Grad and Rubin 1958), which allow the computation of plasma equilibria with one ignorable coordinate, e.g., a translational, rotational or helical symmetry. For an overview on how the Grad–Shafranov equation can be derived for arbitrary curvilinear coordinates with axisymmetry we refer to (Marsh 1996, Section 3.2). In the Cartesian case one finds (see, e.g., Sturrock 1994, Section 13.4)

$$\begin{aligned} \varDelta A = -\lambda ^2 \, f(A), \end{aligned}$$
(21)

where the magnetic flux function A depends only on two spatial coordinates and any choice of f(A) generates a solution of a magneto-static equilibrium with symmetry. For static equilibria with a vanishing plasma pressure gradient the method naturally provides us force-free configurations. A popular choice for the generating function is an exponential function, see, e.g., Low (1977), Birn et al. (1978) and Priest and Milne (1980). The existence of solutions (sometimes multiple, sometimes none) and bifurcation of a solution sequence have been extensively investigated (e.g., Birn and Schindler 1981). We will consider the Grad–Shafranov equation in spherical polar coordinates in the following.

3.1 Low and Lou’s (1990) equilibrium

As an example we refer to Low and Lou (1990), who solved the Grad–Shafranov equation in spherical coordinates \((r, \theta , \varphi )\) for axisymmetric (invariant in \(\varphi \)) nonlinear force-free fields. In this case the magnetic field is assumed to be written in the form

$$\begin{aligned} {\mathbf {B}} = \frac{1}{r \sin \theta } \; \left( \frac{1}{r} \, \frac{\partial A}{\partial \theta } \mathbf {e}_r- \frac{\partial A}{\partial r} \mathbf {e}_{\theta } + Q \, \mathbf {e}_{\varphi } \right) , \end{aligned}$$
(22)

where A is the flux function, and Q represents the \(\varphi \)-component of the magnetic field \({\mathbf {B}}\), which depends only on A. Representing the magnetic field by a flux function automatically satisfies the solenoidal condition (6), and the force-free equation (5) reduces to a Grad–Shafranov equation for the flux function A

$$\begin{aligned} \frac{\partial ^2 A}{\partial r^2}+\frac{1-\mu ^2}{r^2} \, \frac{\partial ^2 A}{\partial \mu ^2}+Q \; \frac{d \, Q}{d \, A} =0 , \end{aligned}$$
(23)

where \(\mu =\cos \theta \). Low and Lou (1990) looked for solutions in the form

$$\begin{aligned} Q(A) = \lambda A^{1+1/n} \qquad (\alpha = \frac{d Q}{d A} \sim A^{1/n}) \end{aligned}$$
(24)

with a separating the variables in the form

$$\begin{aligned} A(r,\theta )=\frac{P(\mu )}{r^n}. \end{aligned}$$
(25)

Here n and \(\lambda \) are constants and n is not necessarily an integer; \(n=1\) and \(\lambda =0\) corresponds to a dipole field. Then Eq. (23) reduces to an ordinary differential equation for \(P(\mu )\), which can be solved numerically. Either by specifying n or \(\lambda \), the other is determined as an eigenvalue problem (Wolfson 1995).The solution in 3D space is axisymmetric and has a point source at the origin. This symmetry is also visible after a transformation to Cartesian geometry as shown in Fig. 6a. The symmetry becomes less obvious, however, when the symmetry axis is rotated with respect to the Cartesian coordinate axis; see Fig. 6b–d. The resulting configurations are very popular for testing numerical algorithms for a 3D NLFFF modeling. For such tests the magnetic field vector on the bottom boundary of a computational box is extracted from the semi-analytic Low-Lou solution and used as the boundary condition for numerical force-free extrapolations. The quality of the reconstructed field is evaluated by quantitative comparison with the exact solution; see, e.g., Schrijver et al. (2006). Similarly one can shift the origin of the point source with respect to the Sun center and the solution is not symmetric to the Sun’s surface and can be used to test spherical codes.

Fig. 6
figure 6

Low and Lou’s (1990) analytic nonlinear force-free equilibrium. The original 2D equilibrium is invariant in \(\varphi \), as shown in (a). Rotating the 2D-equilibrium and a transformation to Cartesian coordinates make this symmetry less obvious (bd), where the equilibrium has been rotated by an angle of \(\varphi =\frac{\pi }{8}, \, \frac{\pi }{4}\), and \(\frac{\pi }{2}\), respectively. The colour-coding corresponds to the vertical magnetic field strength in G (gauss) in the photosphere (\(z=0\) in the model) and a number of arbitrary selected magnetic field lines are shown in yellow. The distances on the axes are in pixel of the computational grid

3.2 Titov–Démoulin equilibrium

Another approach for computing axisymmetric NLFFF solutions has been developed in Titov and Démoulin (1999). This model active region contains a current-carrying flux-tube, which is imbedded into a potential field. A motivation for such an approach is that solar active regions may be thought of as composed of such flux tubes. The method allows the study of a sequence of force-free configurations through which the flux tube emerges. Figure 7 shows how the equilibrium is built up. The model contains a symmetry axis, which is located at a distance d below the photosphere. A line current \(I_0\) runs along this symmetry axis and creates a circular potential magnetic field. This potential field becomes disturbed by a toroidal ring current I with the minor radius a and the major radius R, where \(a \ll R\) is assumed. Two opposite magnetic monopoles of strength q are placed on the axis separated by distance L. These monopoles are responsible for the poloidal potential field. This field has its field lines overlying the force-free current and stabilizes the otherwise unstable configuration. The equilibrium becomes more stable as the toroidal field component

$$\begin{aligned} B_{\theta } \approx \frac{\mu _0 I_0}{2 \pi R} \end{aligned}$$
(26)

is increased. Consequently, an increasing value of R leads to a decreasing toroidal field component and a less stable equilibrium. Under certain approximations (see Appendix A in Titov and Démoulin 1999, for details) the condition where the equilibrium becomes unstable (mainly to a kink instability) can be analytically estimated as

$$\begin{aligned} R \gtrsim \sqrt{2} \, L. \end{aligned}$$
(27)

The unstable branch of this equilibrium has been used to study the onset of coronal mass ejections; see Sect. 5.5. Stable branches of the Titov–Démoulin equilibrium are used as a challenging test for numerical NLFFF extrapolation codes (see, e.g., Wiegelmann et al. 2006a; Valori et al. 2010).

Fig. 7
figure 7

Image reproduced with permission from Fig. 2 of Titov and Démoulin (1999), copyright by ESO

Construction of the Titov–Démoulin equilibrium.

4 Azimuth ambiguity removal and consistency of field measurements

4.1 How to derive vector magnetograms?

NLFFF extrapolations require the photospheric magnetic field vector as input. Before discussing how this vector can be extrapolated into the solar atmosphere, we will address known problems regarding the photospheric field measurements. Vector magnetographs are being operated daily at NAOJ/Mitaka (Sakurai et al. 1995), NAOC/Huairou (Ai and Hu 1986), NASA/MSFC (Hagyard et al. 1982), NSO/Kitt Peak (Henney et al. 2006), and U. Hawaii/Mees Observatory (Mickey et al. 1996), among others. The Solar Optical Telescope (SOT; Tsuneta et al. 2008) on the Hinode mission has been taking vector magnetograms since 2006. Full-disk vector magnetograms are observed routinely since 2010 by the Helioseismic and Magnetic Imager (HMI; Scherrer et al. 2012) onboard the Solar Dynamics Observatory (SDO). Measurements with these vector magnetographs provide us eventually with the magnetic field vector on the photosphere, say \(B_{z0}\) for the vertical and \(B_{x0}\) and \(B_{y0}\) for the horizontal fields. Deriving these quantities from measurements is an involved physical process based on the Zeeman and Hanle effects and the related inversion of Stokes profiles (e.g., LaBonte et al. 1999). Within this work we only outline the main steps and refer to del Toro Iniesta and Ruiz Cobo (1996), del Toro Iniesta (2003) and Landi Degl’Innocenti and Landolfi (2004) for details. The actual measurements are not the field components but are polarization degrees across magnetically sensitive spectral lines, e.g., the line pair Fe i 6302.5 and 6301.5 Å as used on Hinode/SOT (see Lites et al. 2007) or Fe i 6173.3 Å as used on SDO/HMI (see Schou et al. 2012). The accuracy of these measurements depends on the spectral resolution, for example the HMI instruments measures at six points in the Fe i 6173.3 Å absorption line. In a subsequent step the Stokes profiles are inverted to derive the magnetic field strength, its inclination and azimuth. One possibility to carry out the inversion (see Lagg et al. 2004) is to fit the measured Stokes profiles with synthetic ones derived from the Unno–Rachkovsky solutions (Unno 1956; Rachkovsky 1967). Usually one assumes a simple radiative transfer model like the Milne–Eddington atmosphere (see, e.g., Landi Degl’Innocenti 1992) in order to derive the analytic Unno–Rachkovsky solutions. The line-of-sight component of the field is approximately derived by \(B_\ell \propto V/I\), where V is the circular polarization and I the intensity (the so-called weak-field approximation). The error from photon noise is approximately \(\delta B_\ell \propto \frac{\delta V}{I}\), where \(\delta \) corresponds to noise in the measured and derived quantities. As a rule of thumb, \(\delta V/I \approx 10^{-3}\) and \(\delta B_\ell \approx \) a few gauss (G) in currently operating magnetographs. The horizontal field components can be approximately derived from the linear polarization Q and U as \(B_t ^2 \propto \sqrt{Q^2 +U^2}/I\). The error in \(\delta B_t\) is estimated as \( B_t \, \delta B_t \propto \frac{Q \delta Q+U \delta U}{\sqrt{Q^2+U^2} I}\) from which the minimum detectable \(B_t \, (\delta B_t \approx B_t\)) is proportional to the square root of the photon noise \(\approx \sqrt{\delta Q^2 +\delta U^2}/I \approx \sqrt{\delta V/I}\), namely around a few tens of G, one order of magnitude higher than \(\delta B_\ell \). (Although \(\delta B_t\) scales as \(1/B_t\) and gives much smaller \(\delta B_t\) for stronger \(B_t\), one usually assumes a conservative error estimate that \(\delta B_t \approx \) a few tens of G regardless of the magnitude of \(B_t\).)

Additional complications occur when the observed region is far away from the disk center and consequently the line-of-sight and vertical magnetic field components differ from each other with a large angle (see Gary and Hagyard 1990, for details). The inverted horizontal magnetic field components \(B_{x0}\) and \(B_{y0}\) cannot be uniquely derived, but contain a \(180^{\circ }\) ambiguity in azimuth, which has to be removed before the fields can be extrapolated into the corona. In the following, we will discuss this problem briefly. For a more detailed review and a comparison and performance check of currently available ambiguity-removal routines with synthetic data, see Metcalf et al. (2006).

To remove the ambiguity from this kind of data, some a priori assumptions regarding the structure of the magnetic field vector are necessary, e.g., regarding smoothness. Some methods require also an approximation regarding the 3D magnetic field structure (usually from a potential field extrapolation); for example to minimize the divergence of magnetic field vector or the angle with respect to the potential field. We are mainly interested here in automatic methods, although manual methods are also popular, e.g., the AZAM code. If we have in mind, however, the huge data stream from SDO/HMI, fully automatic methods are desirable. In the following, we will give a brief overview of the ambiguity removal techniques and tests with synthetic data.

4.2 Quantitative comparison of ambiguity removal algorithms

Metcalf et al. (2006) compared several algorithms and implementations quantitatively with the help of two synthetic data sets, a flux-rope simulation by Fan and Gibson (2004) and a multipolar constant-\(\alpha \) structure computed with the Chiu and Hilton (1977) linear force-free code. The results of the different ambiguity removal techniques have been compared with a number of metrics (see Table II in Metcalf et al. 2006). For the discussion here we concentrate only on the first test case (flux rope) and the area metrics, which simply tells for what fraction of pixels the ambiguity has been removed correctly. A value of 1 corresponds to a perfect result and 0.5 to random. The result is visualized in Fig. 8, where the ambiguity has been removed correctly in black areas. Wrong pixels are white. In the following, we briefly describe the basic features of these methods and provide the performance (percentage of pixels with correctly removed ambiguity).

Fig. 8
figure 8

Image reproduced with permission from Fig. 3 of Metcalf et al. (2006), copyright by Springer

Overview of the performance of different algorithms for removing the \(180^{\circ }\) azimuth ambiguity. The codes have been applied to synthetic data (a flux-rope simulation by Fan and Gibson 2004). In black areas the codes found the correct azimuth and in white areas not.

4.3 Ambiguity removal algorithms

4.3.1 Acute angle method

The magnetic field in the photosphere is usually not force-free and even not current-free, but an often made assumption is that from two possible directions (\(180^{\circ }\) apart) of the observed field \({\mathbf {B}}^{\mathrm{obs}}\), the solution with the smaller angle to the potential field (or another suitable reference field) \({\mathbf {B}}^{0}\) is the more likely candidate for the true field. Consequently, we get for the horizontal/transverseFootnote 2 field components \({\mathbf {B}}_t\) the condition

$$\begin{aligned} {\mathbf {B}}_t^{\mathrm{obs}} \cdot {\mathbf {B}}_t^{0} >0. \end{aligned}$$
(28)

This condition is easy to implement and fast in application. In Metcalf et al. (2006) several different implementations of the acute angle method are described, which mainly differ by the algorithms used to compute the reference field. The different implementations of the acute angle methods got 64%–75% of the pixels correct (see Fig. 8, panels marked with NJP, YLP, KLP, BBP, JLP, and LSPM).

4.3.2 Improved acute angle methods

A sophistication of the acute angle method uses linear force-free fields (Wang 1997; Wang et al. 2001), where the optimal force-free parameter \(\alpha \) is chosen to maximize the integral

$$\begin{aligned} S=\int \frac{|{\mathbf {B}}^{\mathrm{obs}} \cdot {\mathbf {B}}^{\mathrm{lff}}|}{B^{\mathrm{obs}} \, B^{\mathrm{lff}}} dx \, dy \, \end{aligned}$$
(29)

where \({\mathbf {B}}^{\mathrm{lff}}\) is the linear force-free reference field. 87% of the pixels have been identified correctly (see Fig. 8 second row, right panel marked with HSO).

Another approach, dubbed uniform shear method by Moon et al. (2003) uses the acute angle method (with a potential field as reference) only as a first approximation and subsequently uses this result to estimate a uniform shear angle between the observed field and the potential field. Then the acute angle method is applied again to resolve the ambiguity, taking into account the average shear angle between the observed field and the calculated potential field. 83% of the pixels have been identified correctly. Consequently both methods significantly improve the potential-field acute angle method (see Fig. 8 third row, center panel marked with USM).

4.3.3 Magnetic pressure gradient

The magnetic pressure gradient method (Cuperman et al. 1993) assumes a force-free field and that the magnetic pressure \(B^2/2\) decreases with height. Using the solenoidal and force-free conditions, we can compute the vertical magnetic pressure gradient as:

$$\begin{aligned} \frac{1}{2} \frac{\partial B^2}{\partial z}= B_x \frac{\partial B_z}{\partial x}+ B_y \frac{\partial B_z}{\partial y} - B_z \left( \frac{\partial B_x}{\partial x}+\frac{\partial B_y}{\partial y} \right) \end{aligned}$$
(30)

with any initial choice for the ambiguity of the horizontal magnetic field components \((B_x, B_y)\). Different solutions of the ambiguity removal method give the same amplitude, but opposite sign for the vertical pressure gradient. If the vertical gradient becomes positive, then the transverse field vector is reversed. For the test this method got 74% of the pixels correct, which is comparable with the potential-field acute angle method (see Fig. 8 forth row, left panel marked with MS).

4.3.4 Structure minimization method

The structure minimization method (Georgoulis et al. 2004) is a semi-analytic method which aims at eliminating dependencies between pixels. We do not describe the method here, because in the test only for 22% of the pixels the ambiguity has been removed correctly, which is worse than a random result (see Fig. 8 third row, right panel marked with MPG).

4.3.5 Non-potential magnetic field calculation method

The non-potential magnetic field method developed by Georgoulis (2005) is identical with the acute angle method close to the disk center. Away from the disk center the method is more sophisticated and uses the fact that the magnetic field can be represented as a combination of a potential field and a non-potential part \({\mathbf {B}}={\mathbf {B}}_{\mathrm{p}}+{\mathbf {B}}_{\mathrm{c}}\), where the non-potential part \({\mathbf {B}}_{\mathrm{c}}\) is horizontal on the boundary and only \({\mathbf {B}}_{\mathrm{c}}\) contains electric currents. The method aims at computing a fair a priori approximation of the electric current density before the ambiguity removal. With the help of a Fourier method the component \({\mathbf {B}}_{\mathrm{c}}\) and the corresponding approximate field \({\mathbf {B}}\) are computed. This field is then used as the reference field for an acute angle method. The quality of the reference field depends on the accuracy of the a priori assumed electric current density \(j_z\). In the original implementation by Georgoulis (2005) \(j_z\) was chosen once a priori and not changed afterwards. In an improved implementation (published as part of the comparison paper by Metcalf et al. (2006) and implemented by Georgoulis) \(j_z\) becomes updated in an iterative process. The original implementation got 0.70 pixels correct and the improved version 0.90 (see Fig. 8 forth row, center and right panels marked with NPFC and NPFC2, respectively). So the original method is on the same level as the potential-field acute angle method, but the current iteration introduced in the updated method gives significantly better results. This method has been used for example to resolve the ambiguity of full-disk vector magnetograms from the Synoptic Optical Long-term Investigations of the Sun (SOLIS)/VSM instrument (Henney et al. 2006) at NSO/Kitt Peak.

4.3.6 Pseudo-current method

The pseudo-current method developed by Gary and Démoulin (1995) uses as the initial step the potential-field acute angle method and subsequently applies this result to compute an approximation for the vertical electric current density. The current density is then approximated by a number of local maxima of \(j_z\) with an analytic expression containing free model parameters, which are computed by minimizing a functional of the square of the vertical current density. This optimized current density is then used to compute a correction to the potential field. This new reference field is then used in the acute angle method to resolve the ambiguity. In the test case this method got 78% of the pixels correct, which is only slightly better than the potential-field acute angle method (see Fig. 8 fifth row, left panel marked with PCM).

4.3.7 U. Hawai’i iterative method

This method, originally developed in Canfield et al. (1993) and subsequently improved by a group of people at the Institute for Astronomy, U. Hawai’i. As the initial step the acute angle method is applied, which is then improved by a constant-\(\alpha \) force-free field, where \(\alpha \) has to be specified by the user (in principle it should also be possible to apply an automatic \(\alpha \)-fitting method as discussed in Sect. 4.3.2). Therefore, the result would be similar to the improved acute angle methods, but two additional steps have been introduced for a further improvement. In a subsequent step the solution is smoothed (minimizing the angle between neighboring pixels) by starting at a location where the field is radial and the ambiguity is obvious, e.g., the umbra of a sunspot. Finally also the magnetic field divergence or vertical electric current density is minimized. This code includes several parameters, which have to be specified by the user. In the test case the code recognized 97% of the pixels correctly. So the additional steps beyond the improved acute angle method provide another significant improvement and almost the entire region has been correctly identified (see Fig. 8 fifth row, center panel marked with UHIM).

4.3.8 Minimum energy methods

The minimum energy method has been developed by Metcalf (1994). As other sophisticated methods it uses the potential-field acute angle method as the initial step. Subsequently a pseudo energy, which is defined as a combination of the magnetic field divergence and electric current density, is minimized. In the original formulation the energy was defined as \(E=\sum (|\nabla \cdot {\mathbf {B}}|+|{\mathbf {j}}|)\), which was slightly modified to

$$\begin{aligned} E=\sum (|\nabla \cdot {\mathbf {B}}|+|{\mathbf {j}}|)^2 \end{aligned}$$
(31)

in an updated version. For computing \(j_x\), \(j_y\), and \(\partial B_z/\partial z\), a linear force-free model is computed, in the same way as described in Sect. 4.3.7. The method minimizes the functional (31) with the help of a simulated annealing method, which is a robust algorithm to find a global minimum. In Metcalf et al. (2006) the (global) linear force-free assumption has been relaxed and replaced by local linear force-free assumptions in overlapping parts of the magnetogram. The method was dubbed nonlinear minimum energy method, although it does not use true NLFF fields (would be too slow) for computing the divergence and electric currents. The original linear method got 98% of the pixels correctly and the nonlinear minimum energy method even 100%. Almost all pixels have been correct, except a few on the boundary (see Fig. 8 fifth row, right panel and last row left panel, marked with ME1 and ME2, respectively.) Among the fully automatic methods this approach had the best performance on accuracy. A problem for practical use of the method was that it is very slow, in particular for the nonlinear version. Minimum energy methods are routinely used to resolve the ambiguity in active regions as measured, e.g., with SOT on Hinode or HMI on SDO.

4.4 Summary of automatic methods

The potential-field acute angle method is easy to implement and fast, but its performance of 0.64 – 0.75 is relatively poor. The method is, however, very important as an initial step for more sophisticated methods. Using more sophisticated reference fields (linear force-free fields, constant shear, non-potential fields) in the acute angle method improves the performance to about 0.83 – 0.90. Linear force-free or similar fields are a better approximation to a suitable reference field, but the corresponding assumptions are not fulfilled in a strict sense, which prevents a higher performance. The magnetic pressure gradient and pseudo-current methods are more difficult to implement as simple acute angle methods, but do not perform significantly better. A higher performance is prevented, because the basic assumptions are usually not fulfilled in the entire region. For example, the assumption that the magnetic pressure always decreases with height is not fulfilled over bald patches (Titov et al. 1993). The multi-step U. Hawai’i iterative method and the minimum energy methods showed the highest performance of > 0.97. The pseudo-current method is in principle similar to the better performing minimum energy methods, but due to several local minima it is not guaranteed that the method will always find the global minimum. Let us remark that Metcalf et al. (2006) introduced more comparison metrics, which, however, do not influence the relative rating of the discussed ambiguity algorithms. They also carried out another test case using the Chiu and Hilton (1977) linear force-free model, for which most of the codes showed an absolutely better performance, but again this does hardly influence the relative performance of the different methods. One exception was the improved non-potential magnetic field algorithm, which performed with similar excellence as the minimum energy and U. Hawai’i iterative methods.

The SDO/HMI-vector magnetic field pipeline (see Hoeksema et al. 2014, for details) uses the minimum energy method for the disambiguation in active regions. For SDO/HMI full disk and synoptic maps (see Liu et al. 2017, for details) a combination of different ambiguity removal methods has been used in the quiet Sun. For pixels above 150G the minimum energy method is used. For weaker field pixels in the quiet Sun three simpler methods have been applied: An acute angle method with a potential field, an acute angle method with the radial field and a random method. Applying the minimum energy method to full disk data is more time consuming, but has been done for selected data-sets (see Liu et al. 2017).

4.4.1 HAO AZAM method

This is an interactive tool, which needs human intervention for the ambiguity removal. In the test case, which has been implemented and applied by Bruce Lites, all pixels have been identified correctly. It is of course difficult to tell about the performance of the method, but only about a human and software combination. For some individual or a few active regions the method might be appropriate, but not for a large amount of data.

4.4.2 Ambiguity removal methods using additional observations

The methods described so far use as input the photospheric magnetic field vector measured at a single height in the photosphere. If additional observations/measurements are available they can be used for the ambiguity removal. Measurements at different heights in order to solve the ambiguity problem have been proposed by Li et al. (1993) and revisited by Li et al. (2007). Knowledge of the magnetic field vector at two heights allows us to compute the divergence of the magnetic field and the method was dubbed divergence-free method. The method is non-iterative and thus fast. Li et al. (2007) applied the method to the same flux-rope simulation by Fan and Gibson (2004) as discussed in the examples above, and the method recovered about 98% of the pixels correctly. The main shortcoming of this method is certainly that it can be applied only if vector magnetic field measurements at two heights are available, which is unfortunately not the case for most current data sets. A further complication arises in sunspots and pores. As found by Balthasar (2018) there is a large method-dependent discrepancy in the computed vertical gradient of the vertical magnetic field component. The magnetic field gradient derived from spectral line measurements in two heights is much larger (by about a factor of five) than by estimating it from horizontal measurements and using the solenoidal condition. This discrepancy naturally affects ambiguity removal methods based on measurements in different heights and the divergence \({\mathbf {B}}\) condition. As pointed out in Balthasar (2018) new solar facilities with better spatial resolution might help to resolve this discrepancy and we aim to report about it in a future update of this review article.

Martin et al. (2008) developed the so-called chirality method for e ambiguity removal, which takes additional observations into account, e.g., \(\hbox {H}\alpha \), EUV, or X-ray images. Such images are used to identify the chirality in solar features like filaments, fibrils, filament channels, or coronal loops. Martin et al. (2008) applied the method to different solar features, but to our knowledge the method has not been tested with synthetic data, where the true solution of the ambiguity is known. Therefore, unfortunately one cannot compare the performance of this method with the algorithms described above. It is also now obvious that fully automatic feature recognition techniques to identify the chirality from observed images need to be developed.

From Solar Orbiter, which was launched in February 2020, additional vector magnetograms will become available from above the ecliptic. Taking these observations from two vantage positions combined is expected to be helpful for the ambiguity resolution. If separated by a certain angle, the definition of line-of-sight field and transverse field will be very different from both viewpoints. Removing the ambiguity should be a straightforward process by applying the transformation to vertical and horizontal fields on the photosphere from both viewpoints separately. If the wrong azimuth is chosen, then both solutions will be very different and the ambiguity can be removed by simply checking the consistency between vertical and horizontal fields from both observations.

4.4.3 Effects of noise and spatial resolution

The comparison of ambiguity removal methods started in Metcalf et al. (2006) has been continued in Leka et al. (2009). The authors investigated the effects of Poisson photon noise and a limited spatial resolution. It was found that most codes can deal well with random noise and the ambiguity resolution results are mainly affected locally, but bad solutions (which are locally wrong due to noise) do not propagate within the magnetogram. A limited spatial resolution leads to a loss of information about the fine structure of the magnetic field and erroneous ambiguity solutions. Both photon noise and binning to a lower spatial resolution can lead to artificial vertical currents. The combined effect of noise and binning affect the computation of a reference magnetic field used in acute angle methods as well as quantities in minimization approaches like the electric current density and \(\nabla \cdot {\mathbf {B}}\). Sophisticated methods based on minimization schemes performed again best in the comparison of methods and are more suitable to deal with the additional challenges of noise and limited resolution. As a consequence of these results Leka et al. (2009) suggested that one should use the highest possible resolution for the ambiguity resolution task and if binning of the data is necessary, this should be done only after removing the ambiguity. Georgoulis (2012) challenged their conclusion that the limited spatial resolution was the cause of the failure of ambiguity removal techniques using potential or non-potential reference fields. Georgoulis (2012) pointed out that the failure was caused by a non-realistic test-data set and not by the limited spatial resolution. In a reply to these comments Leka et al. (2012) carried out further investigations and pointed also out several difficulties to create good reference cases to test ambiguity removal methods. That a reduced spatial resolution affects the ambiguity removal was confirmed in this study.

Crouch (2013) investigated the effects of noise and limited spatial resolution for three ambiguity-resolution algorithms based on the divergence-free condition. Codes incorporating this condition need at least measurements at two heights to compute derivatives of the measured magnetic field in the line-of-sight direction. Codes based on a global minimization procedure have been demonstrated to be more robust than simpler approaches. Nevertheless all ambiguity-removal codes based on the divergence-free condition are sensitive to photon noise and unresolved structures due to a limited spatial resolution. Smoothing the data before ambiguity removal does not improve the result. A hybrid approach which minimizes the divergence-free condition under the additional constraint of smoothness improved the result, but still did not provide desirable results in areas with high photon noise. While in Crouch (2013) the ambiguity resolution at different heights influenced each other, the author applied an implementation for resolving the ambiguity at each height independently in Crouch (2015). The result that the hybrid approach performed best remained and the results have been similar, whereas the new approach required a substantial reduced computation time.

4.5 Derived quantities, electric currents, and α

The well-known large uncertainties in the horizontal magnetic field component, in particular in weak field regions (see Sect. 4.1), cause large errors when computing the electric current density with finite differences via Eq. (13). Even more critical is the computation of \(\alpha \) with Eq. (14) in weak field regions and in particular along polarity inversion lines (see, e.g., Cuperman et al. 1991). The nonlinear force-free coronal magnetic field extrapolation is a boundary value problem. As we will see later, some of the NLFFF codes make use of Eq. (14) to specify the boundary conditions while other methods use the photospheric magnetic field vector more directly to extrapolate the field into the corona.

4.6 Consistency criteria for force-free boundary conditions

After Stokes inversion (see Sect. 4.1) and azimuth ambiguity removal, we derive the photospheric magnetic field vector. Unfortunately there might be a problem, when we want to use these data as the boundary condition for NLFFF extrapolations. The solar magnetic field is not force-free in the photosphere (because of the finite \(\beta \) plasma, see Fig. 2 from Gary 2001), but becomes force-free only at about 400 km above the photosphere (see Sect. 4.7 and Metcalf et al. 1995, for details). Consequently, the assumption of a force-free magnetic field is not necessarily justified in the photosphere. Unless we have information on the magnetic flux through the lateral and top boundaries, we have to assume that the photospheric magnetic flux is balanced

$$\begin{aligned} \int _{S} B_z(x,y,0) \;dx\,dy =0, \end{aligned}$$
(32)

which is usually the case when taking an entire active region as the field-of-view.

In the following, we review some necessary conditions the magnetic field vector has to fulfill in order to be suitable as boundary conditions for NLFFF extrapolations. Molodenskii (1969), Molodensky (1974), Low (1985) and Aly (1989) defined several integral relations, which are related to two moments of the magnetic stress tensor.

  1. 1.

    The first moment corresponds to the net magnetic force, which has to vanish on the boundary:

    $$\begin{aligned} \int _{S} B_x B_z \;dx\,dy= \int _{S} B_y B_z \;dx\,dy = 0 , \end{aligned}$$
    (33)
    $$\begin{aligned} \int _{S} (B_x^2 + B_y^2) \; dx\,dy= \int _{S} B_z^2 \; dx\,dy. \end{aligned}$$
    (34)
  2. 2.

    The second moment corresponds to a vanishing torque on the boundary:

    $$\begin{aligned} \int _{S} x \; (B_x^2 + B_y^2) \; dx\,dy= \int _{S} x \; B_z^2 \; dx\,dy , \end{aligned}$$
    (35)
    $$\begin{aligned} \int _{S} y \; (B_x^2 + B_y^2) \; dx\,dy= \int _{S} y \; B_z^2 \; dx\,dy , \end{aligned}$$
    (36)
    $$\begin{aligned} \int _{S} y \; B_x B_z \; dx\,dy= \int _{S} x \; B_y B_z \; dx\,dy . \end{aligned}$$
    (37)

The total energy of a force-free configuration can be estimated directly from boundary conditions with the help of the virial theorem (see, e.g., Aly 1989, for a derivation of this formula)

$$\begin{aligned} E_{\mathrm{tot}}=\frac{1}{\mu _0} \; \int _{S} (x \; B_x + y \; B_y) \; B_z \; dx\,dy . \end{aligned}$$
(38)

For Eq. (38) to be applicable, the boundary conditions must be compatible with the force-free assumption. The integral relations (33)–(37) are necessary conditions and if they are not fulfilled then the data are not consistent with the assumption of a force-free field. A principal way to avoid this problem would be to measure the magnetic field vector in the low-\(\beta \) chromosphere, but unfortunately such measurements are not routinely available. We have therefore to rely on photospheric measurements and apply some procedure, dubbed ‘preprocessing’, in order to derive boundary conditions for NLFFF extrapolations which are more consistent with the force-free approximation than the original measurements. Another necessary condition for force-free consistency, as pointed out by Aly (1989), is the condition that \(\alpha \) is constant on magnetic field lines (12). This leads to the integral relation

$$\begin{aligned} \int _{S_{+}} f(\alpha ) \, B_n \cdot dA=\int _{S_{-}} f(\alpha ) \, B_n \cdot dA, \end{aligned}$$
(39)

where \(S_{+}\) and \(S_{-}\) correspond to areas with positive and negative \(B_z\) in the photosphere, respectively, and f is an arbitrary function. Condition (39) is referred to as differential flux-balance condition as it generalizes the usual flux-balance condition (32). As the connectivity of magnetic field lines (magnetic positive and negative regions on the boundary connected by field lines) is a priori unknown, relation (39) can only be evaluated after a 3D force-free model has been computed.

4.7 Evaluation of forces from magnetograms

The integral relations (33, 34) can be used to compute the forces in the photosphere (or other layers if measurements are available)

$$\begin{aligned} F_x= - \frac{1}{4 \pi } \int _{S} B_x B_z \;dx\,dy \end{aligned}$$
(40)
$$\begin{aligned} F_y= - \frac{1}{4 \pi } \int _{S} B_y B_z \;dx\,dy \end{aligned}$$
(41)
$$\begin{aligned} F_z= \frac{1}{8 \pi } \int _{S} (B_x^2 + B_y^2- B_z^2) \; dx\,dy \end{aligned}$$
(42)
$$\begin{aligned} F_p= \frac{1}{8 \pi } \int _{S} (B_x^2 + B_y^2 + B_z^2) \; dx\,dy \end{aligned}$$
(43)

where \(F_p\) is an integral over the magnetic pressure and used for normalization. If the dimensionless quantities

$$\begin{aligned} \frac{|F_x|}{F_p}, \, \frac{|F_y|}{F_p}, \, \frac{|F_z|}{F_p},\ll 1 \end{aligned}$$
(44)

then the field can be considered consistent with the force-free condition. For arbitrary computational domains the integral-relations (3337) have to be integrated over the entire surface of the computational domain, e.g., the bottom boundary, side boundaries and top boundary of a Cartesian box. Magnetic field measurements of the lateral and top boundaries are not available, however. Therefore one has to assume that the contributions of the lateral and top boundaries are small and can be neglected. The ideal situation would be a flux-balanced active region surrounded by a skirt of low magnetic field strength. This makes it a pre-requisite and necessary condition that the investigated region is flux-balanced, because any unbalanced flux on the bottom boundary need to be compensated through the other boundaries. For practical computations a flux-imbalance of up to about 10% seems acceptable (see, e.g., Moon et al. 2002), whereas the (to our knowledge) first measurements of forces in the solar atmosphere by Metcalf et al. (1995) have been applied to magnetograms (obtained with the Stokes Polarimeter at Mees Solar Observatory) with a maximum imbalance of 0.5%. Another problem is that noise might influence the result, and consequently Metcalf et al. (1995) considered only pixels with a field strength above the noise-level (150 G) of the horizontal fields and different approximations for filling factors in the inversion have been applied to these profiles. The authors investigated the three dimensionless forces (44) separately as a function of height. In the photosphere \(z=0\) km they (Fig. 7 in Metcalf et al. 1995) found \(\frac{|F_x|}{F_p} \approx 0.3, \frac{|F_y|}{F_p} \approx 0.4, \frac{|F_z|}{F_p} \approx 0.6\), but the forces decrease with height and at \(z=400\) km all three dimensionless forces are below 0.1. Therefore it was concluded that the field is not force-free in the photosphere, but becomes approximately force-free at a height of 400 km.

In subsequent works, statistical studies based on the dimensionless forces (44) have been done, but they have been limited to photospheric measurements. A common finding is that the vertical force \(\frac{|F_z|}{F_p}\) in the photosphere are usually (but not always) higher than the horizontal forces \(\frac{|F_x|}{F_p}\) and \(\frac{|F_y|}{F_p}\). Moon et al. (2002) investigated 12 flaring active regions and found \(\frac{|F_z|}{F_p}\) in the range 0.06–0.32 with a median value of 0.13 and they also found that the forces change with time. Tiwari (2012) investigated time series of 19 active regions with high resolution vector magnetograms from Hinode/SOT-SP and concentrated on sunspot areas (most of them approximately flux balanced with an imbalance below 10%, see Fig. 9 for an example). Typical values of the dimensionless forces (44) have been found around 0.1, for some regions even lower, but for other ones values up to nearly 0.6 have been found. Consequently, the majority of the regions are not force-free, but the forces are rather low in the majority of the cases (confirming results from Moon et al. 2002), whereas the values of the regions with the largest forces are comparable to the findings in Metcalf et al. (1995).

Fig. 9
figure 9

Image reproduced with permission from Fig. 1 of Tiwari (2012), copyright by AAS

a Shows the continuum intensity and b the vertical tension force \(F_z\) map of a sunspot observed with Hinode. Umbra and penumbra are marked with white and black dashed lines, respectively. c Shows a histogram of the tension force and d separately the tension force in the umbra (black) und penumbra (blue).

Liu et al. (2013) investigated 925 magnetograms observed with the Solar Magnetic Field Telescope at the Huairou Solar Observatory. Similar to the previous studies it was confirmed that the vertical force is mostly larger than the horizontal ratios and concluded that it is sufficient to check if \(\frac{|F_z|}{F_p} < 0.1\) as the force-free criterion. The authors pointed out that the exact degree of force-freeness depends on calibration coefficients during the inversion. It was found that only a minority of the magnetograms (17% or 25% dependent on inversion-parameters) are force-free with \(\frac{|F_z|}{F_p} < 0.1\) and 38% or 49% of the regions have \(\frac{|F_z|}{F_p} < 0.2\). Consequently, more than half of the investigated magnetograms contain significant forces and are not consistent with the force-free condition.

As already pointed out, instrumental effects, the inversion method/parameters, noise, flux-balance and field-of-view effects influence the computation of the photospheric forces. Therefore, these effects have been investigated systematically in a study by Zhang et al. (2017).

4.8 Preprocessing

Wiegelmann et al. (2006b) developed a numerical algorithm in order to use the integral relations (33)–(37) to derive more consistent NLFFF boundary conditions from photospheric measurements. To do so, we define the functional:

$$\begin{aligned} L_{\mathrm{prep}}= \mu _1 L_1 + \mu _2 L_2 + \mu _3 L_3 + \mu _4 L_4 , \end{aligned}$$
(45)
$$\begin{aligned} L_1= \left[ \left( \sum _p B_x B_z \right) ^2 +\left( \sum _p B_y B_z \right) ^2 +\left( \sum _p B_z^2-B_x^2-B_y^2 \right) ^2 \right] , \end{aligned}$$
(46)
$$\begin{aligned} L_2 &= \left[ \left( \sum _p x \left( B_z^2-B_x^2-B_y^2 \right) \right) ^2 +\left( \sum _p y \left( B_z^2-B_x^2-B_y^2 \right) \right) ^2 \right. \nonumber \\&\quad\left. +\left( \sum _p y B_x B_z -x B_y B_z \right) ^2 \right] , \end{aligned}$$
(47)
$$\begin{aligned} L_3 = \left[ \sum _p \left( B_x-B_{x\, \mathrm {obs}} \right) ^2 +\sum _p \left( B_y-B_{y\, \mathrm {obs}} \right) ^2 +\sum _p \left( B_z-B_{z\, \mathrm {obs}} \right) ^2 \right] , \end{aligned}$$
(48)
$$\begin{aligned} L_4= \left[ \sum _p \left( \varDelta B_x \right) ^2 +\left( \varDelta B_y \right) ^2 +\left( \varDelta B_z \right) ^2 \right] . \end{aligned}$$
(49)

The first and second terms (\(L_1, L_2\)) are quadratic forms of the force and torque balance conditions, respectively. The \(L_3\) term measures the difference between the measured and preprocessed data. \(L_4\) controls the smoothing, which is useful for the application of the data to finite-difference numerical code. The smoothing term is also useful to receive a better approximation of the force-free consistent chromosphere, because the field expands from the photosphere through the chromosphere and consequently the magnetic field in the low-\(\beta \) chromosphere is smoother than in the photosphere. The aim is to minimize \(L_{\mathrm{prep}}\) so that all terms \(L_n\) are made small simultaneously. The optimal parameter sets \(\mu _n\) have to be specified for each instrument separately. The resulting magnetic field vector is then used to prescribe the boundary conditions for NLFFF extrapolations. In an alternative approach Fuhrmann et al. (2007) applied a simulated annealing method to minimize the functional. Furthermore they removed the \(L_3\) term in favour of a different smoothing term \(L_4\), which uses the median value in a small window around each pixel for smoothing. The preprocessing routine has been extended in Wiegelmann et al. (2008) by including chromospheric measurements, e.g., by minimizing additionally the angle between the horizontal magnetic field and chromospheric H\(\alpha \) fibrils. In principle, one could add additional terms to include more direct chromospheric observations, e.g., line-of-sight measurements of the magnetic field in higher regions as provided by SOLIS. In principle, it should be possible to combine methods for ambiguity removal and preprocessing in one code, in particular for ambiguity codes which also minimize a functional like the Metcalf (1994) minimum energy method. A mathematical difficulty for such a combination is, however, that the preprocessing routines use continuous values, but the ambiguity algorithms use only two discrete states at each pixel. Preprocessing minimizes the integral relations (33 – 37) and the value of these integrals reduces usually by orders of magnitudes during the preprocessing procedure. These integral relation are, however, only necessary and not sufficient conditions for force-free consistent boundary conditions, and preprocessing does not make use of condition (39). Including this condition is not straight forward as one needs to know the magnetic field line connectivity, which is only available after the force-free configuration has been computed in 3D. An alternative approach for deriving force-free consistent boundary conditions is to allow changes of the boundary values (in particular the horizontal field) during the force-free reconstruction itself, e.g., as employed by Wheatland and Régnier (2009), Amari and Aly (2010) and Wiegelmann and Inhester (2010). The numerical implementation of these approaches does necessarily depend on the corresponding force-free extrapolation codes and we refer to Sects. 6.2 and 6.4 for details.

5 Nonlinear force-free fields in 3D

In the following section, we briefly discuss some general properties of force-free fields, which are relevant for solar physics, like the magnetic helicity, estimations of the minimum and maximum energy a force-free field can have for certain boundary conditions and investigations of the stability. Such properties are assumed to play an important role for solar eruptions. The Sun and the solar corona are of course three-dimensional and for any application to observed data, configurations based on symmetry assumptions (as used in Sect. 3) are usually not applicable. The numerical treatment of nonlinear problems, in particular in 3D, is significantly more difficult than linear ones. Linearized equations are often an over-simplification which does not allow the appropriate treatment of physical phenomena. This is also true for force-free coronal magnetic fields and has been demonstrated by comparing linear force-free configurations (including potential fields, where the linear force-free parameter \(\alpha \) is zero).

Computations of the photospheric \(\alpha \) distribution from measured vector magnetograms by Eq. (14) show that \(\alpha \) varies across the photosphere (see, e.g., Pevtsov et al. 1994; Régnier et al. 2002; DeRosa et al. 2009). Complementary to this direct observational evidence that nonlinear effects are important, there are also theoretical arguments. Linear models are too simple to estimate the free magnetic energy. Potential fields correspond to the minimum energy configuration for a given magnetic flux distribution on the boundary. Linear force-free fields contain an unbounded magnetic energy in an open half-space above the photosphere (Seehafer 1978), because the governing equation in this case is the Helmholtz (wave) equation [Eq. (17)] whose solution decays slowly toward infinity. Consequently both approaches are not suitable for the estimation of the magnetic energy, in particular not an estimation of the free energy a configuration has in excess of a potential field.

5.1 Magnetic helicity

A useful quantity for studying magnetic fields in general and force-free fields in particular is the magnetic helicity (Woltjer 1958) defined by

$$\begin{aligned} H_{\mathrm{m}} = \int _V \mathbf {A}\cdot {\mathbf {B}}\; dV, \end{aligned}$$
(50)

where \({\mathbf {B}} = \nabla \times \mathbf {A}\) and \(\mathbf {A}\) is the vector potential. When \({\mathbf {B}}\) is given, \(\mathbf {A}\) is not unique and a gradient of any scalar function can be added without changing \({\mathbf {B}}\). Such gauge freedom does not affect the value of \(H_{\mathrm{m}}\) if the volume V is bounded by a magnetic surface (i.e., no field lines go through the surface). Figure 10 shows simple torus configurations and their magnetic helicities. As can be guessed from the figures, magnetic helicity is a topological quantity describing how the field lines are twisted or mutually linked, and is conserved when resistive diffusion of magnetic field is negligible. In the case of the solar corona, the bottom boundary (the photosphere) is not a magnetic surface, and field lines go through it. Even under such conditions, an alternative form, dubbed the relative magnetic helicity K, which does not depend on the gauge of \(\mathbf {A}\) was defined (see Berger and Field 1984; Finn and Antonsen Jr 1985) as

$$\begin{aligned} K = \int _V (\mathbf {A} + \mathbf {A}' ) \cdot ({\mathbf {B}}-{\mathbf {B}}') \; dV, \end{aligned}$$
(51)

where \({\mathbf {B}}'\) and \(\mathbf {A}'\) refer to a reference field. Often a potential field is used as reference field to compute the relative magnetic helicity (see Valori et al. 2016, for a comparison of methods on how to compute the helicity of solar magnetic fields).

A quantity which is easier to compute than the magnetic helicity is the current helicity \(H_c\) defined as

$$\begin{aligned} H_{\mathrm{c}} = \int _V {\mathbf {B}} \cdot \nabla \times {\mathbf {B}} \; dV, \end{aligned}$$
(52)

On the Sun one finds the hemispheric helicity sign rule for the current helicity \(H_{\mathrm{c}}\) (see, e.g., Pevtsov et al. 1995; Wang and Zhang 2010, and references therein). For various features like active regions, filaments, coronal loops, and interplanetary magnetic clouds the current helicity is negative in the northern and positive in the southern hemisphere.

Fig. 10
figure 10

Magnetic helicity of field lines in torus configuration: untwisted (left), twisted by T turns (middle), and two untwisted but intersecting tori (right). \(\varPhi \) stands for the total magnetic flux

5.2 Energy principles

Energy principles leading to various magnetic fields (potential fields, linear force-free fields, and nonlinear force-free fields) were summarized in Sakurai (1989). For a given distribution of magnetic flux (\(B_z\)) on the boundary,

  1. (a)

    A potential field is the state of minimum energy.

  2. (b)

    If the magnetic energy is minimized with an additional condition of a fixed value of \(H_{\mathrm{m}}\), one obtains a linear force-free field. The value of constant \(\alpha \) should be an implicit function of \(H_{\mathrm{m}}\). The obtained solution may or may not be a minimum of energy; in the latter case the solution is dynamically unstable.

  3. (c)

    If the magnetic energy is minimized by specifying the connectivity of all the field lines, one obtains a nonlinear force-free field. The solution may or may not be dynamically stable.

Item (c) is more explicitly shown by introducing the so-called Euler potentials (uv) for the magnetic field (Stern 1970),

$$\begin{aligned} {\mathbf {B}} = \nabla u \times \nabla v . \end{aligned}$$
(53)

This representation satisfies \(\nabla \cdot {\mathbf {B}} =0\). Since \({\mathbf {B}}\cdot \nabla u = {\mathbf {B}}\cdot \nabla v =0\), u and v are constant along the field line. The values of u and v on the boundary can be set so that \(B_z\) matches the given boundary condition. If the magnetic energy is minimized with the values of u and v specified on the boundary, one obtains Eq. (5) for a general (nonlinear) force-free field.

By the construction of the energy principles, the energy of (b) or (c) is always larger than that of the potential field (a). If the values of u and v are so chosen (there is enough freedom) that the value of \(H_{\mathrm{m}}\) is the same in cases (b) and (c), then the energy of nonlinear force-free fields (c) is larger than that of the linear force-free field (b). Therefore, we have seen that magnetic energy increases as one goes from a potential field to a linear force-free field, and further to a nonlinear force-free field. Suppose there are field lines with enhanced values of \(\alpha \) (carrying electric currents stronger than the surroundings). By some instability (or magnetic reconnection), the excess energy may be released and the twist in this part of the volume may diminish. However, in such rapid energy release processes, the magnetic helicity over the whole volume tends to be conserved (Berger 1984). Namely local twists represented by spatially-varying \(\alpha \) only propagate out from the region and are homogenized, but do not disappear. Because of energy principle (b), the end state of such relaxation will be a linear force-free field. This theory (Taylor relaxation; Taylor 1974, 1986) explains the commonly-observed behavior of laboratory plasmas to relax toward linear force-free fields. On the Sun this behaviour is not observed, however. One possible explanation could be that since we observe spatially-varying \(\alpha \) on the Sun, relaxation to linear force-free fields only takes place at limited occasions (e.g., in a flare) and over a limited volume where magnetic reconnection (or other processes) can propagate and homogenize the twist. A second reason that a linear force-free state is not reached on the Sun may be due to the continual perturbation of the fields at the photosphere injecting a Poynting flux, thus not allowing them to relax.

5.3 Maximum energy

There is in particular a large interest on force-free configurations for a given vertical magnetic field \(B_n\) (a radial field for spherical computations) on the lower boundary. A key question is in which range the magnetic energy (minimum and maximum amount of magnetic energy) can vary for configurations with the same vertical field on the bottom boundary. For such theoretical investigations, one usually assumes a so-called star-shaped volume, like the exterior of a spherical shell and the coronal magnetic field is unbounded but has a finite magnetic energy. (Numerical computations, on the other hand, are mainly carried out in finite computational volumes, like a 3D-box in Cartesian geometry.) It is not the aim of this review to follow the involved mathematical derivation, which the interested reader finds in Aly (1984). As we saw above, the minimum energy state is reached for a potential field. On the other hand, one is also interested in the maximum energy a force-free configuration can obtain for the same boundary conditions \(B_n\). This problem has been addressed in the so-called Aly–Sturrock conjecture (Aly 1984, 1991; Sturrock 1991). The conjecture says that the maximum magnetic energy is obtained if all magnetic field lines are open (have one footpoint in the lower boundary and reach to infinity). This result implies that any non-open force-free equilibrium (which contains electric currents parallel to closed magnetic field lines, e.g., created by stressing closed potential field lines) contains an energy which is higher than the potential field, but lower than the open field. As pointed out by Aly (1991) these results imply that the maximum energy which can be released from an active region, say in a flare or coronal mass ejection (CME), is the difference between the energy of an open field and a potential field. While a flare requires free magnetic energy, the Aly–Sturrock conjecture does also have the consequence that it would be impossible that all field lines become open directly after a flare, because opening the field lines costs energy. This is in some way a contradiction to observations of CMEs, where a closed magnetic structure opens during the eruption. Choe and Cheng (2002) constructed force-free equilibria containing tangential discontinuities in multiple flux systems, which can be generated by footpoint motions from an initial potential field. These configurations contain energy exceeding the open field, a violation of the Aly–Sturrock conjecture, and would release energy by opening all field lines. Due to the tangential discontinuities, these configurations contain thin current sheets, which can develop micro-instabilities to convert magnetic energy into other energy forms (kinetic and thermal energy) by resistive processes like magnetic reconnection. It is not clear (Aly and Amari 2007), however, which conditions are exactly necessary to derive force-free fields with energies above the open field: Is it necessary that the multiple flux-tubes are separated by non-magnetic regions like in Choe and Cheng (2002)? Or would it be sufficient that the field in this region is much weaker than in the flux tubes but remains finite? (See Sakurai 2007, for a related discussion).

5.4 Stability of force-free fields

In principle, the magnetohydrodynamic (MHD) stability criteria can also be applied to force-free equilibria. Typical approaches (see the books by Priest 1982, 2014) to investigate the stability of ideal MHD equilibria (which correspond to the assumption of infinite electrical conductivity) are normal mode analysis and an energy criterion. The basic question is how a small disturbance to the equilibrium evolves. Analytic methods typically linearize the problem around an equilibrium state, which leads to the so-called linear stability analysis. One has to keep in mind, however, that a linearly-stable configuration might well be nonlinearly unstable. The nonlinear stability of a system is usually investigated numerically with the help of time dependent simulations, e.g., with an MHD code (see also Sect. 5.5 for an application to NLFFF equilibria). In the following, we concentrate on linear stability investigations by using an energy criterion.

For a force-free configuration the energy is given by

$$\begin{aligned} W_0=\int \frac{B_0^2}{2 \mu _0} dV, \end{aligned}$$
(54)

where the subscript 0 corresponds to the equilibrium state. This equilibrium becomes disturbed by an displacement \(\varvec{\xi }(r_0,t)\) in the form \( {\mathbf {B}}={\mathbf {B}}_0+{\mathbf {B}}_1\) with \({\mathbf {B}}_1=\nabla \times (\varvec{\xi } \times {\mathbf {B}}_0)\). This form of the magnetic field displacement has its origin from the linearized induction equation \(\frac{\partial {\mathbf {B}}_1}{\partial t}=\nabla \times (\mathbf {v}_1 \times {\mathbf {B}}_0)\), where the velocity field has been replaced by the displacement \(\varvec{\xi }\). The MHD energy principle (Bernstein et al. 1958) reduces for force-free fields to (Molodensky 1974):

$$\begin{aligned} W=\frac{1}{2\mu _0} \, \int _V \left[ \left( \nabla \times (\varvec{\xi } \times {\mathbf {B}}) \right) ^2 -\left( \nabla \times (\varvec{\xi } \times {\mathbf {B}}) \right) \cdot \left( \varvec{\xi } \times (\nabla \times {\mathbf {B}})\right) \right] \; dV. \end{aligned}$$
(55)

A configuration is stable if \(W>0\), unstable for \(W<0\), and marginally stable for \(W=0\). W is the variation in the potential energy. The total energy is conserved and consequently a decrease in potential energy results in an increase in kinetic energy and instability of the configuration. For force-free fields and using the perturbed vector potential \(\mathbf {A}_1=\varvec{\xi } \times \mathbf {B_0}\), Eq. (55) can be written as:

$$\begin{aligned} W=\frac{1}{2\mu _0} \, \int _V \left[ \left( \nabla \times \mathbf {A}_1 \right) ^2 -\alpha \mathbf {A}_1 \cdot \nabla \times \mathbf {A}_1 \right] \; dV . \end{aligned}$$
(56)

From Eq. (56) it is obvious that the potential field with \(\alpha =0\) is stable. If we approximate \(|\nabla \times \mathbf {A}_1| \sim |A_1|/\ell \) with a typical length scale \(\ell \) of the system, the first term may remain larger than the second term (i.e., stability) in Eq. (56) if

$$\begin{aligned} |\alpha | \lesssim 1/\ell . \end{aligned}$$
(57)

This means that the scale of twist in the system, \(1/\alpha \), should be larger than the system size \(\ell \) for it to be stable. This criterion is known as Shafranov’s limit in plasma physics. More precise criteria for stability can be obtained for specific geometries. For example the case of cylindrical linear force-free field (Lundquist’s field) was studied by Goedbloed and Hagebeuk (1972).

5.5 Numerical stability investigations

Török and Kliem (2005) investigated the stability of the nonlinear force-free Titov–Démoulin equilibrium numerically with the help of a time-dependent MHD code. Figure 11 shows snapshots from MHD simulation starting from in an unstable branch of the Titov–Démoulin equilibrium in comparison with a solar eruption observed with TRACE. The simulation shows a very good agreement with the observed eruptions and indicates that a helical kink instability can trigger coronal eruptions. Dependent on particular parameters of the original Titov–Démoulin equilibrium the eruption remains confined or leads to a coronal mass ejection (see Török and Kliem 2005, for details).

Fig. 11
figure 11

Image reproduced with permission from Fig. 1 of Török and Kliem (2005), copyright by AAS

Numerical simulations starting from an unstable branch of the Titov–Démoulin equilibrium in comparison with TRACE observations of an eruption.

6 Numerical methods for nonlinear force-free fields

In the following, we review five different approaches for the computation of nonlinear force-free coronal magnetic fields. The aim of all codes is to extrapolate photospheric vector field measurements into the corona, but the way how the measurements are used is different. MHD relaxation and optimization methods prescribe the three components of the magnetic field vector on the bottom boundary. Grad–Rubin methods use the vertical magnetic field and the vertical electric current density (or \(\alpha \)-distribution) as boundary condition. The upward integration method and the boundary-element method require a combination of both boundary conditions. In the following, we will briefly discuss the main features of these five methods. Grad–Rubin, MHD relaxation, and optimization methods require first the computation of a potential field; then the appropriate boundary conditions are specified and eventually one iterates numerically for a solution of the NLFFF equations. Upward integration and boundary-element methods do not require first the computation of a potential field, but solve the NLFFF equations more directly. Both methods have, however, some shortcomings as explained later. Often one is interested anyway to get also the potential field, e.g., to derive the energy the NLFFF field has in excess of the potential field. A more detailed review on mathematical and computational implementations can be found in Wiegelmann (2008).

6.1 Upward integration method

This straightforward method was proposed by Nakagawa (1974) and it has been first computationally implemented by Wu et al. (1985, 1990). The basic idea of this method is to reformulate Eqs. (2)–(4) and extrapolate the magnetic field vector into the solar corona. The method is not iterative and extrapolates the magnetic field directly upward, starting from the bottom layer, where the field is measured. From \({\mathbf {B}}_0(x,y,0)\) one computes the z-component of the electric current \(\mu _0 j_{z0}\) by Eq. (13) and the corresponding \(\alpha \)-distribution with Eq. (14). Then the x- and y-components of the electric current are calculated by Eq. (11):

$$\begin{aligned} \mu _0 j_{x0 }= \alpha _0\, B_{x0} , \end{aligned}$$
(58)
$$\begin{aligned} \mu _0 j_{y0}= \alpha _0\, B_{y0} . \end{aligned}$$
(59)

Finally, we get the z-derivatives of the magnetic field vector with Eqs. (3) and (4) as

$$\begin{aligned} \frac{\partial B_{x0}}{\partial z}= \mu _0 j_{y0}+ \frac{\partial B_{z0}}{\partial x} , \end{aligned}$$
(60)
$$\begin{aligned} \frac{\partial B_{y0}}{\partial z}= \frac{\partial B_{z0}}{\partial y}- \mu _0 j_{x0} ,\end{aligned}$$
(61)
$$\begin{aligned} \frac{\partial B_{z0}}{\partial z}= -\frac{\partial B_{x0}}{\partial x}- \frac{\partial B_{y0}}{\partial y} . \end{aligned}$$
(62)

A numerical integration provides the magnetic field vector at the level \(z+dz\). These steps are repeated in order to integrate the equations upwards in z. Naively one would assume to derive finally the 3D magnetic fields in the corona, which is indeed the idea of this method. The main problem is that this simple straightforward approach does not work because the method is mathematically ill-posed and the algorithm is unstable (see, e.g., Cuperman et al. 1990; Amari et al. 1997 for details). As a result of this numerical instability one finds an exponential growth of the errors in the magnetic field computation with increasing height. The reason for this is that the method transports information only from the photosphere upwards. Other boundary conditions, e.g., at an upper boundary, either at a finite height or at infinity cannot be taken into account. Several attempts have been made to stabilize the algorithm, e.g., by smoothing and reformulating the problem with smooth analytic functions (e.g., Cuperman et al. 1991; Démoulin and Priest 1992; Song et al. 2006). Smoothing does help somewhat to diminish the effect of growing modes, because the shortest spatial modes are the fastest growing ones. To our knowledge the upward integration method has not been compared in detail with other NLFFF codes and it is therefore hard to evaluate the performance of this method.

6.2 Grad–Rubin method

The Grad–Rubin method has been originally proposed (but not numerically implemented) by Grad and Rubin (1958) for the application to fusion plasma. The first numerical application to coronal magnetic fields was carried out by Sakurai (1981). The original Grad–Rubin approach uses the \(\alpha \)-distribution on one polarity and the initial potential magnetic field to calculate the electric current density with Eq. (12) and to update the new magnetic field \({\mathbf {B}}\) from the Biot–Savart equation (11). This scheme is repeated iteratively until a stationary state is reached, where the magnetic field does not change anymore. Amari et al. (1997, 1999) implemented the Grad–Rubin method on a finite difference grid and decomposes Eqs. (2)–(4) into a hyperbolic part for evolving \(\alpha \) along the magnetic field lines and an elliptic one to update the magnetic field from Ampere’s law:

$$\begin{aligned} {\mathbf {B}}^{(k)} \cdot \nabla \alpha ^{(k)}= 0 , \end{aligned}$$
(63)
$$\begin{aligned} \alpha ^{(k)}|_{S^{\pm }}= \alpha _{0\pm } . \end{aligned}$$
(64)

This evolves \(\alpha \) from one polarity on the boundary along the magnetic field lines into the volume above. The value of \(\alpha _{0\pm }\) is computed from the horizontal component of the measured magnetic field with Eq. (14). The force-free equations in the form of Eqs. (11) and (12) are solved iteratively by the following scheme:

$$\begin{aligned} \nabla \times {\mathbf {B}}^{(k+1)}= \alpha ^{(k)} {\mathbf {B}}^{(k)}, \end{aligned}$$
(65)
$$\begin{aligned} \nabla \cdot {\mathbf {B}}^{(k+1)}= 0 , \end{aligned}$$
(66)
$$\begin{aligned} B^{(k+1)}_z|_{S^{\pm }}= B_{z0} , \end{aligned}$$
(67)
$$\begin{aligned} \lim _{|r|\rightarrow \infty }|{\mathbf {B}}^{(k+1)}|= 0 . \end{aligned}$$
(68)

Starting from an initial potential field the NLFFF equations are solved iteratively by computing \(\alpha \) along the magnetic field lines with equation (63) using the boundary condition for \(\alpha \) at one polarity as defined in (64). In a subsequent step the electric current density is updated with equation (65). For updating the magnetic field the solenoidal condition (66) and boundary conditions (67), (68) have to be fulfilled. The iteration is repeated until B converges, although convergence is not guaranteed. An advantage from a mathematical point of view is that the Grad–Rubin approach solves the nonlinear force-free equations as a well-posed boundary value problem. As shown by Bineau (1972) the Grad–Rubin-type boundary conditions, the vertical magnetic field and for one polarity the distribution of \(\alpha \), ensure the existence and unique NLFFF solutions at least for small values of \(\alpha \) and weak nonlinearities. See Amari et al. (1997, 2006) for more details on the mathematical aspect of this approach. The largest-allowed current and the corresponding maximum values of \(\alpha \) for which one can expect convergence of the Grad–Rubin approach have been studied in Inhester and Wiegelmann (2006). While \(\alpha \) can be computed on the entire lower boundary, the Grad–Rubin method requires only the prescription of \(\alpha \) for one polarity. For measured data which contain noise, measurement errors, finite forces, and other inconsistencies the two solutions can be different, however. See for example the extrapolations from Hinode data carried out in DeRosa et al. (2009). While both solutions are based on well-posed mathematical problems, they are not necessary consistent with the observations on the entire lower boundary. One can check the consistency of the \(\alpha \)-distribution on both polarities with Eq. (39).

As a further step to derive one unique solution the Grad–Rubin approach has been extended by Wheatland and Régnier (2009) and Amari and Aly (2010) by using these two different solutions (from different polarities) to correct the \(\alpha \)-distribution on the boundaries and to find finally one consistent solution by an outer iterative loop, which changes the \(\alpha \)-distribution on the boundary. An advantage in this approach is that one can specify where the \(\alpha \)-distribution, as computed by Eq. (14), is trustworthy (usually in strong field regions with a low measurement error in the transverse field) and where not (in weak field regions). This outer iterative loop, which aims at finding a consistent distribution of \(\alpha \) on both polarities, allows also to specify where the initial distribution of \(\alpha \) is trustworthy.

6.3 MHD relaxation method

MHD relaxation method means that a reduced set of time-dependent MHD equations is used to compute stationary equilibria:

$$\begin{aligned} \nu \mathbf {v}= (\nabla \times {\mathbf {B}}) \times {\mathbf {B}} , \end{aligned}$$
(69)
$$\begin{aligned} \mathbf {E} + \mathbf {v} \times {\mathbf {B}}= \mathbf {0} , \end{aligned}$$
(70)
$$\begin{aligned} \frac{\partial {\mathbf {B}}}{\partial t}= -\nabla \times \mathbf {E} , \end{aligned}$$
(71)
$$\begin{aligned} \nabla \cdot {\mathbf {B}}= 0 . \end{aligned}$$
(72)

Here, \(\nu \) is a fictitious viscosity, \(\mathbf {v}\) the fluid velocity, and \(\mathbf {E}\) the electric field. For general MHD equilibria the approach was proposed by Chodura and Schlüter (1981). Applications to force-free coronal magnetic fields can be found in Mikić and McClymont (1994), Roumeliotis (1996) and McClymont et al. (1997). In principle, any time-dependent MHD code can be used for this aim. The first NLFFF implementation of this methods used the code developed by Mikić et al. (1988). MHD relaxation means that an initial non-equilibrium state is relaxed towards a stationary state, here NLFFF. The initial non-equilibrium state is often a potential field in the 3D-box, where the bottom boundary field has been replaced by the measurements. This leads to large deviations from the equilibrium close to this boundary. As a consequence one finds a finite plasma flow velocity \(\mathbf {v}\) in Eq. (69) because all non-magnetic forces accumulate in the velocity field. This velocity field is reduced during the relaxation process and the force-free field equations are obviously fulfilled when the left-hand side of Eq. (69) vanishes. The viscosity \(\nu \) is usually chosen as

$$\begin{aligned} \nu = \frac{1}{\mu } \, |{\mathbf {B}}|^2 \end{aligned}$$
(73)

with \(\mu =\) constant. By combining Eqs. (69), (70), (71), and (73) one gets a relaxation process for the magnetic field

$$\begin{aligned} \frac{\partial {\mathbf {B}}}{\partial t}= \mu \; \mathbf {F}_{\mathrm{MHD}} , \end{aligned}$$
(74)
$$\begin{aligned} \mathbf {F}_{\mathrm{MHD}}= \nabla \times \left( \frac{\left[ (\nabla \times {\mathbf {B}}) \times {\mathbf {B}}\right] \times {\mathbf {B}}}{B^2} \right) . \end{aligned}$$
(75)

For details regarding a computational implementation of this approach see Valori et al. (2005).

6.4 Optimization approach

The optimization approach as proposed in Wheatland et al. (2000) is closely related to the MHD relaxation approach. It shares with this method that a similar initial non-equilibrium state is iterated towards a NLFFF equilibrium. It solves a similar iterative equation as Eq. (74)

$$\begin{aligned} \frac{\partial {\mathbf {B}}}{\partial t} = \mu \; \mathbf {F}, \end{aligned}$$
(76)

but \(\mathbf {F}\) has additional terms, as explained below. The force-free and solenoidal conditions are solved by minimizing the functional

$$\begin{aligned} L=\int _{V} \left[ B^{-2} \, |(\nabla \times {\mathbf {B}}) \times {\mathbf {B}}|^2 +|\nabla \cdot {\mathbf {B}}|^2\right] \; dV. \end{aligned}$$
(77)

If the minimum of this functional at \(L=0\) is attained then the NLFFF equations (2)–(4) are fulfilled. The functional is minimized by taking the functional derivative of Eq. (77) with respect to an iteration parameter t:

$$\begin{aligned} \frac{1}{2} \; \frac{d L}{d t}= - \int _{V} \frac{\partial {\mathbf {B}}}{\partial t} \cdot \mathbf {F} \; dV -\int _{S} \frac{\partial {\mathbf {B}}}{\partial t} \cdot \mathbf {G} \; dS , \end{aligned}$$
(78)
$$\begin{aligned} \mathbf {F} &= \nabla \times \left( \frac{\left[ (\nabla \times {\mathbf {B}}) \times {\mathbf {B}} \right] \times {\mathbf {B}}}{B^2} \right) \nonumber \\&\quad+ \; \left\{ -\nabla \times \left( \frac{((\nabla \cdot {\mathbf {B}}) \; {\mathbf {B}}) \times {\mathbf {B}}}{B^2} \right) \right. \nonumber \\&- {\varvec{\Omega }} \times (\nabla \times {\mathbf {B}}) -\nabla ({\varvec{\Omega }} \cdot {\mathbf {B}}) \nonumber \\&\quad+ \left. {\varvec{\Omega }}(\nabla \cdot {\mathbf {B}}) + \varOmega ^2 \; {\mathbf {B}} \right\} , \end{aligned}$$
(79)
$$\begin{aligned} \mathbf {G}= \hat{n} \times ({\varvec{\Omega }} \times {\mathbf {B}}) -\hat{n}\, ({\varvec{\Omega }} \cdot {\mathbf {B}}), \end{aligned}$$
(80)

where \(\hat{n}\) is the inward unit normal vector.

$$\begin{aligned} {\varvec{\Omega }} = B^{-2} \;\left[ (\nabla \times {\mathbf {B}}) \times {\mathbf {B}}-(\nabla \cdot {\mathbf {B}}) \; {\mathbf {B}} \right] . \end{aligned}$$
(81)

For vanishing surface terms the functional L decreases monotonically if the magnetic field is iterated by

$$\begin{aligned} \frac{\partial {\mathbf {B}}}{\partial t} = \mu \; \mathbf {F} . \end{aligned}$$
(82)

The first term in Eq. (79) is identical with \(\mathbf {F}_{\mathrm{MHD}}\) as defined in Eq. (75).

A principal problem with the optimization and the MHD-relaxation approaches is that using the full magnetic field vector on the lower boundary does not guarantee the existence of a force-free configuration (see the consistency criteria in Sect. 4.6. Consequently, if fed with inconsistent boundary data, the codes cannot find a force-free configuration, but a finite residual Lorentz force and/or a finite divergence of the field remains in the 3D equilibrium. The principle way to deal with these inconsistencies is a sophisticated modelling of the transition from a non-force-free photospheric field to the force-free corona, which requires to take non-magnetic forces into account, in lowest order by magneto-hydro-static extrapolations. Such codes are in their infancy (see Sect. 8.1). They are numerically more expensive than force-free codes and require high spatial resolution vector magnetograms as boundary condition. Without such sophisticated models available, a useful tool to deal with inconsistencies in the measured photospheric data is the preprocessing methods as explained in Sect. 4.8. An alternative approach is that one allows deviations of the measured horizontal field vector and the corresponding field vector on the lower boundary of the computational box during the minimization of the functional (77). Wiegelmann and Inhester (2010) extended this functional by another term

$$\begin{aligned} \nu \int _{S} ({\mathbf {B}} - {\mathbf {B}}_{\mathrm{obs}})\cdot \mathbf {W}\cdot ({\mathbf {B}} - {\mathbf {B}}_{\mathrm{obs}})\; dS , \end{aligned}$$
(83)

where \(\nu \) is a free parameter and the matrix \(\mathbf {W}\) contains information how reliable the data (mainly measurements of the horizontal photospheric field) are. With this approach inconsistencies in the measurement lead to a solution compatible with physical requirements (vanishing Lorentz force and divergence), leaving differences between \({\mathbf {B}}_{\mathrm{obs}}\) and the bottom boundary field \({\mathbf {B}}\) in regions where \(\mathbf {W}\) is low (and the measurement error high). Consequently, this approach takes measurement errors, missing data, and data inconsistencies into account. Further tests are necessary to investigate whether this approach or preprocessing, or a combination of both, is the most effective way to deal with noisy and inconsistent photospheric field measurements. This approach, as well as a variant of the Grad–Rubin method, have been developed in response to a joint study by DeRosa et al. (2009), where one of the main findings was that force-free extrapolation codes should be able to incorporate measurement inconsistencies (see also Sect. 7.1).

6.5 Boundary-element methods

The boundary-element method was developed by Yan and Sakurai (2000) and requires the magnetic field vector and the \(\alpha \)-distribution on the boundary as input. The NLFFF equations relate the magnetic field values on the boundary with those in the volume:

$$\begin{aligned} c_i {\mathbf {B}}_i= \oint _S \left( \bar{\mathbf {Y}} \frac{\partial {\mathbf {B}}}{\partial n} - \frac{\partial \bar{\mathbf {Y}}}{\partial n} {\mathbf {B}}_0 \right) \; dS \end{aligned}$$
(84)

with \(c_i=1\) for points in the volume and \(c_i=1/2\) for boundary points and \({\mathbf {B}}_0\) is the magnetic field vector on the boundary, where

$$\begin{aligned} \bar{\mathbf {Y}} = {\text {diag}} \left( \frac{\cos (\lambda _x r)}{4 \pi r}, \frac{\cos (\lambda _y r)}{4 \pi r}, \frac{\cos (\lambda _z r)}{4 \pi r} \right) \end{aligned}$$
(85)

and \(\lambda _i \, (i=x,y,z)\) are implicitly computed with integrals over the 3D volume,

$$\begin{aligned} \int _V Y_i[\lambda _i^2 B_i-\alpha ^2 B_i -(\nabla \alpha \times {\mathbf {B}}_i)] dV=0 . \end{aligned}$$
(86)

The boundary-element method is slow for computing the NLFFF in a 3D domain. Rudenko and Myshyakov (2009) raised questions on this method.

6.6 Global computations, Yin and Yang grid

One of the problems with installing a NLFFF-code based on finite differences in spherical geometry is the grid convergence problem at the poles. For the optimization and magnetofrictional method it can be estimated that the iteration time-step scales with \(\varDelta t \sim (\varDelta x)^2\) and this results in long computation times if regions close to the poles are included, see e.g., Wiegelmann (2007). This grid-convergence problem is related to using finite differences in spherical geometry and not limited to NLFFF. It can be avoided by using either an unstructured finite-element grid or the so called Yin & Yang grid as developed in Kageyama and Sato (2004) for geophysical applications. Jiang et al. (2012) developed a new global NLFFF code based on MHD-relaxation (CESE-MHD) and using an Yin & Yang grid, which is shown in Fig. 12. The Yin & Yang grid is composed of two complimentary finite-element grids (see panels a and b), which overlap (panel c). Both grids are (almost) equidistant, because they contain only low latitude regions. A price one has to pay is the overhead needed to communicate between the two complimentary grids.

Fig. 12
figure 12

Image reproduced with permission from Fig. 1 of Jiang et al. (2012), copyright by AAS

Yin and Yang grid.

6.7 Guiding NLFFF-computations by coronal images

While classically NLFFF-models are extrapolated from photospheric vector magnetograms and the solution is compared with coronal images with projections of 3D-NLFFF field lines, new approaches have been developed to use coronal images or loops deduced from coronal images to constrain the NLFFF-model directly. A method developed by Malanushenko et al. (2012) uses the line-of-sight photospheric magnetic field and a number of coronal loops deduced from coronal images as input. As a first step the optimum linear force-free parameter \(\alpha \) is computed (see Malanushenko et al. 2009, for details). Usually the optimum value of \(\alpha \) is different for different loops and this means that the solution is not linear force-free and not self-consistent. The idea of the paper by Malanushenko et al. (2012) is to use this state (distribution of different \(\alpha \) on different field lines, but without having a self-consistent field model) as initial state and apply a Grad–Rubin-like method to compute a fully self-consistent NLFFF-model. A necessary condition for such an approach is that the obtained optimum linear-force-free \(\alpha \) values correlate with \(\alpha \) from an NLFFF-model, which was found in Malanushenko et al. (2009). Similar to the normal Grad–Rubin method the code solves the force-free equations starting from a potential field in the computational domain. Different from the Grad–Rubin method, the distribution of \(\alpha \) is not prescribed at the (bottom) boundary of the computational box, but along closed loops in the entire volume. Field lines leaving the computational domain (e.g., open field lines) are set to \(\alpha =0\). As in the Grad–Rubin method, the magnetic field is updated by solving the equation \(\nabla \times {\mathbf {B}}= \alpha {\mathbf {B}}\). This naturally changes the magnetic field structure and magnetic field lines. At every point in the volume a new, updated \(\alpha \) is computed by averaging over the field line passing through this point. Similar to the Grad–Rubin method, the procedure is repeated until convergence.

6.7.1 Parameterized forward fitting: VCA-NLFFF

A nice feature of linear equations is that particular solutions of the equations can be superposed. While this property is not valid for nonlinear equations, Aschwanden (2013a) found a possibility to compute approximate nonlinear force-free equilibria, by superposing strongly localized analytic solutions. Free parameters (e.g., a local value of \(\alpha \)) in the localized non-potential solutions (localized magnetic charges with or without a constant twist) allow a forward-fitting routine in order to find the optimal free parameters to match vector magnetograms or coronal images. In general a superposition of particular force-free fields are not force-free (but divergence free, because the divergence is a linear operator). Say we superpose two linear force-free fields \({\mathbf {B}}={\mathbf {B}}_{\mathbf {1}}+{\mathbf {B}}_{\mathbf {2}}\) with different values of \(\alpha \) and \(\nabla \times {\mathbf {B}}_{\mathbf {1}}= \alpha _1 {\mathbf {B}}_{\mathbf {1}}\) and \(\nabla \times {\mathbf {B}}_{\mathbf {1}}= \alpha _1 {\mathbf {B}}_{\mathbf { 1}}\) we get a finite Lorentz force

$$\begin{aligned} (\nabla \times {\mathbf {B}}) \times {\mathbf {B}}= (\alpha _1 - \alpha _2) \, {\mathbf {B}}_{\mathbf {1}} \times {\mathbf {B}}_{\mathbf {2}} \end{aligned}$$
(87)

If the particular solutions are, however, strongly localized and the field strength decreases rapidly at farther distances, the superposed solution is approximately force-free to second order and was called quasi-NLFFF by the author. In a subsequent work Aschwanden and Malanushenko (2013) developed a code for using these properties for a forward-fitting method (see Fig. 13 for a flow-chart of the method) and tested and compared the code with NLFFF extrapolation techniques. In Aschwanden (2013b) the code was used to compute the free magnetic energy for test solutions and a number of active regions observed in 2007 where stereoscopic reconstructed loops have been available. The forward fitting method computes the free parameters of the local solutions (twisted magnetic elements) by minimizing the angular misalignment with respect to 3D loops obtained from stereoscopy. The method has been further developed in Aschwanden (2013c) to use 2D loops obtained from coronal images. An advantage of this generalization is that images from two vantage points (the two STEREO-spacecraft) which are necessary for stereoscopy are rare and 2D coronal images from SDO/AIA and TRACE have a higher resolution than STEREO/SECCHI images. A disadvantage is certainly that coronal images from one viewpoint do not provide any information regarding the heights of the extracted loop. Aschwanden et al. (2015) developed an automated stereoscopy procedure to reconstruct coronal 3D structures, and as part of the analysis the code packages evaluate the non-potentiality of coronal magnetic loops. In a later work the package was extended (Aschwanden 2016), dubbed vertical current approximation (VCA-NLFFF) and was used to compute the magnetic energy dissipated in flares. The VCA-NLFFF code was further developed and the most recent version (VCA3-NLFFF) is described in detail in Aschwanden (2019). This version of the code uses a more accurate analytical solution which is second-order accurate in the divergence-free and third order accurate in the force-free condition.

Fig. 13
figure 13

Image reproduced with permission from Fig. 1 of Aschwanden and Malanushenko (2013), copyright by Springer

Flow chart of a code for the forward fitting of quasi-NLFFF equilibria.

6.7.2 Nonlinear force-free magnetic stereoscopy: S-NLFFF

The optimization method to compute NLFFF is flexible in the sense that it allows to incorporate additional constraints by Lagrangian multipliers. This feature was used in Chifu et al. (2015) by adding an integral which measures the angle between a number of 3D coronal loops and the direction of the reconstructed coronal magnetic field vector. The corresponding optimization routine minimizes the entire functional L, which contains the force-free (\(L_1\)) and solenoidal condition (\(L_2\)), the photospheric vector magnetogram (\(L_3\)), and additionally the angular misalignment with respect to stereoscopic reconstructed loops (\(L_4\)), where

$$\begin{aligned} L_4 &= \sum _i\frac{1}{\int _{{\mathbf {c}}_i} ds} \int _{{\mathbf {c}}_i}\frac{|{\mathbf {B}}\times {\mathbf {t}}_i|^2}{\sigma ^2_{c_i}}\;ds, \nonumber \\&\quad{\text {where}}\quad {\mathbf {t}}_i=\frac{d{\mathbf {c}}_i}{ds}. \end{aligned}$$
(88)

The method was dubbed nonlinear force-free coronal stereoscopy (S-NLFFF) and was applied to an active region in Chifu et al. (2017). For this active region vector magnetograms from SDO/HMI and coronal EUV-images from three vantage points (two STEREO-spacecraft and SDO) have been available, see Fig. 14. The added term in the optimization procedure by stereoscopically reconstructed loops led to significant reduced angles between the observed coronal loops and the reconstructed magnetic field. Additionally the numerical residual of the force-free condition (e.g., measured by the angle between the electric current and the magnetic field) was improved as well by about a factor of two. All terms in the S-NLFFF-code are weighted with multipliers and can contain additionally space-dependent weighting functions. This allows to take care about noise and inconsistency both in the measured photospheric magnetic field vector (\(L_3\)-term) as well as reconstruction errors of the stereoscopically reconstructed 3D coronal loops.

Fig. 14
figure 14

Image reproduced with permission from Fig. 3 of Chifu et al. (2017), copyright AAS

NLFFF constraint by stereoscopy. The left, center, and right panel show projections to STEREO-B, SDO and STEREO-A, respectively. Magenta loops are reconstructed using all of the three spacecraft, green loops used STEREO A and SDO, and light blue loops STEREO B and SDO.

7 Force-free models: effects, limitations and comparisons

7.1 Comparison of methods and the NLFFF consortium

Since 2004, a group of scientists chaired by Karel Schrijver has compared, evaluated, and improved methods for the nonlinear force-free computation of coronal magnetic fields and related topics. The test cases are available at http://www.lmsal.com/ derosa/for_nlfff/. So far, eight workshops have been organized and the consortium published joint publications:

  1. 1.

    Schrijver et al. (2006) performed blind tests on analytical force-free field models with various boundary conditions to show that in general the NLFFF algorithms perform best where the magnetic field and the electrical currents are strongest, but they are also very sensitive to the specified boundary conditions. Nevertheless, it was shown that the optimization method as proposed by Wheatland et al. (2000) and as implemented by Wiegelmann (2004) was the fastest-converging and best-performing one for this analytical test case.

  2. 2.

    Metcalf et al. (2008) tested the performance of the NLFFF algorithms applied to a solar-like reference model including realistic photospheric Lorentz forces and a complex magnetic field structure. All the codes were able to recover the presence of a weakly twisted, helical flux rope. Due to the sensitivity to the numerical details, however, they were less accurate in reproducing the field connectivity and magnetic energy when applied to the preprocessed, more force-free, chromospheric-like boundary conditions. When applied to the forced, not preprocessed photospheric data the codes did not perform successfully, indicating that the consistency of the used boundary conditions is crucial for the success of the magnetic field extrapolations. It also showed that the magnetic field connection between the photosphere, chromosphere, and lower corona needs to be additionally precisely modeled.

  3. 3.

    Schrijver et al. (2008) used four different codes and a variety of boundary conditions to compute 14 NLFFF models based on Hinode/SOT-SPFootnote 3 data of an active region around the time of a powerful flare. When applied to this real solar data, the models produced a wide variety of magnetic field geometries, energy contents, and force-freeness. Force-free consistency criteria, like the alignment of electric currents with magnetic field lines, have been best fulfilled for computations with the Grad–Rubin approach. It was concluded that strong electrical currents in the form of an ensemble of thin strands emerge together with magnetic flux preceding the flare. The global patterns of magnetic fields are compatible with a large-scale twisted flux rope topology, and they carry energy which is large enough to power the flare and its associated CME.

  4. 4.

    DeRosa et al. (2009) found that various NLFFF models differ remarkably in the field line configuration and produce different estimates of the free magnetic energy when applied to Hinode/SOT-SP data. This problem was recognized already in the first application to Hinode data in Schrijver et al. (2008) and it has been worked out that a small field-of-view vector magnetogram, which does not contain an entire active region and its surroundings, does not provide the necessary magnetic connectivity for successful NLFFF extrapolations. As visible in Fig. 15 the stereoscopically-reconstructed loops by Aschwanden et al. (2008b) do not agree well with the NLFFF models. Unfortunately, the FOV of Hinode covered only a small fraction (about 10%) of area spanned by loops reconstructed from STEREO/SECCHI images. The quantitative comparison was unsatisfactory and NLFFF models have not proven better than potential fields here. In other studies NLFFF methods have shown to be superior to potential and linear force-free extrapolations (Wiegelmann et al. 2005). NLFF field lines showed in particular excellent agreement with the observed loops, when both footpoints are within the FOV of the vector magnetogram and sufficiently far away from the boundaries.

  5. 5.

    DeRosa et al. (2015) investigated the effect of spatial resolution. We discuss this paper in Sect. 7.3.2.

Fig. 15
figure 15

Image reproduced with permission from Fig. 1 of DeRosa et al. (2009), copyright by AAS

ac A series of coaligned images of active region AR 10953. In b field lines (white) from best fit NLFFF model are overlaid. d, e show the trajectories of loops from different viewpoints. The stereoscopically-reconstructed loops are taken from (Aschwanden et al. 2008b). The solid cube outlines the computational box of the NLFFF models. The interior dotted line outlines the FOV of Hinode. The STEREO-loops are coloured in blue outside the NLFFF-domain and are coloured with the misalignment angle \(\phi \) of STEREO-loops and best fitting NLFFF model from yellow through orange to red with \(5^{\circ } \le \phi \le 45^{\circ }\).

When presented with complete and consistent boundary conditions, NLFFF algorithms generally succeed in reproducing the test fields. However, for a well-observed dataset (a Hinode/SOT-SP vector-magnetogram embedded in data observed with the Michelson Doppler Imager (MDI) on the Solar and Heliospheric Observatory (SOHO) the NLFFF algorithms did not yield consistent solutions. From this study we conclude that one should not rely on a model-field geometry or energy estimates unless they match coronal observations. In DeRosa et al. (2009) it was concluded that successful application to real solar data likely requires at least:

  1. 1.

    Large model volumes with high resolution that accommodate most of the field-line connectivity within a region and to its surroundings.

  2. 2.

    Accommodation of measurement uncertainties (in particular in the transverse field component) in the lower boundary condition.

  3. 3.

    ‘Preprocessing’ of the lower-boundary vector field that approximates the physics of the photosphere-to-chromosphere interface as it transforms the observed, forced, photospheric field to a realistic approximation of the chromospheric, nearly-force-free, field.

  4. 4.

    The extrapolated coronal magnetic field lines should be compared and verified by coronal observations.

In reply to these conclusions a decent amount of development has been done on the coding and instrumental side:

  1. 1.

    On the instrumentation side SDO/HMI and SOLIS provide us with full-disk measurements of the photospheric magnetic field vector, which allow to find suitable large model volumes. Large model volumes including using full disk and synoptic vector maps require implementations of NLFFF-codes in spherical geometry as done for the Grad–Rubin method in Amari et al. (2013, 2014) and Gilchrist and Wheatland (2014), for MHD-relaxation in Jiang et al. (2012) and for the optimization approach in Wiegelmann (2007) and Tadesse et al. (2014b, 2015).

  2. 2.

    Implementations of the Grad–Rubin and optimization methods do accommodate the measurement errors; see Sects. 6.2 and 6.4 for an overview and Wheatland and Régnier (2009), Wiegelmann and Inhester (2010), Amari and Aly (2010), Wheatland (2015) and Mastrano et al. (2020) for the corresponding publications.

  3. 3.

    Some datasets from SDO/HMI do not necessarily require preprocessing, see, e.g., Wiegelmann et al. (2012). Also attempts to model the transition from a forced photosphere to a near-force-free chromosphere by magneto-hydro-static extrapolations have been done, see Sect. 8.1.

  4. 4.

    The extrapolated fields are not only compared and verified with coronal images, but methods have been developed to guide NLFFF-extrapolations by coronal images, see Sect. 6.7.

7.2 Extrapolations and coronal seismology

Verwichte et al. (2013) deduced the Alfvén speed in two oscillating loops by coronal seismology and independently with a potential-field source-surface (PFSS) model in combination with a spectral analysis of coronal images from SDO/AIA. Figure 16a shows the two loops in red in comparison with magnetic field lines from a PFSS-model shown in blue. Panel (b) shows the same two loops over-plotted onto an EUV-image from a different view direction (STEREO-A). The authors found that the two independently-applied methods led to consistent results. For a general idea on how magnetic field extrapolations, seismology and spectral methods can be combined to derive physical properties of coronal loops, see the scheme in Fig. 16c). In this work a PFSS-model was used, but for future research it is a more desirable approach to combine seismology and spectral methods also with more sophisticated magnetic field models like NLFFF.

Fig. 16
figure 16

Image reproduced with permission from Figs. 1, 3, 7 of Verwichte et al. (2013), copyright by AAS

a Two oscillating loops (red) and potential field lines (blue). b Loops seen from STEREO-A. c Combining seismology and magnetic extrapolations (see text).

7.3 Evaluation of different effects in NLFFF

7.3.1 Size of computational domain

Tadesse et al. (2015) investigated the effect of the size of the computational domain on the quantities like the free magnetic energy, magnetic flux and electric current densities etc. It was found that the domain size influences these quantities, more for active regions which are magnetically connected to other areas and to a lesser extend for magnetically isolated ARs.

7.3.2 Spatial resolution

DeRosa et al. (2015) investigated the effect of spatial resolution on the result of NLFFF-computations for various codes. It was found that the spatial resolution of the vector magnetogram influences the results quantitatively, whereas higher resolution input data result in better self-consistent results. Consistently the free magnetic energy increased with increasing resolution, whereas there was a large scatter and no clear trend for the relative magnetic helicity.

7.3.3 Electric currents, free energy and helicity

Tadesse et al. (2014a) used synoptic vector magnetograms from SOLIS/VSM as boundary condition for global nonlinear force-free computations. The authors found that magnetic field lines containing strong current concentrations are located mainly in active regions up to a height of about 70 Mm. Associated with these strong currents is a high density region of free magnetic energy. It was also found that the ARs with the largest amount of free magnetic energy show the strongest flaring activity. Moraitis et al. (2014) made benchmark tests for the computation of free energy and helicity from NLFFF. Despite some scatter in resulting quantities they concluded that NLFFF can be reliably used for both aims.

7.3.4 Limitations due to finite \(\beta \) effects

Peter et al. (2015) revisited the force-free assumption in solar active regions and pointed out that if the plasma \(\beta \) is of the order of the relative free magnetic energy then plasma forces (in particular the pressure gradient force) become important and need to be considered for a consistent modelling.

7.3.5 Instrumental effects

Thalmann et al. (2013) compared NLFFF from Hinode and SDO. Differences in the photospheric vector field measurements led to differences in the coronal NLFFF equilibria.

7.3.6 Initial conditions

Kawabata et al. (2020) used linear force-free models (with several values of \(\alpha \)) and potential fields as initial conditions for NLFFF extrapolations with an MHD-relaxation technique and compared the results for two active regions. For a rather simple active region the NLFFF-model computed with initially a linear force-free model (global \(\alpha \) was computed from photospheric data) agreed somewhat better with coronal X-ray images than a NLFFF-model initialized with a potential field. For a more complex multipolar active regions the result did hardly depend on the initial conditions, however. The magnetic energy did not strongly depend on the initial conditions, either. An exception is the case when very large values of \(\alpha \) were used for the initial linear force-free field, which leads to a significantly enhanced magnetic energy already in the initial state. In one of the cases the NLFFF-computation did not fully converge. Strong field regions have been hardly affected by the initial conditions and differences are seen mainly in weak field regions around the polarity inversion line.

7.3.7 Additional measurements

Fleishman et al. (2017) used a publicly available data cube from radiation MHD-simulations (RMHD, see Carlsson et al. 2016) as reference to investigate the performance of NLFFF-extrapolations. One finding was that using force-free chromospheric measurements (here extracted from the RMHD-model) lead to more accurate result than using (non-force-free) photospheric vector magnetograms. In a subsequent paper Fleishman et al. (2019) instigated the possibility of using chromospheric measurements additionally to the photospheric vector magnetograms. This was done by extending the functional in the optimization method by additional terms containing chromospheric or coronal information, e.g., the full vector field, only the line-of-sight field or the absolute magnetic field strength. These effects have been investigated with two different implementations of force-free optimization codes and with the RMHD-simulations as reference. It was found that any additional information (even incomplete one) about the magnetic field in the force-free region (e.g., in the chromosphere) is helpful to improve the performance of NLFFF. For incomplete chromospheric information the performance does, however, depend on details of the implementation.

Dalmasse et al. (2019) developed a concept of data-driven coronal magnetic field modelling based on force-free (or MHD) magnetic field models and polarimetric coronal measurements. For a synthetic test case it was demonstrated that the coronal polarimetric measurements contain enough information to constrain the magnetic field model. Application to real data are challenging, however, and require observations from different view directions. Ideally the photospheric (and/or chromospheric) magnetic field vector would be measured close to disk center, whereas the coronal polarimetry works best in limb observations. This can be achieved in principle by combining ground-based measurements with data from Solar Orbiter.

7.4 Comparison of models

Murray et al. (2013) investigated a flaring active region with potential, linear- and nonlinear force-free models. It was found that the field undergoes partly a Taylor relaxation towards a less nonlinear state as a consequence of flaring. Tadesse et al. (2014b) compared global potential and NLFFF models based on SDO-data. While NLFFF agrees better with coronal images than potential fields, it was found that most trans-equatorial loops connecting both hemispheres are almost current-free.

Yeates et al. (2018) contains the results of two meetings at ISSI (International Space Science Institute) on global non-potential coronal magnetic field models. Seven different models have been applied to model the coronal magnetic field for an eclipse in 2015. The models included three different implementations of nonlinear force-free codes, a magneto-static code, an evolving magneto-frictional code and two MHD codes (full MHD and zero-beta MHD). It was found that the nonlinear force-free (and static!) extrapolation codes perform best to model active regions, while quiet-Sun features like filaments and filament channels are better modelled with the time-dependent codes. A reason is that the static models use synoptic vector magnetograms as input and due to the poor signal to noise ratio in quiet-Sun weak fields, the horizontal photospheric field measurements are not trustworthy. The time-dependent models use only the line-of-sight photospheric field as the boundary condition and additional observations (e.g., filaments) as input. Consequently time-dependent models perform better in the quiet Sun and worse in active regions. An advice from the workshop series is that the best future approach would be to develop hybrid models. The idea is to basically apply static models (nonlinear force-free or magneto-static) but with additional input from evolutionary models.

7.5 Application of nonlinear force-free codes

Despite the difficulties outlined in Sect. 7.1 NLFFF-codes have been used to study active regions (for a review paper on flaring active regions see Toriumi and Wang 2019) in various situations. Several studies deal with the energy content of the coronal magnetic field in active regions. Bleybel et al. (2002) studied the energy budget of active region AR7912 before and after a flare on 1995 October 14 with a Grad–Rubin method and found that the magnetic energy decreased during the flare. The magnetic field lines computed from the nonlinear force-free model seem to be in reasonable agreement with a soft X-ray image from Yohkoh, as shown in the top panel in Fig. 17. At least the nonlinear force-free model seems to agree better with the X-ray image than a linear force-free and a potential field model shown in the center and bottom panel, respectively. Régnier et al. (2002), also using the Grad–Rubin approach, studied the non-flaring active region AR 8151 in February 1998 and found that the available free magnetic energy was not high enough to power a flare. These results are consistent which the observation in the sense that nonlinear force-free field lines reasonably agree with coronal observations and a consistent flaring activity: The particular active regions flared (not flared) when the free magnetic energy computed with NLFFF-codes was high enough (too low). A decreasing free magnetic energy during flares has been confirmed in several studies. Thalmann and Wiegelmann (2008) and Thalmann et al. (2008), using the optimization approach, found that the force-free energy before a small C-class flare (observed in active region NOAA 10960 on 2007 June 7) was 5% higher than the potential field energy. Before a large M-class flare (observed in active region NOAA 10540 in January 2004) the force-free energy exceeded the potential field energy by 60%. In a statistic study, based on 75 samples extrapolate with the optimization approach, Jing et al. (2010) found a positive correlation between free magnetic energy and the X-ray flaring index. It seems that we can trust that there is a relation between computed free energy and flaring activity, whereas the results of Sect. 7.1 indicate that one might not fully trust in the exact numbers of magnetic energies computed with one NLFFF-code only. Gilchrist et al. (2012) pointed out that uncertainties in the vector magnetograms likely result in underestimating the computed magnetic energy. NLFFF-codes are, however, a strong tool to guide the investigation of coronal features. Régnier and Amari (2004), Valori et al. (2012) and Sun et al. (2012) applied the Grad–Rubin, MHD-relaxation and optimization approach, respectively and found at least qualitatively a good agreement of NLFFF-models with observed sigmoid or serpentine structures. Gibb et al. (2014) used the evolving magneto-frictional model to study the temporal evolution of an active region as a series of force-free equilibria and found the formation of an observed sigmoid which well agreed with observations in X-rays. Since the launch of SDO about a decade ago vector magnetic fields are routinely available. The first vector magnetograms from SDO/HMI have been released at the end of the year 2011 and SDO/HMI data are since then frequently used for force-free extrapolations in active regions and on global scales.

Fig. 17
figure 17

Image reproduced with permission from Fig. 8 of Bleybel et al. (2002), copyright by ESO

Yohkoh soft X-ray image overlaid with magnetic field lines from different models. Top: nonlinear force-free; center: linear force-free; bottom: potential fields.

8 Summary and discussion

In this review, we tried to give an overview of force-free magnetic fields, particularly model assumptions, which are important for understanding the physics of the solar corona. While the underlying mathematical equations describe stationary states and look relatively simple, solving them is by no means a trivial problem because of the nonlinear nature of the problem. Exact solutions are only available for further simplifications, like linearizing the equations or to restrict to 1D/2D for the nonlinear case. For force-free configurations in 3D, we know that (for given flux distributions in the photosphere) the magnetic field energy is bounded from below by a potential field. An upper-limit for the energy is more difficult to obtain. While the Aly–Sturrock conjecture (Sect. 5.3) claims that the upper limit is for the configurations with all magnetic field lines open, Choe and Cheng (2002) constructed solutions with energies above the Aly–Sturrock limit. These configurations contain discontinuities and the debate of the validity of the Aly–Sturrock limit is ongoing (Hu 2004; Wolfson et al. 2012).

For practical computations of the 3D-field in the solar corona, one has to use numerical computations and several codes have been developed, compared, and applied. As input these codes require measurements of the magnetic field vector in the solar photosphere. However, the transverse field component contains an ambiguity in the azimuth, which has to be resolved before the data can be used for coronal magnetic field modeling. The accuracy of photospheric measurements is lower for the transverse field component compared with the line-of-sight field, and in weak field regions measurements and azimuth ambiguity removal are less trustworthy. Consequently the majority of coronal force-free field models are carried out in active regions, although methods for full-disk computations have been developed too. A further complication of using photospheric measurements as the boundary condition for force-free extrapolations is that the photospheric magnetic field is not necessarily consistent with the force-free assumption. Possible solutions are to use only the vertical magnetic field and the vertical electric current as boundary conditions, as done for the Grad–Rubin approach, to preprocess the photospheric measurements with the aim to make them compatible with force-free and other physical requirements, or to allow changes of the transverse magnetic field during the iteration of a force-free field. The latter approach has been implemented in the optimization approach and allows us to take measurement errors into account.

A major source for research on force-free fields within the last decade is SDO/HMI, which measures the photospheric magnetic field vector on the full disk, which in principle allows us to compute global coronal models as well as selecting appropriate isolated active regions with a sufficiently large field-of-view. Research on Stokes inversion, azimuth ambiguity removal, and force-free modeling for SDO/HMI data has been done and is ongoing. Another important aspect on coronal modeling is the comparison and improvement of force-free models as extrapolated from photospheric measurements with coronal images as observed, for example, with SDO/AIA (Lemen et al. 2012). On the one hand, such a comparison is important to validate the models (see DeRosa et al. 2009, for details), and, on the other hand, the 3D models help to interpret the observations. With the 3D structure of magnetic loops from the models in hand, one has important tools for modeling of plasma loops, and gains understanding of coronal heating and plasma flows along the loops. Ongoing and future research is to incorporate finite \(\beta \) effects by going beyond the force-free assumption and by using force-free equilibria as initial state for time-dependent MHD-simulations.

8.1 Magneto-hydro-statics

While the force-free assumption is well justified in the solar corona above active regions, this is not the case in the photosphere and chromosphere. These regions can, however, still be modelled under the assumption of static models and using photospheric vector magnetograms as input. Plasma forces like gravity and plasma pressure have to be taken into account to compensate the Lorentz force. Codes to compute the corresponding magneto-hydro-static (MHS) equilibria have been developed by generalization of the corresponding nonlinear force-free models:

  • MHS code based on optimization: The code has been developed in Wiegelmann and Neukirch (2006), and was intensively tested and improved in Zhu and Wiegelmann (2018, 2019).

  • MHS code based on MHD-relaxation: Zhu et al. (2013) developed a magneto-static code based on MHD-relaxation. The method was applied in Zhu et al. (2016) to study the structure of chromospheric H\(\alpha \) fibrils. Miyoshi et al. (2020) contains a newly developed relaxation method for computing MHS-equilibria, which has been tested in 2D.

  • MHS code based on Grad–Rubin iteration: Gilchrist and Wheatland (2013) and Gilchrist et al. (2016) developed a MHS-code based on the Grad–Rubin method. Some tests were done with and without gravity.

Compared with force-free models, magneto-hydro-static codes are numerically more expensive, in particular when dealing with mixed-\(\beta \) plasmas where the value of \(\beta \) changes over orders of magnitude in the computational domain.

8.2 MHD simulations initialized with force-free equilibria

The temporal evolution of eruptive phenomena like flares and CMEs cannot be studied by static extrapolations and require time-dependent MHD simulations. Force-free models are used as initial equilibria, which are disturbed by photospheric plasma flows (which can be deduced, e.g., from measurements with SDO/HMI). The temporal evolution and the potential occurrence of eruptions can be investigated with ideal or resistive MHD simulations in comparison with observations. Within the last few years a number of corresponding studies has been carried out, e.g.:

  • Jiang et al. (2013) modelled a sigmoid eruption using NLFFF as an initial state for MHD-simulations.

  • Pagano et al. (2014) used a global NLFFF-model as an initial state for MHD-simulations to study a flux rope ejection and compared it with coronal observations.

  • Jiang et al. (2017) investigated the formation of a pre-flare large scale current sheet with the help of an MHD-code which was initialized by a potential magnetic field and a hydrostatic plasma. The used MHD equilibrium code was iterated towards a stationary solution with photospheric vector magnetic field measurements from SDO/HMI as the boundary condition.

  • Prasad et al. (2018) initialized MHD simulations by NLFFF equilibria to investigate magnetic reconnection events at magnetic null points and their relevance for flare ribbons.

  • Pagano et al. (2018) combined a quasi-static global NLFFF-model with MHD-simulations for space weather applications.

  • Toriumi et al. (2020) is a study on data-driven modelling of the solar corona. Flux emergence simulations have been used as reference. Results of NLFFF computed with a relaxation code have been compared with 3 data-driven MHD-codes. All four methods reproduced the flux rope, but quantitatively there have been differences.

Questions are if or to which extent the configurations remain approximately force-free during eruptions, the role of thin current sheets and discontinuities, and the energy and helicity content.