PHASEGLASSMAGNETIC RESONANCE OBSERVATORY
VIRTUAL PHYSICS INSTRUMENT · VOL. 01INITIALISING
SPIN DYNAMICS / ELECTROMAGNETISM / EXPERIMENTAL PHYSICS

Make the invisible measurable.

Place an ensemble of nuclear magnetic moments inside a precision spectrometer. Tune radiofrequency pulses, watch coherent magnetisation evolve and recover an echo from apparent silence.

PROTON RESONANCE¹Hγ / 2π = 42.57747892 MHz T⁻¹
INTERACTIVE SCIENTIFIC APPARATUS

04 · Hahn spin echo

READY TO EXPERIMENT
ROTATING FRAME⟳ ORBIT · ⇧ PAN · SCROLL ZOOM
BLOCH SPACE · RF COIL · B₀ MAGNET
LARMOR FREQUENCY9.3670 MHz
COHERENT SIGNAL |Mxy|0.000
LONGITUDINAL Mz1.000
ELAPSED MODEL TIME0.0 ms
MEASUREMENT STATE
Thermal equilibrium
Press Run to excite the sample

01 / Time domain

REAL NUMERICAL DATA

02 / Field laboratory

Click to tune when available
GUIDED RESEARCH PROGRAMME

Investigate the physics.

Five interconnected experiments, one consistent physical model and measurable hypotheses.

01 · CW

Find the resonance

Apply continuous RF and vary drive detuning. Click the frequency-response chart to set the drive. Observe maximal coherent response near resonance, and notice power broadening when B₁ rises.

02 · RABI

Tip the spins

Choose a flip angle from 15° to 360°, run the pulse and compare simulated Mz with the ideal cosine curve. Try 90° and 180°, then introduce detuning to see pulse imperfections.

03 · FID

Watch coherence vanish

Prepare 90° transverse magnetisation and let the isochromats evolve freely. Increase σ or the field gradient to accelerate dephasing while intrinsic T₂ remains unchanged.

04 · ECHO

Recover the signal

Use 90°–τ–180°–τ to refocus static offsets. Compare transverse signal just before the refocusing pulse with signal at 2τ. Increase τ to expose true T₂ losses.

05 · T₁

Measure recovery

Invert Mz with a 180° pulse. Track its return to +1 and identify the zero crossing near T₁ ln 2. Compare the integrated curve with ideal exponential relaxation.

SCIENTIFIC SKILLS LABORATORY

Ten challenges. One instrument.

Real calculations, conceptual reasoning and missions verified against the running simulation.

0 / 10 solved
Worksheet ready
FIELD MANUAL · PRINCIPLES & LIMITS

Understand every measurement.

An original introduction to rotating-frame nuclear magnetic resonance and the exact assumptions used here.

01 / What is magnetic resonance?

Many atomic nuclei possess magnetic moments. A proton ensemble placed in a static magnetic field B₀ develops a small net longitudinal magnetisation through thermal polarisation. Nuclear moments precess at the Larmor frequency f₀ = (γ/2π)B₀. For protons, γ/2π is approximately 42.57747892 megahertz per tesla. A radiofrequency field B₁ applied near f₀ can rotate the ensemble magnetisation away from the field axis. Modern magnetic resonance spectroscopy and MRI exploit the resulting coherent transverse signal.

This laboratory uses a frame rotating at the RF frequency. In that frame a resonant RF drive looks approximately stationary, so millisecond-scale precession is visible even though the underlying laboratory-frame spin frequency is several megahertz. The luminous 3D arrows show normalised magnetisation vectors, not individual quantum spin particles.

02 / Equations behind the instrument

The Bloch equations govern the vector M = (Mx, My, Mz), scaled so equilibrium is (0, 0, 1). With effective angular frequencies Ω₁ = γB₁ and Δω = 2πΔf, this implementation integrates dMx/dt = Δω My − Mx/T₂; dMy/dt = Ω₁ Mz − Δω Mx − My/T₂; dMz/dt = −Ω₁ My + (1 − Mz)/T₁. During free evolution, Ω₁ is zero and an exact analytical rotation plus exponential relaxation is used. When RF is on, fourth-order Runge–Kutta integrates the coupled equations with adaptive subdivisions.

Every simulated isochromat has a fixed frequency offset drawn from a deterministic Gaussian quantile ensemble, plus a spatial field gradient. The instrument reports the average of these magnetisation vectors. Phase differences cause cancellation even while each individual vector remains transversely coherent.

03 / Calibration and recommended procedure

Start with the Clinical phantom preset and inspect B₀, B₁ and the Larmor readout. In Resonance mode, run the experiment with zero detuning, then adjust Δf by dragging the right copper dial or using the slider. Click the secondary plot to tune a frequency directly. In RF nutation, enter 90° and watch Mz approach zero. A 180° pulse should invert the magnetisation approximately to −z.

Use Run to start a fresh standard sequence, Pause to halt model time, Reset to restore equilibrium, and the speed slider to change playback. Drag the 3D scene to orbit, Shift-drag or right-drag to pan, and scroll or use plus/minus to zoom. The camera reset control restores the introductory view. The copper RF and frequency dials are individually draggable objects in 3D space.

04 / Free induction and magnetic inhomogeneity

After a resonant 90° pulse, the ensemble has a large transverse moment. Each frequency offset adds a different rotating-frame phase, dispersing the arrow fan. With Gaussian static offset standard deviation σ in hertz, ideal inhomogeneous dephasing contributes exp[−(2πσt)²/2], where t is measured in seconds. The intrinsic T₂ damping multiplies that envelope by exp(−t/T₂). The plotted signal is not this formula: it is the directly calculated magnitude of the numerically evolved ensemble average.

Set σ almost to zero and observe approximately exponential decay governed by T₂. Increase σ or apply a spatial gradient in hertz per millimetre and observe the faster apparent decay. The reported “T₂* estimate” is a 1/e width from the Gaussian-plus-exponential ideal envelope, not an independently measured material constant.

05 / Hahn echo: reversible and irreversible loss

The Hahn experiment applies a 90° pulse, waits τ, applies a 180° pulse, then waits again. The refocusing pulse reverses which transverse spin vectors lead and lag in phase, so stationary offsets cause rephasing near twice the free-precession interval. For ideal instantaneous pulses, the echo amplitude is reduced by exp(−2τ/T₂), not by static offset dispersion. The finite RF pulses here are integrated explicitly, which also lets off-resonance imperfections reduce refocusing.

Hypothesis: increasing σ from 10 to 40 hertz makes the free induction vanish sooner, but a sufficiently strong resonant 180° pulse still produces a substantial echo. Hypothesis: increasing τ weakens the echo through genuine T₂ relaxation. Observe whether numerical traces support both claims; use the notebook to store and compare them.

06 / T₁ return and engineering applications

Longitudinal recovery restores Mz to equilibrium at rate (1 − Mz)/T₁. After ideal inversion, Mz(t) = 1 − 2exp(−t/T₁), crossing zero at t = T₁ln2. The application calculates recovery from the integrated isochromat model and displays the ideal curve as a separately labelled reference. T₁, T₂ and pulse timing are central to MR pulse-sequence design, material characterisation, chemical analysis and diagnostic contrast methods.

Real MRI additionally uses receive-coil electronics, gradient-dependent imaging, signal-to-noise optimisation, spatial reconstruction and magnet safety controls. This model teaches the pre-imaging spin physics; it does not simulate a scanner, produce real patient data or assess health.

07 / Limitations and science quality

This is a classical macroscopic Bloch model in the rotating-wave approximation. It assumes independent isochromats, an ideal uniform transverse RF field, static offsets during each experiment, constant phenomenological T₁ and T₂, and a proton gyromagnetic ratio. The Gaussian offset distribution is represented by 121 equally weighted deterministic quantiles, so narrow numerical integration error and finite ensemble discretisation remain. B₀ changes the Larmor frequency without changing relaxation times; temperature and sample chemistry are not modelled.

No diffusion, exchange, radiation damping, pulse-shape hardware, coil sensitivity or molecular quantum spectroscopy is included. The field gradient is a frequency gradient applied across an 8 mm synthetic sample. Inhomogeneity can be reversible but T₂ relaxation cannot. Signal amplitudes are normalised to equilibrium, not voltages or clinical measurements. The 3D geometry is schematic; physical amplitudes and timing come from the mathematical model.

08 / Glossary and further questions

Isochromat: a subensemble with one local resonance frequency. Detuning: separation between applied RF frequency and resonance. Flip angle: rotation induced by an RF pulse. FID: decaying transverse response following excitation. Spin echo: refocused signal after a pulse sequence. T₁: longitudinal relaxation time. T₂: intrinsic transverse relaxation time. T₂*: apparent decay time including static dispersion. Rotating frame: coordinates that spin at the RF drive frequency.

Explore: Why does a longer τ reduce recovered amplitude even when field offsets are perfectly static? What does a strong gradient do to phase across the 8 mm sample? Why does off-resonance excitation make a nominal 90° pulse imperfect? How could repeated echoes distinguish static inhomogeneity from spin diffusion? Which assumptions would need replacing before this could model an actual MRI scanner?

Made with 🤖 ChatGPT · Three.js