Space & Plasma ★★ Intermediate

🌞 Solar Wind & Magnetosphere

The Sun constantly blasts charged particles outward at 400–800 km/s. Earth's magnetic dipole deflects this stream, carving out a cavity called the magnetosphere — complete with a bow shock, magnetopause, magnetosheath, and magnetotail. When the interplanetary magnetic field (IMF) turns southward, magnetic reconnection allows particles to funnel down field lines, lighting up auroras at the poles.

vsw = 400 km/s Magnetopause standoff = RE Aurora Kp:

Solar Wind–Magnetosphere Coupling

Bow shock: where the supersonic solar wind abruptly decelerates to sub-Alfvénic speeds. Standoff distance ≈ 14 RE upstream. Visualised in orange.

Magnetopause: the pressure-balance boundary between the magnetosheath (compressed solar wind plasma) and the inner magnetosphere. Described by the Shue (1997) model: r = r0 (2/(1+cos φ))α, r0 ≈ 10–12 RE, α ≈ 0.58. Visualised in blue.

IMF Bz: when the interplanetary magnetic field points southward (Bz < 0), it anti-parallels Earth's dayside field — enabling magnetic reconnection. Particles enter the polar cusps and precipitate toward the poles, producing auroras. Raise the storm / CME activity to see this.

About the Solar Wind & Magnetosphere Shader

This simulation renders Earth's magnetosphere as a single real-time GLSL fragment shader — there is no particle system, only closed-form geometry evaluated per pixel. Each frame, a magnetopause standoff distance r0 is derived from the solar wind's dynamic pressure (density × (speed/400)²) and Earth's dipole strength, then swept into a Shue (1997)-style boundary r = r0·(2/(1+cosφ))0.58, with the bow shock traced at 1.32×r0. Fractal Brownian motion (fBm) noise advects the plasma stream and bends it around the dayside boundary, while a wedge-shaped magnetotail stretches away from the Sun. A synthetic Kp index, driven by wind speed and storm/CME activity, brightens two auroral ovals near the poles.

What You're Looking At

What it shows

Bow shock, magnetopause, magnetosheath, and a stretched magnetotail — all traced from closed-form boundary equations rather than simulated particles. Two auroral ovals brighten near the poles when the synthetic Kp index climbs.

How to use it

Drag wind speed, Earth field strength, wind density, and storm/CME activity to reshape the magnetosphere in real time. Hit Solar storm! to spike activity to maximum and watch it decay back to baseline over the following seconds.

Did you know?

During severe geomagnetic storms the real magnetopause can compress inside geostationary orbit (~6.6 Earth radii), briefly exposing communications satellites to unshielded solar wind plasma — exactly the compression this shader's standoff formula models.

Frequently Asked Questions

What is the Shue magnetopause model used here?

The shader's magnetopause(phi, r0) function implements a Shue (1997)-style boundary, r = r0·(2/(1+cosφ))α with α = 0.58, where φ is the angle from the Sun–Earth line and r0 is the subsolar standoff distance. A guard clamps the denominator max(1+cosφ, 0.18) near the tail to avoid a singularity as φ approaches π. The bow shock reuses the same formula with r0 scaled by 1.32, since the shock stands further upstream than the magnetopause itself.

Why does the magnetopause shrink when I increase wind speed or density?

The standoff() function computes a dynamic pressure term press = density × (speed/400)², then sets r0 = 0.42 × (fieldStrength / (press × storm))1/6, clamped between 0.16 and 0.62 screen units. Because press sits in the denominator under a sixth root, faster or denser wind raises the pressure and shrinks r0 — a soft echo of the real pressure-balance relation that sets Earth's actual magnetopause distance.

How is the synthetic aurora Kp value calculated?

Two related formulas run in parallel: the on-screen readout uses kpLevel() = storm×7 + ((speed−300)/500)×2, clamped to 0–9 to mimic the real geomagnetic Kp scale, while the shader itself computes kp = 0.3 + storm×0.9 + ((speed−300)/500)×0.4 to set how strongly the two polar auroral ovals brighten. Both rise with storm/CME activity and solar wind speed, so pushing either slider — or hitting Solar storm! — lights the poles up faster.

Is this a real particle simulation of the solar wind?

No — the entire scene, including the Sun's glow, the plasma stream, the bow shock and magnetopause arcs, the magnetotail, Earth, and the aurora, is painted analytically inside one GLSL fragment shader running on a full-screen quad. Fractal Brownian motion (fbm) noise gives the plasma its turbulent, flowing look, but there are no individual charged particles being integrated through a magnetic field — the boundaries and glow are closed-form functions of position and time.

What shapes the magnetotail on the night side?

The tail half-width is tailHalf = r0 × (0.95 + 0.25×fieldStrength), and a night-side mask restricts the tail to the side of Earth away from the Sun (where d.x is negative). Within that wedge, a brighter "plasma sheet" glow is drawn at the tail's centreline, its intensity modulated by the same fbm noise function used for the upstream solar wind, so the tail shimmers rather than appearing as a flat triangle.