Magnetisation vector · RF pulse excitation · T1 & T2 relaxation · FID signal
This simulator models nuclear magnetic resonance (NMR) — the physical basis of MRI — using the Bloch equations. A net magnetisation vector M = (Mx, My, Mz) starts aligned with the static field B₀ along the z-axis. An RF pulse tips M into the transverse plane, where it precesses at the Larmor frequency and decays due to two independent relaxation processes: T1 (spin-lattice, longitudinal recovery) and T2 (spin-spin, transverse decay). The decaying transverse signal is the Free Induction Decay (FID).
MRI was independently developed by Paul Lauterbur and Peter Mansfield in the 1970s; both shared the 2003 Nobel Prize in Medicine. Unlike CT or X-ray, MRI uses no ionising radiation — it relies entirely on radiofrequency pulses and magnetic fields. A clinical 1.5 T MRI magnet is about 30 000 times stronger than Earth's magnetic field. Different tissues have characteristic T1 and T2 times, which is how MRI creates contrast between grey matter, white matter, CSF and pathology — all without a single drop of contrast agent for many sequences.
This simulation models nuclear magnetic resonance, the physics underlying MRI, by integrating the Bloch equations for a single net magnetisation vector M = (Mx, My, Mz). At rest M lies along the static field B₀ on the z-axis. Each animation step applies exponential relaxation — transverse components decay as exp(−dt/T2) while the longitudinal component recovers toward M₀=1 as Mz = 1 + (Mz−1)·exp(−dt/T1) — plus a visual precession.
The RF pulse buttons rotate M about the x-axis: a 90° pulse tips it fully into the transverse plane, a 180° pulse inverts it. The T1, T2 and B₀ sliders set relaxation times and field strength, and tissue presets load realistic 1.5 T values for water, fat, muscle, grey and white matter, and CSF. The decaying transverse signal is the Free Induction Decay, the raw signal every clinical MRI scanner records.
What are the Bloch equations?
The Bloch equations are a set of differential equations describing how a net nuclear magnetisation vector evolves in a magnetic field. They combine precession with two relaxation terms: transverse decay governed by T2 and longitudinal recovery governed by T1. This simulator integrates them numerically each frame to move the magnetisation vector M.
What is the difference between T1 and T2 relaxation?
T1, or spin-lattice relaxation, is the recovery of the longitudinal component Mz back toward equilibrium as energy is released to surroundings. T2, or spin-spin relaxation, is the loss of the transverse component Mxy as individual spins lose phase coherence. T1 is always longer than or equal to T2, which is why the sliders here span 100 to 5000 ms for T1 and 10 to 2000 ms for T2.
What does the 90 degree RF pulse do?
The 90° RF Pulse button rotates the magnetisation by 90 degrees about the x-axis, tipping it from the longitudinal z-axis into the transverse plane. This maximises the detectable transverse signal Mxy, which then precesses and decays to produce the Free Induction Decay shown in green on the right of the canvas.
The Larmor frequency is the rate at which nuclear spins precess about the static field, equal to the gyromagnetic ratio times the field strength. The simulator uses γ = 42.577 MHz/T for hydrogen, so at 1.5 T the displayed value is about 63.9 MHz. Raising the B₀ slider increases this frequency proportionally.
Free Induction Decay is the oscillating, decaying voltage induced in a receiver coil by the precessing transverse magnetisation after an RF pulse. In the simulator it is plotted as the magnitude of Mxy modulated by a cosine, fading away as T2 relaxation reduces transverse coherence. It is the fundamental raw signal from which MRI images are reconstructed.
The 180° Inversion button rotates the magnetisation by a full 180 degrees about the x-axis. Starting from equilibrium this drives Mz to −1, after which it recovers toward +1 along the T1 curve. Inversion recovery is widely used in real MRI to null specific tissues, such as fat or CSF, by timing the readout when their signal crosses zero.
Each tissue has a characteristic molecular environment, so water and CSF relax slowly (long T1 and T2), whereas fat and muscle relax faster. The presets load measured 1.5 T values — for example brain grey matter at roughly T1 1000 ms and T2 100 ms, and CSF at about T1 4300 ms and T2 2200 ms. These contrasts are exactly what produce image differences between tissues.
The relaxation physics is faithful: it uses exact exponential solutions of the Bloch relaxation terms with the correct gyromagnetic ratio and realistic tissue times. For clarity, however, the on-screen precession rate is visually scaled rather than the true tens-of-megahertz Larmor frequency, and chemical shift, diffusion and spatial gradients are not modelled. It is a conceptual teaching tool, not a scanner-grade sequence simulator.
MRI relies only on a strong static magnetic field and radiofrequency pulses to manipulate and detect hydrogen nuclei, mostly from water and fat in the body. Unlike X-ray or CT, no high-energy photons are involved, so there is no ionising radiation dose. This makes MRI especially valuable for repeated scans and for imaging children and soft tissue.
By timing the RF pulses and signal readout, a scanner weights the image toward T1 or T2 differences between tissues. A T1-weighted sequence makes fat bright and fluid dark, while a T2-weighted sequence makes fluid bright. The distinct T1 and T2 values you load via the presets are the underlying cause of this contrast across grey matter, white matter, CSF and pathology.
B₀ sets the strength of the static magnet, here adjustable from 0.5 to 7 T. Higher field raises the Larmor frequency and increases the signal-to-noise ratio, generally giving sharper images, but also intensifies certain artefacts and tissue heating limits. Clinical scanners are commonly 1.5 T or 3 T, while 7 T systems are used for research.