The plasma cross-section (a poloidal slice) is written with the Miller/D-shape parametrization used throughout tokamak equilibrium fitting:
R(θ) = R0 + dR + a·cos(θ + δ·sin θ)
Z(θ) = dZ + a·κ·sin θ
κ (elongation) and δ (triangularity) set the D-shape; dR, dZ are the horizontal/vertical position of the plasma centroid. Sweeping θ around a poloidal slice and revolving it through the toroidal angle φ generates the 3D surface you see.
An elongated plasma (κ > 1) is vertically unstable: any small upward or downward displacement grows exponentially unless something opposes it — this simulation models that as a positive-feedback term on Z0 whose growth rate scales with (κ − 1)². Real tokamaks correct it (and hold κ, δ, dR at their targets) with a fast feedback loop driving currents in a set of poloidal-field (PF) coils; DeepMind and EPFL's 2022 Nature paper "Magnetic control of tokamak plasmas through deep reinforcement learning" replaced the hand-tuned version of that loop with a policy trained by RL, controlling the TCV tokamak's coils directly from sensor readings.
Here the loop is a simpler proportional–derivative (PD) controller — effectively the classic baseline the RL policy has to beat: it reads the error e = (κ,δ,dR,dZ) − target and drives a corrective "coil current" u = −Kp·e − Kd·ė back into the shape's rate of change every tick. Set the gain slider to 0 to see the same instability run open-loop; the vertical drift diverges until the plasma touches the wall (marked LOSS OF CONTROL) — exactly the "disruption" tokamak operators try to avoid.
- Preset — sets the (κ, δ) target shape; higher κ means a harder, more unstable control problem.
- AI gain Kp — feedback strength; 0 disables the controller entirely.
- Disturbance — random forcing on the shape state, standing in for turbulence and error fields.
- Inject kick — a one-off large disturbance, like a real error-field event or ELM.
- Small purple spheres are the poloidal magnetic pickup sensors used for shape reconstruction; the six rings are the PF shaping coils, glowing brighter as their commanded current rises.