Physics simulation lab

Magic squares as zero-field states

Six linked simulations explore the same centered square as line charges, flowing bubbles, spin frustration, orbital shells, annealing swaps, and an energy landscape. The shared energy is E = Σ_L (Σ_{(i,j)∈L} Z_ij)^2.

Iron filings / line fields

Line charges create a field over the square

Rows, columns, and diagonals act like charged field lines. Animated filings align with the local residual field. A magic square makes the field collapse toward neutrality.

Whole-system magnetic flow

Charged values flow around one another

Values are continuous bubbles, not swapped pairs. Every bubble feels all row, column, and diagonal fields at once, repels nearby bubbles, and is softly pulled toward lattice wells. The displayed square is the nearest-cell assignment induced by the flow.

Spin lattice

Cells as frustrated spins

Each cell’s spin is driven by its centered height and by the line residuals passing through it. Large coherent regions reveal imbalanced rows, columns, or diagonals.

Planets / electron orbitals

Values orbit on shells from their vector lengths

The original vector (X,Y,Z) sets each body’s shell radius. Color and glow are driven by each cell’s line-force frustration, tying the orbit picture back to magic energy.

Simulated annealing swaps

Values snap toward lower line energy

A proposed swap is accepted if it reduces energy, or with probability exp(-ΔE/T). The chart tracks how a random permutation cools toward balance.

Energy landscape

Nearby permutations as terrain

Points are sampled one-swap and random-walk neighbors. Axes are low-mode energy and high-mode residual energy; color is complete line energy.