This is pretty amazing: Scientists have created a computer model that can simulate the conditions in the Sun that generate a solar flare. This is the first time a single model has been able to do this, combining all the necessary extremely (like, really really extremely) complicated physics involved together with the huge range of physical properties in the Sun over which a flare is generated. And it does it all in three dimensions.

A solar flare is an intense explosion of energy just above the Sun’s surface. And by intense, I mean it: A big flare can release as much as 10% of the Sun’s entire energy, but focused in a single spot. That’s a million times the yield of the entire nuclear weapon arsenal on Earth.

A solar flare is, at its heart, a magnetic event associated with sunspots. I’ve described them before:

The quick version of this is that the Sun has a very complicated magnetic field. Inside the Sun there are enormous packets of hot plasma (gas with its electrons stripped off) that rise from deep within. These blobs have their own internal magnetic field, and as they rise to the surface the huge loops of magnetic field lines (similar to what you see in bar magnet diagrams) pierce the surface. These loops carry a vast amount of energy with them, and normally carry that energy up the loop and back down into the Sun.

But if a bunch of these loops get tangled, they can interact and connect with each other, releasing their energy all at once. The resulting explosion dwarfs our planet’s entire nuclear arsenal and is what we call a solar flare. Sometimes, this can trigger an even larger release of energy in the Sun’s outer atmosphere (the corona). That’s a coronal mass ejection. The expanding bubble of subatomic particles and energy sweeps out into the solar system, and if it hits the Earth, it can connect with our own magnetic field, creating all kinds of havoc.

While astronomers study these events because the physics is fascinating, that last bit puts a very real-world impact on them. A powerful flare can zap satellites around the Earth, be a danger to orbiting astronauts, and even cause widespread power outages on Earth. I suggest you read my article about the ridiculously powerful 2012 event that very thankfully missed us to see how harrowing these things are.

The problem is the physics of these events is notoriously and fiendishly complex. Most computer models simplify the equations to make the physics palatable (like reducing the problem in three dimensions to just one), or don’t include important factors because they’re just too hard to incorporate (or take too long to calculate even using supercomputers).

That’s why these new results are so exciting. For the first time all the needed 3D physics is included in one model, and they are able to follow the action from thousands of kilometers below the Sun’s surface to tens of thousands of kilometers above. And the result is simply gorgeous.

Video of From emergence to eruption: A comprehensive simulation of a solar flare

Whoa.

In the video, the colors represent the temperature of the gas: Violet is “cooler” gas at less than a million degrees Celsius (!), red between 1 and 10 million, and green is everything even hotter than that. At these temperatures, the atoms in the gas have their electrons stripped away, so technically we call this a plasma. That’s not being nitpicky or pedantic; a plasma is ionized, which means it holds an electric charge, and that means in turn it can be affected by magnetic fields. And that’s why this model is so complicated.

The equations governing how magnetic fields behave with time are extraordinarily difficult to solve. Worse, the magnetic fields are generated by moving gas, which is governed by the also-massively-hard equations of hydrodynamics. Combining them is the work of the field of magnetohydrodynamics, which is inhumanly convoluted. And then, even after all that, you have to account for turbulence, which itself is tortuously complex. The math here is a nightmare.

And it gets worse! They have to account for the huge range of conditions inside the Sun compared to above its surface; the density changes by a factor of a thousand, and temperatures go from thousands of degrees at the bottom of the solar layer simulated (7,500 km below the Sun’s surface) to millions above it.

Zoom In On March 28, 2014, a sunspot associated with active region 12017 on the Sun flared (bright spot to the upper right), one of many times it flared that week. It was this active region that was modeled using a supercomputer. Credit: NASA/SDO

This is why, in the past, computer models have done this work piecemeal, or using simplified equations, and that’s why this new work is so important. Even cooler is that in this simulation they didn’t set out to create a flare! They simply put in the physical conditions seen in the Sun before a flare erupts — in this case, what was seen before a series of flares erupted from some active sunspots in March 2014 — and let the code run. When they did, they got flares very similar to what were actually seen in the real sunspot.

It’s beautiful. You can see the towering loops of the solar magnetic fields, plasma flowing along them. Then the eruption occurs, and some of the plasma blasts into space, while some falls back to the surface in what’s called “coronal rain.” This sort of thing actually occurs on the Sun and is really dramatic:

Video of NASA JAXA Hinode - Flare Now & Later Rain, April 16, 2012

It feels weird, sometimes, to think that you can write down a bunch of equations, plug in some numbers, crank them through, and get out something that looks a whole lot like what nature does. But — and I’m not the first to say this — math is the language of the Universe. Or, perhaps more aptly, math is the engine that drives the Universe. It’s a framework inside which the Universe gets its rules.

If you can perceive and understand those spars, those connectors, those beams and foundations, then you can build a cosmos around them.