1 Introduction

The coronal magnetic field can be constrained in a number of ways, such as by extrapolation of photospheric magnetograms or vector-magnetograph data, by radio observations of gyroresonance layers above sunspots, of by coronal seismology of oscillating loops. Before the advent of the STEREO mission, attempts were made to model observed coronal loops with stretched potential field solutions (Gary and Alexander 1999), to fit a linear force-free model with solar-rotation stereoscopy (Wiegelmann and Neukirch, 2002; Feng et al., 2007), by tomographic reconstruction with magnetohydrostatic constraints (Wiegelmann and Inhester, 2003; Ruan et al., 2008), by magnetic modeling applied to spectropolarimetric loop detections (Wiegelmann et al. 2005), or by magnetic field supported stereoscopic loop triangulation (Wiegelmann and Inhester, 2006; Conlon and Gallagher, 2010). Recently, stereoscopic triangulation of coronal loops with the STEREO mission became available, which constrains the 3D geometry of coronal magnetic field lines (Aschwanden et al., 2008; Aschwanden, 2009). The plethora of coronal high-resolution data allows us now to compare different magnetic models and to test whether they are self-consistent. A critical assessment of nonlinear force-free field (NLFFF) codes revealed the disturbing fact that different NLFFF codes yield incompatible results among themselves, and exhibit significant misalignments with stereoscopically triangulated loops (DeRosa et al., 2009; Sandman et al., 2009; Aschwanden and Sandman, 2010; Sandman and Aschwanden, 2011; Aschwanden et al. 2012a, 2012b). The discrepancy was attributed to uncertainties in the boundary conditions as well as to the non-force-freeness of the photosphere and lower chromosphere. Earlier tests with the virial theorem already indicated that the magnetic fields in the lower chromosphere at altitudes of h≲400 km are not force-free (Metcalf et al. 1995). Constraints by coronal tracers thus have become an important criterion to bootstrap a self-consistent magnetic field solution. The misalignment between theoretical extrapolation models and stereoscopically triangulated loops could be minimized by using potential field models with forward-fitted unipolar magnetic charges (Aschwanden and Sandman 2010) or dipoles (Sandman and Aschwanden 2011).

In this Paper we go a step further by deriving a simple analytical approximation of nonlinear force-free field solutions that is suitable for fast forward-fitting to stereoscopically triangulated loops or to some other coronal observations. While accurate solutions of force-free magnetic fields have been known for special mathematical functions (Low and Lou, 1990) that have been used to reconstruct the local twist of coronal loops (Malanushenko, Longcope, and McKenzie, 2009; Malanushenko, Yusuf, and Longcope, 2011), they are not suitable for forward-fitting to entire active regions. In contrast, our theoretical framework entails the representation of a potential or non-potential field by a superposition of a finite number of elementary field components that are associated with buried unipolar magnetic charges at arbitrary locations, each one being divergence-free and force-free to a good approximation, as we test numerically. While this Paper contains the analytical framework of the magnetic field model, the numerical forward-fitting code with applications to observations will be presented in a Paper II (Aschwanden and Malanushenko 2012), and applications to stereoscopically observed active regions in Aschwanden et al. (2012a, 2012b).

2 Theory

2.1 Potential Field Parameterization

The simplest representation of a magnetic potential field that fulfills Maxwell’s divergence-free condition (∇⋅B=0) is a unipolar magnetic charge j that is buried below the solar surface, which predicts a magnetic field B j (x) that points away from the buried unipolar charge and whose field strength falls off with the square of the distance r j ,

$$ \mathbf{B}_j(\mathbf{x}) = B_j \biggl(\frac{d_j}{r_j}\biggr)^2 \frac{\mathbf{r}_j}{r_j}, $$
(1)

where B j is the magnetic field strength at the solar surface above a buried magnetic charge, (x j ,y j ,z j ) is the subphotospheric position of the buried charge, d j is the depth of the magnetic charge,

$$ d_j = 1-\sqrt{x_j^2+y_j^2+z_j^2}, $$
(2)

and r j =[xx j ,yy j ,zz j ] is the vector between an arbitrary location x=(x,y,z) in the solar corona (were we desire to calculate the magnetic field) and the location (x j ,y j ,z j ) of the buried charge. We choose a Cartesian coordinate system (x,y,z) with the origin in the Sun center and are using units of solar radii, with the direction of z chosen along the line-of-sight from Earth to Sun center. For a location near disk center (x≪1,y≪1), the magnetic charge depth is d j ≈(1−z j ). Thus, the distance r j from the magnetic charge is

$$ r_j = \sqrt{(x-x_j)^2+(y-y_j)^2+(z-z_j)^2}. $$
(3)

The absolute value of the magnetic field B j (r j ) is simply a function of the radial distance r j (with B j and d j being constants for a given magnetic charge),

$$ B(r_j) = B_j \biggl(\frac{d_j}{r_j}\biggr)^2. $$
(4)

In order to obtain the Cartesian coordinates (B x ,B y ,B z ) of the magnetic field vector B j (x), we can rewrite Equation (1) as

$$ \begin{array}{lll} B_x(x,y,z) &=& B_j ({d_j/r_j})^2 (x-x_j)/r_j, \\[6pt] B_y(x,y,z) &=& B_j ({d_j/r_j})^2 (y-y_j)/r_j, \\[6pt] B_z(x,y,z) &=& B_j ({d_j/r_j})^2 (z-z_j)/r_j. \end{array} $$
(5)

We progress now from a single magnetic charge to an arbitrary number N m of magnetic charges and represent the general magnetic field with a superposition of N m buried magnetic charges, so that the potential field can be represented by the superposition of N m fields B j from each magnetic charge j=1,…,N m,

$$ \mathbf{B}(\mathbf{x}) = \sum_{j=1}^{N_{\mathrm{m}}} \mathbf{B}_j(\mathbf{x}) = \sum_{j=1}^{N_{\mathrm{m}}} B_j \biggl(\frac{d_j}{r_j}\biggr)^2 \frac{\mathbf{r}_j}{r_j}. $$
(6)

As an example we show the representation of a dipole with two magnetic unipolar charges (N m=2) of opposite polarity (B 2=−B 1) in Figure 1. Each of the unipolar charges has a radial magnetic field (dotted lines), but the superposition of the two vectors of both unipolar charges in every point of space, B(x)=B 1(x)+B 2(x), reproduces the familiar dipole field. For the case shown in Figure 1 we used the parameterization of two subphotospheric unipolar magnetic charges at positions x 1=−0.5 and x 2=+0.5, which produces dipole-like field lines (solid curves), while they converge to the classical solution of a dipole field in the limit of x 1↦0 and x 2↦0, as can be shown analytically (Jackson, 1962).

Figure 1
figure 1

The magnetic field of a symmetric dipole (dashed lines) is shown, together with the field resulting from the superposition of two unipolar magnetic charges (solid lines). The two field models become identical once the two unipolar charges are moved towards the location of the dipole moment at position (x,y)=(0,0). The radial field of each unipolar (positive and negative) charge is also shown for comparison (dotted lines).

2.2 Force-Free Field Solution of a Uniformly Twisted Fluxtube

A common geometrical concept is to characterize coronal loops with cylindrical fluxtubes. For thin fluxtubes, the curvature of coronal loops and the related forces can be neglected, so that a cylindrical geometry can be applied. Because the footpoints of coronal loops are anchored in the photosphere, where a random velocity field creates vortical motion on the coronal fluxtubes, they are generally twisted. We consider now such twisted fluxtubes in a cylindrical geometry and derive a relation between the helical twist and the force-free parameter α. The analytical solution of a uniformly twisted flux tube is described in several textbooks (e.g. Gold and Hoyle, 1960; Priest, 1982; Sturrock, 1994; Boyd and Sanderson, 2003; Aschwanden, 2004), but we summarize the derivation here to provide physical insights for the generalized derivation of nonlinear force-free magnetic field solutions derived in Section 2.3 in a self-consistent notation.

We consider a straight cylinder where a uniform twist is applied, so that an initially straight field line B=(0,0,B s ), aligned with a field line coordinate s, is rotated by a number N twist of full turns over the cylinder length l, yielding an azimuthal field component B φ at radius ρ,

$$ \frac{B_{\varphi}}{B_s} = \frac{\rho \partial \varphi}{\partial s} = \frac{2\pi \rho N_{\mathrm{twist}}}{l} = b \rho, $$
(7)

with the constant b defined in terms of the number of full twisting turns N twist over a (loop) length l.

The cylindrical geometry of a twisted flux tube is visualized in Figure 2. The longitudinal component of the untwisted magnetic field corresponds to a potential field vector B P, while the twisted non-potential field line B NP has a helical geometry with an angle μ at a radius ρ, which can be described by the longitudinal component B s and the azimuthal component B φ . The fluxtube can be considered as a sequence of cylinders with radii ρ, each one twisted by the same twist angle ∂φ/∂s=2πN twist/l. For uniform twisting, the magnetic components B φ and B s depend only on the radius ρ, but not on the length coordinate s or azimuth angle φ. Thus, the functional dependence in cylindrical coordinates (ρ,φ,s) is

$$ \mathbf{B} = [ B_{\rho}, B_{\varphi}, B_s ] = \bigl[ 0, B_{\varphi}(\rho), B_s(\rho) \bigr]. $$
(8)

Consequently, the general expression of ∇×B in cylindrical coordinates,

$$ {\nabla} \times \mathbf{B} = \biggl[ \frac{1}{\rho} \frac{\partial B_s}{\partial \varphi} - \frac{\partial B_{\varphi}}{\partial s}, \frac{\partial B_\rho}{\partial s} - \frac{\partial B_s}{\partial \rho}, \frac{1}{\rho} \biggl( \frac{\partial}{\partial \rho}(\rho B_{\varphi}) - \frac{\partial B_\rho}{\partial \varphi}\biggr)\biggr], $$
(9)

is simplified with B ρ =0 and the sole dependencies of B φ (ρ) and B s (ρ) on the radius ρ (Equation (7)), yielding a force-free current density j of

$$ \mathbf{j} = [ j_\rho, j_{\varphi}, j_s] = \frac{c}{4\pi} ({\nabla} \times \mathbf{B}) = \frac{c}{4\pi} \biggl[ 0, -\frac{\partial B_s}{\partial \rho}, \frac{1}{\rho} \biggl( \frac{\partial}{\partial \rho} (\rho B_{\varphi})\biggr)\biggr]. $$
(10)

Requiring that the Lorentz force is zero for a force-free solution, F=j×B=0, we obtain a single non-zero component in the radial ρ-direction, since j ρ =0 and B ρ =0 for the two other components,

$$ \mathbf{F} = \mathbf{j} \times \mathbf{B} = [ B_s j_{\varphi} - B_{\varphi} j_s, 0, 0], $$
(11)

yielding a single differential equation for B s and B φ ,

$$ B_s \frac{dB_s}{d\rho} + B_{\varphi} \frac{1}{\rho} \frac{d}{d\rho} (\rho B_{\varphi}) = 0. $$
(12)

By substituting B φ =bρB s from Equation (7) into Equation (12), this simplifies to

$$ \frac{d}{d\rho} \bigl[\bigl(1 + b^2 \rho^2\bigr)B_s\bigr] = 0. $$
(13)

A solution is found by making the expression inside the derivative to a constant (B 0), which yields B φ and B s ,

$$ \mathbf{B} = [ B_\rho, B_{\varphi}, B_s] = \biggl[ 0, \frac{B_0\ b \rho}{1 + b^2 \rho^2}, \frac{B_0}{1 + b^2 \rho^2}\biggr]. $$
(14)

[This equation also corrects a misprint in Equation (5.5.8) of Aschwanden (2004), where a superfluous zero component has to be eliminated.] With the definition of the force-free α-parameter,

$$ (\nabla \times \mathbf{B}) = \frac{4\pi}{c} \mathbf{j} = \alpha (\rho) \mathbf{B}, $$
(15)

we can now verify that the α-parameter for a uniformly twisted fluxtube depends only on the radius ρ,

$$ \alpha (\rho) = \frac{2b}{(1 + b^2 \rho^2)}, $$
(16)

with the constant b defined in terms of the number of full twisting turns N twist over a (loop) length l (see Equation (7)),

$$ b = \frac{2\pi N_{\mathrm{twist}}}{l}. $$
(17)
Figure 2
figure 2

The basic 3D geometry of a cylindrical flux tube with uniform twist is defined by the length l of the cylinder axis, the number of twisting turns along this length, N twist, or by the misalignment angle μ at the flux tube radius ρ between the potential field line B P (aligned with the cylindrical axis) and the non-potential field line B NP (aligned with the twisted loop). The non-potential field line B NP can be decomposed into a longitudinal field component B s and an azimuthal field component B φ .

The geometry of a twisted flux tube is visualized in Figure 3 (top middle), where the parallel field lines are aligned with the coordinate axis s in the vertical direction, the cross-sectional radius ρ is defined in the direction perpendicular to s, and the twist angle φ is indicated in the horizontal projection (Figure 3, bottom middle). According to Equations (8) and (14), the variations of the longitudinal B s (ρ) and of the azimuthal component B φ (ρ) with radius ρ are

$$ B_s(\rho) = \frac{B_0}{1 + b^2 \rho^2}, $$
(18)
$$ B_{\varphi}(\rho) = \frac{B_0 b \rho}{1 + b^2 \rho^2}. $$
(19)

These radial dependencies are shown in Figure 4 for different numbers of twist (N twist=0.5,1.0,1.5). In the limit of vanishing twist (N twist=0↦b=0), we have an untwisted flux tube (Figure 3, left) with a constant longitudinal field B s (ρ)=B 0 and a vanishing azimuthal component B φ (ρ)=0. The dependence of the azimuthal field component B φ (ρ) and the longitudinal field component B s (ρ) as a function of the radius ρ from the twist axis (Figure 4) shows that the longitudinal component falls off monotonically with radius ρ, while the azimuthal component increases first for small distances ρl, but falls off at larger distances. Thus, the twisting causes a smaller cross-section of a fluxtube compared with the potential field situation, as widely known (e.g. Klimchuk, Antiochos, and Norton, 2000).

Figure 3
figure 3

The field line geometry is shown for an untwisted cylindrical flux tube (left), a twisted cylindrical flux tube (middle), and for a twisted radial field (right), from the side view in the xz-plane (top) and from the top view in the xy-plane (bottom). The top panels show the longitudinal magnetic field component B s (ρ) and the bottom panels show the azimuthal magnetic field component B φ (ρ,φ).

Figure 4
figure 4

The dependence of the longitudinal (solid lines) and azimuthal magnetic field component (dashed lines) as a function of the distance r/l from the twist axis field is shown for three different amounts of twist (N twist=1.5,1.0,0.5 full turns per loop length l).

2.3 Nonlinear Force-Free Field Parameterization

We are now synthesizing the concept of point-like buried magnetic charges that we used to parameterize a potential field (Section 2.1) with the uniformly twisted flux tube concept that represents an exact solution of a nonlinear force-free field (Section 2.2). The geometric difference between the two concepts is the spherical symmetry of a point charge versus the parallel field configuration of an untwisted flux tube. However, we can synthesize the two geometries by considering the parallel field as a far-field approximation of a radial field. In an Euclidean parallel field, the equi-potential surface is a plane perpendicular to the parallel field vector, while a radial field has spherical equi-potential surface. We can make the transformation of a parallel field in cylindrical coordinates (s,ρ,φ) into a radial field with spherical coordinates (r,θ,φ) by mapping (see Figure 3)

$$ \begin{array}{l} s \mapsto r, \\ \rho \mapsto r \sin(\theta). \end{array} $$
(20)

This transformation from cylindrical to spherical coordinates preserves the orthogonality of the longitudinal field component (B s B r ) to the equi-potential surface (s= const ↦r= const) and conserves the magnetic flux Φ(r) along a bundle of field lines with area A(r)=ρ 2(r),

$$ \Phi(r) = B(r) A(r) = B(r) \rho^2(r) = B(r) r^2 \sin^2{\theta} = \mathrm{const}, $$
(21)

if the longitudinal component B(r)∝r −2 (Equation (1)) decreases quadratically with distance from the magnetic charge. Thus, applying the transformation into spherical coordinates (Equation (20)) and the magnetic flux conservation (Equation (21)) to the straight flux tube solution (Equations (18) and (19)), we can already guess the approximate nonlinear force-free solution in spherical coordinates,

$$ B_r(r, \theta) \propto r^{-2} \frac{1}{(1 + b^2 r^2 \sin^2{\theta})}, $$
(22)
$$ B_\varphi(r, \theta) \propto r^{-2} \frac{b r \sin{\theta}}{(1 + b^2 r^2 \sin^2{\theta})}. $$
(23)

More rigorously, we can derive a nonlinear force-free field solution by writing the divergence-free condition (∇⋅B)=0 and the force-free condition (∇×B)=(4π/c)j=α(ρ)B (Equation (15)) of a magnetic field vector (B r ,B θ ,B φ ) in spherical coordinates (r,θ,φ) (with the origin at the location of the magnetic charge and the spherical symmetry axis aligned with the vertical direction to the local solar surface),

$$ (\nabla \cdot \mathbf{B}) = \frac{1}{r^2} \frac{\partial}{\partial r} \bigl(r^2 B_r\bigr) + \frac{1}{r \sin{\theta}} \frac{\partial}{\partial \theta} (B_\theta \sin{\theta}) + \frac{1}{r \sin{\theta}} \frac{\partial B_\varphi}{\partial \varphi} = 0, $$
(24)
$$ [\nabla \times \mathbf{B}]_r = \frac{1}{r \sin{\theta}} \biggl[\frac{\partial}{\partial \theta} (B_\varphi \sin{\theta}) - \frac{\partial B_\varphi}{\partial \varphi}\biggr] = \alpha B_r, $$
(25)
$$ [\nabla \times \mathbf{B}]_\theta = \frac{1}{r} \biggl[\frac{1}{\sin{\theta}} \frac{\partial B_r}{\partial \varphi} - \frac{\partial}{\partial r} (r B_\varphi)\biggr] = \alpha B_\theta, $$
(26)
$$ [\nabla \times \mathbf{B}]_\varphi = \frac{1}{r} \biggl[\frac{\partial}{\partial r}(r B_\theta) - \frac{\partial B_r}{\partial \theta}\biggr] = \alpha B_\varphi. $$
(27)

For a simple approximative nonlinear force-free solution we require axi-symmetry with no azimuthal dependence (/∂φ=0) and neglect components that contribute only to second order (B θ ∝[brsinθ]2≈0), in analogy to the uniformly twisted flux tubes on cylindrical surfaces (Figure 2). This requirement simplifies Equations (24) – (27) to

$$ \frac{1}{r^2} \frac{\partial}{\partial r} \bigl(r^2 B_r\bigr)\approx 0, $$
(28)
$$ \frac{1}{r \sin{\theta}} \frac{\partial}{\partial \theta}(B_\varphi \sin \theta) = \alpha B_r, $$
(29)
$$ -\frac{1}{r} \frac{\partial}{\partial r} (r B_\varphi)\approx 0, $$
(30)
$$ -\frac{1}{r} \frac{\partial B_r}{\partial \theta}\approx \alpha B_\varphi. $$
(31)

Eliminating α from Equations (29) and (31) and using the analog ansatz as for cylindrical fluxtubes (Equation (7)),

$$ B_\varphi = B_r b r \sin{\theta}, $$
(32)

we obtain a similar differential equation as in Equation (13),

$$ \frac{\partial}{\partial \theta} \bigl[ B_r \bigl( 1 + b^2 r^2 \sin^2{\theta}\bigr)\bigr] = 0. $$
(33)

A solution of this differential equation is obtained by setting the expression inside the bracket to the constant B 0(d 2/r 2), which fulfills the divergence-free condition (Equation (28)), and we obtain a solution for B r and B φ (using Equation (32)), for α (using Equation (29)),

$$ B_r(r, \theta) = B_0 \biggl(\frac{d^2}{r^2}\biggr) \frac{1}{(1 + b^2 r^2 \sin^2{\theta})}, $$
(34)
$$ B_\varphi(r, \theta) = B_0 \biggl(\frac{d^2}{r^2}\biggr) \frac{b r \sin{\theta}}{(1 + b^2 r^2 \sin^2{\theta})}, $$
(35)
$$ B_\theta(r, \theta) \approx 0, $$
(36)
$$ \alpha(r, \theta)\approx \frac{2 b \cos{\theta}}{(1 + b^2 r^2 \sin^2{\theta})}. $$
(37)

This solution fulfills both the force-free condition (Equations (29) – (31)) and the divergence-free condition (Equation (28)) to second-order accuracy (∝[brsinθ]2). We see that this solution is identical with the simplified derivation of Equations (22) and (23). At locations near the twist axis (θ↦0), the general solution (Equations (34) – (37)) converges to the cylindrical flux tube geometry solution (Equations (18) and (19)). Furthermore, in the limit of vanishing twist (b↦0) we retrieve the potential-field solution (Equation (4)), since the force-free parameter becomes α↦0, the azimuthal field component becomes B φ =0, and the radial component reproduces the potential-field solution B r B 0(d 2/r 2).

2.4 Cartesian Coordinate Transformation

In the derivation in the last section we derived the solution in terms of spherical coordinates (r,θ,φ) in a coordinate system where the rotational symmetry axis is aligned with the vertical to the solar surface intersecting a magnetic charge j. Since we are going to model a number of magnetic charges at arbitrary positions on the solar disk, we have to transform an individual coordinate system (r j ,θ j ,φ j ) associated with magnetic charge j into a Cartesian coordinate system (x,y,z) that is given by the observers line-of-sight (in z-direction) and the observer’s image coordinate system (x,y) in the plane-of-sky. The variables of the Cartesian coordinate transformation are shown in Figure 5.

Figure 5
figure 5

The geometry of a twisted radial field of a magnetic charge j buried at a subphotospheric position (x j ,y j ,z j ) is shown. The central twist axis (dashed line) intersects an equi-potential surface at position (x 0,y 0,z 0) and the longitudinal field vector B r at position (x,y,z) has a radial distance ρ from the twist axis and an azimuth angle φ. The azimuthal magnetic field component B φ at location (x,y,z) is orthogonal to the radial vector ρ and the longitudinal field component B r , as well as to the direction of the twist axis R.

The radial magnetic field vector B r (which is pointing radially away from a magnetic charge j located in the solar interior at (x j ,y j ,z j ) is simply given by the difference of the Cartesian coordinates from an arbitrary location (x,y,z),

$$ \frac{\mathbf{B}_{r}}{B_r} = \biggl[ \frac{x-x_j}{r_j}, \frac{y-y_j}{r_j}, \frac{z-z_j}{r_j}\biggr] = [ \cos_{r,x}, \cos_{r,y}, \cos_{r,z}], $$
(38)

where B r is the absolute value of the radial magnetic field component B r (r j ,θ j ) (Equation (34)), r j is the spatial length of the radial vector r j (Equation (3)), defining the directional cosines cos r,i (for the 3D coordinates i=x,y,z) of the radial magnetic field vector B r .

The azimuthal component B φ (with the absolute value B φ (r j ,θ j ) defined in Equation (35)) of the twisted magnetic field is orthogonal to the direction of the twist axis R (aligned with the local vertical),

$$ \mathbf{R} = [ x_j, y_j, z_j], $$
(39)

and the radial magnetic field component B r (Figure 5), and thus can be computed from the vector product of the two vectors B r and R,

$$ \frac{\mathbf{B}_{\varphi}}{B_{\varphi}} = \frac{\mathbf{R} \times {\mathbf{B}_r}}{|\mathbf{R} \times \mathbf{B}_r|} = [\cos_{\varphi,x}, \cos_{\varphi,y}, \cos_{\varphi_z}], $$
(40)

which defines the directional cosines cos φ,i of the azimuthal component in the Cartesian coordinate system. The vector product allows us also to extract the inclination angle θ j between the radial magnetic field component B r and the local vertical direction R,

$$ \theta_j = \sin^{-1} \biggl( \frac{|\mathbf{R} \times \mathbf{B}_r|}{|\mathbf{R}| |\mathbf{B}_r|}\biggr). $$
(41)

Finally, the total non-potential magnetic field vector B=(B x ,B y ,B z ) is then the vector sum of the radial B r and the azimuthal magnetic field component B φ ,

$$ \begin{array}{ll} B_x &= B_r(r_j, \theta_j) \cos_{r,x} + B_{\varphi}(r_j, \theta_j) \cos_{\varphi, x} \\[6pt] B_y &= B_r(r_j, \theta_j) \cos_{r,y} + B_{\varphi}(r_j, \theta_j) \cos_{\varphi, y} \\[6pt] B_z &= B_r(r_j, \theta_j) \cos_{r,z} + B_{\varphi}(r_j, \theta_j) \cos_{\varphi, z}, \end{array} $$
(42)

with the directional cosines (cos r,i , cos φ,i , cos θ,i ) defined by Equations (38) and (40). This is a convenient parameterization that allows us directly to calculate the magnetic field vector of the non-potential field B j =(B x ,B y ,B z ) associated with a magnetic charge j that is characterized with five parameters: (B j ,x j ,y j ,z j ,α j ), where we define the force-free α-parameter from the twist parameter b j =2πN twist/l (Equation (7)) at the location of the twist axis (θ j =0),

$$ \alpha_j = \alpha(\theta_j=0) = {2\ b_j}, $$
(43)

according to Equation (37).

2.5 Superposition of Twisted Field Components

The total non-potential magnetic field from all j=1,…,N m magnetic charges can be approximately obtained from the vector sum of all components j (in an analog way as we applied in Equation (6) for the potential field),

$$ \mathbf{B}(\mathbf{x}) = \sum_{j=1}^{N_{\mathrm{m}}} \mathbf{B}_j(\mathbf{x}), $$
(44)

where the vector components B j =(B x,j ,B y,j ,B z,j ) of the non-potential field of a magnetic charge j are defined in Equation (42), which can be parameterized with 5N m free parameters (B j ,x j ,y j ,z j ,α j ) for a non-potential field, or with 4N m free parameters for a potential field (with α j =0). Of course, the sum of force-free magnetic field vectors is generally not force-free, but we will prove in the following (Equations (46) and (47)) that the sum of NLFFF solutions of the form of Equations (34) – (37), which are force-free to second-order accuracy in α (or, more strictly, in [brsinθ]), have the property that their sum is also force-free to second-order in α.

Let us first consider the condition of divergence-freeness. Since the divergence operator is linear, the superposition of a number of divergence-free fields is divergence-free also,

$$ \nabla \cdot \mathbf{B} = \nabla \cdot \biggl(\sum_j \mathbf{B}_j\biggr) = \sum_j (\nabla \cdot \mathbf{B}_j) = 0. $$
(45)

While the divergence-free condition is exactly fulfilled for a potential field solution (Equation (4)), our quasi-force-free approximation (Equations (34) – (37)) matches this requirement to second order in α, as the insertion of the solutions (Equations (34) – (37)) into the divergence expression (Equation (24)) shows. For a quantitative measure of this level of accuracy we can also check numerical tests of the figure of merit (Section 3.3).

Now, let us consider the condition of force-freeness. A force-free field has to satisfy Maxwell’s equation (Equation (15)). Since we parameterized both the potential field and the non-potential field with a linear sum of N m magnetic charges, the requirement would be,

$$ \nabla \times \mathbf{B} = \nabla \times \sum_{j=1}^{N_{\mathrm{m}}} \mathbf{B}_j = \sum_{j=1}^{N_{\mathrm{m}}} (\nabla_j \times \mathbf{B}_j) = \sum_{j=1}^{N_{\mathrm{m}}} \alpha_j (\mathbf{r}) \mathbf{B}_j = \alpha (\mathbf{r}) \mathbf{B}. $$
(46)

Generally, these three equations of the vector ∇×B cannot be fulfilled with a scalar function α(r) for a sum of force-free field components, unless the magnetic field volume consists of spatially separated force-free subvolumes. However, we can show the validity of the force-freeness equation (Equation (46)) to second-order accuracy in α. Note that the nonlinear force-free parameter α is proportional to b (Equations (37) and (43)), which is defined in Equation (17), and thus we set second-order accuracy in b equal to second-order accuracy in α. The argument goes as follows. If we use spherical coordinates, the NLFFF solution of the radial component is of zeroth order, B r (r,θ)∝O(α 0) (Equation (34)), the azimuthal component is of first order, B φ (r,θ)∝O(α 1) (Equation (35)), and the neglected third component magnetic field component is of second-order, B θ (r,θ)∝O(α 2) (as can be shown by inserting B r and B φ into Equation (26)). The curl of the magnetic field (Equations (25) – (27)) is then of first order for the radial component, [∇×B] r αB r O(α 1) (Equation (25)), to second order for the azimuthal component, [∇×B] φ ∝(αB φ )∝O(α 2) (Equation (27)), and the remaining third component is of third-order, [∇×B] θ ∝(αB θ )∝O(α 3) (Equation (26)).

Therefore, if we neglect second-order and higher-order terms, the divergence-free condition (Equation (46)), which generally has three equations for the three curl components, e.g. [∇×B] r , [∇×B] φ , [∇×B] θ , reduces to one single equation for the radial component, [∇×B] r , which can be fulfilled with a scalar function α(r),

(47)

Thus, we expect that the force-freeness is fulfilled to second-order accuracy O(α 2) (or strictly speaking O(b 2)). We will demonstrate the near force-freeness of simulated examples in the next section.

3 Simulations and Tests

We are now going to simulate examples of the analytical nonlinear force-free solutions in order to visualize the magnetic topology and to quantify the accuracy of the divergence-free and force-free conditions.

3.1 Numerical Examples

The simplest case is a single magnetic charge j=1, which we illustrate as case A in Figure 6 (top row). We choose the following parameters: a magnetic field strength of B 1=1000 G (gauss) at the solar surface directly above the buried charge, the location (x 1,y 1,z 1)=(0.1,0.0,0.95) for the buried charge, and a number of zero twist b 1=0 for the potential field case. We show the simulated line-of-sight magnetogram B z (x,y) in Figure 1 (top left), which mimics an isolated sunspot. The pixel size of the magnetogram and the stepping size in the extrapolation along a field line is Δs=0.004 solar radii (2800 km ≈4″, corresponding to the pixel size of SoHO/MDI magnetograms). We extrapolate the field lines for every pixel that has a footpoint magnetic field strength above a threshold of 50 % (>500 G). The field lines point in radial direction away from the center of the buried magnetic charge, as is expected for the potential field of an isolated sunspot (and defined in Equation (1)).

Figure 6
figure 6

Simulations of three line-of-sight magnetograms (left) and magnetic field lines projected into the xy plane (left) and into the vertical xz plane (right). The three cases include: (A) a single positive magnetic charge (first row), (B) a dipole produced by two magnetic charges with opposite polarity (second row), and (C) a quadrupole configuration (third row). See parameters in Table 1. Only field lines with magnetic fields above a 50 % threshold of the maximum field strength are shown.

The next basic example is a magnetic dipole, which can be represented in our model by a superposition of a pair of two magnetic charges with opposite polarity, as sketched in Figure 1. The case B shown in Figure 6 is simulated with equal, but oppositely signed magnetic field strengths (B 1=1000 G, B 2=−1000 G) at mirrored positions (x 1=0.1,x 2=−0.1), otherwise we used the same parameters as in case A (y 1=y 2=0.0,r 1=r 2=0.95,b 2=b 1=0.0). The magnetic field lines mimic the familiar structure of a dipole, which is parameterized here with eight free parameters (in the potential case).

A quadrupolar configuration is simulated in case C (Figure 6, bottom), with translational symmetry (x 1=0.1,x 2=0.05,x 3=−0.05,x 4=−0.1;y 1=0.1,y 2=0.05,y 3=0.1,y 4=0.05), equal depths (r 1=r 2=r 3=r 4=0.95), and alternating field strengths (B 1=B 3=1000,B 2=B 4=−1000 G). The quadrupolar configuration shows essentially two bipoles, each one with field lines that mostly connect within the same dipole domain, but a few intermediate field lines actually connect from one to the other domain.

In Figure 7 we show the same three configurations as for the potential field model (A, B, and C of Figure 6), but add electric currents caused by twisting, corresponding to N twist=−0.5 turns for the single charge (case D) or first dipole (case E), and N twist=1.0 for the second dipole (case F), defined for a loop length of L=0.1π solar radii. These amounts of twist correspond to force-free α-parameters of α=2πN twist/L=−10 and −20 solar radius−1 (i.e., α=−1.43 and −2.86×10−10 cm−1). Comparing the potential (Figure 6) and non-potential cases (Figure 7) shows clearly the differences that result from the presence of electric currents. The force-free field lines of a sunspot become distorted into spiral shapes (case D), the straight dipole becomes distorted into a sigmoid shape (case E), and the quadrupolar configuration becomes also more distorted with sigmoid-like structures (case F).

Figure 7
figure 7

Simulations of three line-of-sight magnetograms (left) and magnetic field lines of a non-potential model with currents are shown, projected into the xy plane (left) and into the vertical xz plane (right). The parameters of the three cases (D), (E), and (F) are identical to thous of (A), (B), and (C), except for the addition of electric currents.

In Figure 8 we show a few more complicated cases (G, H, and I), consisting of N m=10 magnetic charges, with random values chosen in the magnetic field range −1000 G <B j <+1000 G, in positions −0.15<x j <0.15 solar radii, −0.15<y j <0.15 solar radii, 0.95<r j <0.97 solar radii, and random twist in the range −3<N twist<+3 per L=0.1π solar radii. The field lines displayed in Figure 8 demonstrate that a rich variety of sigmoid-shaped dipoles and inter-connecting multi-pole configurations can be generated with our quasi-force-free solutions, which mimic realistic active regions observed in the solar corona.

Figure 8
figure 8

Simulations of three line-of-sight magnetograms (left) and magnetic field lines of a non-potential model with currents are shown, projected into the xy plane (left) and into the vertical xz plane (right). The three cases (G), (H), and (I) have each N m=10 magnetic charges, with randomly chosen field strengths, locations, and electric currents.

3.2 Force-Free α-Parameter and Electric Current Maps

In Figure 9 we show examples of various maps that can be generated to visualize a 3D vector field solution, for the case F of a quadrupolar configuration with currents. We show the following quantities in the image plane (x,y,z=1+Δs), which corresponds to an image plane near the solar surface: The three magnetic field vector component maps B x (x,y), B y (x,y), B z (x,y) (Figure 9, left panels, the vertical electric current map j z (x,y) (Figure 9, top right panel), the nonlinear α-parameter α(x,y) (Figure 9, middle right panel), and the LOS magnetogram B z (x,y) together with extrapolated field lines (Figure 9, bottom right panel). The B z map shows most clearly the locations of the four buried magnetic charges that form two dipolar or a quadrupolar configuration. The magnetic polarization is also reflected in the j z and α-map. The B z and the α-map show also the location of the neutral line, where numerical effects due to the limited spatial resolution become visible.

Figure 9
figure 9

Maps of the magnetic field components B x (x,y),B y (x,y),B z (x,y) (left panels), the electric current density j z (x,y), and the force-free α-parameter (right panels).

3.3 Figures of Merit

The degree of convergence towards a divergence-free magnetic field model solution can be quantified by a measure that compares the average divergence ∇⋅B, which should be close to zero, with the gradient Bx of the magnetic field over a reference length scale Δx, for instance a pixel of the computational grid. The average deviation can then be defined by (see also Wheatland, Sturrock, and Roumeliotis (2000) or Schrijver et al. (2006))

$$ L_{\mathrm{d}} = \frac{1}{V} \int_V \frac{|(\nabla \cdot \mathbf{B})|^2}{|B/\Delta x|^2}\,\mathrm{d}V. $$
(48)

Similarly, the force-freeness can be quantified by the ratio of the Lorentz force, (j×B)=(∇×BB to the normalization constant B 2x,

$$ L_{\mathrm{f}} = \frac{1}{V} \int_V \frac{|(\nabla \times \mathbf{B}) \times \mathbf{B}|^2}{|B^2/\Delta x|^2}\,\mathrm{d}V, $$
(49)

where B=|B|.

We calculated these figure of merit quantities for the nine cases simulated in Figures 6 – 9. The values are listed in each of the panels in Figures 6 – 8 and listed in Table 1. The potential-field cases (A, B, and C) are found to have a figure of merit in the range of L d=0.0009±0.0006 for the divergence-freeness, and L f=0.0014±0.0006 for the force-freeness. The non-potential field cases (D, E, F, G, H, and I) have values in similar ranges of L d=0.0009±0.0005 for the divergence-freeness, and L f=0.0100±0.0080 for the force-freeness. We find no tendency that this figure of merit depends on the number of magnetic charges or some other model parameters. The fact that our quasi-force free analytical solutions perform equally well as standard NLFFF codes described in Schrijver et al. (2006) tells us that the inaccuracy of the analytical approximation is commensurable or even smaller than the numerical uncertainty of other NLFFF codes. However, since our analytical solution provides an explicit formulation of nonlinear force-free fields, it can be computed much faster than the standard NLFFF codes, and still provides approximate solutions with acceptable accuracy (to second order). The computation time of the analytical solutions for the cases shown in Figures 6 – 8 amounts to about 1 s (on a recent Mac computer: Mac OS X, 2×3.2 GHz Quad-Core Intel Xeon, Memory 32 GB 800 MHz DDR2 FB-DIMM), while standard iterative NLFFF codes need several hours to converge to a single NLFFF solution.

Table 1 Figures of merit for nine simulations of nonlinear force-free field solutions, detailing the size of the 3D data cube, the number of magnetic charges (N m), potential or non-potential model (P and NP), the number of computed field lines N f, the divergence-freeness L d, the force-freeness L f, and the computation times t CPU.

4 Discussion and Conclusions

The coronal magnetic field has generally been computed by extrapolation from lower boundary data in form of photospheric magnetograms B z (x,y,z=z ph) or vector-magnetograph data B(x,y), using a numerical extrapolation algorithm that fulfills the conditions of force-freeness (∇⋅B) and divergence-freeness ∇×B=α(r)B, where α(r) is a scalar function in space r. These extrapolation algorithms are very computing-intensive, because a good solution requires many iterations on a large computational 3D-grid that has sufficient spatial resolution to resolve the relevant magnetic field gradients. The accuracy of these numerical solutions depends very much on the noise in boundary vector magnetic field data as well as on deviations of photospheric fields from a force-free state. Recent stereoscopic triangulation of coronal loops has demonstrated a considerable mismatch between the extrapolated fields and the actual coronal loops, which cannot easily be reconciled with extrapolation algorithms, since they have only a very limited degree of freedom within the noise of the boundary data. Moreover, since each NLFFF solution is very time-consuming to compute, these algorithms are not suitable for forward-fitting.

The forward-fitting of magnetic field solutions to observed data requires a faster algorithm to compute many NLFFF solutions for variable boundary data or for coronal constraints as given by stereoscopic 3D reconstructions. The fastest computational way would be an explicit analytical solution for the coronal field vectors B(r) as a function of some suitable parameterization of the boundary data or coronal constraints. There exist some analytical solutions of nonlinear force-free fields, such as a class of solutions in terms of Legendre polynomials (Low and Lou 1990), which is characterized by some spatial symmetry and has been used to test numerical extrapolation algorithms (e.g. DeRosa et al., 2009; Malanushenko, Longcope, and McKenzie, 2009). However, to our knowledge, the class of analytical NLFFF solutions of Low and Lou (1990) has never been applied to forward-fitting of observed data, such as line-of-sight magnetograms, vector magnetograph 3D data, or to stereoscopically triangulated loops. Moreover, the special class of NLFFF solutions derived in Low and Lou (1990) correspond to harmonics of Legendre polynomials, which have a high degree of symmetry that does not match realistic observations of active regions, and thus is not suitable for forward-fitting to real data.

What we need to model observed solar magnetic data with high accuracy is:

  1. i)

    an explicit formulation of an analytical NLFFF solution;

  2. ii)

    a parameterization of the NLFFF solution with a sufficient large number of free parameters that can be forward-fitted to data and converges close to observations; and

  3. iii)

    a fast computation algorithm that can perform many interactions without computing-intensive techniques.

Hence, such a project consists of developing a suitable analytical formulation first, and then to implement the analytical solutions into a forward-fitting code. In this paper we have undertaken the first step. We started with a potential-field parameterization in terms of N m buried magnetic charges, which is defined by 4N m free parameters that can easily be extracted from an observed line-of-sight magnetogram B z (x,y) with arbitrary accuracy, as demonstrated in two recent studies (Aschwanden and Sandman, 2010; Aschwanden et al., 2012a). The key concept of this potential-field representation is that an arbitrary complex 3D magnetic field can be decomposed into a finite number of elementary magnetic field components, where each one simply consists of a quadratically decreasing radial field of a buried magnetic charge. Divergence-freeness is conserved due to the linearity in the superposition of elementary field components. In a next step we extended the elementary potential-field component to a nonpotential-field component by adding a uniform twist that can be parameterized by the force-free α-parameter. Such an elementary nonpotential field component requires five free parameters, consisting of the four potential-field parameters plus the force-free α-parameter. We derived an explicit analytical formulation of the radial B r (r,θ) and azimuthal field vector B φ (r,θ) that represents an approximative solution of the divergence-free and force-free condition to second order (∝α 2). This solution is very accurate for weakly non-potential fields and converges to the potential field solution for α=0. In analogy to the potential-field representation, we represent a general non-potential field solution with a superposition of elementary non-potential field components and prove that the divergence-freeness and force-freeness is conserved to second-order accuracy in our NLFFF approximation.

We calculated some examples of potential and non-potential fields that mimic an isolated sunspot, a dipolar and a quadrupolar configuration, as well as more complex multi-polar configurations. The examples show that the magnetic field of arbitrary complex active regions can be represented with our parameterization. Increasing the force-free α-parameter distorts circular field lines into helical and sigmoid-shaped geometries. Our parameterization allows one to compute either field lines (starting from arbitrary locations), 3D data cubes of magnetic field vectors, of maps of the force-free α-parameter and electric current j z (Figure 9). We tested the figures of merit for divergence-freeness and force-freeness, which amount to L d≲10−3 and L f≲10−2. The examples demonstrate also the computing speed of this algorithm, which amounts to the order of ≈1 s for a computation grid that encompasses a typical active region with the spatial resolution of MDI. Thus, we envision that a full-fletched forward-fitting code can converge within a few seconds to a few minutes, depending on the number of iterations and number of magnetic field components.

Where do we go from here? The next step is the development of a forward-fitting code that uses the magnetic field parameterization described here (see Paper II). We envision the applications to at least three different sets of constraints, requiring three different versions of forward-fitting codes: i) line-of-sight magnetograms B z (x,y) and 3D coordinates [x(s),y(s),z(s)] of stereoscopically triangulated loops; ii) line-of-sight magnetograms B z (x,y) and 2D coordinates [(x(s),y(s)] of traced loops; and iii) vector-magnetograph data [B x (x,y),B y (x,y),B z (x,y)]. The first application requires STEREO data, while the second one can be obtained from any EUV imager (e.g. AIA/SDO, TRACE, EIT/SOHO). The third application can be conducted with the new HMI/SDO data and is equivalent to other NLFFF extrapolation codes without coronal constraints, while the first two use coronal tracers and alleviate the force-free assumption of photospheric data. We envision that these three applications will reveal insights into a number of crucial questions in a novel way.

There is a large number of physical problems and issues that can be addressed with the anticipated forward-fitting code, such as:

  1. i)

    the force-freeness of the photosphere;

  2. ii)

    the accuracy of NLFFF solutions;

  3. iii)

    the spatial distribution of electric currents in active regions;

  4. iv)

    the temporal evolution of currents before and during flares;

  5. v)

    the spatial distribution of current dissipation and coronal heating;

  6. vi)

    helicity injection;

  7. vii)

    the 3D geometry of coronal loops which is needed for hydrodynamic modeling;

  8. viii)

    scaling laws of the volumetric heating function with other physical parameters;

  9. ix)

    tests of the magnetic field strength inferred from coronal seismology, etc.

There hardly exists a phenomenon in the solar corona that can be modeled without the knowledge of the coronal magnetic field.