1 Introduction

Modeling the magnetic field in the solar atmosphere is of great importance for our interpretation of many of solar observations, in particular in the solar corona (e.g. Wiegelmann, Thalmann, and Solanki, 2014). Because coronal magnetic fields cannot be measured routinely with the required accuracy, extrapolation methods with photospheric magnetic field measurements as boundary conditions are normally used, usually assuming that the magnetic field is force-free (see e.g. recent reviews by Wiegelmann and Sakurai, 2012; Régnier, 2013). In recent years measurements of the magnetic field in the chromosphere have also become available (e.g. Harvey, 2012). An overview of measurements of photospheric and chromospheric magnetic fields can, for example, be found in the paper by Lagg et al. (2017).

While the assumption of force-free magnetic fields is well satisfied in large parts of the solar corona due to the low plasma \(\beta \), the lower parts of the solar atmosphere (chromosphere and photosphere) can in general not be considered to be force-free (e.g. Metcalf et al., 1995; De Rosa et al., 2009; Wiegelmann, Thalmann, and Solanki, 2014) and hence magnetohydrostatic (MHS) models, including pressure and gravity, would be more appropriate for these regions. Developing numerical extrapolation methods for the magnetostatic case has, for example, been attempted in Wiegelmann and Neukirch (2006) (including pressure only), Gilchrist and Wheatland (2013), and Zhu and Wiegelmann (2018).

These numerical approaches are usually computationally expensive. Hence, a complementary approach for including pressure and gravity forces in magnetic extrapolation, which is computationally relatively cheap, would be to use analytical three-dimensional MHS equilibrium solutions. Obviously, just as for 3D force-free fields only a limited number of analytical 3D MHS solutions suitable for magnetic field extrapolation are known, with the known 3D MHS solutions useful for extrapolation purposes being comparable in status to 3D linear force-free solutions. We emphasize that in order to find analytical solutions to the MHS equations in 3D one has to make a number of assumptions, which may limit the applicability of the method to some extent. Hence, this approach using analytical MHS equilibria has to be regarded as an alternative method which allows one to get a reasonably fast extrapolation method including a non-force-free part of the solar atmosphere, but not as a replacement for the numerical approaches mentioned above.

Various aspects of the theory of analytical 3D MHS solutions have been developed in a series of papers by Low (1982, 1984, 1985, 1991, 1992, 1993a,b, 2005) and Bogdan and Low (1986), both in CartesianFootnote 1 and in spherical geometry. Additions, extensions and applications of this work were provided by, for example, Neukirch (1995, 1997a,b), Neukirch and Rastätter (1999), Petrie and Neukirch (2000), Neukirch (2009), Al-Salti, Neukirch, and Ryan (2010), Al-Salti and Neukirch (2010), Gent et al. (2013), Gent, Fedun, and Erdélyi (2014), MacTaggart et al. (2016) and Wilson and Neukirch (2018). A different, but less general approach has been pursued by Osherovich (1985b,a).

Subsets of these three-dimensional MHS solutions have been used for modeling both global solar magnetic field models, using spherical coordinates (e.g. Bagenal and Gibson, 1991; Gibson and Bagenal, 1995; Gibson, Bagenal, and Low, 1996; Zhao and Hoeksema, 1993, 1994; Zhao, Hoeksema, and Scherrer, 2000; Ruan et al., 2008), and local solar coronal structures, using Cartesian or cylindrical coordinates (e.g. Aulanier et al., 1999, 1998; Petrie, 2000; Gent et al., 2013; Gent, Fedun, and Erdélyi, 2014; Wiegelmann et al., 2015, 2017). Other applications include, for example, models of the magnetic fields of stars (e.g. MacTaggart et al., 2016) and their interaction with exoplanets (e.g. Lanza, 2008, 2009). In this paper, we shall focus on 3D MHS solutions in Cartesian geometry, i.e. assuming a constant gravitational force, which we take to point in the negative \(z\)-direction (hence the coordinate \(z\) has the meaning of height above the photosphere from now on).

If we follow the argument that small plasma-\(\beta \) should imply nearly force-free magnetic fields (and vice versa), there should be a marked transition from non-force-free to force-free fields with increasing height when moving from the photosphere through the chromosphere into the corona. Of the currently known solutions the one which comes closest to showing this feature has been suggested by Low (1991, 1992) and has an exponential height profile of the non-force-free current density. This solution has been used repeatedly for modeling purposes (see e.g. Aulanier et al., 1998, 1999; Wiegelmann et al., 2015, 2017). It is the aim of this paper to provide another set of 3D MHS solutions whose non-force-free current density has a more flexible dependence on height.

A general problem which arises in the use of this class of 3D MHS solutions for extrapolation purposes is that one has to be careful to avoid generating regions of negative plasma pressure or density (see e.g. Petrie and Neukirch, 2000; Petrie, 2000; Gent et al., 2013). This problem is caused by the mathematical structure of the expressions for the plasma pressure and density, both of which are written as the difference between a positive background pressure and density, and potentially negative terms, depending on the a priori unknown magnetic field solution. In theory, this problem can always be solved by either increasing the background plasma pressure and density or by decreasing the amplitude of the negative terms. In practice, the former often leads to an unrealistically high value of the plasma-\(\beta \) throughout the model domain, whereas the latter can cause the loss of meaningful spatial structures in plasma pressure and density. Being able to control the solution structure better should be of advantage for modeling purposes and may also have a (positive) bearing on the problem of keeping plasma pressure and density positive everywhere.

The structure of the paper is as follows. In Section 2 we briefly summarize the basic theory of the particular class of 3D MHS solutions we use in this paper and then present the calculation leading to the new set of solutions in Section 3. In Section 4, we present some example solutions and in Section 5 a discussion and conclusions.

2 Basic Theory

The MHS equations are given by

$$\begin{aligned} {\boldsymbol {j}}\times {\boldsymbol {B}}- \mathbf{\nabla } p - \rho {\mathbf{\nabla }} \Psi =& 0 , \end{aligned}$$
(1)
$$\begin{aligned} \mathbf{\nabla } \times {\boldsymbol {B}} = & \mu _{0} { \boldsymbol {j}}, \end{aligned}$$
(2)
$$\begin{aligned} \nabla \cdot {\boldsymbol {B}} =& 0 . \end{aligned}$$
(3)

Here \({\boldsymbol {B}}\) denotes the magnetic field, \({\boldsymbol {j}}\) the current density, \(p\) the plasma pressure, \(\rho \) the mass density, \(\Psi \) the gravitational potential and \(\mu _{0}\) is the permeability of free space.

In this paper we use Cartesian geometry with a constant gravitational force pointing in the negative \(z\)-direction, i.e. \(\Psi = g z\) with \(g\) being the constant gravitational acceleration. The general theory for this case was first developed by Low (1991, 1992). Later, Neukirch and Rastätter (1999) presented a somewhat simpler, albeit equivalent, formulation and we will follow their approach in the following brief summary. The main assumption made is that the current density can be written in the form

$$ \mu _{0} {\boldsymbol {j}}= \alpha {\boldsymbol {B}}+ \mathbf{\nabla } \times (F \hat{\mathbf{z}} ). $$
(4)

It can be shown (Low, 1991; Neukirch and Rastätter, 1999) that \(F\) has to be a function of \(B_{z}\) and \(z\). The form for \(F\) suggested by Low (1991, 1992) was

$$ F = f(z) B_{z}, $$
(5)

i.e. linear in \(B_{z}\), but with an arbitrary function \(f(z)\). Clearly, the function \(F\) is responsible for the non-force-free, i.e. perpendicular, part of the current density in this approach, although it should be noted that it will generally also contribute to the parallel part of the current density. Hence, the choice of the free function \(f(z)\) influences the dependence of the non-force-free part of the current density with height.

Choosing \(F\) to be a linear in \(B_{z}\) leads to a linear partial differential equation for \(B_{z}\) (e.g. Low, 1991). Alternatively, representing the magnetic field \({\boldsymbol {B}}\) in the form (e.g. Nakagawa and Raadu, 1972)

$$ {\boldsymbol {B}}= \mathbf{\nabla } \times \bigl[ {\mathbf{\nabla }} \times ( \Phi \hat{\mathbf{z}} ) \bigr]+ \mathbf{\nabla } \times (\Theta \hat{\mathbf{z}} ), $$
(6)

one can show that (Neukirch and Rastätter, 1999)

$$ \Delta \Phi - f(z) \Delta _{xy} \Phi + \alpha ^{2} \Phi = 0, $$
(7)

where

$$ \Delta \Phi = \frac{\partial ^{2} \Phi }{\partial {x}^{2}} + \frac{ \partial ^{2} \Phi }{\partial {y}^{2}} + \frac{\partial ^{2} \Phi }{ \partial {z}^{2}} $$
(8)

is the Laplace operator, and

$$ \Delta _{xy} \Phi = \frac{\partial ^{2} \Phi }{\partial {x}^{2}} + \frac{ \partial ^{2} \Phi }{\partial {y}^{2}} $$
(9)

is the two-dimensional Laplace operator in \(x\) and \(y\). Additionally, one finds that

$$ \Theta =\alpha \Phi , $$
(10)

and hence that

$$\begin{aligned} B_{x} = & \frac{\partial ^{2} \Phi }{\partial x \partial z} + \alpha \frac{\partial \Phi }{\partial y} , \end{aligned}$$
(11)
$$\begin{aligned} B_{y} = & \frac{\partial ^{2} \Phi }{\partial y \partial z} - \alpha \frac{\partial \Phi }{\partial x} , \end{aligned}$$
(12)
$$\begin{aligned} B_{z} =& - \frac{\partial ^{2} \Phi }{\partial {x}^{2}} - \frac{ \partial ^{2} \Phi }{\partial {y}^{2}} . \end{aligned}$$
(13)

The plasma pressure and the plasma density are given by the expressions

$$\begin{aligned} p =& p_{0}(z) - f(z) \frac{B_{z}^{2}}{2\mu _{0}}, \end{aligned}$$
(14)
$$\begin{aligned} \rho =& \frac{1}{g} \biggl(-\frac{{\mathrm{d}} p_{0}}{{\mathrm{d}} z} + \frac{{\mathrm{d}} f}{{\mathrm{d}} z} \frac{B_{z}^{2}}{2\mu _{0}}+ \frac{f}{ \mu _{0}} {\boldsymbol {B}} \cdot \nabla B_{z} \biggr), \end{aligned}$$
(15)

where \(g\) is the constant gravitational acceleration. The plasma temperature can be determined from the plasma density and pressure via an equation of state, for example, the ideal gas law

$$ T = \frac{\bar{\mu } p}{k_{\mathrm{B}} \rho }, $$
(16)

with \(\bar{\mu }\) the mean atomic weight of the plasma and \(k_{ \mathrm{B}}\) the Boltzmann constant.

3 A New Family of Solutions

Solutions to Equation 7 have been found for several different choices of the function \(f(z)\), using either separation of variables (see e.g. Low, 1991) or the Green’s function method (e.g. Petrie and Neukirch, 2000). We will use separation of variables in this paper. Leaving \(f(z)\) unspecified for the time being, separation of variables leads to

$$ \Phi = \iint _{-\infty }^{\infty }\bar{\Phi }(z; k_{x}, k_{y}) \exp \bigl[ \mbox{i}(k _{x} x + k_{y} y)\bigr] {\ \mathrm{d}} k_{x} \!\! {\ \mathrm{d}} k_{y} $$
(17)

in Cartesian coordinates \(x\), \(y\), \(z\) with the equation for \(\bar{\Phi }\) being

$$ \frac{{\mathrm{d}}^{2} \bar{\Phi }}{{\mathrm{d}} {z}^{2}} + \bigl[\alpha ^{2} -k^{2}+ k^{2} f(z)\bigr] \bar{\Phi } =0, $$
(18)

where \(k^{2} = k_{x}^{2} +k_{y}^{2}\). In Equation 18 we have suppressed the parametric dependence of \(\bar{\Phi }\) on \(k_{x}\) and \(k_{y}\) in the Cartesian coordinate case. At this point it is also convenient to normalize all coordinates by a typical length scale \(L\), and regard \(\alpha \) as the normalized \(\alpha L\) and \(k\) as \(k L\) from now on.

In practical applications, for example using potential or linear force-free magnetic fields to extrapolate photospheric field measurements, different versions of periodic boundary conditions are often imposed (e.g. Seehafer, 1978; Alissandrakis, 1981; Otto, Büchner, and Nikutowski, 2007). If periodic boundary conditions in \(x\) and \(y\) are imposed \(k_{x}\), \(k_{y}\) take on discrete values and the integrals in Equation 17 are replaced by infinite sums (which are then truncated in applications to observational data). With such boundary conditions Fast Fourier transformation (FFT) techniques can be used to implement the boundary conditions very effectively.

As pointed out by Neukirch (1995) Equation 18 is analogous to a one-dimensional Schrödinger equation with the potential \(-k^{2} f(z)\) with energy eigenvalue \(-(\alpha ^{2} -k^{2})\) (or alternatively \(-k^{2}[f(z) -1]\) with energy eigenvalue \(-\alpha ^{2}\)). Thus solutions to Equation 18 are known for a large class of functions \(f(z)\), but not all of these will be of use for modeling solar magnetic fields. Examples of functions \(f(z)\) which have been used for modeling solar magnetic fields are \(f(z)=f_{0}=\)constant, for which the solutions for \(\bar{\Phi }\) are exponential functions (e.g. Neukirch, 1997a; Petrie, 2000; Petrie and Neukirch, 2000), and \(f(z)= \bar{a} \exp (-\kappa z)\), with Bessel functions with an argument that is proportional to \(\exp (-\kappa z/2)\) as solutions (e.g. Low, 1991, 1992; Aulanier et al., 1998, 1999).

In this paper we aim to find solutions to Equations 7 or 18, respectively, which show a transition from non-force-free behavior to (linear) force-free behavior as the height \(z\) increases from the photosphere through the chromosphere into the corona. Hence, we would like \(f(z)\) to possibly decrease from non-zero values to a value close to zero when reaching the corona. While it is also in principle possible to model such a behavior with the exponential \(f(z)\) mentioned above, the transition is only controlled by the parameter \(\kappa \). Because we would like to be able to control both the height at which the transition from non-force-free to force-free fields happens and the range in height over which this happens we here suggest to use the function

$$ f(z) = a \biggl[1 - b \tanh \biggl(\frac{z-z_{0}}{\Delta z} \biggr) \biggr], $$
(19)

with \(a\), \(b\), \(z_{0}\) and \(\Delta z\) real parameters. The parameters \(a \) and \(b \) are dimensionless and we assume \(a > 0\) and \(1\ge b >0 \) in this paper. At \(z=0\) we have

$$ f(0) = a \biggl[1 +b \tanh \biggl(\frac{z_{0}}{\Delta z} \biggr) \biggr]. $$
(20)

The parameters \(a\) and \(b\) control the overall magnitude of \(f\) in the regimes \((z- z_{0})/ \Delta z \ll 0\) and \((z- z_{0})/\Delta z \gg 0\). It is easy to see that \(f \to a(1+b)\) for \((z- z_{0})/\Delta z \ll 0\) and \(f \to a(1-b) \) for \((z- z_{0})/\Delta z \gg 0\). The parameter \(z_{0}\) controls where this transition takes place and the parameter \(\Delta z\) is the length scale over which the transition happens. We see that \(f \to 0\) for \((z- z_{0})/\Delta z \gg 0\) if \(b=1\) is chosen. This means that any perpendicular electric currents go to zero above the region in which the transition happens and the magnetic field becomes a (linear) force-free field.

We remark that the form of \(f(z)\) in Equation 19 includes the possibility of \(f(z)= f_{0} =\mbox{constant}\), by choosing \(b=0\). As discussed above, for this special case the \(z\)-dependence of the solutions is given by exponential functions (e.g. Neukirch, 1997a; Petrie, 2000; Petrie and Neukirch, 2000). In principle, Equation 19 also includes the case of an exponentially decaying function of \(z\) (e.g. Low, 1991) by choosing \(b=1\) and letting

$$ \lim \limits _{z_{0} \to -\infty } a \exp (2 z_{0}/\Delta z) = \bar{a} > 0. $$
(21)

As stated above, in this case the \(z\)-dependence is given by Bessel functions with exponential arguments of the form \(\exp (-\kappa z/2)\), with \(\kappa /2 = 1/(\Delta z)\) in our limit (see e.g. Low, 1991). However, as one can see from the expression inside the limit, this case combines two of the parameters of \(f\) into one parameter \(\bar{a}\) and hence has less flexibility in applications. Although, as discussed before, the model with an exponential \(f(z)\) also allows for a transition from non-force-free to force-free fields one can only control the length scale over which this happens, but one does not have an additional specific height at which this happens such as \(z_{0}\) in the \(f\) considered in this paper. We show example plots of the three different forms of \(f(z)\) discussed above in Figure 1.

Figure 1
figure 1

The shape of \(f(z)\) (solid line) defined in Equation 19. Also shown are the two limiting cases described in the main text.

Substituting the function \(f(z)\) given in Equation 19 into Equation 18 we obtain

$$ \frac{{\mathrm{d}}^{2} \bar{\Phi }}{{\mathrm{d}} {z}^{2}} + \biggl[\alpha ^{2} -k^{2}(1-a) - k^{2} a b \tanh \biggl(\frac{z-z_{0}}{\Delta z} \biggr) \biggr] \bar{ \Phi } =0. $$
(22)

Making use of the coordinate transformation

$$ \eta = \frac{1}{2} \biggl[1- \tanh \biggl(\frac{z-z_{0}}{\Delta z} \biggr) \biggr] $$
(23)

with \(0 < \eta < 1\), we can transform Equation 22 into the differential equation

$$ \frac{{\mathrm{d}}^{2} \bar{\Phi }}{{\mathrm{d}} {\eta }^{2}} + \biggl( \frac{1}{\eta } - \frac{1}{1-\eta } \biggr)\frac{{\mathrm{d}} \bar{ \Phi }}{{\mathrm{d}} \eta } + \biggl( \frac{C_{1}}{\eta } - \frac{C _{2}}{1-\eta } \biggr) \frac{\bar{\Phi }}{\eta (1-\eta )} = 0, $$
(24)

where

$$\begin{aligned} C_{1} =& \frac{ 1}{4} \bigl[ {\bar{k}}^{2} (1-a +ab) - {\bar{\alpha }}^{2} \bigr], \end{aligned}$$
(25)
$$\begin{aligned} C_{2} =& \frac{ 1}{4} \bigl[ {\bar{k}}^{2} (1-a -ab) - {\bar{\alpha }}^{2} \bigr], \end{aligned}$$
(26)

with \(\bar{k} = k \Delta z\) and \(\bar{\alpha } = \alpha \Delta z\). Equation 24 can be solved using the hypergeometric function \({~}_{2}{\mathrm{F}}_{1}(a,b,c;z)\) (see e.g. Abramowitz and Stegun, 1965; Olver et al., 2010; NIST Digital Library of Mathematical Functions, 2014) in the form

$$\begin{aligned} \bar{\Phi } = & A \eta ^{\delta }(1-\eta )^{\gamma }{~}_{2}{ \mathrm{F}} _{1}(\gamma +\delta +1,\gamma +\delta ,2\delta +1; \eta ) \\ &{}+ B \eta ^{-\delta }(1-\eta )^{\gamma }{~}_{2}{ \mathrm{F}} _{1}(\gamma -\delta +1,\gamma -\delta ,1-2\delta ;\eta ), \end{aligned}$$
(27)

with \(\gamma =\sqrt{C_{2}}\), \(\delta =\sqrt{C_{1}}\), and \(A\), \(B\) constants to be determined by boundary conditions at \(z=z_{ \mathrm{min}}\) (here we take \(z_{\mathrm{min}}=0\)) and \(z= z_{ \mathrm{max}}\). For example, if we want the solution to tend to zero as \(z\to \infty \) (\(\eta \to 0\)), we have to choose \(B=0\). The other coefficient \(A\) will be determined by the boundary condition at \(z=z_{\mathrm{min}}=0\) in the same way as in the potential or linear force-free magnetic field case. The only difference is the functional dependence of the individual modes on \(z\).

We notice that for given values of \(a\), \(b\) and \(\bar{\alpha }\) the parameters \(C_{1}\) and \(C_{2}\) become negative for small \(k\) (in particular \(C_{1} < 0\) if \(\bar{k}^{2} < \bar{\alpha }^{2}/[1 -a(1-b)]\) and \(C_{2} < 0\) when \(\bar{k}^{2} < \bar{\alpha }^{2}/[1 -a(1+b)]\)). This implies that \(\gamma \), \(\delta \) or both become imaginary. The change in nature of the solution is similar to the change from exponential to trigonometric in the linear force-free case and while this can in principle be incorporated into a Green’s function approach (for a discussion see e.g. Chiu and Hilton, 1977; Wheatland, 1999; Petrie and Lothian, 2003; Priest, 2014) one usually has to impose restrictions on the values of \(a\), \(b\) and \(\bar{\alpha }\) in the case with periodic boundary conditions and discrete Fourier modes. As in the linear force-free case the specific bounds are determined by the smallest value of the wave vector \(k^{2}\). We will discuss an example in Section 4.

4 Illustrative Examples

Instead of using an arbitrary magnetogram we investigate the effects of the solution parameters on the structure of the magnetic field and the plasma pressure, density and temperature, by using a relatively simple, doubly periodic example which allows us to control the shape of the bottom boundary conditions and hence enables us to undertake a study of the solutions that highlights the features of the solutions more clearly.

To achieve this we will use the following boundary condition for \(B_{z}\) at \(z=0\):

$$\begin{aligned} B_{z}(x,y,0) =& B_{0} \biggl\{ \frac{\exp [ \tilde{\kappa } _{x1} \cos (\tilde{x} - \tilde{\mu }_{x1} ) ]}{ 2 \pi \mbox{I}_{0}(\tilde{\kappa }_{x1})} \frac{\exp [ \tilde{\kappa }_{y1} \cos (\tilde{y} - \tilde{\mu }_{y1} ) ]}{ 2\pi \mbox{I}_{0}(\tilde{\kappa }_{y1})} \\ & {} - \frac{\exp [ \tilde{\kappa }_{x2} \cos (\tilde{x} - \tilde{\mu }_{x2} ) ]}{ 2\pi \mbox{I}_{0}(\tilde{\kappa }_{x2})} \frac{\exp [ \tilde{\kappa }_{y2} \cos (\tilde{y} - \tilde{\mu }_{y2} ) ]}{ 2\pi \mbox{I}_{0}(\tilde{\kappa }_{y2})} \biggr\} . \end{aligned}$$
(28)

This choice is based on a special case of the bivariate von Mises distribution which is used, for example, in directional statistics (see e.g. Mardia and Jupp, 1999) and we combine two of these functions, one with a positive sign and one with a negative sign, to balance the magnetic flux through the lower boundary. Here \(\tilde{x} =\pi x/L\) and \(\tilde{y} =\pi y/L\), with the domain size in the \(x\)- and \(y\)-directions given by \(-1 \le \tilde{x}\), \(\tilde{y} \le 1\). All other quantities with a tilde that are directly related to length scales are also normalized by \(L\). Furthermore, \(B_{0}\) is a reference magnetic field value, the \(\tilde{\kappa }_{ij}\,\, (>0) \) values determine the width of the flux distribution, with larger \(\tilde{\kappa }_{ij}\) values making the width to smaller, the \(\tilde{\mu }_{ij}\) values specify the positions of the maximum or minimum of the magnetic flux distribution. The function \(\mbox{I}_{0}(x)\) is a modified Bessel function of the first kind (see e.g. Abramowitz and Stegun, 1965; Olver et al., 2010; NIST Digital Library of Mathematical Functions, 2014). The denominator is included to normalize the integral of the bivariate von Mises distribution over the \(x\)\(y\) box to unity, so that the positive and the negative magnetic flux through the bottom boundary cancel exactly and the total magnetic flux through the bottom boundary vanishes, independently of the values chosen for \(\tilde{\kappa }_{ij}\) and \(\tilde{\mu }_{ij}\). The remaining boundary condition imposed is \(B_{z} \to 0\) as \(z \to \infty \).

The function 28 is periodic in the \(x\)- and the \(y\)-direction and can easily be expanded into a Fourier series, which allows us to find the general solution for these boundary conditions without problems (for mathematical details see Appendix A). We show surface plots of the exact expression 28 and an expansion based on the first ten Fourier modes in both \(x\) and \(y\) in Figure 2. The parameter values used in this plot are \(\tilde{\mu }_{x1} = \tilde{\mu }_{y1} = - \tilde{\mu }_{x2} = - \tilde{\mu }_{y2} = 1.2/\pi \approx 0.382 \) and \(\kappa _{x1} = \kappa _{x2} = \kappa _{y1} = \kappa _{y2} = 10\). The maximum difference between the exact plot and the ten-mode approximation is of the order of \(10^{-5}\) and hence the ten-mode approximation is considered to be sufficiently accurate for this choice of parameter values.

Figure 2
figure 2

Surface plot of the \(B_{z}\)-component of the magnetic field at \(z=0\) used for the examples in this paper. Panel (a) shows a plot of the exact expression 28 and panel (b) an approximation based on a Fourier expansion using ten Fourier modes. The parameter values used in this plot are \(\tilde{\mu }_{x1} = \tilde{\mu }_{y1} = - \tilde{\mu }_{x2} = - \tilde{\mu }_{y2} = 1.2/ \pi \approx 0.382 \) and \(\kappa _{x1} = \kappa _{x2} = \kappa _{y1} = \kappa _{y2} = 10\). The maximum value of \(|B_{z}|/B_{0}\) in this plot is \(\approx \exp (2 \tilde{\mu }_{x1}) / [2 \pi \mbox{I}_{0}( \tilde{\kappa }_{x1})]^{2} = 1.55\). The difference between the exact plot and the ten-mode approximation is of the order of \(10^{-5}\).

For the MHS examples we will be showing we have used the values \(z_{0} =0.2 L\), \(\Delta z = 0.1 z_{0}\) and \(b=1.0\), which means that for \(z \gg z_{0}\) the magnetic field tends towards a potential state (in the case \(\alpha =0\)) or a linear force-free state (if \(\alpha \ne 0\)). By choosing \(b < 1.0\) one could retain a controlled level of MHS behavior of the magnetic field above \(z_{0}\).

We will present solutions for different values of the parameter \(a\) below the maximum value for \(a\), which is given by

$$ a_{\mathrm{max}} = \frac{\bar{k}^{2}_{\mathrm{min}}-\bar{\alpha }^{2}}{ \bar{k}^{2}_{\mathrm{min}}(1 + b)}. $$
(29)

As discussed in Section 3 the condition 29 follows directly from the definition of \(\gamma \) and for given \(b\), \(\alpha \) and minimum value of \(k^{2}\) corresponds to the value of \(a\) at which \(\gamma \) becomes imaginary. One can also see from Equation 29 that to have \(a_{\mathrm{max}} > 0\) one has to have \(k^{2}_{\mathrm{min}} > \alpha ^{2}\) which is the condition for linear force-free field modes to drop off exponentially with height.

We present magnetic field line plots for four different parameter combinations in Figures 3 and 4. For reference we present the potential magnetic field for the given boundary conditions (\(a=0.0\), \(\alpha =0.0\)) in panel (a) and the linear force-free magnetic field with \(\alpha =0.5\) (\(a=0\)) in panel (b) of Figures 3 and 4. We compare these two cases with two field line plots for non-zero values of \(a\), one roughly half of \(a_{ \mathrm{max}}\) and the other \(0.99 \, a_{\mathrm{max}}\). To highlight the region where the field lines change the most between the different cases, we also present the same field line plots on a domain with \(z \le 2 z_{0}\) in Figures 5 and 6.

Figure 3
figure 3

Field line plots for the boundary conditions shown in Figure 2. The box is a cube with size \(-1 \le x/L\), \(y/L \le 1\), \(0 \le z/L \le 2\). Panel (a) shows the potential magnetic field (\(a=0\), \(\tilde{\alpha }=0\)), panel (b) a linear force-free magnetic field (\(a=0\), \(\tilde{\alpha }=0.5\)) and panels (c) and (d) two MHS solutions with \(a=0.24\), \(\tilde{\alpha }=0.5\), in panel (c) and \(a=0.48\), \(\tilde{\alpha }=0.5\), in panel (d). In each panel we show field lines traced from the same foot points located on two concentric circles around the position of the positive polarity maximum. The field lines are traced until the encounter the lower boundary, with the periodic boundary conditions taken into account.

Figure 4
figure 4

The same field line plots as in Figure 3, but viewed along the \(y\)-direction (i.e. projected onto the \(x\)\(z\)-plane). As in Figure 3 we have \(-1 \le x/L \le 1\) (horizontal direction) and \(0 \le z/L \le 2\) (vertical direction). The field lines in the MHS cases (panels (c) and (d)) show clear signs of steepening below \(z/L=z_{0}/L=0.2\) (second tick mark on the vertical \(z\)-axis), as expected.

Figure 5
figure 5

The same field line plots as in Figure 3, but with \(0 \le z \le 2 z_{0}\) to make the difference between the various cases more obvious.

Figure 6
figure 6

The same field line plots as in Figure 5, but viewed along the \(y\)-direction (i.e. projected onto the \(x\)\(z\)-plane).

As expected, the main difference between the linear force-free case and the two MHS cases can be seen for \(z \le z_{0}\). This is particularly obvious in Figure 4, in which a considerable steepening of the field lines is noticeable in the region below \(z_{0}=0.2\). This change in the field line behavior can be attributed to the value of the smallest \(\gamma \) in the series expansion approaching zero which leads to a less rapid decrease of the lowest order mode with height for \(z \le z_{0}\). Due to our choice of a relatively small value for \(\Delta z\) this behavior changes relatively sharply around \(z \approx z_{0}\) and hence no major changes in the magnetic field can be seen at heights above \(z_{0}\). The magnetic field above \(z_{0}\) is therefore basically identical to a linear force-free field.

In Figures 7 and 8 we show the spatial variation of

$$ \Delta p = - f(z) \frac{B_{z}^{2}}{2 \mu _{0}} $$
(30)

and

$$ \Delta \rho =\frac{1}{g} \biggl( \frac{{\mathrm{d}} f}{{\mathrm{d}} z} \frac{B_{z}^{2}}{2 \mu _{0}}+\frac{f}{\mu _{0}} {\boldsymbol {B}}\cdot {\mathbf{\nabla }} B_{z} \biggr). $$
(31)

In these two figures \(\Delta p\) is normalized by \(B_{\mathrm{max}} ^{2}/\mu _{0}\), where \(B_{\mathrm{max}}\) is the maximum value of \(B_{z}\) at \(z=0\), and \(\Delta \rho \) is normalized by \(B_{ \mathrm{max}}^{2}/(\mu _{0} g L)\). Figure 7 shows the variation of \(\Delta p\) and \(\Delta \rho \) with height for \(0 \le z \le 2 z_{0}\) at the position of the maximum of \(|B_{z}|\) on the lower boundary, i.e. \(x=y=\tilde{\mu }_{x1} \approx -0.382\). We have chosen these \(x\) and \(y\)-coordinates because one expects the largest variations of \(\Delta p\) and \(\Delta \rho \) to happen there. As one can see both \(\Delta p\) and \(\Delta \rho \) have negative values and they generally increase with \(z\) from their lowest value at \(z=0\) until approaching zero around \(z=z_{0}\), as expected. The increase of the amplitude of \(\Delta p\) and \(\Delta \rho \) and their slower increase with \(z\) with increasing value of \(a\) is also obvious. The latter is caused by the Fourier modes, in particular the lowest order mode, to decrease less fast with height when \(a\) increases. Although a detailed analysis is a bit more complicated, one can roughly regard the \(z\) dependence of each mode as being given by \(\exp (-2 \gamma z)\) below and \(\exp (-2 \delta z)\) above \(z\approx z_{0}\). As \(a \to a_{ \mathrm{max}}\) we have \(\gamma \to 0\) for the lowest order mode and hence the mode decreases more slowly with \(z\).

Figure 7
figure 7

Plots of the variation with height \(z\) of the pressure (panel (a)) and density (panel (b)) deviation from a stratified background atmosphere for \(\alpha = 0.5\), \(z_{0}/L = 0.2\) and \(\Delta z = 0.1 z_{0}\), and three different values of \(a\) (\(a = 0.0\), 0.24 and 0.48). The \(x\)- and \(y\)-coordinates of these plots are the position of the maximum value of \(|B_{z}|\) on the lower boundary, \(x/L=\mu _{x}/\pi \approx -0.38\), \(y/L=\mu _{y}/\pi \approx -0.38\).

Figure 8
figure 8

Surface plots of \(\Delta p\) and \(\Delta \rho \) at the heights \(z=0\) ((a) and (b)), \(z=z_{0}/2\) ((c) and (d)) and \(z=z_{0}\) ((e) and (f)), showing the variation of pressure and density in the \(x\)- and \(y\)-directions.

We also note that \(\Delta \rho \) has a local maximum and minimum just below \(z_{0}\). This is caused by the \(\frac{{\mathrm{d}} f}{{\mathrm{d}} z}\) term in \(\Delta \rho \), which is largest at \(z_{0}\). This term becomes the larger the sharper the gradient of \(f\) at \(z=z_{0}\) is made, i.e. the smaller \(\Delta z\) becomes (the derivative actually tends to a \(\delta \)-function in the limit \(\Delta z \to 0\) in which case the tanh-function tends to a step function). For this reason one should not attempt to make \(\Delta z\) too small.

To keep the pressure and density positive everywhere we need to make the background pressure \(p_{0}(z)\) and the corresponding background density \(\rho _{0}(z) = - \frac{1}{g} \frac{{\mathrm{d}} p_{0}}{{\mathrm{d}} z}\) positive and larger at every height \(z\) than the minimum values of \(\Delta p\) and \(\Delta \rho \) for all \(x\), \(y\) values at the same height (see e.g. Wiegelmann et al., 2015). As one can see from Figures 7 and 8 for this new solution family this condition is only needed to be satisfied for \(z < z_{0}\) in the case \(b=1.0\) because the contributions to the pressure and the density by \(\Delta p\) and \(\Delta \rho \) become arbitrarily small very fast for \(z > z_{0}\). In Figure 9 we show a comparison of variation with \(z\) of the absolute values of \(\Delta p\) and \(\Delta \rho \) (again at \(x=y=\tilde{\mu }_{x1} \approx -0.382\)), for a solution of the family presented in this paper and a solution for \(f(z) = \bar{a} \exp (- \kappa z)\) (Low, 1991). We remark that in order to start with the same pressure at \(z=0\) one has to set \(\bar{a} = 2 a\). We have also chosen the inverse length scale \(\kappa = 1/z_{0}\), corresponding to the height of the transition of the solutions presented in this paper from non-force-free to force-free. These plots clearly show that while for both sets of solutions the pressure and density deviations decrease rapidly for \(z > z_{0}\), the decrease is much more rapid for our solutions, which, as already stated above, reduces the need for artificially adjusting the stratified background atmosphere in this region to avoid negative density or pressure values.

Figure 9
figure 9

Comparison of the variation with height \(z\) of the absolute values of the pressure (panel (a)) and density (panel (b)) deviation from a stratified background atmosphere for the solutions presented in this paper (solid lines) and for a solution with an exponential \(f(z)\) (Low, 1991). The plots have a logarithmic \(y\)-axis to emphasize the difference of the quantities of the solutions, especially the much faster drop-off of the solutions presented in this paper above the transition height \(z_{0}\). The parameters chosen for this plot are \(\alpha = 0.5\), \(a = 0.48\), \(z_{0}/L = 0.2\) and \(\Delta z = 0.1 z_{0}\) for the solid line, whereas we have chosen \(\bar{a} = 0.96\) and \(\kappa = 1/z_{0}\) (see main text for definitions). The \(x\)- and \(y\)-coordinates of these plots are the position of the maximum value of \(|B_{z}|\) on the lower boundary, \(x/L=\mu _{x}/\pi \approx -0.38\), \(y/L=\mu _{y}/\pi \approx -0.38\).

One could of course argue that by increasing \(\kappa \), i.e. reducing the length scale over which the exponential \(f(z)\) and hence the pressure and density deviations decay, one could in principle achieve a similar effect for the exponential \(f(z)\). However, for this \(f(z)\) this would also decrease the effect of the non-force-free part of the current density in the regions below \(z_{0}\) and hence reduce the effect of the non-force-free part of the current density, which somewhat defeats the purpose of using such a magnetic field model for extrapolation in the first place. Because the solutions presented in this paper can guarantee a very rapid transition to a linear force-free magnetic field, but still allow us to control the region \(z < z_{0}\) separately this problem does not arise in the new family of solutions.

5 Discussion and Conclusions

We have presented a new family of three-dimensional MHS solutions based on the general theory originally developed by Low et al. (e.g. Low, 1985; Bogdan and Low, 1986; Low, 1991, 1992), although we have used the alternative mathematical formulation by Neukirch and Rastätter (1999). The main motivation for trying to find these solutions was that they are of potential importance for analytical non-force-free magnetic field extrapolation methods. The new family of solutions allows for the MHS nature of the equilibria to be limited to a domain below a specific pre-determined height with a smooth transition to a potential or linear force-free solution possible above that height. This is achieved by choosing one of the fundamental free functions of the theory in the form of a hyperbolic tangent. It is important to emphasize that this is just one possibility of choosing the parameters for this equilibrium family and that MHS solutions in the full domain are also possible.

While such a transition is also possible with the free function mentioned above chosen in the form a decaying exponential function (e.g. Low, 1991, 1992; Aulanier et al., 1998, 1999; Wiegelmann et al., 2015, 2017), the new solution family allows much more control over the transition from the MHS domain to the non-MHS domain, in particular regarding the departures of the plasma pressure and density from a stratified atmosphere. This property can be of importance for keeping the plasma pressure and density of the solution positive and should make this equilibrium family interesting for magnetic field extrapolation purposes when a non-force-free layer has to be included. We emphasize that we do not regard these analytical extrapolation methods as replacements for numerical methods for non-force-free magnetic field extrapolation, but as a numerically relatively cheap complementary method, which could be used as an initial “quick look” tool. Obviously, the limitations that arise from having to make a number of strong assumptions to allow analytical progress have to born in mind when applying these methods.