---
title: "Magnetic Reconnection Interactive Lab | Sandbox Physics"
description: "Where does the energy go when a magnetic field rearranges? Magnetic stresses accelerate the plasma."
canonical_url: "https://sandboxphysics.com/labs/magnetic-reconnection/"
language: "en"
page_type: "lab"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/labs/magnetic-reconnection/"
last_modified: "2026-11-04"
---

AC28 · Magnetic stresses release energy

# Magnetic Reconnection

**Where does the energy go when a magnetic field rearranges?** Magnetic stresses accelerate the plasma. Electric resistance and viscosity convert part of the magnetic and fluid energy into heat. A thin nonideal region lets magnetic flux change its connection to the moving fluid.

Drag a probe through a current layer. Follow the field, the outflow and the magnetic energy converted into motion and heat.

> Interactive simulation: open this page in a web browser to change the parameters and run the model.

Model assumptions

This periodic two-dimensional incompressible viscoresistive-MHD initial-value model releases a specified initial magnetic stress. Four discrete cases have independent 128/256-grid and time-step checks. Current colour, magnetic contours, velocity and energy records share the selected numerical state. Flow glyph motion depicts instantaneous velocity; playback speed and colours are schematic. Dissipation is stored as global heat, without a temperature equation. There is no photospheric footpoint driver, flare trigger, particle acceleration, three-dimensional evolution or radiative prediction. The separate GOES tutorial measures actual band irradiance; partial-minute fluence estimates assume the available seconds represent the full minute.

One numerical state

## Magnetic stresses launch outflows

Selected physical time $1\,t_A$

### Field energy becomes motion and heat

$t/t_A,\quad E/(B_0^2/\mu_0)$

Domain-mean energy densities. Blue: magnetic. Green: kinetic. Orange and purple: Ohmic and viscous heat.

$(E_B+E_K+Q_\Omega+Q_\nu)/E_0=1.000$

### Magnetic flux between the two nulls

$t/t_A,\quad[\psi(O)-\psi(X)]/(B_0L_0)$

Gold: the selected island’s signed flux contrast. Both nulls can undergo diffusion.

$\dot\psi(O)-\dot\psi(X)=E_z(X)-E_z(O)$

What this calculation resolves

The four fixed cases release an initially stressed periodic field. Local induction, finer-grid fields and time-step errors are checked separately from the global energy sum. A retained coarse ideal case demonstrates why conservation alone is insufficient. Solar footpoint driving, flare onset, particles and emitted light need additional models.

The canvas preview samples a verified 128-grid Python state; the full saved input is checked before JavaScript evolution.

Physics tutorial

## Follow magnetic energy into motion and heat

**Background** A bent magnetic field exerts a force on the surrounding plasma. The resulting motion can concentrate current into a thin layer, where resistance lets magnetic flux move relative to the fluid.

**Why it matters** Solar flares release stored magnetic energy, but a useful first calculation must identify what it actually evolves. This small periodic model follows the field and fluid together.

Start with the essentials

- **Focus question**: Where does magnetic energy go in this model?
- **One-sentence intuition**: The magnetic field accelerates the fluid; electric resistance and viscosity feed separate dissipative reservoirs.

### Core mathematical model

#### Flux carried by the moving fluid

$$
\partial_t\psi+\mathbf v\cdot\nabla\psi=\eta\nabla^2\psi
$$

Magnetic contours follow constant $\psi$. Here $\eta$ is dimensionless magnetic diffusivity. The ideal case sets it to zero.

#### Two coupled divergence-free fields

$$
\mathbf B=(\psi_y,-\psi_x),\qquad\mathbf v=(\phi_y,-\phi_x)
$$

The magnetic potential and the streamfunction supply the field and velocity in the same periodic plane.

#### The closed unforced energy sum

$$
E_B+E_K+Q_\Omega+Q_\nu=E_0
$$

The initial energy moves between magnetic and kinetic forms and accumulates in the two heat reservoirs. These normalized reservoirs do not determine a temperature.

#### Both magnetic nulls can diffuse

$$
\frac{d}{dt}[\psi(O)-\psi(X)]=E_z(X)-E_z(O)
$$

A closed periodic island also diffuses at its O point. The difference needs both local electric fields.

### Common difficulties

#### Field lines as objects

**Typical misconception** A drawn magnetic line is a thread made of particles.

**Better mental model** The line is a contour describing the instantaneous field. A fluid element follows the velocity, which is a different vector field.

#### Energy as the only numerical test

**Typical misconception** An almost perfect energy sum proves that reconnection is resolved.

**Better mental model** A retained low-grid ideal example conserves global quantities while changing flux at magnetic nulls incorrectly. Local induction and a finer grid must also agree.

#### Heat as brightness

**Typical misconception** The dissipated-energy curve is the light curve of a solar flare.

**Better mental model** Calculating emitted X-rays also needs density, thermodynamics, conduction, radiation and instrument response. The GOES tutorial analyzes measured band irradiance separately.

### Run the experiment

1. 01

   #### Find the outflow

   Watch the default state, then drag the gold probe across the bright current layer.

   **What to observe:** The green arrows and probe values trace the calculated fluid velocity. The gold curve is the magnetic contour through the probe.

2. 02

   #### Remove irreversible heating

   Choose Ideal flow and inspect the two energy curves.

   **What to observe:** Magnetic and fluid energy exchange while the dissipative reservoirs remain zero over the tested short interval.

3. 03

   #### Change the actual transport process

   Compare Diffusion and Viscosity, returning to the same saved time in the advanced group.

   **What to observe:** Diffusion acts on the magnetic field. Viscosity damps the fluid. Their different energy curves follow different solutions.

4. 04

   #### Check a saved state

   Save JSON and the history CSV. Compare the selected time, field map, probe and energy values.

   **What to observe:** They retain the same case and numerical state; normalized values need a specified physical length, field and density before solar units can be assigned.

Physical conclusion

Read field, flow and energy at one physical time. The local induction test determines whether a globally conservative calculation is also accurate near the nulls.

## Related experiments and articles

From magnetic stress to reconnection · Reading path

### From magnetic stress to reconnection

Articles on this path that use this experiment, followed by the other experiments they suggest.

1. [Article **Where a solar flare finds its energy**](https://sandboxphysics.com/stories/solar-magnetic-reconnection/where-the-flare-finds-energy/)
2. [Article **When magnetic flux follows the fluid**](https://sandboxphysics.com/stories/solar-magnetic-reconnection/when-flux-follows-the-fluid/)
3. [Article **How a thin current sheet sets the pace**](https://sandboxphysics.com/stories/solar-magnetic-reconnection/how-a-sheet-sets-the-pace/)
4. [Article **Follow energy through a reconnection calculation**](https://sandboxphysics.com/stories/solar-magnetic-reconnection/follow-the-converted-energy/)
5. [Article **Recompute a flare from one GOES file**](https://sandboxphysics.com/stories/solar-magnetic-reconnection/one-goes-file-one-flare/)
6. [Article **Where the fluid picture of reconnection runs out**](https://sandboxphysics.com/stories/solar-magnetic-reconnection/where-the-fluid-picture-runs-out/)

Fields & matter · Starter path

## From a field to an electron microscope

Map an electric field and steer a charged particle. Then find the electron's wavelength and use electron beams to see a crystal and a surface.

[Start here → **Make an Electric Field Visible** Move the probe around a dipole and check that the field always points downhill on the potential landscape. Observe · 8 min](https://sandboxphysics.com/labs/electric-field/)

1. [1 Make an Electric Field Visible](https://sandboxphysics.com/labs/electric-field/)
2. [2 A Charge Bending through Fields](https://sandboxphysics.com/labs/charged-particle/)
3. [3 Electron Wavelength & Voltage](https://sandboxphysics.com/labs/electron-wavelength/)
4. [4 Electron Diffraction & Reciprocal Space](https://sandboxphysics.com/labs/electron-diffraction/)
5. [5 TEM Bright Field, Dark Field & SAED](https://sandboxphysics.com/labs/tem-mode-selector/)
6. [6 SEM Secondary-Electron Topography](https://sandboxphysics.com/labs/sem-topography/)

[View the full path →](https://sandboxphysics.com/topics/fields-and-matter/#starter-path)
