A magnetar's crust is a rigid crystalline lattice pinned to a magnetic field up to 10¹⁵ gauss. As the field slowly evolves it twists the crust, building elastic stress until the lattice suddenly fractures — a starquake. The fracture releases magnetic energy as a gamma-ray flare and lets the crust settle into a slightly lower moment of inertia, so the whole star spins a little faster: a sudden downward jump in the rotation period, a glitch.
P(t) = P₀ + Ṗ·t (steady magnetic braking)
Δp/p = −glitch size (sudden jump at t_quake)
p(t) = trend(t) + perm + temp·e^(−(t−t_quake)/τ)
- Magnetic braking (Ṗ) — how fast the field bleeds rotational energy away; steeper braking lengthens the period faster between quakes.
- Crust stiffness — how much stress the lattice can absorb before it cracks; a stiffer crust builds toward rarer but sharper starquakes.
- Trigger starquake — force a fracture immediately, regardless of accumulated stress.
- Auto starquakes — let stress build and release on its own, like the real object.
- After each glitch, part of the spin-up is permanent (the crust's new configuration) and part relaxes back over subsequent simulated days as the rigid crust re-couples to the superfluid interior below it — watch the period trace bend back partway toward its pre-glitch slope.
Real-world relevance: this crust-fracture / glitch / partial-relaxation pattern is exactly what radio and X-ray timing campaigns measure in real magnetars and soft gamma repeaters such as SGR 1806-20 and 1E 2259+586.