Enter custom periodic functions of toroidal angle phi and poloidal angle theta (using sin, cos, N, iota, axis, elong, tri):
Closing a helix into a torus breaks continuous Euclidean symmetry. The magnetic axis $\gamma_0 : S^1 \to \mathbb{R}^3$ generates on-axis rotational transform $\iota_0$ via its spatial Writhe and cross-section rotation $\delta(s)$:
When $\iota = n/m \in \mathbb{Q}$, closed field lines form $(m, n)$-torus knots (resonant island chains); irrational Diophantine $\iota$ yields dense KAM flux surfaces.
Each flux surface $\Sigma_s \cong T^2$ is parameterized by Fourier modes $(R_{m,n}, Z_{m,n})$ with $N_{\text{fp}}$-fold dihedral stellarator symmetry:
Positive bean/triangularity $R_{2,1} > 0$ indents the cross-section on the inboard side, creating a stabilizing magnetic well ($\partial_\psi B > 0$) and preserving $\det(D\Phi) > 0$.
Bad Conditions (Red on 3D Torus): Where normal curvature $\kappa_n < 0$ ($\nabla B$ parallel to $\nabla p$) overlaps trapped-particle wells ($|B|$ minima) and steep $\nabla T_i$ ($\eta_i = L_n/L_{T_i} > \eta_{\text{crit}}$), ITG & TEM streamers erupt:
Try clicking "⚠️ Unoptimized Bad-Curvature" above to see trapped wells align with bad curvature ($\partial_\psi \mathcal{J}_\parallel > 0$), causing Available Energy $\widehat{\mathcal{A}}$ to spike!