Poloidal cross-section. Drag on the plasma to choose the flux surface to follow.

Tokamak confinement - safety factor q(r) and the current-ramp disruption test

The science

A tokamak confines a hot plasma with a strong toroidal field B (from external coils) plus a poloidal field from a current Ip driven in the plasma itself. The sum twists every field line into a helix on nested flux surfaces. The twist is the safety factor q = (toroidal turns) / (poloidal turns).

Model: current density j(r) = j0 (1 - r^2/a^2)^nu, enclosed current I(r) = Ip [1 - (1 - r^2/a^2)^(nu+1)], poloidal field Bp = mu0 I / (2 pi r), so for a circular section q(r) = r B / (R0 Bp) = 2 pi r^2 B / (mu0 R0 I(r)). On axis q0 = 2 pi a^2 B / (mu0 R0 Ip (nu+1)); at the edge q(a) = (nu+1) q0. Shaping raises q by F = (1 + k^2 (1 + 2 d^2 - 1.2 d^3)) / 2 (standard engineering approximation). The edge is characterised by q at 95% of the radius, "q95".

Field lines: on a surface with safety factor q a line advances theta = phi / q. Dots in the cross-section are where one line pierces the plane after each toroidal turn. If q = m/n is rational the line closes after n turns (m dots, resonant surface where magnetic islands can grow, dashed rings); if q is irrational the dots fill the whole ring. The small lower plot unwraps the surface so the line is straight with slope 1/q.

Limits shown: kink limit q95 > 2 (otherwise the q = 2 surface leaves the plasma and an m=2 kink grows); Greenwald density n_G = Ip / (pi a^2) in 1e20 m^-3 with Ip in MA; Troyon beta beta_N = beta[%] a B / Ip < 2.8. Energy confinement uses the empirical IPB98(y,2) scaling and W = P tau_E, beta = 2 mu0 W / (1.5 V B^2). The Shafranov shift of the axis, Delta ~ a^2 (beta_p + 0.5) / (2 R0), is drawn approximately.

Current-ramp test: Ip rises until q95 falls below 2. The sim then plays a simplified disruption: an m=2 kink grows exponentially, the thermal quench dumps the stored energy in a fraction of a millisecond, the field lines turn chaotic, and the current decays on the resistive time. Because q is proportional to 1/Ip the predicted limit is Ip_crit = Ip q95 / 2; the test reports the measured value from a numerical ramp against it. The profile check integrates j(r) numerically and compares q0 and q(a) with the closed forms above.

Simplifications: large-aspect-ratio circular q profile with an empirical shaping factor, no real MHD equilibrium solve, no bootstrap current, constant profiles, approximate disruption timings. Educational model only; not a design tool.