Low and Lou analytical NLFFF solution

The non-linear force-free equations cannot be solved exactly in general, so we have no simple formula for the coronal field. This is a problem when we want to test an extrapolation code: if we feed it a magnetogram and it returns a 3D field, how do we know the answer is right? The usual metrics only tell us the field is self-consistent (small force, small divergence), not that it matches the true field.

Low & Lou (1990) got around this by finding one special case that can be solved. They assumed the field is axisymmetric (the same all the way around an axis), which is enough to collapse the equations down to a single ordinary differential equation that we can solve on a computer to high accuracy. The trick at the end is to bury the solution below the surface and tilt it, so that on a flat photosphere it looks like an ordinary bipolar active region rather than something obviously symmetric.

NF2 ships this as get_analytic_b_field(...) in nf2/data/analytical_field.py. It is the synthetic partner to the real-data AR 11158 benchmark.


Setting up an axisymmetric field

We work in spherical coordinates and assume nothing depends on the angle around the axis, so . Any such field can be built from a single scalar function , called the flux function, plus a separate sideways (azimuthal) part :

Writing this out gives the three components

where in the last term we have just renamed the azimuthal field, defining because it turns out to be the more convenient variable. The reason for building the field from this way is that it is automatically divergence-free: with these definitions holds exactly, so one of Maxwell’s conditions is satisfied before we do any work. These are the same formulas used in analytical_field.py:

Br     = (r**2 * np.sin(theta))**-1 * dA_dtheta
Btheta = -(r * np.sin(theta))**-1 * dA_dr
Bphi   = (r * np.sin(theta))**-1 * Q

Applying the force-free condition

A force-free field obeys , where is the torsion function and is constant along each field line. We now put our axisymmetric field into this condition. Because taking the curl swaps the in-plane and sideways parts of the field, the single vector equation splits into two pieces.

The sideways part gives one equation linking and :

The in-plane part gives . This says changes in exactly the same direction as everywhere, which can only happen if depends on position only through . In other words

This is just the axisymmetric version of the familiar result that is the same all along a field line. Substituting back into the first equation leaves a single equation for alone (this is a force-free Grad–Shafranov equation, the standard equation for axisymmetric magnetic equilibria):

So we have gone from a system of vector equations to one scalar equation, as long as we pick the function .


Simplifying the angle

It helps to swap the angle for . The messy angular term then tidies up to , and the equation becomes


The Low & Lou guess

Low & Lou looked for a solution where the and dependence separate, of the form

for some number and some shape function . With this guess, the first two terms in the equation both fall off as . For the third term to fall off at the same rate (so the ‘s cancel and we are left with an equation in only), we have to choose

for a constant . Note this makes , which varies in space — so this really is a non-linear force-free field, not the constant- kind. In the code , where a2 is and the absolute value keeps the fractional power well-defined when changes sign.

Putting the guess in and cancelling the dependence leaves a single ordinary differential equation for :

This is the Low & Lou equation, and it is exactly what _differential_equation solves:

d2P_dmu2 = -(n*(n+1)*P + a2*(1+n)/n * P**(1+2/n)) / (1 - mu**2 + 1e-8)

(the +1e-8 just avoids dividing by zero at the poles, where ).

Boundary conditions and why is fixed

At the two poles () the field has to stay finite, which forces . That is two conditions on a second-order equation, which is normally one too many. The catch is that is not free: only for certain special values of does a solution exist that is zero at both poles. Finding those values is the whole job. Because the equation is non-linear, the size of also matters, so we fix it by also setting the slope at one pole. NF2 uses

and solves the problem numerically with scipy.integrate.solve_bvp, scanning for the allowed values of . The integer counts how many times crosses zero in between, and selects which solution we want. The standard choice (and the NF2 default) is : this gives a clean, dipole-like field with a single sign change.


Burying and tilting it

As derived, the solution sits at the centre of its coordinate system and is perfectly symmetric about the axis. That is not yet useful: the centre is a singular point, and a symmetric field is a poor test. Low & Lou fix both by moving the whole solution. Two numbers control this:

  • - how far below the photosphere the centre sits. Burying it (NF2 default ) keeps the singular point out of the box, so the field is smooth everywhere we look.
  • (called psi in the code) — the tilt of the symmetry axis away from vertical. A tilt (NF2 default ) is what makes the field look asymmetric on the flat surface, turning the symmetric solution into a realistic, sheared bipole.

In the code, each point in the box is shifted down by and rotated by to find where it sits relative to the buried, axis-aligned solution:

X = x*np.cos(psi) - (z + l)*np.sin(psi)
Y = y
Z = x*np.sin(psi) + (z + l)*np.cos(psi)

We then read off , , in that frame, evaluate the field, and rotate the result back into the box.


Building the final field

With and known, everything is now an explicit formula. We compute

get from the formulas at the top, convert these to Cartesian components, and finally rotate back through into the box frame. The output is a 3D array that, to numerical precision, is an exact non-linear force-free field everywhere.


How NF2 uses it

The test is simple: build the full cube, hand the code only the bottom slice as a fake magnetogram, let it extrapolate, and compare its 3D answer against the cube we already know (using , energy ratios, and the other metrics).

This is a stronger check than the force-free and divergence residuals NF2 minimises during training. A small residual only says the field is self-consistent; Low & Lou lets us confirm it is the correct field. For example, a current-free potential field can have a small residual yet completely miss the twist and free energy that the true field carries.

Its weakness as a test is that it is very clean: one smooth buried source, no noise, and perfectly force-free boundary data. Passing it shows the solver’s maths is right, but not that it can cope with the messy, partly non-force-free photospheric data of a real active region like AR 11158.